15.10. Anatomy of SimpleSdt: the testdataset data

It is often the case that test code for higher level analyses require some sensor data of a particular type to be available on the server. Such test code has one of two options: either generate that sensor data dynamically and send it to the server as part of the setup to running the test case on the analysis, or else create persistent XML data files for that sensor data type in a special test user account and make them available on the test server as part of the build process.

The testdataset/ subdirectory in the simplesdt package shows how the latter can be accomplished. This subdirectory contains data/SimpleSdt/2001-01-02.xml, which will be copied into the test server's hackystat data directory as a result of the install.pre-sensorshell target in hackyDoc_SimpleSdt's local.build.xml file.

Example 15.9, “The 2001-01-02.xml file for SimpleSdt” illustrates the contents of the 2001-01-02.xml file.

Example 15.9. The 2001-01-02.xml file for SimpleSdt

<?xml version="1.0" encoding="UTF-8"?>
<sensor>
  <entry tstamp="978472800000" tool="Emacs" fileName="Foo" elapsedTime="1" />
  <entry tstamp="978472800001" tool="Emacs" fileName="Bar" elapsedTime="2" />
  <entry tstamp="978472800002" tool="Emacs" fileName="Baz" elapsedTime="3" />
</sensor>

This particular dataset would most likely not be useful for higher level analyses, but of neither would the SimpleSdt sensor data type. It does, however, illustrate how one might provide test sensor data for use in higher level analysis testing that avoids the time required to dynamically generate it each time that the test is run.