Versions Compared

Key

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

...

  • The bundles of the three basic component tests are automatically scanned for new test sets
  • If a test component tests the processing results with a given list (called expected output), the file of the expected output must be a csv-file in the same folder like the qry file. Furthermore, it may have the same name like the qry (for example: "example.csv" for "example.qry") . Alternatively, the name of the expected output could also one of "output.csv", "expected.csv" or "expected_output.csv".
  • You can use ${BUNDLE-ROOT} within the qry-file, if you want to use some files from the same bundle (e.g. as a data-input for access operators)
  • currently, only the Timeinterval is considered for metadata
  • It is importend that the bundles (which are jar files after the build) are unpacked. Therefore, you have to activate this option in the de.uniol.inf.is.odysseus.test.feature under "Plug-ins" for the componets (it is called "Unpack the plug-in archive after installation" on the right hand side). It is also important to add the testdata and queries to your build properties (or via the MANIFEST.MF of the test component bundle in the "Build" tab)  so that they are part of the "binary build"!
Example: Adding a new Test window_sliding

We use the Test-Component under to the bundle: de.unol.inf.is.odysseus.test.component.operator

Here you can find the folder: testdaten containing tests.

First, you have to define a new input data set. Forst most cases, the easiest way would be a CSV file. It can be copied from other tests. We use input0.csv from the aggregate_time test

Second, you have to define a new query. This should be done in Odysseus Studio.In our Example we use: window_sliding.qry

Code Block
///OdysseusScript
#PARSER PQL
#TRANSCFG Standard
#RUNQUERY
percentage = ACCESS({
    source='percentage', 
    wrapper='GenericPull',
    transport='file', 
    protocol='SimpleCSV',
    dataHandler='Tuple', 
    options=[
        ['filename', '${WORKSPACEPROJECT}\input0.csv'], 
        ['csv.delimiter', ';'],
        ['csv.trim', 'true']
        ], 
    schema=[
        ['timestamp', 'STARTTIMESTAMP'], 
        ['percentage', 'INTEGER']
]})
window0 = window({size = 1, type = 'time'}, percentage)

Here we test a simple window, that creates windows of 1 millisecond.

Start the query and look if everthings compiles correclty. When der query terminates use Show Stream Elements - List - Show all last elements on the query and let the query run again.

YOU SHOULD NOW CAREFULLY CHECK THE RESULT. IS THIS THE OUTPUT YOU EXPECT. This step is very important, else the test makes no sense!

If everthings seems ok, copy the whole ouput of the list window and paste it into a file window_sliding.csv.

Now go to the testbundle: de.unol.inf.is.odysseus.test.component.operator

  • In the folder: testdaten add new new folder for your test: window_sliding
  • copy the input0.csv, window_sliding.csv and window_sliding.qry into this new folder
  • Change in windows_sliding.qry the filename as folllows: ['filename', '${BUNDLE-ROOT}\testdaten\window_sliding\input0.csv']

     

Testing Behavior

Some remarks for the testing behavior.

...