Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Run workflow test runs from within a FEWS stand-alone

In Fews, a new item is added to the debug context menu (F12 - U) to 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 and start it to run in the current environment.

...

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);
....