Some refactoring for better testing
Former-commit-id: 159d14c7ee81ea75ef9bade2d48c67a056ea4c42
This commit is contained in:
parent
e9168e6136
commit
060f784611
11 changed files with 47 additions and 28 deletions
|
|
@ -12,9 +12,8 @@ public class TelstickSerialCommNexaOnOffTest {
|
|||
System.out.println("Connecting to db...");
|
||||
TellstickSerialComm comm = new TellstickSerialComm();
|
||||
// http://developer.telldus.com/doxygen/TellStick.html
|
||||
System.out.println("Connecting to com port...");
|
||||
//comm.connect("COM5");
|
||||
comm.connect("/dev/ttyUSB1");
|
||||
comm.connect("COM5");
|
||||
//comm.connect("/dev/ttyUSB1");
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package se.koc.hal.plugin.tellstick;
|
||||
|
||||
import se.koc.hal.HalContext;
|
||||
import se.koc.hal.intf.HalSensor;
|
||||
import se.koc.hal.intf.HalSensorController;
|
||||
import se.koc.hal.intf.HalSensorReportListener;
|
||||
|
|
@ -24,8 +25,9 @@ public class TelstickSerialCommTest {
|
|||
LogUtil.setGlobalFormatter(new CompactLogFormatter());
|
||||
LogUtil.setGlobalLevel(Level.FINEST);
|
||||
|
||||
logger.info("Connecting to db...");
|
||||
final DBConnection db = new DBConnection(DBConnection.DBMS.SQLite, "hal.db");
|
||||
logger.info("Initializing HalContext...");
|
||||
HalContext.initialize();
|
||||
final DBConnection db = HalContext.getDB();
|
||||
|
||||
logger.info("Setting up Tellstick listeners...");
|
||||
TellstickSerialComm comm = new TellstickSerialComm();
|
||||
|
|
@ -47,8 +49,8 @@ public class TelstickSerialCommTest {
|
|||
}
|
||||
}
|
||||
});
|
||||
logger.info("Connecting to com port...");
|
||||
comm.connect("/dev/ttyUSB1");
|
||||
comm.connect("COM5");
|
||||
//comm.connect("/dev/ttyUSB1");
|
||||
|
||||
logger.info("Up and Running");
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue