package tech.pegasys.pantheon.ethereum.vm.blockchain;

import static tech.pegasys.pantheon.ethereum.vm.BlockchainReferenceTestTools.executeTest;
import static tech.pegasys.pantheon.ethereum.vm.BlockchainReferenceTestTools.generateTestParametersForConfig;

import tech.pegasys.pantheon.ethereum.vm.BlockchainReferenceTestCaseSpec;

import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import static org.junit.Assume.assumeTrue;

/** The blockchain test operation testing framework entry point. */
@RunWith(Parameterized.class)
public class %%TESTS_NAME%% {

  private static final String[] TEST_CONFIG_FILE_DIR_PATH = new String[] {%%TESTS_FILE%%};

  @Parameters(name = "Name: {0}")
  public static Collection<Object[]> getTestParametersForConfig() {
    return generateTestParametersForConfig(TEST_CONFIG_FILE_DIR_PATH);
  }

  private final String name;
  private final BlockchainReferenceTestCaseSpec spec;

  public %%TESTS_NAME%%(
      final String name,
      final BlockchainReferenceTestCaseSpec spec,
      final boolean runTest) {
    this.name = name;
    this.spec = spec;
    assumeTrue("Test was blacklisted", runTest);
  }

  @Test
  public void execution() {
    executeTest(spec);
  }
}
