org.hackystat.sensorbase.resource.sensordata
Class TestSensorDataRestApi

java.lang.Object
  extended by org.hackystat.sensorbase.test.SensorBaseRestApiHelper
      extended by org.hackystat.sensorbase.resource.sensordata.TestSensorDataRestApi

public class TestSensorDataRestApi
extends SensorBaseRestApiHelper

Tests the SensorBase REST API for Sensor Data resources.

Author:
Philip M. Johnson

Field Summary
 
Fields inherited from class org.hackystat.sensorbase.test.SensorBaseRestApiHelper
adminEmail, adminPassword, projectManager, sdtManager, sensorDataManager, server, userManager
 
Constructor Summary
TestSensorDataRestApi()
           
 
Method Summary
 void deleteAllData()
          Test that DELETE host/sensorbase/sensordata/user deletes all data.
 void getNonExistingUserSensorData()
          Test GET host/sensorbase/sensordata/TestUser@hackystat.org/9999-04-30T09:00:00.000 throws a SensorBaseClientException, since the data does not exist.
 void getSensorDataIndex()
          Test that GET host/sensorbase/sensordata returns an index containing all Sensor Data.
 void getSensorDataIndexLastMod()
          Test that GET host/sensorbase/sensordata/TestUser@hackystat.org?
 void getUserSdtSensorDataIndex()
          Test that GET host/sensorbase/sensordata/TestUser@hackystat.org?
 void getUserSensorData()
          Test GET host/sensorbase/sensordata/TestUser@hackystat.org/2007-04-30T09:00:00.000 and see that it returns a SensorData instance..
 void getUserSensorDataIndex()
          Test that GET host/sensorbase/sensordata/TestUser@hackystat.org returns some sensor data.
 void putBatchSensorData()
          Test that a batch PUT of sensor data works.
 void putSensorData()
          Test that PUT and DELETE of host/sensorbase/sensordata/TestUser@hackystat.org/2007-04-30T02:00:00.000 works.
 void testCaching()
          Tests that caching works.
 void testMakeSensorData()
          Tests the makeSensorData method.
 
Methods inherited from class org.hackystat.sensorbase.test.SensorBaseRestApiHelper
getHostName, setupServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestSensorDataRestApi

public TestSensorDataRestApi()
Method Detail

getSensorDataIndex

public void getSensorDataIndex()
                        throws java.lang.Exception
Test that GET host/sensorbase/sensordata returns an index containing all Sensor Data. We now @Ignore this method since it slows down testing so much.

Throws:
java.lang.Exception - If problems occur.

deleteAllData

public void deleteAllData()
                   throws java.lang.Exception
Test that DELETE host/sensorbase/sensordata/user deletes all data.

Throws:
java.lang.Exception - If problems occur.

testCaching

public void testCaching()
                 throws java.lang.Exception
Tests that caching works.

Throws:
java.lang.Exception - If problems occur.

getUserSensorDataIndex

public void getUserSensorDataIndex()
                            throws java.lang.Exception
Test that GET host/sensorbase/sensordata/TestUser@hackystat.org returns some sensor data.

Throws:
java.lang.Exception - If problems occur.

getUserSdtSensorDataIndex

public void getUserSdtSensorDataIndex()
                               throws java.lang.Exception
Test that GET host/sensorbase/sensordata/TestUser@hackystat.org?sdt=TestSdt returns data.

Throws:
java.lang.Exception - If problems occur.

getSensorDataIndexLastMod

public void getSensorDataIndexLastMod()
                               throws java.lang.Exception
Test that GET host/sensorbase/sensordata/TestUser@hackystat.org? lastModStartTime={tstamp}&lastModEndTime={tstamp} returns data.

Throws:
java.lang.Exception - If problems occur.

getUserSensorData

public void getUserSensorData()
                       throws java.lang.Exception
Test GET host/sensorbase/sensordata/TestUser@hackystat.org/2007-04-30T09:00:00.000 and see that it returns a SensorData instance..

Throws:
java.lang.Exception - If problems occur.

getNonExistingUserSensorData

public void getNonExistingUserSensorData()
                                  throws java.lang.Exception
Test GET host/sensorbase/sensordata/TestUser@hackystat.org/9999-04-30T09:00:00.000 throws a SensorBaseClientException, since the data does not exist.

Throws:
java.lang.Exception - If problems occur.

putSensorData

public void putSensorData()
                   throws java.lang.Exception
Test that PUT and DELETE of host/sensorbase/sensordata/TestUser@hackystat.org/2007-04-30T02:00:00.000 works.

Throws:
java.lang.Exception - If problems occur.

putBatchSensorData

public void putBatchSensorData()
                        throws java.lang.Exception
Test that a batch PUT of sensor data works.

Throws:
java.lang.Exception - If problems occur.

testMakeSensorData

public void testMakeSensorData()
                        throws java.lang.Exception
Tests the makeSensorData method.

Throws:
java.lang.Exception - If problems occur.