Hi Burt,
Hongbing and I worked on this problem some more and we have solved it. For everyone's general amusement and edification, here's the solution:
First, the difference between the hackydev machine and your local machine (and Hongbing's machine) is that the hackydev build environment redefines the context root. This is so that the hackydev machine can install multiple hackystat configurations in one Tomcat. For example,
http://localhost:15004/hackystat-all
goes to the ALL configuration.
http://localhost:15004/hackystat-cocomo
goes to the cocomo configuration, etc.
The setting of the context root is controlled by the property hackystat.context.root in the hackystat.properties file. So, for example, you can say:
hackystat.context.root=hackystat-all
and override the default value for the context root, which is 'hackystat'.
Your code is written to assume that the context root is 'hackystat', which works in 'normal' cases, but will fail in cases where the context root is redefined, such as in the build environment. (If you were to add the above property into your hackystat.properties file and re-run your test, you would find that it will start failing, even in your local environment.)
Now, if you look at other server-side test code that sends data to the server, such as TestActivity, it looks like this:
ServerProperties serverProperties = ServerProperties.getInstance();
String testUser = "testshellcommand" + serverProperties.getTestDomain();
SensorProperties sensorProps = new SensorProperties(serverProperties.getHackystatHost(), testUser);
The key point here is that we are using serverProperties.getHackystatHost() to get the hackystat host. By instantiating ServerProperties and asking it for the hackystat host, we will be given back a string that contains the correct context root, because ServerProperties checks the contents of the hackystat.properties file.
In contrast, your code was written to get the hackystat host this way:
this.hackystatHost = (new SensorProperties(this.tool).getHackystatHost());
Because it does not use ServerProperties, it won't know about the correct context root and will instead use the default. That works accidentally in your local environment, but not on the build machine.
Hongbing has been nice enough to go ahead and fix your code and commit the changes.
Cheers, Philip
