You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/10/18 13:17:26 UTC
[plc4x] 02/15: [OSGi] Finally, integration test is running.
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/resolve-split-package-osgi
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 21fa91da78d4a1787bcc6743ec81b6257019176b
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Thu Oct 17 21:57:44 2019 +0200
[OSGi] Finally, integration test is running.
---
plc4j/karaf-features/karaf-itest/pom.xml | 52 ++++-
.../java/org/apache/plc4x/karaf/FeatureITest.java | 227 ++++++++++++---------
.../test/resources/etc/org.ops4j.pax.logging.cfg | 71 +++++++
.../src/test/resources/etc/system.properties | 18 ++
.../karaf-itest/src/test/resources/exam.properties | 1 -
plc4j/karaf-features/s7/pom.xml | 99 ---------
.../karaf-features/s7/src/main/feature/feature.xml | 2 +-
7 files changed, 271 insertions(+), 199 deletions(-)
diff --git a/plc4j/karaf-features/karaf-itest/pom.xml b/plc4j/karaf-features/karaf-itest/pom.xml
index 44b2a44..b42c5b6 100644
--- a/plc4j/karaf-features/karaf-itest/pom.xml
+++ b/plc4j/karaf-features/karaf-itest/pom.xml
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
<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">
@@ -12,7 +30,7 @@
<artifactId>karaf-itest</artifactId>
<properties>
- <karaf.version>4.2.1</karaf.version>
+ <karaf.version>4.2.6</karaf.version>
<pax.version>4.13.1</pax.version>
</properties>
@@ -78,6 +96,12 @@
<version>1.3_1</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4j-api</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -85,6 +109,7 @@
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>depends-maven-plugin</artifactId>
+ <version>1.4.0</version>
<executions>
<execution>
<id>generate-depends-file</id>
@@ -94,6 +119,31 @@
</execution>
</executions>
</plugin>
+ <!-- See https://issues.apache.org/jira/browse/KARAF-6457 -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkCount>1</forkCount>
+ <reuseForks>false</reuseForks>
+ <systemPropertyVariables>
+ <org.ops4j.pax.logging.DefaultServiceLog.level>INFO</org.ops4j.pax.logging.DefaultServiceLog.level>
+ <spring31.version>3.1.4.RELEASE</spring31.version>
+ <spring32.version>3.2.18.RELEASE_1</spring32.version>
+ <spring40.version>4.0.9.RELEASE_1</spring40.version>
+ <spring41.version>4.1.9.RELEASE_1</spring41.version>
+ <spring42.version>4.2.9.RELEASE_1</spring42.version>
+ <spring43.version>4.3.25.RELEASE_1</spring43.version>
+ <spring50.version>5.0.15.RELEASE_1</spring50.version>
+ <spring51.version>5.1.9.RELEASE_1</spring51.version>
+ <spring.security31.version>3.1.4.RELEASE</spring.security31.version>
+ <spring.security42.version>4.2.4.RELEASE_1</spring.security42.version>
+ <spring.security51.version>5.1.5.RELEASE_1</spring.security51.version>
+ <activemq.version>5.15.9</activemq.version>
+ <plc4x.version>${project.version}</plc4x.version>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
</plugins>
</build>
diff --git a/plc4j/karaf-features/karaf-itest/src/test/java/org/apache/plc4x/karaf/FeatureITest.java b/plc4j/karaf-features/karaf-itest/src/test/java/org/apache/plc4x/karaf/FeatureITest.java
index b7a12a6..f38cdc1 100644
--- a/plc4j/karaf-features/karaf-itest/src/test/java/org/apache/plc4x/karaf/FeatureITest.java
+++ b/plc4j/karaf-features/karaf-itest/src/test/java/org/apache/plc4x/karaf/FeatureITest.java
@@ -13,137 +13,170 @@
*/
package org.apache.plc4x.karaf;
-import org.apache.karaf.features.Feature;
-import org.apache.karaf.features.FeaturesService;
import org.apache.karaf.itests.KarafTestSupport;
-import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.karaf.container.internal.JavaVersionUtil;
+import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
import org.ops4j.pax.exam.karaf.options.LogLevelOption;
import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
-import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.osgi.framework.Bundle;
-import java.io.File;
+import java.util.stream.Stream;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureSecurity;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerClass.class)
+@ExamReactorStrategy(PerMethod.class)
public class FeatureITest extends KarafTestSupport {
- @Override
@Configuration
public Option[] config() {
- MavenArtifactUrlReference karafUrl = maven().groupId("org.apache.karaf").artifactId("apache-karaf").versionAsInProject().type("tar.gz");
-
- String httpPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_HTTP_PORT), Integer.parseInt(MAX_HTTP_PORT)));
- String rmiRegistryPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_RMI_REG_PORT), Integer.parseInt(MAX_RMI_REG_PORT)));
- String rmiServerPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_RMI_SERVER_PORT), Integer.parseInt(MAX_RMI_SERVER_PORT)));
- String sshPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_SSH_PORT), Integer.parseInt(MAX_SSH_PORT)));
- String localRepository = System.getProperty("org.ops4j.pax.url.mvn.localRepository");
- if (localRepository == null) {
- localRepository = "";
- }
-
- if (JavaVersionUtil.getMajorVersion() >= 9) {
- return new Option[]{
- //KarafDistributionOption.debugConfiguration("8889", true),
- karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache Karaf").unpackDirectory(new File("target/exam")),
- // enable JMX RBAC security, thanks to the KarafMBeanServerBuilder
- configureSecurity().disableKarafMBeanServerBuilder(),
- // configureConsole().ignoreLocalConsole(),
- keepRuntimeFolder(),
- logLevel(LogLevelOption.LogLevel.INFO),
- mavenBundle().groupId("org.awaitility").artifactId("awaitility").versionAsInProject(),
- mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(),
- mavenBundle().groupId("org.apache.karaf.itests").artifactId("common").versionAsInProject(),
- editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", httpPort),
- editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", rmiRegistryPort),
- editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", rmiServerPort),
- editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", sshPort),
- editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository", localRepository),
- new VMOption("--add-reads=java.xml=java.logging"),
- new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
- new VMOption("--patch-module"),
- new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-"
- + System.getProperty("karaf.version") + ".jar"),
- new VMOption("--patch-module"),
- new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-"
- + System.getProperty("karaf.version") + ".jar"),
- new VMOption("--add-opens"),
- new VMOption("java.base/java.security=ALL-UNNAMED"),
- new VMOption("--add-opens"),
- new VMOption("java.base/java.net=ALL-UNNAMED"),
- new VMOption("--add-opens"),
- new VMOption("java.base/java.lang=ALL-UNNAMED"),
- new VMOption("--add-opens"),
- new VMOption("java.base/java.util=ALL-UNNAMED"),
- new VMOption("--add-opens"),
- new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
- new VMOption("--add-opens"),
- new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
- new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
- new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
- new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
- new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
- new VMOption("-classpath"),
- new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
- };
- } else {
- return new Option[]{
- //KarafDistributionOption.debugConfiguration("8889", true),
- karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache Karaf").unpackDirectory(new File("target/exam")),
- // enable JMX RBAC security, thanks to the KarafMBeanServerBuilder
- configureSecurity().disableKarafMBeanServerBuilder(),
- // configureConsole().ignoreLocalConsole(),
- keepRuntimeFolder(),
- logLevel(LogLevelOption.LogLevel.INFO),
- mavenBundle().groupId("org.awaitility").artifactId("awaitility").versionAsInProject(),
- mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(),
- mavenBundle().groupId("org.apache.karaf.itests").artifactId("common").versionAsInProject(),
- editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", httpPort),
- editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", rmiRegistryPort),
- editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", rmiServerPort),
- editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", sshPort),
- editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository", localRepository)
- };
- }
+ Option[] options = new Option[]{
+ logLevel(LogLevelOption.LogLevel.DEBUG),
+ KarafDistributionOption.editConfigurationFilePut("etc/system.properties", "plc4x.version", System.getProperty("plc4x.version")),
+// features("scr"),
+// mavenBundle()
+// .groupId("org.ops4j.pax.exam.samples")
+// .artifactId("pax-exam-sample8-ds")
+// .version("4.13.1")
+// .start()
+ };
+ return Stream.of(super.config(), options).flatMap(Stream::of).toArray(Option[]::new);
+
+//
+// String httpPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_HTTP_PORT), Integer.parseInt(MAX_HTTP_PORT)));
+// String rmiRegistryPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_RMI_REG_PORT), Integer.parseInt(MAX_RMI_REG_PORT)));
+// String rmiServerPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_RMI_SERVER_PORT), Integer.parseInt(MAX_RMI_SERVER_PORT)));
+// String sshPort = Integer.toString(getAvailablePort(Integer.parseInt(MIN_SSH_PORT), Integer.parseInt(MAX_SSH_PORT)));
+// String localRepository = System.getProperty("org.ops4j.pax.url.mvn.localRepository");
+// if (localRepository == null) {
+// localRepository = "";
+// }
+//
+// if (JavaVersionUtil.getMajorVersion() >= 9) {
+// return new Option[]{
+// //KarafDistributionOption.debugConfiguration("8889", true),
+// karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache Karaf").unpackDirectory(new File("target/exam")),
+// // enable JMX RBAC security, thanks to the KarafMBeanServerBuilder
+// configureSecurity().disableKarafMBeanServerBuilder(),
+// // configureConsole().ignoreLocalConsole(),
+// keepRuntimeFolder(),
+// logLevel(LogLevelOption.LogLevel.INFO),
+// mavenBundle().groupId("org.awaitility").artifactId("awaitility").versionAsInProject(),
+// mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(),
+// mavenBundle().groupId("org.apache.karaf.itests").artifactId("common").versionAsInProject(),
+// editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", httpPort),
+// editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", rmiRegistryPort),
+// editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", rmiServerPort),
+// editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", sshPort),
+// editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository", localRepository),
+// new VMOption("--add-reads=java.xml=java.logging"),
+// new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
+// new VMOption("--patch-module"),
+// new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-"
+// + System.getProperty("karaf.version") + ".jar"),
+// new VMOption("--patch-module"),
+// new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-"
+// + System.getProperty("karaf.version") + ".jar"),
+// new VMOption("--add-opens"),
+// new VMOption("java.base/java.security=ALL-UNNAMED"),
+// new VMOption("--add-opens"),
+// new VMOption("java.base/java.net=ALL-UNNAMED"),
+// new VMOption("--add-opens"),
+// new VMOption("java.base/java.lang=ALL-UNNAMED"),
+// new VMOption("--add-opens"),
+// new VMOption("java.base/java.util=ALL-UNNAMED"),
+// new VMOption("--add-opens"),
+// new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
+// new VMOption("--add-opens"),
+// new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
+// new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
+// new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
+// new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
+// new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
+// new VMOption("-classpath"),
+// new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
+// };
+// } else {
+// return new Option[]{
+// //KarafDistributionOption.debugConfiguration("8889", true),
+// karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache Karaf").unpackDirectory(new File("target/exam")),
+// // enable JMX RBAC security, thanks to the KarafMBeanServerBuilder
+// configureSecurity().disableKarafMBeanServerBuilder(),
+// // configureConsole().ignoreLocalConsole(),
+// keepRuntimeFolder(),
+// logLevel(LogLevelOption.LogLevel.INFO),
+// mavenBundle().groupId("org.awaitility").artifactId("awaitility").versionAsInProject(),
+// mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(),
+// mavenBundle().groupId("org.apache.karaf.itests").artifactId("common").versionAsInProject(),
+// editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", httpPort),
+// editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", rmiRegistryPort),
+// editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", rmiServerPort),
+// editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", sshPort),
+// editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository", localRepository)
+// };
+// }
}
+ /**
+ * Checks:
+ * - the feature can be installed
+ * - the Driver Bundle is there and active
+ * - the Bundle contains the DS for PlcDriver
+ * - the feature is installed
+ */
@Test
public void installAndAssertFeature() throws Exception {
- // ...
+ // Assemble Maven URL
final MavenArtifactUrlReference featureRepo = maven()
.groupId("org.apache.plc4x")
.artifactId("driver-s7-feature")
- .versionAsInProject()
- .classifier("xml")
- .type("feature");
-
- System.out.println(featureRepo.getURL());
+ .version(System.getProperty("plc4x.version"))
+ .type("xml")
+ .classifier("features");
+ System.out.println("Installing feature repo " + featureRepo.getURL());
- // ...
+ // Install the feature-repo
addFeaturesRepository(featureRepo.getURL());
- // ...
+
+ // Install the feature
installAndAssertFeature("driver-s7-feature");
- // Print Bundles
+
+ // Print Bundles and fetch result
String bundles = executeCommand("bundle:list -t 0");
+
+ // Find that line
+ // 84 │ Active │ 80 │ 0.5.0.SNAPSHOT │ PLC4J: Driver: S7
+ assertContains("PLC4J: Driver: S7", bundles);
System.out.println(bundles);
- // Print features
+
+ // Find Bundle for more detailed check
+ final Bundle bundle = findBundleByName("org.apache.plc4x.plc4j-driver-s7");
+
+ // Bundle has to be ACTIVE
+ assertNotNull(bundle);
+ assertEquals(Bundle.ACTIVE, bundle.getState());
+
+ // Check declarative service is present
+ String services = executeCommand("services -p " + bundle.getBundleId());
+ System.out.println("Services: " + services);
+ assertContains("component.name = org.apache.plc4x.java.s7.S7PlcDriver", services);
+ assertContains("objectClass = [org.apache.plc4x.java.spi.PlcDriver]", services);
+
+ // Just for Debugging...
String features = executeCommand("feature:list -i");
System.out.print(features);
+ assertContains("driver-s7-feature", features);
}
}
\ No newline at end of file
diff --git a/plc4j/karaf-features/karaf-itest/src/test/resources/etc/org.ops4j.pax.logging.cfg b/plc4j/karaf-features/karaf-itest/src/test/resources/etc/org.ops4j.pax.logging.cfg
new file mode 100644
index 0000000..285e55f
--- /dev/null
+++ b/plc4j/karaf-features/karaf-itest/src/test/resources/etc/org.ops4j.pax.logging.cfg
@@ -0,0 +1,71 @@
+###############################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+# See https://issues.apache.org/jira/browse/KARAF-6456
+
+# Common pattern layout for appenders
+log4j2.pattern = %d{ISO8601} | %-5p | %-16t | %-32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
+
+# Root logger
+log4j2.rootLogger.level = INFO
+# uncomment to use asynchronous loggers, which require mvn:com.lmax/disruptor/3.3.2 library
+#log4j2.rootLogger.type = asyncRoot
+#log4j2.rootLogger.includeLocation = false
+log4j2.rootLogger.appenderRefs = RollingFile, PaxOsgi, Console
+log4j2.rootLogger.appenderRef.RollingFile.ref = RollingFile
+log4j2.rootLogger.appenderRef.PaxOsgi.ref = PaxOsgi
+log4j2.rootLogger.appenderRef.Console.ref = Console
+log4j2.rootLogger.appenderRef.Console.filter.threshold.type = ThresholdFilter
+log4j2.rootLogger.appenderRef.Console.filter.threshold.level = ${karaf.log.console:-OFF}
+
+# Appenders configuration
+log4j2.appenders = console, rolling, osgi
+
+# CONSOLE appender not used by default
+log4j2.appender.console.type = Console
+log4j2.appender.console.name = Console
+log4j2.appender.console.layout.type = PatternLayout
+log4j2.appender.console.layout.pattern = ${log4j2.pattern}
+
+# File appender
+log4j2.appender.rolling.type = RollingRandomAccessFile
+log4j2.appender.rolling.name = RollingFile
+log4j2.appender.rolling.fileName = ${karaf.log}/karaf.log
+log4j2.appender.rolling.filePattern = ${karaf.log}/karaf.log.%i
+# uncomment to not force a disk flush
+#log4j2.appender.rolling.immediateFlush = false
+log4j2.appender.rolling.append = true
+log4j2.appender.rolling.layout.type = PatternLayout
+log4j2.appender.rolling.layout.pattern = ${log4j2.pattern}
+log4j2.appender.rolling.policies.type = Policies
+log4j2.appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
+log4j2.appender.rolling.policies.size.size = 16MB
+
+# OSGi appender
+log4j2.appender.osgi.type = PaxOsgi
+log4j2.appender.osgi.name = PaxOsgi
+log4j2.appender.osgi.filter = *
+
+# help with identification of maven-related problems with pax-url-aether
+#log4j2.logger.aether.name = shaded.org.eclipse.aether
+#log4j2.logger.aether.level = TRACE
+#log4j2.logger.http-headers.name = shaded.org.apache.http.headers
+#log4j2.logger.http-headers.level = DEBUG
+#log4j2.logger.maven.name = org.ops4j.pax.url.mvn
+#log4j2.logger.maven.level = TRACE
\ No newline at end of file
diff --git a/plc4j/karaf-features/karaf-itest/src/test/resources/etc/system.properties b/plc4j/karaf-features/karaf-itest/src/test/resources/etc/system.properties
new file mode 100644
index 0000000..a3caa37
--- /dev/null
+++ b/plc4j/karaf-features/karaf-itest/src/test/resources/etc/system.properties
@@ -0,0 +1,18 @@
+###############################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
\ No newline at end of file
diff --git a/plc4j/karaf-features/karaf-itest/src/test/resources/exam.properties b/plc4j/karaf-features/karaf-itest/src/test/resources/exam.properties
deleted file mode 100644
index db2c7db..0000000
--- a/plc4j/karaf-features/karaf-itest/src/test/resources/exam.properties
+++ /dev/null
@@ -1 +0,0 @@
-pax.exam.karaf.version = 4.2.1
\ No newline at end of file
diff --git a/plc4j/karaf-features/s7/pom.xml b/plc4j/karaf-features/s7/pom.xml
index 472b868..36043d4 100644
--- a/plc4j/karaf-features/s7/pom.xml
+++ b/plc4j/karaf-features/s7/pom.xml
@@ -30,105 +30,6 @@
<artifactId>driver-s7-feature</artifactId>
<packaging>feature</packaging>
- <dependencies>
- <dependency>
- <groupId>org.ops4j.pax.exam.samples</groupId>
- <artifactId>pax-exam-sample8-ds</artifactId>
- <version>4.13.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.karaf.features</groupId>
- <artifactId>standard</artifactId>
- <version>4.2.1</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-container-karaf</artifactId>
- <version>4.13.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-junit4</artifactId>
- <version>4.13.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam</artifactId>
- <version>4.13.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.url</groupId>
- <artifactId>pax-url-aether</artifactId>
- <version>1.6.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.inject</groupId>
- <artifactId>javax.inject</artifactId>
- <version>1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.11</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>6.0.0</version>
- <scope>provided</scope>
- </dependency>
- <!-- -->
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-api</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.inject</groupId>
- <artifactId>javax.inject</artifactId>
- <version>1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <!-- Needed if you use versionAsInProject() -->
- <plugin>
- <groupId>org.apache.servicemix.tooling</groupId>
- <artifactId>depends-maven-plugin</artifactId>
- <version>1.2</version>
- <executions>
- <execution>
- <id>generate-depends-file</id>
- <goals>
- <goal>generate-depends-file</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemPropertyVariables>
- <pax.exam.karaf.version>4.2.1</pax.exam.karaf.version>
- </systemPropertyVariables>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<!-- This would be necessary with the kar goal which works not fine, yet -->
<!-- <dependencies>-->
<!-- <dependency>-->
diff --git a/plc4j/karaf-features/s7/src/main/feature/feature.xml b/plc4j/karaf-features/s7/src/main/feature/feature.xml
index aebf22a..6bf41bb 100644
--- a/plc4j/karaf-features/s7/src/main/feature/feature.xml
+++ b/plc4j/karaf-features/s7/src/main/feature/feature.xml
@@ -24,7 +24,7 @@
</details>
<feature prerequisite="true" dependency="false">wrap</feature>
<feature>scr</feature>
-<!-- <bundle>mvn:org.apache.plc4x/plc4j-driver-s7/0.5.0-SNAPSHOT</bundle>-->
+ <bundle>mvn:org.apache.plc4x/plc4j-driver-s7/0.5.0-SNAPSHOT</bundle>
<bundle>mvn:org.apache.plc4x/plc4j-api/0.5.0-SNAPSHOT</bundle>
<bundle>mvn:org.apache.plc4x/plc4j-protocol-iso-on-tcp/0.5.0-SNAPSHOT</bundle>
<bundle>mvn:org.apache.plc4x/plc4j-protocol-iso-tp/0.5.0-SNAPSHOT</bundle>