djp3/cacophony — pull request #2 by JohnHBrock (2014-07-17 23:27:15+00:00)
Title: sqlite support, retrieval and storage of sensor values, minor tweaks and bugfixes

Outstanding issues:

* A test is failing, but I don't know why:

```
edu.uci.ics.luci.cacophony.server.responder.ResponderConfigurationTest

testResponder(edu.uci.ics.luci.cacophony.server.responder.ResponderConfigurationTest)
java.lang.AssertionError: Received an unexpected response:
{"responses":[{"predictors":["p2p://edu.uci.ics.luci.cacophony.test.345558218741146212901/c_node_02"],"c_node_name":"c_node_03","features":[{"translator":{"classname":"edu.uci.ics.luci.cacophony.node.TranslatorString","options":{"a":"thing"}},"path_expression":"//*[@id=\"cnn_ftrcntntinner\"]/div[9]/div[1]/text()[2]","name":"feature 1","ID":"ID of feature 1","reg_ex":"(.*)","format":"html","url":"http://www.cnn.com"}],"target":{"translator":{"classname":"edu.uci.ics.luci.cacophony.node.TranslatorString","options":{"c":"yet another thing"}},"path_expression":"//*[@id=\\\"cnn_ftrcntntinner\\\"]/div[9]/div[1]/text()[2]","name":"name of target","ID":"ID of target","reg_ex":"temp=(.*)","format":"html","url":"http://cnn.com"},"polling":{"min_interval":"5000","policy":"ON_CHANGE"}}]}
at org.junit.Assert.fail(Assert.java:93)
at edu.uci.ics.luci.cacophony.server.P2PSinkTest.waitForResponse(P2PSinkTest.java:108)
at edu.uci.ics.luci.cacophony.server.responder.ResponderConfigurationTest.testResponder(ResponderConfigurationTest.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
```

* I'm occassionally seeing a "database is locked" error coming from sqlite. Some Googling suggests this happens when two threads try accessing the database simultaneously, which, the way I've written the code, shouldn't normally be possible... it may be that two JUnit tests are running simultaneously on different threads and both triggering accesses to the database. I'll look into this some more.

* I haven't written JUnit tests for the DB code yet.