Skip to content

Commit 80d1589

Browse files
fixed target platform and added unit test
1 parent 9828224 commit 80d1589

16 files changed

Lines changed: 431 additions & 34 deletions

File tree

kura/tools/kura-addon-archetype/pom.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
1111
Contributors:
1212
Eurotech
13-
-->
14-
<project xmlns="http://maven.apache.org/POM/4.0.0"
15-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
16-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
13+
--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1714
<modelVersion>4.0.0</modelVersion>
1815

1916
<parent>
@@ -42,7 +39,6 @@
4239
</resource>
4340
<resource>
4441
<directory>src/main/resources</directory>
45-
<filtering>false</filtering>
4642
<excludes>
4743
<exclude>archetype-resources/test/test-env/framework/kura.properties</exclude>
4844
<exclude>META-INF/maven/archetype-metadata.xml</exclude>
@@ -106,6 +102,7 @@
106102
</execution>
107103
</executions>
108104
</plugin>
105+
109106
</plugins>
110107
</build>
111108

kura/tools/kura-addon-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
<fileSet filtered="true" packaged="true">
6767
<directory>tests/__artifactId__.bundle.test/src/main/java</directory>
6868
</fileSet>
69+
<fileSet filtered="true" packaged="true">
70+
<directory>tests/__artifactId__.bundle.test/src/test/java</directory>
71+
</fileSet>
6972
<fileSet encoding="UTF-8">
7073
<directory></directory>
7174
<includes>

kura/tools/kura-addon-archetype/src/main/resources/archetype-resources/bundles/__artifactId__.bundle/src/main/java/ExampleComponent.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
public class ExampleComponent implements ConfigurableComponent {
3333

3434
private static final Logger logger = LoggerFactory.getLogger(ExampleComponent.class);
35+
36+
private ExampleComponentOptions options;
3537

3638
/*
3739
* In the in activate, modified, deactivate methods it is possible to provide
@@ -59,7 +61,7 @@ public void updated(final Map<String, Object> properties) {
5961
logger.info("Updating");
6062

6163
logger.debug("Updating with properties: {}", properties);
62-
ExampleComponentOptions options = new ExampleComponentOptions(properties);
64+
this.options = new ExampleComponentOptions(properties);
6365

6466
logger.info("Updated");
6567
}
@@ -69,5 +71,9 @@ public synchronized void deactivate() {
6971
logger.info("Deactivating");
7072
logger.info("Deactivated");
7173
}
74+
75+
public ExampleComponentOptions getOptions() {
76+
return this.options;
77+
}
7278

7379
}

kura/tools/kura-addon-archetype/src/main/resources/archetype-resources/bundles/__artifactId__.bundle/src/main/java/ExampleComponentOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import java.util.Map;
1616

17-
class ExampleComponentOptions {
17+
public class ExampleComponentOptions {
1818

1919
private static final Property<String> EXAMPLE_PROPERTY = new Property<>("example.property", "example");
2020

kura/tools/kura-addon-archetype/src/main/resources/archetype-resources/bundles/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<tycho-version>4.0.11</tycho-version>
3939
<bnd-version>7.1.0</bnd-version>
4040
<maven-resources-version>3.1.0</maven-resources-version>
41+
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
4142
<maven-deploy-version>2.8.2</maven-deploy-version>
4243
<antrun-version>1.8</antrun-version>
4344
<exists-version>0.0.6</exists-version>

0 commit comments

Comments
 (0)