You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Workflow test runs can be configured to automate tests.

Configuration

Workflow test runs can either be started from within a FEWS stand-alone application, or within a JUnit test.

Run workflow test runs from within a FEWS stand-alone

To start a workflow test in DELFT-FEWS open the debug menu (F12) and select 'run workflow test' (U). This will open an open file dialog in which you can select a workflow configuration file to run in the current environment.

Run workflow test runs from JUnit tests

Workflow test runs can be started in JUnit tests in order to build (nightly) regression tests. To do so, initialize the test environment and create a datastore to pass to the workflow constructor. Next code snipped demonstrates the use of WorkflowTestRun in JUnit:

....
// init test application
App.init(WorkflowTestRunTest.class);

FewsInstance.init(TestSupport.getInputFile());

TestSupport.setUp();

configDir = TestSupport.getInputFile("config");

relativeViewPeriod = new RelativePeriod(-100 * TimeUnit.DAY_MILLIS, TimeUnit.DAY_MILLIS);

connection = TestSupport.createTestDatabase("test");

// create datastore
dataStore = new TestDataStore(connection, configDir, coldStatesDir, cacheDir, time0);

// select the workflowtest configuration file
File configFile = TestSupport.getInputFile("testfiles/WFT_Test1.xml");

SystemActivityDescriptor descriptor = dataStore.getRuns().getSystemActivityDescriptors().add(SystemActivityType.OC);

// the WorkflowTestRun is created here
WorkflowTestRun testRun = new WorkflowTestRun(dataStore, descriptor);

// run it
testRun.run(configFile);
....

  • No labels