mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-25 11:45:49 +01:00
Enable Model Script Tests (#737)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
5c44d5f8fe
commit
edc27847d1
@ -6,6 +6,13 @@
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
@ -16,17 +23,10 @@
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
@ -3,16 +3,14 @@
|
||||
Bundle-SymbolicName: ${project.artifactId}
|
||||
Fragment-Host: org.openhab.core.model.script
|
||||
|
||||
-runrequires: bnd.identity;id='org.openhab.core.model.script.tests'
|
||||
-runrequires: \
|
||||
bnd.identity;id='org.openhab.core.model.script.tests',\
|
||||
bnd.identity;id='org.openhab.core.model.script.runtime'
|
||||
|
||||
#
|
||||
# done
|
||||
#
|
||||
-runbundles: \
|
||||
ch.qos.logback.classic;version='[1.2.0,1.2.1)',\
|
||||
ch.qos.logback.core;version='[1.2.0,1.2.1)',\
|
||||
com.google.gson;version='[2.7.0,2.7.1)',\
|
||||
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)',\
|
||||
joda-time;version='[2.9.2,2.9.3)',\
|
||||
@ -22,22 +20,14 @@ Fragment-Host: org.openhab.core.model.script
|
||||
org.apache.commons.exec;version='[1.1.0,1.1.1)',\
|
||||
org.apache.commons.io;version='[2.2.0,2.2.1)',\
|
||||
org.apache.commons.lang;version='[2.6.0,2.6.1)',\
|
||||
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
org.apache.felix.scr;version='[2.1.10,2.1.11)',\
|
||||
org.apache.servicemix.bundles.commons-codec;version='[1.3.0,1.3.1)',\
|
||||
org.apache.servicemix.bundles.commons-httpclient;version='[3.1.0,3.1.1)',\
|
||||
org.apache.xbean.bundleutils;version='[4.6.0,4.6.1)',\
|
||||
org.apache.xbean.finder;version='[4.6.0,4.6.1)',\
|
||||
org.eclipse.emf.common;version='[2.12.0,2.12.1)',\
|
||||
org.eclipse.emf.ecore;version='[2.12.0,2.12.1)',\
|
||||
org.eclipse.emf.ecore.xmi;version='[2.12.0,2.12.1)',\
|
||||
org.eclipse.equinox.common;version='[3.8.0,3.8.1)',\
|
||||
org.eclipse.equinox.event;version='[1.4.300,1.4.301)',\
|
||||
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)',\
|
||||
@ -46,33 +36,14 @@ Fragment-Host: org.openhab.core.model.script
|
||||
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.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)',\
|
||||
org.eclipse.xtext.common.types;version='[2.14.0,2.14.1)',\
|
||||
org.eclipse.xtext.util;version='[2.14.0,2.14.1)',\
|
||||
org.eclipse.xtext.xbase;version='[2.14.0,2.14.1)',\
|
||||
org.eclipse.xtext.xbase.lib;version='[2.14.0,2.14.1)',\
|
||||
org.glassfish.hk2.external.aopalliance-repackaged;version='[2.4.0,2.4.1)',\
|
||||
org.glassfish.hk2.external.javax.inject;version='[2.4.0,2.4.1)',\
|
||||
org.objectweb.asm;version='[6.1.1,6.1.2)',\
|
||||
org.objectweb.asm.commons;version='[6.1.1,6.1.2)',\
|
||||
org.objectweb.asm.tree;version='[6.1.1,6.1.2)',\
|
||||
org.openhab.core.compat1x;version='[2.5.0,2.5.1)',\
|
||||
org.ops4j.pax.swissbox.optional.jcl;version='[1.8.2,1.8.3)',\
|
||||
org.ops4j.pax.web.pax-web-api;version='[7.2.3,7.2.4)',\
|
||||
org.ops4j.pax.web.pax-web-jetty;version='[7.2.3,7.2.4)',\
|
||||
org.ops4j.pax.web.pax-web-runtime;version='[7.2.3,7.2.4)',\
|
||||
org.ops4j.pax.web.pax-web-spi;version='[7.2.3,7.2.4)',\
|
||||
org.osgi.service.event;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)',\
|
||||
osgi.enroute.hamcrest.wrapper;version='[1.3.0,1.3.1)',\
|
||||
osgi.enroute.junit.wrapper;version='[4.12.0,4.12.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.compat1x.tests;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.config.core;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.io.console;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.io.http;version='[2.5.0,2.5.1)',\
|
||||
@ -81,15 +52,49 @@ Fragment-Host: org.openhab.core.model.script
|
||||
org.openhab.core.model.item;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)',\
|
||||
org.openhab.core.model.sitemap;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.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.model.persistence.runtime;version='[2.5.0,2.5.1)',\
|
||||
ch.qos.logback.classic;version='[1.2.3,1.2.4)',\
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
com.google.guava;version='[21.0.0,21.0.1)',\
|
||||
org.apache.servicemix.specs.activation-api-1.1;version='[2.9.0,2.9.1)',\
|
||||
org.apache.servicemix.specs.annotation-api-1.3;version='[1.3.0,1.3.1)',\
|
||||
org.apache.servicemix.specs.jaxb-api-2.2;version='[2.9.0,2.9.1)',\
|
||||
org.apache.servicemix.specs.stax-api-1.2;version='[2.9.0,2.9.1)',\
|
||||
org.apache.xbean.bundleutils;version='[4.12.0,4.12.1)',\
|
||||
org.apache.xbean.finder;version='[4.12.0,4.12.1)',\
|
||||
org.eclipse.equinox.common;version='[3.10.200,3.10.201)',\
|
||||
org.eclipse.xtend.lib;version='[2.17.0,2.17.1)',\
|
||||
org.eclipse.xtend.lib.macro;version='[2.17.0,2.17.1)',\
|
||||
org.eclipse.xtext;version='[2.17.0,2.17.1)',\
|
||||
org.eclipse.xtext.common.types;version='[2.17.0,2.17.1)',\
|
||||
org.eclipse.xtext.util;version='[2.17.0,2.17.1)',\
|
||||
org.eclipse.xtext.xbase;version='[2.17.0,2.17.1)',\
|
||||
org.eclipse.xtext.xbase.lib;version='[2.17.0,2.17.1)',\
|
||||
org.objectweb.asm;version='[7.0.0,7.0.1)',\
|
||||
org.objectweb.asm.commons;version='[7.0.0,7.0.1)',\
|
||||
org.objectweb.asm.tree;version='[7.0.0,7.0.1)',\
|
||||
org.openhab.core.model.script.tests;version='[2.5.0,2.5.1)',\
|
||||
org.openhab.core.test;version='[2.5.0,2.5.1)',\
|
||||
slf4j.api;version='[1.7.25,1.7.26)',\
|
||||
org.openhab.core.model.script.runtime;version='[2.5.0,2.5.1)',\
|
||||
jollyday;version='[0.5.8,0.5.9)',\
|
||||
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
|
||||
org.eclipse.equinox.event;version='[1.4.300,1.4.301)',\
|
||||
org.openhab.core.ephemeris;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.sitemap;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)'
|
||||
org.ops4j.pax.swissbox.optional.jcl;version='[1.8.2,1.8.3)',\
|
||||
org.ops4j.pax.web.pax-web-jetty;version='[7.2.3,7.2.4)',\
|
||||
org.ops4j.pax.web.pax-web-runtime;version='[7.2.3,7.2.4)',\
|
||||
org.ops4j.pax.web.pax-web-spi;version='[7.2.3,7.2.4)',\
|
||||
org.threeten.extra;version='[1.4.0,1.4.1)',\
|
||||
org.openhab.core.storage.json;version='[2.5.0,2.5.1)',\
|
||||
tec.uom.lib.uom-lib-common;version='[1.0.3,1.0.4)',\
|
||||
tec.uom.se;version='[1.0.10,1.0.11)'
|
||||
|
@ -29,7 +29,6 @@ import org.quartz.impl.StdSchedulerFactory;
|
||||
* Tests for {@link ScriptExecution}
|
||||
*
|
||||
* @author Jon Evans - Initial contribution
|
||||
*
|
||||
*/
|
||||
public class ScriptExecutionTest {
|
||||
private static MockScheduler scheduler;
|
||||
@ -42,7 +41,7 @@ public class ScriptExecutionTest {
|
||||
@BeforeClass
|
||||
public static void setUp() throws SchedulerException {
|
||||
scheduler = new MockScheduler();
|
||||
System.setProperty(StdSchedulerFactory.PROPERTIES_FILE, "quartz-test.properties");
|
||||
System.setProperty(StdSchedulerFactory.PROPERTIES_FILE, "../../../../../target/classes/quartz-test.properties");
|
||||
SchedulerRepository.getInstance().bind(scheduler);
|
||||
|
||||
assertThat(StdSchedulerFactory.getDefaultScheduler(), sameInstance(scheduler));
|
||||
|
@ -15,12 +15,12 @@ package org.eclipse.smarthome.model.script.engine;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.measure.quantity.Length;
|
||||
import javax.measure.quantity.Temperature;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
import org.eclipse.smarthome.core.common.registry.ProviderChangeListener;
|
||||
import org.eclipse.smarthome.core.events.EventPublisher;
|
||||
import org.eclipse.smarthome.core.items.Item;
|
||||
@ -41,8 +41,10 @@ import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Henning Treu - Initial contribution
|
||||
*/
|
||||
public class ScriptEngineOSGiTest extends JavaOSGiTest {
|
||||
|
||||
private static final String ITEM_NAME = "Switch1";
|
||||
@ -76,7 +78,7 @@ public class ScriptEngineOSGiTest extends JavaOSGiTest {
|
||||
|
||||
@Override
|
||||
public Collection<Item> getAll() {
|
||||
return Lists.newArrayList(new SwitchItem(ITEM_NAME),
|
||||
return Arrays.asList(new SwitchItem(ITEM_NAME),
|
||||
createNumberItem(NUMBER_ITEM_TEMPERATURE, Temperature.class),
|
||||
createNumberItem(NUMBER_ITEM_LENGTH, Length.class), new NumberItem(NUMBER_ITEM_DECIMAL));
|
||||
}
|
||||
@ -345,7 +347,7 @@ public class ScriptEngineOSGiTest extends JavaOSGiTest {
|
||||
assertEquals("\\", runScript("return \"\\\\\""));
|
||||
}
|
||||
|
||||
private Item createNumberItem(String numberItemName, Class<@NonNull ?> dimension) {
|
||||
private Item createNumberItem(String numberItemName, Class<?> dimension) {
|
||||
return new NumberItem("Number:" + dimension.getSimpleName(), numberItemName);
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,6 @@ import org.junit.Test;
|
||||
/**
|
||||
*
|
||||
* @author Henning Treu - Initial contribution
|
||||
*
|
||||
*/
|
||||
public class NumberExtensionsTest {
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -42,7 +42,7 @@
|
||||
<module>org.openhab.core.model.lsp.tests</module>
|
||||
<module>org.openhab.core.model.persistence.tests</module>
|
||||
<module>org.openhab.core.model.rule.tests</module>
|
||||
<!-- <module>org.openhab.core.model.script.tests</module> -->
|
||||
<module>org.openhab.core.model.script.tests</module>
|
||||
<module>org.openhab.core.model.thing.testsupport</module>
|
||||
<module>org.openhab.core.model.thing.tests</module>
|
||||
<module>org.openhab.core.semantics.tests</module>
|
||||
|
Loading…
Reference in New Issue
Block a user