Versions Compared

Key

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

New: Testing can now be done with mvn, too. Detailled information will follow. Here some short hints

  • In folder "test" Create a new feature with name "de.uniol.inf.is.odysseus.test.feature"
  • For each test group (see below) create a new feature and bundle in the test folder
  • Add each feature to the test feature
  • Use maven to create a test product for the local platform
Code Block
mvn clean verify -Ptest,solobuild,currentOS -Dtargetfilename=${PLATFORMTARGETFILE}  
// change to dir, where product is placed (here linux example)                      
cd ${WORKSPACE}/odysseus_dev/test/test.product/target/products/de.uniol.inf.is.odysseus.test.runner.product/linux/gtk/x86_64/
// run test
java -Dosgi.requiredJavaVersion=1.8 -Xms1024m -Xmx1024m -jar plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar

See PLATFORMTARGETFILE for further information about targetfilename.


In combination with our build tooling (Jenkins), we are running some integration tests for checking Odysseus functionalities. After each hourly build a certain server product is built and run. This instance is used for different sets of queries (and sometimes some expected output) to test different things like query languages, the executor or operators. This article shows the currently existing test components and how a new component can be integrated.

...

This test has very short queries, because it only tests a single operator (or some more if they are needed - like windows for aggregations (big grin)). Each sub folder corresponds to a sub test and each sub test is a pair of the query and the expected output. The folder is searched recursively for new pairs, so you may simply add a new subfolder with a pair of qry- and csv-file to create a new operator-test or you can use the Testcase Generator to create a new test case for an operator.

test.component.keyvalue

This test checks if the key value operators work and have the expected results. For now key value project and select and the keyvaluetotuple and tupletokeyvalue operators are tested. The input and output data is given as json files.

...

This test checks the operators and transformation rule of the probabilistic feature. The test consists of all relational operators and tests for the correct estimation of stochastic models.

test.component.jira

This test checks reported issues. Each test is named after a JIRA issue to make sure the reported issue remains fixed in future releases.

Creating New Test Components

...

  • Create a new bundle using the naming convention "de.uniol.inf.is.odysseus.test.component...."
  • add odysseus.core, odysseus.core.server and odysseus.test to the required plugins
  • Add a new class and inherit from one the following abstract classes:
    • AbstractTestComponent for a very basic test component
    • AbstractQueryTestComponent for a test component that should install a query
    • AbstractQueryExptectedTestComponent for a test that should compare the query results with an expected output by automatically adding TICompareSinks (look above under "Testing behavior").
  • Implement the needed methods
    • The createTestSets should return the list of sub tests that should be executed by the test component. The type of the test set depends on the type you choose before. So, if you used AbstractQueryTestComponent, you have to return a list of QueryTestSet, which contains the query to be executed. You can use the TestSetFactory class. It offers some methods to search and create test sets.
    • You can override the getName to name the test component.
  • create a service component description for the test component class (which inherits from on the abstract classes). It has to provide the "ITestComponent" service.
  • additionally, you have to check for lazy loading, so that your bundle is not started if one class is needed.
  • Look also at the tips from "Adding new Queries" above.
  • If the tests should run periodically, add the the component to de.uniol.inf.is.odysseus.test.feature.

Testcase Generator

The testcase generator is a RCP view to generate testcases for operators. You can create a new testcase by using the Testcase Wizard. The wizard will create a template for a testcase as show in the figure below.

Image Removed

 

...

  • .

...

 

Code Block
languagejs
/// Odysseus Testcase: MyTestcase
/// Operator: ASSUREORDER
/// Date: Sun Apr 26 00:53:35 CST 2015
/// User: ckuka
/// Parameter: 
///  SUPPRESSPUNCTUATIONS: 
///  NAME: 
///  DESTINATION: 
///  ID: 
///  DEBUG: true
#PARSER PQL
#DROPALLSOURCES
#DROPALLQUERIES
#METADATA TimeInterval
#RUNQUERY
input0 = ACCESS({
    source='source',
    wrapper='GenericPull',
    transport='file',
    protocol='SimpleCSV',
    dataHandler='Tuple',
    options=[
        ['filename', '${BUNDLE-ROOT}/input0.csv'],
        ['csv.delimiter', ';'],
        ['csv.trim', 'true']
        ],
    schema=[['Attribute2', 'Double']]})
output = ASSUREORDER({DEBUG=true}, input0)

 

 

 

...