Mooved Tellstick plugin to plugin folder and added all targets to build xml
This commit is contained in:
parent
efdbc56859
commit
da290e570f
25 changed files with 155 additions and 11 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
/screenlog.0*
|
/screenlog.0*
|
||||||
/hal.conf
|
/hal.conf
|
||||||
/hal.db*
|
/hal.db*
|
||||||
/build/
|
build
|
||||||
/lib/Zutil.jar
|
/lib/Zutil.jar
|
||||||
|
|
|
||||||
3
Hal.iml
3
Hal.iml
|
|
@ -7,7 +7,10 @@
|
||||||
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/resource" type="java-resource" relativeOutputPath="resource" />
|
<sourceFolder url="file://$MODULE_DIR$/resource" type="java-resource" relativeOutputPath="resource" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/plugins/zwave/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/plugins/zwave/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/plugins/tellstick/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/plugins/tellstick/test" isTestSource="true" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/plugins/tellstick/build" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/plugins/zwave/build" />
|
<excludeFolder url="file://$MODULE_DIR$/plugins/zwave/build" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
|
|
|
||||||
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
|
|
@ -10,12 +10,12 @@ node {
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
sh 'ant clean'
|
sh 'ant clean'
|
||||||
sh 'ant build'
|
sh 'ant build-all'
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
try {
|
try {
|
||||||
sh 'ant test'
|
sh 'ant test-all'
|
||||||
} finally {
|
} finally {
|
||||||
step([$class: 'JUnitResultArchiver', testResults: 'build/reports/*.xml'])
|
step([$class: 'JUnitResultArchiver', testResults: 'build/reports/*.xml'])
|
||||||
}
|
}
|
||||||
|
|
@ -23,7 +23,7 @@ node {
|
||||||
|
|
||||||
|
|
||||||
stage('Package') {
|
stage('Package') {
|
||||||
sh 'ant package'
|
sh 'ant package-all'
|
||||||
archiveArtifacts artifacts: 'build/release/**', fingerprint: true
|
archiveArtifacts artifacts: 'build/release/**', fingerprint: true
|
||||||
|
|
||||||
// Tag artifact
|
// Tag artifact
|
||||||
|
|
|
||||||
49
build.xml
49
build.xml
|
|
@ -59,6 +59,9 @@
|
||||||
</java>
|
</java>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<!-- Test targets -->
|
||||||
|
<target name="test-all" depends="test,test-plugins" />
|
||||||
|
|
||||||
<target name="test" depends="build-test">
|
<target name="test" depends="build-test">
|
||||||
<mkdir dir="${reportsDir}" />
|
<mkdir dir="${reportsDir}" />
|
||||||
<junit printsummary="yes" haltonfailure="false" fork="true">
|
<junit printsummary="yes" haltonfailure="false" fork="true">
|
||||||
|
|
@ -72,16 +75,28 @@
|
||||||
</junit>
|
</junit>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="test-plugins" depends="build-test">
|
||||||
|
<subant target="test" verbose="true">
|
||||||
|
<fileset dir="plugins/" includes="*/build.xml"/>
|
||||||
|
</subant>
|
||||||
|
</target>
|
||||||
<!-- ________________________ BUILD TARGETS ________________________ -->
|
<!-- ________________________ BUILD TARGETS ________________________ -->
|
||||||
|
|
||||||
<!--clean all build paths-->
|
<!-- clean all build paths -->
|
||||||
<target name="clean">
|
<target name="clean">
|
||||||
<delete includeemptydirs="true" failonerror="false">
|
<delete includeemptydirs="true" failonerror="false">
|
||||||
<fileset dir="${buildRoot}" includes="**/*"/>
|
<fileset dir="${buildRoot}" includes="**/*"/>
|
||||||
</delete>
|
</delete>
|
||||||
|
<!-- clean plugins -->
|
||||||
|
<subant target="clean" verbose="true">
|
||||||
|
<fileset dir="plugins/" includes="*/build.xml"/>
|
||||||
|
</subant>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!--build product code-->
|
|
||||||
|
<!-- build product code -->
|
||||||
|
<target name="build-all" depends="build,build-plugins" />
|
||||||
|
|
||||||
<target name="build" depends="build-dependencies">
|
<target name="build" depends="build-dependencies">
|
||||||
<mkdir dir="${compileDir}" />
|
<mkdir dir="${compileDir}" />
|
||||||
<javac srcdir="${srcDir}" destdir="${compileDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
<javac srcdir="${srcDir}" destdir="${compileDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
||||||
|
|
@ -101,6 +116,12 @@
|
||||||
dest="${libDir}" verbose="true" usetimestamp="true"/>
|
dest="${libDir}" verbose="true" usetimestamp="true"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="build-plugins" depends="build">
|
||||||
|
<subant target="build" verbose="true">
|
||||||
|
<fileset dir="plugins/" includes="*/build.xml"/>
|
||||||
|
</subant>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="build-test" depends="build">
|
<target name="build-test" depends="build">
|
||||||
<mkdir dir="${compileTestDir}" />
|
<mkdir dir="${compileTestDir}" />
|
||||||
<javac srcdir="${testDir}" destdir="${compileTestDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
<javac srcdir="${testDir}" destdir="${compileTestDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
||||||
|
|
@ -113,6 +134,9 @@
|
||||||
</copy>
|
</copy>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<!-- generate release packages -->
|
||||||
|
<target name="package-all" depends="package,package-plugins" />
|
||||||
|
|
||||||
<target name="package" depends="build">
|
<target name="package" depends="build">
|
||||||
<copy todir="${releaseDir}" >
|
<copy todir="${releaseDir}" >
|
||||||
<fileset file="${root}/hal.conf.example" />
|
<fileset file="${root}/hal.conf.example" />
|
||||||
|
|
@ -120,15 +144,32 @@
|
||||||
<fileset file="${root}/logging.properties" />
|
<fileset file="${root}/logging.properties" />
|
||||||
<fileset file="${root}/run.sh" />
|
<fileset file="${root}/run.sh" />
|
||||||
</copy>
|
</copy>
|
||||||
<copy todir="${releaseDir}/lib">
|
<copy todir="${releaseDir}/lib">
|
||||||
<fileset dir="${libDir}" excludes="junit-*.jar,hamcrest-*.jar" />
|
<fileset dir="${libDir}" excludes="junit-*.jar,hamcrest-*.jar" />
|
||||||
</copy>
|
</copy>
|
||||||
<copy todir="${releaseDir}/resource/web">
|
<copy todir="${releaseDir}/resource/web">
|
||||||
<fileset dir="resource/web" />
|
<fileset dir="resource/web" />
|
||||||
</copy>
|
</copy>
|
||||||
<jar destfile="${releaseDir}/${releaseJar}" basedir="${compileDir}" />
|
<jar destfile="${releaseDir}/${releaseJar}" basedir="${compileDir}" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="package-plugins" depends="package">
|
||||||
|
<subant target="package" verbose="true">
|
||||||
|
<fileset dir="plugins/" includes="*/build.xml"/>
|
||||||
|
</subant>
|
||||||
|
<!-- Copy plugin jars -->
|
||||||
|
<copy todir="${releaseDir}/plugins" flatten="true" includeEmptyDirs="false">
|
||||||
|
<fileset dir="plugins/">
|
||||||
|
<include name="*/build/release/**"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
<!-- Copy plugin libs -->
|
||||||
|
<copy todir="${releaseDir}/lib" flatten="true" includeEmptyDirs="false">
|
||||||
|
<fileset dir="plugins/">
|
||||||
|
<include name="*/lib/**"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
<!-- ________________________ UTILITY TARGETS ________________________ -->
|
<!-- ________________________ UTILITY TARGETS ________________________ -->
|
||||||
|
|
||||||
|
|
|
||||||
96
plugins/tellstick/build.xml
Executable file
96
plugins/tellstick/build.xml
Executable file
|
|
@ -0,0 +1,96 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project name="Tellstick Plugin" >
|
||||||
|
|
||||||
|
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
|
||||||
|
|
||||||
|
<!--common properties-->
|
||||||
|
<property name="root" value="." />
|
||||||
|
<property name="srcDir" value="${root}/src" />
|
||||||
|
<property name="testDir" value="${root}/test" />
|
||||||
|
<property name="libDir" value="${root}/lib" />
|
||||||
|
|
||||||
|
<property name="buildRoot" value="${root}/build" />
|
||||||
|
<property name="compileDir" value="${buildRoot}/production" />
|
||||||
|
<property name="compileTestDir" value="${buildRoot}/test" />
|
||||||
|
<property name="releaseDir" value="${buildRoot}/release" />
|
||||||
|
<property name="releaseJar" value="tellstick.jar" />
|
||||||
|
<property name="reportsDir" value="../../${buildRoot}/reports" /> <!-- Use Hal reports folder -->
|
||||||
|
|
||||||
|
<!-- ________________________ CLASSPATH ________________________ -->
|
||||||
|
|
||||||
|
<!--define standard arguments for javac-->
|
||||||
|
<presetdef name="javac">
|
||||||
|
<javac includeantruntime="false" />
|
||||||
|
</presetdef>
|
||||||
|
|
||||||
|
<!--classpath included when building-->
|
||||||
|
<path id="classpath.build">
|
||||||
|
<fileset dir="${libDir}">
|
||||||
|
<include name="**/*.jar"/>
|
||||||
|
</fileset>
|
||||||
|
<pathelement location="${compileDir}" />
|
||||||
|
<!-- Hal core -->
|
||||||
|
<pathelement location="../../build/production" />
|
||||||
|
<fileset dir="../../lib">
|
||||||
|
<include name="**/*.jar"/>
|
||||||
|
</fileset>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path id="classpath.test">
|
||||||
|
<pathelement location="${compileTestDir}" />
|
||||||
|
<pathelement location="../../${compileTestDir}" />
|
||||||
|
<!--include libraries used for building-->
|
||||||
|
<path refid="classpath.build"/>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ________________________ EXECUTION TARGETS ________________________ -->
|
||||||
|
|
||||||
|
<target name="test" depends="build-test">
|
||||||
|
<mkdir dir="${reportsDir}" />
|
||||||
|
<junit printsummary="yes" haltonfailure="false" fork="true">
|
||||||
|
<classpath refid="classpath.test" />
|
||||||
|
<formatter type="plain" usefile="false" /> <!-- to screen -->
|
||||||
|
<formatter type="xml" /> <!-- to file -->
|
||||||
|
|
||||||
|
<batchtest todir="${reportsDir}" skipNonTests="true">
|
||||||
|
<fileset dir="${compileTestDir}" includes="**/*Test*.class" />
|
||||||
|
</batchtest>
|
||||||
|
</junit>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- ________________________ BUILD TARGETS ________________________ -->
|
||||||
|
|
||||||
|
<!--clean all build paths-->
|
||||||
|
<target name="clean">
|
||||||
|
<delete includeemptydirs="true" failonerror="false">
|
||||||
|
<fileset dir="${buildRoot}" includes="**/*"/>
|
||||||
|
</delete>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!--build product code-->
|
||||||
|
<target name="build">
|
||||||
|
<mkdir dir="${compileDir}" />
|
||||||
|
<javac srcdir="${srcDir}" destdir="${compileDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
||||||
|
<classpath refid="classpath.build" />
|
||||||
|
<include name="**/*.java" />
|
||||||
|
</javac>
|
||||||
|
<copy todir="${compileDir}">
|
||||||
|
<fileset dir="${srcDir}"
|
||||||
|
excludes="**/*.java" />
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="build-test" depends="build">
|
||||||
|
<mkdir dir="${compileTestDir}" />
|
||||||
|
<javac srcdir="${testDir}" destdir="${compileTestDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
||||||
|
<classpath refid="classpath.test" />
|
||||||
|
<include name="**/*.java" />
|
||||||
|
</javac>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="package" depends="build">
|
||||||
|
<jar destfile="${releaseDir}/${releaseJar}" basedir="${compileDir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
@ -34,6 +34,10 @@
|
||||||
</fileset>
|
</fileset>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
<!-- ________________________ EXECUTION TARGETS ________________________ -->
|
||||||
|
|
||||||
|
<target name="test" />
|
||||||
|
|
||||||
<!-- ________________________ BUILD TARGETS ________________________ -->
|
<!-- ________________________ BUILD TARGETS ________________________ -->
|
||||||
|
|
||||||
<!--clean all build paths-->
|
<!--clean all build paths-->
|
||||||
|
|
|
||||||
6
test/se/hal/daemon/SensorDataAggregationDeamonTest.java
Normal file → Executable file
6
test/se/hal/daemon/SensorDataAggregationDeamonTest.java
Normal file → Executable file
|
|
@ -6,7 +6,7 @@ import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import se.hal.HalContext;
|
import se.hal.HalContext;
|
||||||
import se.hal.plugin.tellstick.device.Oregon0x1A2D;
|
import se.hal.plugin.netscan.NetworkDevice;
|
||||||
import se.hal.util.UTCTimeUtility;
|
import se.hal.util.UTCTimeUtility;
|
||||||
import zutil.db.DBConnection;
|
import zutil.db.DBConnection;
|
||||||
import zutil.db.DBUpgradeHandler;
|
import zutil.db.DBUpgradeHandler;
|
||||||
|
|
@ -43,7 +43,7 @@ public class SensorDataAggregationDeamonTest {
|
||||||
System.out.println("Adding user to database");
|
System.out.println("Adding user to database");
|
||||||
db.exec("INSERT INTO user(id, external, username) VALUES(222, 0, 'test')"); //adding user
|
db.exec("INSERT INTO user(id, external, username) VALUES(222, 0, 'test')"); //adding user
|
||||||
System.out.println("Adding sensor to database");
|
System.out.println("Adding sensor to database");
|
||||||
db.exec("INSERT INTO sensor(id, user_id, external_id, type) VALUES(111, 222, 333, '"+Oregon0x1A2D.class.getName()+"')"); //adding sensor
|
db.exec("INSERT INTO sensor(id, user_id, external_id, type) VALUES(111, 222, 333, '"+NetworkDevice.class.getName()+"')"); //adding sensor
|
||||||
System.out.println("Generating raw data and saving it to the database...");
|
System.out.println("Generating raw data and saving it to the database...");
|
||||||
PreparedStatement stmt = db.getPreparedStatement("INSERT INTO sensor_data_raw (timestamp, sensor_id, data) VALUES(?, ?, ?)");
|
PreparedStatement stmt = db.getPreparedStatement("INSERT INTO sensor_data_raw (timestamp, sensor_id, data) VALUES(?, ?, ?)");
|
||||||
try{
|
try{
|
||||||
|
|
@ -77,7 +77,7 @@ public class SensorDataAggregationDeamonTest {
|
||||||
|
|
||||||
//TODO: verify the aggregation
|
//TODO: verify the aggregation
|
||||||
|
|
||||||
System.out.println("Finnished testing raw data aggregation");
|
System.out.println("Finished testing raw data aggregation");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue