From c37d2a41e96a45f50dccbe96336e4d9765ef629a Mon Sep 17 00:00:00 2001 From: Markus Rathgeb Date: Fri, 1 Feb 2019 10:02:39 +0000 Subject: [PATCH] use openHAB Core index, simplify itests and demo app (#503) * use openHAB Core index, simplify itests and demo app Signed-off-by: Markus Rathgeb --- bom/openhab-core-index/.classpath | 27 ++++++ .../index => bom/openhab-core-index}/.project | 8 +- .../org.eclipse.core.resources.prefs | 0 .../.settings/org.eclipse.m2e.core.prefs | 0 bom/openhab-core-index/pom.xml | 41 ++++++++ bom/pom.xml | 1 + demo/app/app.bndrun | 90 +++++++++--------- demo/app/pom.xml | 11 ++- demo/index/pom.xml | 56 ----------- demo/pom.xml | 1 - itests/itest-common.bndrun | 26 +++++ .../{integration-test.bndrun => itest.bndrun} | 27 ++---- .../org.openhab.core.compat1x.tests/pom.xml | 91 ------------------ .../{integration-test.bndrun => itest.bndrun} | 25 ++--- itests/org.openhab.core.tests/pom.xml | 73 -------------- itests/pom.xml | 95 ++++++++++++++++++- 16 files changed, 261 insertions(+), 311 deletions(-) create mode 100644 bom/openhab-core-index/.classpath rename {demo/index => bom/openhab-core-index}/.project (61%) rename {demo/index => bom/openhab-core-index}/.settings/org.eclipse.core.resources.prefs (100%) rename {demo/index => bom/openhab-core-index}/.settings/org.eclipse.m2e.core.prefs (100%) create mode 100644 bom/openhab-core-index/pom.xml delete mode 100644 demo/index/pom.xml create mode 100644 itests/itest-common.bndrun rename itests/org.openhab.core.compat1x.tests/{integration-test.bndrun => itest.bndrun} (85%) rename itests/org.openhab.core.tests/{integration-test.bndrun => itest.bndrun} (71%) diff --git a/bom/openhab-core-index/.classpath b/bom/openhab-core-index/.classpath new file mode 100644 index 000000000..5e8a55fef --- /dev/null +++ b/bom/openhab-core-index/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/index/.project b/bom/openhab-core-index/.project similarity index 61% rename from demo/index/.project rename to bom/openhab-core-index/.project index b95fab9c8..bb532f95b 100644 --- a/demo/index/.project +++ b/bom/openhab-core-index/.project @@ -1,10 +1,15 @@ - org.openhab.core.demo.index + org.openhab.core.bom.openhab-core-index + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.m2e.core.maven2Builder @@ -12,6 +17,7 @@ + org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature diff --git a/demo/index/.settings/org.eclipse.core.resources.prefs b/bom/openhab-core-index/.settings/org.eclipse.core.resources.prefs similarity index 100% rename from demo/index/.settings/org.eclipse.core.resources.prefs rename to bom/openhab-core-index/.settings/org.eclipse.core.resources.prefs diff --git a/demo/index/.settings/org.eclipse.m2e.core.prefs b/bom/openhab-core-index/.settings/org.eclipse.m2e.core.prefs similarity index 100% rename from demo/index/.settings/org.eclipse.m2e.core.prefs rename to bom/openhab-core-index/.settings/org.eclipse.m2e.core.prefs diff --git a/bom/openhab-core-index/pom.xml b/bom/openhab-core-index/pom.xml new file mode 100644 index 000000000..5d1b63b75 --- /dev/null +++ b/bom/openhab-core-index/pom.xml @@ -0,0 +1,41 @@ + + + + 4.0.0 + + + org.openhab.core.bom + org.openhab.core.reactor.bom + 2.5.0-SNAPSHOT + + + org.openhab.core.bom.openhab-core-index + + openHAB Core :: BOM :: openHAB Core Index + + + + org.openhab.core.bom + org.openhab.core.bom.openhab-core + ${project.version} + pom + compile + true + + + + + + + biz.aQute.bnd + bnd-maven-plugin + + + biz.aQute.bnd + bnd-indexer-maven-plugin + + + + + diff --git a/bom/pom.xml b/bom/pom.xml index 0e64de1f4..9045d8187 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -23,6 +23,7 @@ test test-index openhab-core + openhab-core-index diff --git a/demo/app/app.bndrun b/demo/app/app.bndrun index 102e99822..9de520f6b 100644 --- a/demo/app/app.bndrun +++ b/demo/app/app.bndrun @@ -1,6 +1,6 @@ -index: ../index/target/index.xml;name="org.openhab.core.demo.index" - --standalone: ${index} +-standalone: \ + ../../bom/runtime-index/target/index.xml;name="org.openhab.core.bom.runtime-index",\ + ../../bom/openhab-core-index/target/index.xml;name="org.openhab.core.bom.openhab-core-index" -resolve.effective: active @@ -73,7 +73,6 @@ feature.esh-model-runtime-all: \ ch.qos.logback.core;version='[1.2.0,1.2.1)',\ com.eclipsesource.jaxrs.jersey-all;version='[2.22.2,2.22.3)',\ com.eclipsesource.jaxrs.publisher;version='[5.3.1,5.3.2)',\ - com.google.gson;version='[2.3.1,2.3.2)',\ com.google.guava;version='[15.0.0,15.0.1)',\ com.google.inject;version='[3.0.0,3.0.1)',\ javax.measure.unit-api;version='[1.0.0,1.0.1)',\ @@ -108,7 +107,6 @@ feature.esh-model-runtime-all: \ org.eclipse.jetty.client;version='[9.4.11,9.4.12)',\ org.eclipse.jetty.http;version='[9.4.11,9.4.12)',\ org.eclipse.jetty.io;version='[9.4.11,9.4.12)',\ - org.eclipse.jetty.proxy;version='[9.4.11,9.4.12)',\ org.eclipse.jetty.security;version='[9.4.11,9.4.12)',\ org.eclipse.jetty.server;version='[9.4.11,9.4.12)',\ org.eclipse.jetty.servlet;version='[9.4.11,9.4.12)',\ @@ -117,46 +115,6 @@ feature.esh-model-runtime-all: \ org.eclipse.jetty.websocket.client;version='[9.4.11,9.4.12)',\ org.eclipse.jetty.websocket.common;version='[9.4.11,9.4.12)',\ org.eclipse.jetty.xml;version='[9.4.11,9.4.12)',\ - org.openhab.core.config.core,\ - org.openhab.core.config.discovery,\ - org.openhab.core.config.dispatch,\ - org.openhab.core.config.xml,\ - org.openhab.core,\ - org.openhab.core.audio,\ - org.openhab.core.binding.xml,\ - org.openhab.core.id,\ - org.openhab.core.persistence,\ - org.openhab.core.scheduler,\ - org.openhab.core.semantics,\ - org.openhab.core.thing,\ - org.openhab.core.thing.xml,\ - org.openhab.core.transform,\ - org.openhab.core.voice,\ - org.openhab.core.io.console,\ - org.openhab.core.io.console.rfc147,\ - org.openhab.core.io.http,\ - org.openhab.core.io.monitor,\ - org.openhab.core.io.net,\ - org.openhab.core.io.rest,\ - org.openhab.core.io.rest.core,\ - org.openhab.core.io.rest.optimize,\ - org.openhab.core.io.rest.sse,\ - org.openhab.core.model.core,\ - org.openhab.core.model.item,\ - org.openhab.core.model.item.runtime,\ - org.openhab.core.model.persistence,\ - org.openhab.core.model.persistence.runtime,\ - org.openhab.core.model.rule,\ - org.openhab.core.model.rule.runtime,\ - org.openhab.core.model.script,\ - org.openhab.core.model.script.runtime,\ - org.openhab.core.model.sitemap,\ - org.openhab.core.model.sitemap.runtime,\ - org.openhab.core.model.thing,\ - org.openhab.core.model.thing.runtime,\ - org.openhab.core.storage.mapdb,\ - org.openhab.core.ui,\ - org.openhab.core.ui.icon,\ org.eclipse.xtend.lib;version='[2.14.0,2.14.1)',\ org.eclipse.xtend.lib.macro;version='[2.14.0,2.14.1)',\ org.eclipse.xtext;version='[2.14.0,2.14.1)',\ @@ -180,4 +138,44 @@ feature.esh-model-runtime-all: \ org.osgi.service.metatype;version='[1.4.0,1.4.1)',\ slf4j.api;version='[1.7.21,1.7.22)',\ tec.uom.lib.uom-lib-common;version='[1.0.2,1.0.3)',\ - tec.uom.se;version='[1.0.8,1.0.9)' + tec.uom.se;version='[1.0.8,1.0.9)',\ + com.google.gson;version='[2.7.0,2.7.1)',\ + org.apache.aries.javax.jax.rs-api;version='[1.0.0,1.0.1)',\ + org.openhab.core;version='[2.5.0,2.5.1)',\ + org.openhab.core.audio;version='[2.5.0,2.5.1)',\ + org.openhab.core.binding.xml;version='[2.5.0,2.5.1)',\ + org.openhab.core.config.core;version='[2.5.0,2.5.1)',\ + org.openhab.core.config.discovery;version='[2.5.0,2.5.1)',\ + org.openhab.core.config.dispatch;version='[2.5.0,2.5.1)',\ + org.openhab.core.config.xml;version='[2.5.0,2.5.1)',\ + org.openhab.core.id;version='[2.5.0,2.5.1)',\ + org.openhab.core.io.console;version='[2.5.0,2.5.1)',\ + org.openhab.core.io.console.rfc147;version='[2.5.0,2.5.1)',\ + org.openhab.core.io.http;version='[2.5.0,2.5.1)',\ + org.openhab.core.io.monitor;version='[2.5.0,2.5.1)',\ + org.openhab.core.io.net;version='[2.5.0,2.5.1)',\ + org.openhab.core.io.rest;version='[2.5.0,2.5.1)',\ + org.openhab.core.io.rest.core;version='[2.5.0,2.5.1)',\ + org.openhab.core.io.rest.optimize;version='[2.5.0,2.5.1)',\ + org.openhab.core.io.rest.sse;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.core;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.item;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.item.runtime;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.persistence;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.persistence.runtime;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.rule;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.rule.runtime;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.script;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.script.runtime;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.sitemap;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.sitemap.runtime;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.thing;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.thing.runtime;version='[2.5.0,2.5.1)',\ + org.openhab.core.persistence;version='[2.5.0,2.5.1)',\ + org.openhab.core.scheduler;version='[2.5.0,2.5.1)',\ + org.openhab.core.semantics;version='[2.5.0,2.5.1)',\ + org.openhab.core.storage.mapdb;version='[2.5.0,2.5.1)',\ + org.openhab.core.thing;version='[2.5.0,2.5.1)',\ + org.openhab.core.thing.xml;version='[2.5.0,2.5.1)',\ + org.openhab.core.transform;version='[2.5.0,2.5.1)',\ + org.openhab.core.voice;version='[2.5.0,2.5.1)' diff --git a/demo/app/pom.xml b/demo/app/pom.xml index 0eca4ddcc..6e199eaca 100644 --- a/demo/app/pom.xml +++ b/demo/app/pom.xml @@ -15,8 +15,15 @@ - org.openhab.core.demo - org.openhab.core.demo.index + org.openhab.core.bom + org.openhab.core.bom.runtime-index + ${project.version} + pom + provided + + + org.openhab.core.bom + org.openhab.core.bom.openhab-core-index ${project.version} pom provided diff --git a/demo/index/pom.xml b/demo/index/pom.xml deleted file mode 100644 index 9b922d161..000000000 --- a/demo/index/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - 4.0.0 - - - org.openhab.core.demo - org.openhab.core.reactor.demo - 2.5.0-SNAPSHOT - - - org.openhab.core.demo.index - pom - - openHAB Core :: Demo :: Index - - - - org.openhab.core.bom - org.openhab.core.bom.runtime - pom - - - org.openhab.core.bom - org.openhab.core.bom.compile - pom - - - - - org.openhab.core.bom - org.openhab.core.bom.openhab-core - ${project.version} - pom - runtime - - - - - - - - biz.aQute.bnd - bnd-maven-plugin - - - biz.aQute.bnd - bnd-indexer-maven-plugin - - true - - - - - diff --git a/demo/pom.xml b/demo/pom.xml index 170a18648..6040ef663 100644 --- a/demo/pom.xml +++ b/demo/pom.xml @@ -17,7 +17,6 @@ app - index diff --git a/itests/itest-common.bndrun b/itests/itest-common.bndrun new file mode 100644 index 000000000..3a6027d19 --- /dev/null +++ b/itests/itest-common.bndrun @@ -0,0 +1,26 @@ +-standalone: \ + ../../bom/runtime-index/target/index.xml;name="org.openhab.core.bom.runtime-index",\ + ../../bom/test-index/target/index.xml;name="org.openhab.core.bom.test-index",\ + ../../bom/openhab-core-index/target/index.xml;name="org.openhab.core.bom.openhab-core-index",\ + target/index.xml;name="self" + +-resolve.effective: active + +# Run all integration tests which are named xyzTest +Test-Cases: ${classes;CONCRETE;PUBLIC;NAMED;*Test} + +# A temporary inclusion until an R7 framework is available +Import-Package: org.osgi.framework.*;version="[1.8,2)",* + +# Used by Objenesis/Mockito and not actually optional +-runsystempackages: sun.reflect + +-runfw: org.eclipse.osgi +-runee: JavaSE-1.8 + +# We can provide that capability programmatic by our test bundle +Provide-Capability: osgi.service;objectClass:List="org.eclipse.smarthome.core.storage.StorageService" + +# The integration test itself does not export anything. +Export-Package: +-exportcontents: diff --git a/itests/org.openhab.core.compat1x.tests/integration-test.bndrun b/itests/org.openhab.core.compat1x.tests/itest.bndrun similarity index 85% rename from itests/org.openhab.core.compat1x.tests/integration-test.bndrun rename to itests/org.openhab.core.compat1x.tests/itest.bndrun index bffc26639..4bea1b9e5 100644 --- a/itests/org.openhab.core.compat1x.tests/integration-test.bndrun +++ b/itests/org.openhab.core.compat1x.tests/itest.bndrun @@ -1,25 +1,7 @@ --standalone: \ - ../../bom/runtime-index/target/index.xml;name="runtime",\ - ../../bom/test-index/target/index.xml;name="test",\ - target/index.xml;name="self" - --resolve.effective: active - -# Run all integration tests which are named xyzTest -Test-Cases: ${classes;CONCRETE;PUBLIC;NAMED;*Test} - -# A temporary inclusion until an R7 framework is available -Import-Package: org.osgi.framework.*;version="[1.8,2)",* +-include: ../itest-common.bndrun Bundle-SymbolicName: ${project.artifactId} Fragment-Host: org.openhab.core.compat1x -Provide-Capability: osgi.service;objectClass:List="org.eclipse.smarthome.core.storage.StorageService" - -# Used by Objenesis/Mockito and not actually optional --runsystempackages: sun.reflect - --runfw: org.eclipse.osgi --runee: JavaSE-1.8 -runrequires: bnd.identity;id='org.openhab.core.compat1x.tests' @@ -97,7 +79,6 @@ Provide-Capability: osgi.service;objectClass:List="org.eclipse.smarthome org.openhab.core.io.net;version='[2.5.0,2.5.1)',\ org.openhab.core.model.core;version='[2.5.0,2.5.1)',\ org.openhab.core.model.item;version='[2.5.0,2.5.1)',\ - org.openhab.core.model.item.runtime;version='[2.5.0,2.5.1)',\ org.openhab.core.model.persistence;version='[2.5.0,2.5.1)',\ org.openhab.core.model.script;version='[2.5.0,2.5.1)',\ org.openhab.core.model.script.runtime;version='[2.5.0,2.5.1)',\ @@ -107,4 +88,8 @@ Provide-Capability: osgi.service;objectClass:List="org.eclipse.smarthome org.openhab.core.thing;version='[2.5.0,2.5.1)',\ org.openhab.core.transform;version='[2.5.0,2.5.1)',\ org.openhab.core.ui;version='[2.5.0,2.5.1)',\ - org.openhab.core.voice;version='[2.5.0,2.5.1)' + org.openhab.core.voice;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.persistence.runtime;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.rule;version='[2.5.0,2.5.1)',\ + org.openhab.core.model.thing;version='[2.5.0,2.5.1)',\ + org.openhab.core.storage.json;version='[2.5.0,2.5.1)' diff --git a/itests/org.openhab.core.compat1x.tests/pom.xml b/itests/org.openhab.core.compat1x.tests/pom.xml index 27e353bc1..d9868ddd2 100644 --- a/itests/org.openhab.core.compat1x.tests/pom.xml +++ b/itests/org.openhab.core.compat1x.tests/pom.xml @@ -12,95 +12,4 @@ openHAB Core :: Integration Tests :: 1.x Compatibility Layer Tests - - - org.openhab.core.bundles - org.openhab.core.compat1x - ${project.version} - compile - - - org.openhab.core.bundles - org.openhab.core.model.item.runtime - ${project.version} - runtime - - - org.openhab.core.bundles - org.openhab.core.model.script.runtime - ${project.version} - runtime - - - org.openhab.core.bundles - org.openhab.core.scheduler - ${project.version} - runtime - - - - org.openhab.core.bom - org.openhab.core.bom.test - pom - provided - - - org.openhab.core.bom - org.openhab.core.bom.compile - pom - - - - org.openhab.core.bom - org.openhab.core.bom.runtime-index - ${project.version} - pom - provided - - - org.openhab.core.bom - org.openhab.core.bom.test-index - ${project.version} - pom - provided - - - - - - - biz.aQute.bnd - bnd-maven-plugin - - integration-test.bndrun - - - - biz.aQute.bnd - bnd-indexer-maven-plugin - - true - - - - biz.aQute.bnd - bnd-testing-maven-plugin - - - integration-test.bndrun - - - - - biz.aQute.bnd - bnd-resolver-maven-plugin - - - integration-test.bndrun - - - - - - diff --git a/itests/org.openhab.core.tests/integration-test.bndrun b/itests/org.openhab.core.tests/itest.bndrun similarity index 71% rename from itests/org.openhab.core.tests/integration-test.bndrun rename to itests/org.openhab.core.tests/itest.bndrun index 7c45487b1..a3aec8f31 100644 --- a/itests/org.openhab.core.tests/integration-test.bndrun +++ b/itests/org.openhab.core.tests/itest.bndrun @@ -1,28 +1,15 @@ --standalone: \ - ../../bom/runtime-index/target/index.xml;name="runtime",\ - ../../bom/test-index/target/index.xml;name="test",\ - target/index.xml;name="self" - --resolve.effective: active - -# Run all integration tests which are named xyzTest -Test-Cases: ${classes;CONCRETE;PUBLIC;NAMED;*Test} - -# A temporary inclusion until an R7 framework is available -Import-Package: org.osgi.framework.*;version="[1.8,2)",* +-include: ../itest-common.bndrun Bundle-SymbolicName: ${project.artifactId} Fragment-Host: org.openhab.core -Provide-Capability: osgi.service;objectClass:List="org.eclipse.smarthome.core.storage.StorageService" - -# Used by Objenesis/Mockito and not actually optional --runsystempackages: sun.reflect - --runfw: org.eclipse.osgi --runee: JavaSE-1.8 -runrequires: bnd.identity;id='org.openhab.core.tests' +# We would like to use the "volatile" storage only +-runblacklist: \ + bnd.identity;id='org.openhab.core.storage.json',\ + bnd.identity;id='org.openhab.core.storage.mapdb' + # # done # diff --git a/itests/org.openhab.core.tests/pom.xml b/itests/org.openhab.core.tests/pom.xml index b66a7b371..4e7600e7b 100644 --- a/itests/org.openhab.core.tests/pom.xml +++ b/itests/org.openhab.core.tests/pom.xml @@ -14,77 +14,4 @@ openHAB Core :: Integration Tests :: Tests - - - org.openhab.core.bundles - org.openhab.core.test - ${project.version} - compile - - - - org.openhab.core.bom - org.openhab.core.bom.test - pom - provided - - - org.openhab.core.bom - org.openhab.core.bom.compile - pom - - - - org.openhab.core.bom - org.openhab.core.bom.runtime-index - ${project.version} - pom - provided - - - org.openhab.core.bom - org.openhab.core.bom.test-index - ${project.version} - pom - provided - - - - - - - biz.aQute.bnd - bnd-maven-plugin - - integration-test.bndrun - - - - biz.aQute.bnd - bnd-indexer-maven-plugin - - true - - - - biz.aQute.bnd - bnd-testing-maven-plugin - - - integration-test.bndrun - - - - - biz.aQute.bnd - bnd-resolver-maven-plugin - - - integration-test.bndrun - - - - - - diff --git a/itests/pom.xml b/itests/pom.xml index 7af3ecad6..9aaf30b35 100644 --- a/itests/pom.xml +++ b/itests/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 @@ -63,6 +64,7 @@ + itests-os-unix-only unix @@ -72,6 +74,97 @@ + + + itests-common + + + itest.bndrun + + + + + + org.openhab.core.bom + org.openhab.core.bom.test + pom + provided + + + org.openhab.core.bom + org.openhab.core.bom.openhab-core + ${project.version} + pom + provided + + + org.openhab.core.bom + org.openhab.core.bom.compile + pom + provided + + + + org.openhab.core.bom + org.openhab.core.bom.test-index + ${project.version} + pom + provided + + + org.openhab.core.bom + org.openhab.core.bom.openhab-core-index + ${project.version} + pom + provided + + + org.openhab.core.bom + org.openhab.core.bom.runtime-index + ${project.version} + pom + provided + + + + + + + biz.aQute.bnd + bnd-maven-plugin + + itest.bndrun + + + + biz.aQute.bnd + bnd-indexer-maven-plugin + + true + + + + biz.aQute.bnd + bnd-testing-maven-plugin + + + itest.bndrun + + + + + biz.aQute.bnd + bnd-resolver-maven-plugin + + + itest.bndrun + + + + + + +