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:24 UTC

[plc4x] branch feature/resolve-split-package-osgi updated (0d73e80 -> 95c37c0)

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a change to branch feature/resolve-split-package-osgi
in repository https://gitbox.apache.org/repos/asf/plc4x.git.


    from 0d73e80  - Added the OSGI Annotation to all remaining drivers - Added a missing OPCUA feature - Added the OPCUA feature to the demo-server
     add 87d9743  [OSGi] Added initial Implementation of a Exam Test.
     add 6cfcff1  Merge branch 'feature/resolve-split-package-osgi' of https://github.com/JulianFeinauer/incubator-plc4x into feature/resolve-split-package-osgi
     new 21b4b48  [OSGi] Tests not running yet.
     new 21fa91d  [OSGi] Finally, integration test is running.
     new ac8b7e8  [OSGi] Refactoring.
     new 1f55774  [OSGi] Added initial Implementation of a Exam Test.
     new aeaf07f  [OSGi] Tests not running yet.
     new 47919d5  [OSGi] Finally, integration test is running.
     new a14fe10  [OSGi] Refactoring.
     new 296efd2  Merge remote-tracking branch 'jfeinauer/feature/resolve-split-package-osgi' into feature/resolve-split-package-osgi
     new 3b41e54  [Karaf] Improved maven config for IT, added readme.
     new 6f22f31  [Karaf] Removed "old" module in integartions.C
     new 41709bb  [Karaf] Removed "old" module in integartions.
     new 482875e  [Karaf] Fixed bug in feature.xml.
     new f127594  Fixed review comment, removed unused file.
     new 317c088  Merge remote-tracking branch 'jfeinauer/feature/resolve-split-package-osgi' into feature/resolve-split-package-osgi
     new 95c37c0  - Configured the test to work with failsafe instead of surefire - Cleaned up the maven config

The 15 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache-karaf/karaf-ads-feature/pom.xml         |  61 -------
 .../apache-karaf/karaf-demo-server/pom.xml         | 128 --------------
 .../apache-karaf/karaf-ethernet-ip-feature/pom.xml |  61 -------
 .../apache-karaf/karaf-modbus-feature/pom.xml      |  61 -------
 .../apache-karaf/karaf-opcua-feature/pom.xml       |  61 -------
 .../apache-karaf/karaf-s7-feature/pom.xml          |  61 -------
 .../apache-karaf/karaf-simulated-feature/pom.xml   |  61 -------
 plc4j/integrations/apache-karaf/pom.xml            | 121 -------------
 plc4j/integrations/pom.xml                         |   1 -
 plc4j/karaf-features/README.md                     |  42 +++++
 plc4j/karaf-features/karaf-itest/pom.xml           | 189 +++++++++++++++++++++
 .../java/org/apache/plc4x/karaf/FeatureIT.java     | 100 +++++++++++
 .../test/resources/etc/org.ops4j.pax.logging.cfg   |  71 ++++++++
 plc4j/karaf-features/pom.xml                       |  33 +++-
 plc4j/karaf-features/s7/pom.xml                    |   5 +-
 .../karaf-features/s7/src/main/feature/feature.xml |  18 +-
 .../java/org/apache/plc4x/karaf/FeatureTest.java   |  91 ++++++++++
 pom.xml                                            |  13 ++
 18 files changed, 549 insertions(+), 629 deletions(-)
 delete mode 100644 plc4j/integrations/apache-karaf/karaf-ads-feature/pom.xml
 delete mode 100644 plc4j/integrations/apache-karaf/karaf-demo-server/pom.xml
 delete mode 100644 plc4j/integrations/apache-karaf/karaf-ethernet-ip-feature/pom.xml
 delete mode 100644 plc4j/integrations/apache-karaf/karaf-modbus-feature/pom.xml
 delete mode 100644 plc4j/integrations/apache-karaf/karaf-opcua-feature/pom.xml
 delete mode 100644 plc4j/integrations/apache-karaf/karaf-s7-feature/pom.xml
 delete mode 100644 plc4j/integrations/apache-karaf/karaf-simulated-feature/pom.xml
 delete mode 100644 plc4j/integrations/apache-karaf/pom.xml
 create mode 100644 plc4j/karaf-features/README.md
 create mode 100644 plc4j/karaf-features/karaf-itest/pom.xml
 create mode 100644 plc4j/karaf-features/karaf-itest/src/test/java/org/apache/plc4x/karaf/FeatureIT.java
 create mode 100644 plc4j/karaf-features/karaf-itest/src/test/resources/etc/org.ops4j.pax.logging.cfg
 create mode 100644 plc4j/karaf-features/s7/src/test/java/org/apache/plc4x/karaf/FeatureTest.java


[plc4x] 12/15: [Karaf] Fixed bug in feature.xml.

Posted by cd...@apache.org.
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 482875e20a7de710763191c166322c3166b128e7
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Fri Oct 18 14:01:36 2019 +0200

    [Karaf] Fixed bug in feature.xml.
---
 plc4j/karaf-features/s7/src/main/feature/feature.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plc4j/karaf-features/s7/src/main/feature/feature.xml b/plc4j/karaf-features/s7/src/main/feature/feature.xml
index b05e95f..e79b498 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">wrap</feature>
     <feature>scr</feature>
-<!--    <bundle>mvn:org.apache.plc4x/plc4j-driver-s7/${project.version}</bundle>-->
+    <bundle>mvn:org.apache.plc4x/plc4j-driver-s7/${project.version}</bundle>
     <bundle>mvn:org.apache.plc4x/plc4j-api/${project.version}</bundle>
     <bundle>mvn:org.apache.plc4x/plc4j-protocol-iso-on-tcp/${project.version}</bundle>
     <bundle>mvn:org.apache.plc4x/plc4j-protocol-iso-tp/${project.version}</bundle>


[plc4x] 11/15: [Karaf] Removed "old" module in integartions.

Posted by cd...@apache.org.
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 41709bb26e8b486eb300bedfb0a11111d42ced7d
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Fri Oct 18 13:56:00 2019 +0200

    [Karaf] Removed "old" module in integartions.
---
 plc4j/integrations/pom.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/plc4j/integrations/pom.xml b/plc4j/integrations/pom.xml
index f2ba6d0..424eed9 100644
--- a/plc4j/integrations/pom.xml
+++ b/plc4j/integrations/pom.xml
@@ -37,7 +37,6 @@
     <module>apache-edgent</module>
     <module>apache-kafka</module>
     <module>apache-nifi</module>
-    <module>apache-karaf</module>
     <module>apache-calcite</module>
   </modules>
 


[plc4x] 10/15: [Karaf] Removed "old" module in integartions.C

Posted by cd...@apache.org.
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 6f22f318aae1d0cce43fbe8f5b13544106b8e315
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Fri Oct 18 13:55:07 2019 +0200

    [Karaf] Removed "old" module in integartions.C
---
 .../apache-karaf/karaf-ads-feature/pom.xml         |  61 ----------
 .../apache-karaf/karaf-demo-server/pom.xml         | 128 ---------------------
 .../apache-karaf/karaf-ethernet-ip-feature/pom.xml |  61 ----------
 .../apache-karaf/karaf-modbus-feature/pom.xml      |  61 ----------
 .../apache-karaf/karaf-opcua-feature/pom.xml       |  61 ----------
 .../apache-karaf/karaf-s7-feature/pom.xml          |  61 ----------
 .../apache-karaf/karaf-simulated-feature/pom.xml   |  61 ----------
 plc4j/integrations/apache-karaf/pom.xml            | 121 -------------------
 8 files changed, 615 deletions(-)

diff --git a/plc4j/integrations/apache-karaf/karaf-ads-feature/pom.xml b/plc4j/integrations/apache-karaf/karaf-ads-feature/pom.xml
deleted file mode 100644
index f2e706f..0000000
--- a/plc4j/integrations/apache-karaf/karaf-ads-feature/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.plc4x</groupId>
-    <artifactId>plc4j-apache-karaf</artifactId>
-    <version>0.5.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>plc4j-karaf-ads-feature</artifactId>
-  <packaging>feature</packaging>
-
-  <name>PLC4J: Integrations: Apache Karaf: ADS</name>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-driver-ads</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.karaf.tooling</groupId>
-        <artifactId>karaf-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <configuration>
-          <usedDependencies>
-            <usedDependency>org.apache.plc4x:plc4j-driver-ads</usedDependency>
-          </usedDependencies>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-</project>
\ No newline at end of file
diff --git a/plc4j/integrations/apache-karaf/karaf-demo-server/pom.xml b/plc4j/integrations/apache-karaf/karaf-demo-server/pom.xml
deleted file mode 100644
index ee18822..0000000
--- a/plc4j/integrations/apache-karaf/karaf-demo-server/pom.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?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">
-
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.plc4x</groupId>
-    <artifactId>plc4j-apache-karaf</artifactId>
-    <version>0.5.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>plc4j-karaf-demo-server</artifactId>
-  <packaging>karaf-assembly</packaging>
-
-  <name>PLC4J: Integrations: Apache Karaf: Demo Server</name>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.karaf.features</groupId>
-      <artifactId>framework</artifactId>
-      <version>${karaf.version}</version>
-      <type>kar</type>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.karaf.features</groupId>
-      <artifactId>standard</artifactId>
-      <version>${karaf.version}</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-karaf-ads-feature</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-karaf-ethernet-ip-feature</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-karaf-modbus-feature</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-karaf-opcua-feature</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-karaf-s7-feature</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-karaf-simulated-feature</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.karaf.tooling</groupId>
-        <artifactId>karaf-maven-plugin</artifactId>
-        <configuration>
-          <startupFeatures>
-            <feature>wrap</feature>
-          </startupFeatures>
-          <bootFeatures>
-            <feature>standard</feature>
-          </bootFeatures>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <configuration>
-          <usedDependencies>
-            <usedDependency>org.apache.karaf.features:framework</usedDependency>
-            <usedDependency>org.apache.karaf.features:standard</usedDependency>
-            <usedDependency>org.apache.plc4x:plc4j-karaf-ads-feature</usedDependency>
-            <usedDependency>org.apache.plc4x:plc4j-karaf-ethernet-ip-feature</usedDependency>
-            <usedDependency>org.apache.plc4x:plc4j-karaf-modbus-feature</usedDependency>
-            <usedDependency>org.apache.plc4x:plc4j-karaf-opcua-feature</usedDependency>
-            <usedDependency>org.apache.plc4x:plc4j-karaf-s7-feature</usedDependency>
-            <usedDependency>org.apache.plc4x:plc4j-karaf-simulated-feature</usedDependency>
-          </usedDependencies>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-</project>
\ No newline at end of file
diff --git a/plc4j/integrations/apache-karaf/karaf-ethernet-ip-feature/pom.xml b/plc4j/integrations/apache-karaf/karaf-ethernet-ip-feature/pom.xml
deleted file mode 100644
index c0dd9dc..0000000
--- a/plc4j/integrations/apache-karaf/karaf-ethernet-ip-feature/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.plc4x</groupId>
-    <artifactId>plc4j-apache-karaf</artifactId>
-    <version>0.5.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>plc4j-karaf-ethernet-ip-feature</artifactId>
-  <packaging>feature</packaging>
-
-  <name>PLC4J: Integrations: Apache Karaf: EtherNet/IP</name>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-driver-ethernet-ip</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.karaf.tooling</groupId>
-        <artifactId>karaf-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <configuration>
-          <usedDependencies>
-            <usedDependency>org.apache.plc4x:plc4j-driver-ethernet-ip</usedDependency>
-          </usedDependencies>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-</project>
\ No newline at end of file
diff --git a/plc4j/integrations/apache-karaf/karaf-modbus-feature/pom.xml b/plc4j/integrations/apache-karaf/karaf-modbus-feature/pom.xml
deleted file mode 100644
index 7c3ad36..0000000
--- a/plc4j/integrations/apache-karaf/karaf-modbus-feature/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.plc4x</groupId>
-    <artifactId>plc4j-apache-karaf</artifactId>
-    <version>0.5.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>plc4j-karaf-modbus-feature</artifactId>
-  <packaging>feature</packaging>
-
-  <name>PLC4J: Integrations: Apache Karaf: Modbus</name>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-driver-modbus</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.karaf.tooling</groupId>
-        <artifactId>karaf-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <configuration>
-          <usedDependencies>
-            <usedDependency>org.apache.plc4x:plc4j-driver-modbus</usedDependency>
-          </usedDependencies>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-</project>
\ No newline at end of file
diff --git a/plc4j/integrations/apache-karaf/karaf-opcua-feature/pom.xml b/plc4j/integrations/apache-karaf/karaf-opcua-feature/pom.xml
deleted file mode 100644
index f2602b4..0000000
--- a/plc4j/integrations/apache-karaf/karaf-opcua-feature/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.plc4x</groupId>
-    <artifactId>plc4j-apache-karaf</artifactId>
-    <version>0.5.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>plc4j-karaf-opcua-feature</artifactId>
-  <packaging>feature</packaging>
-
-  <name>PLC4J: Integrations: Apache Karaf: OPC-UA</name>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-driver-opcua</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.karaf.tooling</groupId>
-        <artifactId>karaf-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <configuration>
-          <usedDependencies>
-            <usedDependency>org.apache.plc4x:plc4j-driver-opcua</usedDependency>
-          </usedDependencies>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-</project>
\ No newline at end of file
diff --git a/plc4j/integrations/apache-karaf/karaf-s7-feature/pom.xml b/plc4j/integrations/apache-karaf/karaf-s7-feature/pom.xml
deleted file mode 100644
index f614f0a..0000000
--- a/plc4j/integrations/apache-karaf/karaf-s7-feature/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.plc4x</groupId>
-    <artifactId>plc4j-apache-karaf</artifactId>
-    <version>0.5.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>plc4j-karaf-s7-feature</artifactId>
-  <packaging>feature</packaging>
-
-  <name>PLC4J: Integrations: Apache Karaf: S7</name>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-driver-s7</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.karaf.tooling</groupId>
-        <artifactId>karaf-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <configuration>
-          <usedDependencies>
-            <usedDependency>org.apache.plc4x:plc4j-driver-s7</usedDependency>
-          </usedDependencies>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-</project>
\ No newline at end of file
diff --git a/plc4j/integrations/apache-karaf/karaf-simulated-feature/pom.xml b/plc4j/integrations/apache-karaf/karaf-simulated-feature/pom.xml
deleted file mode 100644
index 1b5aae2..0000000
--- a/plc4j/integrations/apache-karaf/karaf-simulated-feature/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.plc4x</groupId>
-    <artifactId>plc4j-apache-karaf</artifactId>
-    <version>0.5.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>plc4j-karaf-simulated-feature</artifactId>
-  <packaging>feature</packaging>
-
-  <name>PLC4J: Integrations: Apache Karaf: Simulated</name>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.plc4x</groupId>
-      <artifactId>plc4j-driver-simulated</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.karaf.tooling</groupId>
-        <artifactId>karaf-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <configuration>
-          <usedDependencies>
-            <usedDependency>org.apache.plc4x:plc4j-driver-simulated</usedDependency>
-          </usedDependencies>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-</project>
\ No newline at end of file
diff --git a/plc4j/integrations/apache-karaf/pom.xml b/plc4j/integrations/apache-karaf/pom.xml
deleted file mode 100644
index bdbbe6a..0000000
--- a/plc4j/integrations/apache-karaf/pom.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?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">
-
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.plc4x</groupId>
-    <artifactId>plc4j-integrations</artifactId>
-    <version>0.5.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>plc4j-apache-karaf</artifactId>
-  <packaging>pom</packaging>
-
-  <name>PLC4J: Integrations: Apache Karaf</name>
-  <description>Integration module for integrating PLC4X into Apache Karaf.</description>
-
-  <properties>
-    <karaf.version>4.2.7</karaf.version>
-    <karaf-maven-plugin.version>${karaf.version}</karaf-maven-plugin.version>
-  </properties>
-
-  <modules>
-    <module>karaf-ads-feature</module>
-    <module>karaf-ethernet-ip-feature</module>
-    <module>karaf-modbus-feature</module>
-    <module>karaf-opcua-feature</module>
-    <module>karaf-s7-feature</module>
-    <module>karaf-simulated-feature</module>
-    <module>karaf-demo-server</module>
-  </modules>
-
-  <dependencies>
-    <!-- This is just a way of removing this dependency -->
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <!-- With OSGI there's a lot of stuff with duplicate classes in different versions -->
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-enforcer-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>enforce-ban-duplicate-classes</id>
-            <phase>validate</phase>
-            <goals>
-              <goal>enforce</goal>
-            </goals>
-            <configuration>
-              <skip>true</skip>
-              <rules/>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.karaf.tooling</groupId>
-          <artifactId>karaf-maven-plugin</artifactId>
-          <version>${karaf-maven-plugin.version}</version>
-          <extensions>true</extensions>
-          <executions>
-            <!--
-              Generate the feature.xml used by the bundle based on the modules dependencies and transitive
-              dependencies.
-            -->
-            <execution>
-              <id>default-features-generate-descriptor</id>
-              <phase>package</phase>
-              <goals>
-                <goal>features-generate-descriptor</goal>
-              </goals>
-              <configuration>
-                <enableGeneration>true</enableGeneration>
-              </configuration>
-            </execution>
-            <!--
-              Verifies and validates a features XML descriptor by checking if all the required imports for the
-              bundles defined in the features can be matched to a provided export.
-            -->
-            <execution>
-              <id>default-verify</id>
-              <phase>package</phase>
-              <goals>
-                <goal>verify</goal>
-              </goals>
-            </execution>
-          </executions>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
-
-</project>
\ No newline at end of file


[plc4x] 07/15: [OSGi] Refactoring.

Posted by cd...@apache.org.
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 a14fe10a26e99ded968d2d3b7100bd023b4cfc68
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Thu Oct 17 21:58:28 2019 +0200

    [OSGi] Refactoring.
---
 .../java/org/apache/plc4x/karaf/FeatureITest.java  | 82 ----------------------
 1 file changed, 82 deletions(-)

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 f38cdc1..33a7722 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
@@ -31,8 +31,6 @@ 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.features;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
 
 @RunWith(PaxExam.class)
@@ -44,88 +42,8 @@ public class FeatureITest extends KarafTestSupport {
         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)
-//            };
-//        }
     }
 
     /**


[plc4x] 01/15: [OSGi] Tests not running yet.

Posted by cd...@apache.org.
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 21b4b48d92e92b9d99dc1008e398a5caf47d5666
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Thu Oct 17 20:31:59 2019 +0200

    [OSGi] Tests not running yet.
---
 plc4j/karaf-features/karaf-itest/pom.xml           | 102 ++++-------
 .../java/org/apache/plc4x/karaf/FeatureITest.java  | 200 +++++++++++----------
 2 files changed, 139 insertions(+), 163 deletions(-)

diff --git a/plc4j/karaf-features/karaf-itest/pom.xml b/plc4j/karaf-features/karaf-itest/pom.xml
index 9d4e3f5..44b2a44 100644
--- a/plc4j/karaf-features/karaf-itest/pom.xml
+++ b/plc4j/karaf-features/karaf-itest/pom.xml
@@ -12,55 +12,49 @@
   <artifactId>karaf-itest</artifactId>
 
   <properties>
-    <dependency.karaf.version>4.2.1</dependency.karaf.version>
+    <karaf.version>4.2.1</karaf.version>
     <pax.version>4.13.1</pax.version>
   </properties>
 
   <dependencies>
-<!--    &lt;!&ndash; S7 Driver for Build &ndash;&gt;-->
-<!--    <dependency>-->
-<!--      <groupId>org.apache.plc4x</groupId>-->
-<!--      <artifactId>driver-s7-feature</artifactId>-->
-<!--      <version>0.5.0-SNAPSHOT</version>-->
-<!--      <scope>test</scope>-->
-<!--    </dependency>-->
-
-    <!-- Pax Exam Test setup -->
+    <!-- Provide the KarafTestSupport -->
     <dependency>
-      <groupId>org.ops4j.pax.exam.samples</groupId>
-      <artifactId>pax-exam-sample8-ds</artifactId>
-      <version>${pax.version}</version>
+      <groupId>org.apache.karaf.itests</groupId>
+      <artifactId>common</artifactId>
+      <version>${karaf.version}</version>
       <scope>test</scope>
     </dependency>
+    <!-- Define the Apache Karaf version to download and use for the test -->
+    <!-- We use a released version here to avoid SNAPSHOT resolution -->
     <dependency>
-      <groupId>org.apache.karaf.features</groupId>
-      <artifactId>standard</artifactId>
-      <version>${dependency.karaf.version}</version>
-      <classifier>features</classifier>
-      <type>xml</type>
+      <groupId>org.apache.karaf</groupId>
+      <artifactId>apache-karaf</artifactId>
+      <version>${karaf.version}</version>
       <scope>test</scope>
+      <type>tar.gz</type>
     </dependency>
 
     <dependency>
       <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>1.7.26</version>
       <scope>test</scope>
     </dependency>
-
+    <!-- Required to use shell commands in the tests -->
     <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <version>6.0.0</version>
-      <scope>provided</scope>
+      <groupId>org.apache.karaf.shell</groupId>
+      <artifactId>org.apache.karaf.shell.core</artifactId>
+      <version>${karaf.version}</version>
+      <scope>test</scope>
     </dependency>
-
-    <!-- Dependencies for pax exam karaf container -->
+    <!-- Provide the PaxExam Karaf support -->
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam-container-karaf</artifactId>
       <version>${pax.version}</version>
       <scope>test</scope>
     </dependency>
+    <!-- Provide the PaxExam JUnit extension -->
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam-junit4</artifactId>
@@ -68,57 +62,29 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam</artifactId>
-      <version>${pax.version}</version>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-atinject_1.0_spec</artifactId>
+      <version>1.1</version>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.ops4j.pax.url</groupId>
-      <artifactId>pax-url-aether</artifactId>
-      <version>2.6.1</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>javax.inject</groupId>
-      <artifactId>javax.inject</artifactId>
-      <version>1</version>
-      <scope>test</scope>
+      <groupId>org.awaitility</groupId>
+      <artifactId>awaitility</artifactId>
+      <version>3.1.6</version>
     </dependency>
-
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
+      <groupId>org.apache.servicemix.bundles</groupId>
+      <artifactId>org.apache.servicemix.bundles.hamcrest</artifactId>
+      <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>
-    <dependency>
-      <groupId>org.apache.karaf.features</groupId>
-      <artifactId>org.apache.karaf.features.core</artifactId>
-      <version>${dependency.karaf.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.karaf.bundle</groupId>
-      <artifactId>org.apache.karaf.bundle.core</artifactId>
-      <version>${dependency.karaf.version}</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.4.0</version>
         <executions>
           <execution>
             <id>generate-depends-file</id>
@@ -128,14 +94,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <systemPropertyVariables>
-            <pax.exam.karaf.version>${dependency.karaf.version}</pax.exam.karaf.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 1efc1db..b7a12a6 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,119 +13,137 @@
  */
 package org.apache.plc4x.karaf;
 
-import org.apache.karaf.bundle.core.BundleService;
+import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
-import org.apache.plc4x.java.spi.PlcDriver;
+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.ConfigurationManager;
 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.LogLevelOption;
 import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
-import org.ops4j.pax.exam.options.MavenUrlReference;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+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 javax.inject.Inject;
 import java.io.File;
-import java.util.Arrays;
-import java.util.Optional;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.bundle;
 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.configureConsole;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
+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.logLevel;
 
 @RunWith(PaxExam.class)
-public class FeatureITest {
-
-    private static Logger LOG = LoggerFactory.getLogger(FeatureITest.class);
-
-    @Inject
-    private FeaturesService featuresService;
-
-    @Inject
-    private BundleContext bundleContext;
+@ExamReactorStrategy(PerClass.class)
+public class FeatureITest extends KarafTestSupport {
 
+    @Override
     @Configuration
     public Option[] config() {
-        MavenArtifactUrlReference karafUrl = maven()
-            .groupId("org.apache.karaf")
-            .artifactId("apache-karaf")
-            .version(karafVersion())
-            .type("zip");
-
-        MavenUrlReference karafStandardRepo = maven()
-            .groupId("org.apache.karaf.features")
-            .artifactId("standard")
-            .version(karafVersion())
-            .classifier("features")
-            .type("xml");
-
-        final MavenArtifactUrlReference plc4xRepo = maven()
-            .groupId("org.apache.plc4x")
-            .artifactId("driver-s7-feature")
-            .version("0.5.0-SNAPSHOT")
-            .classifier("features")
-            .type("xml");
-        return new Option[] {
-            // KarafDistributionOption.debugConfiguration("5005", true),
-            karafDistributionConfiguration()
-                .frameworkUrl(karafUrl)
-                .unpackDirectory(new File("target", "exam"))
-                .useDeployFolder(false),
-            keepRuntimeFolder(),
-            configureConsole().ignoreLocalConsole(),
-            features(karafStandardRepo , "scr"),
-            features(plc4xRepo, "driver-s7-feature"),
-            mavenBundle()
-                .groupId("org.apache.plc4x")
-                .artifactId("plc4j-driver-s7")
-                .version("0.5.0-SNAPSHOT")
-                .start()
-        };
-    }
-
-    public static String karafVersion() {
-        ConfigurationManager cm = new ConfigurationManager();
-        String karafVersion = cm.getProperty("pax.exam.karaf.version", "3.0.0");
-        return karafVersion;
-    }
-
+        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 = "";
+        }
 
-    @Test
-    public void checkFeatureInstalled() throws Exception {
-        assertTrue(
-            featuresService.isInstalled(featuresService.getFeature("driver-s7-feature"))
-        );
+        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)
+            };
+        }
     }
 
     @Test
-    public void checkBundleStarted() throws Exception {
-        for (Bundle bundle : bundleContext.getBundles()) {
-            System.out.println(bundle.getSymbolicName());
-        }
-
-        // Try to find the bundle
-        final Optional<Bundle> optionalBundle = Arrays.stream(bundleContext.getBundles())
-            .filter(bundle -> "org.apache.plc4x.plc4j-driver-s7".equals(bundle.getSymbolicName()))
-            .findFirst();
-
-        // Ensure that the bundle is resolved
-        assertTrue(optionalBundle.isPresent());
-
-        // Check if the bundle is active
-        assertEquals(Bundle.ACTIVE, optionalBundle.get().getState());
+    public void installAndAssertFeature() throws Exception {
+        // ...
+        final MavenArtifactUrlReference featureRepo = maven()
+            .groupId("org.apache.plc4x")
+            .artifactId("driver-s7-feature")
+            .versionAsInProject()
+            .classifier("xml")
+            .type("feature");
+
+        System.out.println(featureRepo.getURL());
+
+        // ...
+        addFeaturesRepository(featureRepo.getURL());
+        // ...
+        installAndAssertFeature("driver-s7-feature");
+        // Print Bundles
+        String bundles = executeCommand("bundle:list -t 0");
+        System.out.println(bundles);
+        // Print features
+        String features = executeCommand("feature:list -i");
+        System.out.print(features);
     }
 
-}
+}
\ No newline at end of file


[plc4x] 06/15: [OSGi] Finally, integration test is running.

Posted by cd...@apache.org.
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 47919d571325546b62b990f82cfb8e3fd0f1fb21
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>


[plc4x] 13/15: Fixed review comment, removed unused file.

Posted by cd...@apache.org.
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 f1275940c39617311fb0bda6b16a88b753faad77
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Fri Oct 18 14:04:20 2019 +0200

    Fixed review comment, removed unused file.
---
 .../src/test/resources/etc/system.properties           | 18 ------------------
 1 file changed, 18 deletions(-)

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
deleted file mode 100644
index a3caa37..0000000
--- a/plc4j/karaf-features/karaf-itest/src/test/resources/etc/system.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-#
-#    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


[plc4x] 02/15: [OSGi] Finally, integration test is running.

Posted by cd...@apache.org.
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>


[plc4x] 09/15: [Karaf] Improved maven config for IT, added readme.

Posted by cd...@apache.org.
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 3b41e54469531359833d22b45a03d6bb6e827215
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Fri Oct 18 13:54:12 2019 +0200

    [Karaf] Improved maven config for IT, added readme.
---
 plc4j/karaf-features/README.md                     | 42 ++++++++++++++++++++++
 plc4j/karaf-features/karaf-itest/pom.xml           | 35 ++++++++++++++++++
 .../karaf/{FeatureITest.java => FeatureIT.java}    |  2 +-
 .../karaf-features/s7/src/main/feature/feature.xml | 18 +++++-----
 4 files changed, 87 insertions(+), 10 deletions(-)

diff --git a/plc4j/karaf-features/README.md b/plc4j/karaf-features/README.md
new file mode 100644
index 0000000..818a097
--- /dev/null
+++ b/plc4j/karaf-features/README.md
@@ -0,0 +1,42 @@
+<!--
+
+  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.
+
+-->
+# This module provides Karaf features for plc4x
+
+As all plc4x modules are valid OSGi bundles, this module provides Karaf features for easier 
+deployment to Apache Karaf. 
+
+## Structure
+
+The module `driver-s7-featre` contains a `feature.xml` which defines a feature to load 
+the drivers bundles and all dependent bundles.
+The module `karaf-itest` contains an integration test to ensure that the features load correct in Karaf.
+
+## Testing
+
+In the Module `karaf-itest` are integration tests which verify the generated feature.
+But as they use the feature from the local maven repository the features have to be installed first.
+The Integration tests run in the verify phase, so you can e.g. use the comman
+```$mvn
+mvn clean install verify
+```
+in the `karaf-features` module. This will first install the `driver-s7-feature` feature in the 
+maven repo and then run the Integration test.
+
+The integration tests loads the feature and checks if the feature and the most important bundle 
+can be loaded. 
\ No newline at end of file
diff --git a/plc4j/karaf-features/karaf-itest/pom.xml b/plc4j/karaf-features/karaf-itest/pom.xml
index b42c5b6..00e4988 100644
--- a/plc4j/karaf-features/karaf-itest/pom.xml
+++ b/plc4j/karaf-features/karaf-itest/pom.xml
@@ -35,6 +35,14 @@
   </properties>
 
   <dependencies>
+    <!-- Important, have a dependency on the feature maven module that its built first -->
+    <dependency>
+      <groupId>org.apache.plc4x</groupId>
+      <artifactId>driver-s7-feature</artifactId>
+      <version>0.5.0-SNAPSHOT</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+    </dependency>
     <!-- Provide the KarafTestSupport -->
     <dependency>
       <groupId>org.apache.karaf.itests</groupId>
@@ -144,6 +152,33 @@
           </systemPropertyVariables>
         </configuration>
       </plugin>
+      <!-- Run in the verify Phase -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>**/*IT.java</exclude>
+          </excludes>
+        </configuration>
+        <executions>
+          <execution>
+            <id>integration-test</id>
+            <goals>
+              <goal>test</goal>
+            </goals>
+            <phase>integration-test</phase>
+            <configuration>
+              <excludes>
+                <exclude>none</exclude>
+              </excludes>
+              <includes>
+                <include>**/*IT.java</include>
+              </includes>
+            </configuration>
+          </execution>
+        </executions>
+      </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/FeatureIT.java
similarity index 98%
rename from plc4j/karaf-features/karaf-itest/src/test/java/org/apache/plc4x/karaf/FeatureITest.java
rename to plc4j/karaf-features/karaf-itest/src/test/java/org/apache/plc4x/karaf/FeatureIT.java
index 33a7722..6d2bc16 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/FeatureIT.java
@@ -35,7 +35,7 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class FeatureITest extends KarafTestSupport {
+public class FeatureIT extends KarafTestSupport {
 
     @Configuration
     public Option[] config() {
diff --git a/plc4j/karaf-features/s7/src/main/feature/feature.xml b/plc4j/karaf-features/s7/src/main/feature/feature.xml
index 6bf41bb..b05e95f 100644
--- a/plc4j/karaf-features/s7/src/main/feature/feature.xml
+++ b/plc4j/karaf-features/s7/src/main/feature/feature.xml
@@ -22,19 +22,19 @@
     <details>PLC4X is an effort to create a universal library for accessing industrial programmable logic controllers
       using a variety of protocols using a uniform API.
     </details>
-    <feature prerequisite="true" dependency="false">wrap</feature>
+    <feature prerequisite="true">wrap</feature>
     <feature>scr</feature>
-    <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>
-    <bundle>mvn:org.apache.plc4x/plc4j-protocol-s7/0.5.0-SNAPSHOT</bundle>
+<!--    <bundle>mvn:org.apache.plc4x/plc4j-driver-s7/${project.version}</bundle>-->
+    <bundle>mvn:org.apache.plc4x/plc4j-api/${project.version}</bundle>
+    <bundle>mvn:org.apache.plc4x/plc4j-protocol-iso-on-tcp/${project.version}</bundle>
+    <bundle>mvn:org.apache.plc4x/plc4j-protocol-iso-tp/${project.version}</bundle>
+    <bundle>mvn:org.apache.plc4x/plc4j-protocol-s7/${project.version}</bundle>
+    <bundle>mvn:org.apache.plc4x/plc4j-protocol-driver-base/${project.version}</bundle>
+    <bundle>mvn:org.apache.plc4x/plc4j-utils-driver-base-java/${project.version}</bundle>
+    <bundle>mvn:org.apache.plc4x/plc4j-protocol-driver-base-tcp/${project.version}</bundle>
     <bundle>mvn:io.netty/netty-codec/4.1.39.Final</bundle>
-    <bundle>mvn:org.apache.plc4x/plc4j-protocol-driver-base/0.5.0-SNAPSHOT</bundle>
-    <bundle>mvn:org.apache.plc4x/plc4j-utils-driver-base-java/0.5.0-SNAPSHOT</bundle>
     <bundle>wrap:mvn:com.github.jinahya/bit-io/1.4.2</bundle>
     <bundle>mvn:commons-codec/commons-codec/1.12</bundle>
-    <bundle>mvn:org.apache.plc4x/plc4j-protocol-driver-base-tcp/0.5.0-SNAPSHOT</bundle>
     <bundle>mvn:io.netty/netty-common/4.1.39.Final</bundle>
     <bundle>mvn:io.netty/netty-transport/4.1.39.Final</bundle>
     <bundle>mvn:io.netty/netty-resolver/4.1.39.Final</bundle>


[plc4x] 05/15: [OSGi] Tests not running yet.

Posted by cd...@apache.org.
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 aeaf07f46a34b4877868b60bf7fda402d8820acb
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Thu Oct 17 20:31:59 2019 +0200

    [OSGi] Tests not running yet.
---
 plc4j/karaf-features/karaf-itest/pom.xml           | 102 ++++-------
 .../java/org/apache/plc4x/karaf/FeatureITest.java  | 200 +++++++++++----------
 2 files changed, 139 insertions(+), 163 deletions(-)

diff --git a/plc4j/karaf-features/karaf-itest/pom.xml b/plc4j/karaf-features/karaf-itest/pom.xml
index 9d4e3f5..44b2a44 100644
--- a/plc4j/karaf-features/karaf-itest/pom.xml
+++ b/plc4j/karaf-features/karaf-itest/pom.xml
@@ -12,55 +12,49 @@
   <artifactId>karaf-itest</artifactId>
 
   <properties>
-    <dependency.karaf.version>4.2.1</dependency.karaf.version>
+    <karaf.version>4.2.1</karaf.version>
     <pax.version>4.13.1</pax.version>
   </properties>
 
   <dependencies>
-<!--    &lt;!&ndash; S7 Driver for Build &ndash;&gt;-->
-<!--    <dependency>-->
-<!--      <groupId>org.apache.plc4x</groupId>-->
-<!--      <artifactId>driver-s7-feature</artifactId>-->
-<!--      <version>0.5.0-SNAPSHOT</version>-->
-<!--      <scope>test</scope>-->
-<!--    </dependency>-->
-
-    <!-- Pax Exam Test setup -->
+    <!-- Provide the KarafTestSupport -->
     <dependency>
-      <groupId>org.ops4j.pax.exam.samples</groupId>
-      <artifactId>pax-exam-sample8-ds</artifactId>
-      <version>${pax.version}</version>
+      <groupId>org.apache.karaf.itests</groupId>
+      <artifactId>common</artifactId>
+      <version>${karaf.version}</version>
       <scope>test</scope>
     </dependency>
+    <!-- Define the Apache Karaf version to download and use for the test -->
+    <!-- We use a released version here to avoid SNAPSHOT resolution -->
     <dependency>
-      <groupId>org.apache.karaf.features</groupId>
-      <artifactId>standard</artifactId>
-      <version>${dependency.karaf.version}</version>
-      <classifier>features</classifier>
-      <type>xml</type>
+      <groupId>org.apache.karaf</groupId>
+      <artifactId>apache-karaf</artifactId>
+      <version>${karaf.version}</version>
       <scope>test</scope>
+      <type>tar.gz</type>
     </dependency>
 
     <dependency>
       <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>1.7.26</version>
       <scope>test</scope>
     </dependency>
-
+    <!-- Required to use shell commands in the tests -->
     <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <version>6.0.0</version>
-      <scope>provided</scope>
+      <groupId>org.apache.karaf.shell</groupId>
+      <artifactId>org.apache.karaf.shell.core</artifactId>
+      <version>${karaf.version}</version>
+      <scope>test</scope>
     </dependency>
-
-    <!-- Dependencies for pax exam karaf container -->
+    <!-- Provide the PaxExam Karaf support -->
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam-container-karaf</artifactId>
       <version>${pax.version}</version>
       <scope>test</scope>
     </dependency>
+    <!-- Provide the PaxExam JUnit extension -->
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam-junit4</artifactId>
@@ -68,57 +62,29 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam</artifactId>
-      <version>${pax.version}</version>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-atinject_1.0_spec</artifactId>
+      <version>1.1</version>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.ops4j.pax.url</groupId>
-      <artifactId>pax-url-aether</artifactId>
-      <version>2.6.1</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>javax.inject</groupId>
-      <artifactId>javax.inject</artifactId>
-      <version>1</version>
-      <scope>test</scope>
+      <groupId>org.awaitility</groupId>
+      <artifactId>awaitility</artifactId>
+      <version>3.1.6</version>
     </dependency>
-
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
+      <groupId>org.apache.servicemix.bundles</groupId>
+      <artifactId>org.apache.servicemix.bundles.hamcrest</artifactId>
+      <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>
-    <dependency>
-      <groupId>org.apache.karaf.features</groupId>
-      <artifactId>org.apache.karaf.features.core</artifactId>
-      <version>${dependency.karaf.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.karaf.bundle</groupId>
-      <artifactId>org.apache.karaf.bundle.core</artifactId>
-      <version>${dependency.karaf.version}</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.4.0</version>
         <executions>
           <execution>
             <id>generate-depends-file</id>
@@ -128,14 +94,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <systemPropertyVariables>
-            <pax.exam.karaf.version>${dependency.karaf.version}</pax.exam.karaf.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 1efc1db..b7a12a6 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,119 +13,137 @@
  */
 package org.apache.plc4x.karaf;
 
-import org.apache.karaf.bundle.core.BundleService;
+import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
-import org.apache.plc4x.java.spi.PlcDriver;
+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.ConfigurationManager;
 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.LogLevelOption;
 import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
-import org.ops4j.pax.exam.options.MavenUrlReference;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+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 javax.inject.Inject;
 import java.io.File;
-import java.util.Arrays;
-import java.util.Optional;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.ops4j.pax.exam.CoreOptions.bundle;
 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.configureConsole;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
+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.logLevel;
 
 @RunWith(PaxExam.class)
-public class FeatureITest {
-
-    private static Logger LOG = LoggerFactory.getLogger(FeatureITest.class);
-
-    @Inject
-    private FeaturesService featuresService;
-
-    @Inject
-    private BundleContext bundleContext;
+@ExamReactorStrategy(PerClass.class)
+public class FeatureITest extends KarafTestSupport {
 
+    @Override
     @Configuration
     public Option[] config() {
-        MavenArtifactUrlReference karafUrl = maven()
-            .groupId("org.apache.karaf")
-            .artifactId("apache-karaf")
-            .version(karafVersion())
-            .type("zip");
-
-        MavenUrlReference karafStandardRepo = maven()
-            .groupId("org.apache.karaf.features")
-            .artifactId("standard")
-            .version(karafVersion())
-            .classifier("features")
-            .type("xml");
-
-        final MavenArtifactUrlReference plc4xRepo = maven()
-            .groupId("org.apache.plc4x")
-            .artifactId("driver-s7-feature")
-            .version("0.5.0-SNAPSHOT")
-            .classifier("features")
-            .type("xml");
-        return new Option[] {
-            // KarafDistributionOption.debugConfiguration("5005", true),
-            karafDistributionConfiguration()
-                .frameworkUrl(karafUrl)
-                .unpackDirectory(new File("target", "exam"))
-                .useDeployFolder(false),
-            keepRuntimeFolder(),
-            configureConsole().ignoreLocalConsole(),
-            features(karafStandardRepo , "scr"),
-            features(plc4xRepo, "driver-s7-feature"),
-            mavenBundle()
-                .groupId("org.apache.plc4x")
-                .artifactId("plc4j-driver-s7")
-                .version("0.5.0-SNAPSHOT")
-                .start()
-        };
-    }
-
-    public static String karafVersion() {
-        ConfigurationManager cm = new ConfigurationManager();
-        String karafVersion = cm.getProperty("pax.exam.karaf.version", "3.0.0");
-        return karafVersion;
-    }
-
+        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 = "";
+        }
 
-    @Test
-    public void checkFeatureInstalled() throws Exception {
-        assertTrue(
-            featuresService.isInstalled(featuresService.getFeature("driver-s7-feature"))
-        );
+        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)
+            };
+        }
     }
 
     @Test
-    public void checkBundleStarted() throws Exception {
-        for (Bundle bundle : bundleContext.getBundles()) {
-            System.out.println(bundle.getSymbolicName());
-        }
-
-        // Try to find the bundle
-        final Optional<Bundle> optionalBundle = Arrays.stream(bundleContext.getBundles())
-            .filter(bundle -> "org.apache.plc4x.plc4j-driver-s7".equals(bundle.getSymbolicName()))
-            .findFirst();
-
-        // Ensure that the bundle is resolved
-        assertTrue(optionalBundle.isPresent());
-
-        // Check if the bundle is active
-        assertEquals(Bundle.ACTIVE, optionalBundle.get().getState());
+    public void installAndAssertFeature() throws Exception {
+        // ...
+        final MavenArtifactUrlReference featureRepo = maven()
+            .groupId("org.apache.plc4x")
+            .artifactId("driver-s7-feature")
+            .versionAsInProject()
+            .classifier("xml")
+            .type("feature");
+
+        System.out.println(featureRepo.getURL());
+
+        // ...
+        addFeaturesRepository(featureRepo.getURL());
+        // ...
+        installAndAssertFeature("driver-s7-feature");
+        // Print Bundles
+        String bundles = executeCommand("bundle:list -t 0");
+        System.out.println(bundles);
+        // Print features
+        String features = executeCommand("feature:list -i");
+        System.out.print(features);
     }
 
-}
+}
\ No newline at end of file


[plc4x] 14/15: Merge remote-tracking branch 'jfeinauer/feature/resolve-split-package-osgi' into feature/resolve-split-package-osgi

Posted by cd...@apache.org.
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 317c0881e1e0d3b497a5f6543d2562e613a7ca5a
Merge: 296efd2 f127594
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Fri Oct 18 14:13:16 2019 +0200

    Merge remote-tracking branch 'jfeinauer/feature/resolve-split-package-osgi' into feature/resolve-split-package-osgi

 .../apache-karaf/karaf-ads-feature/pom.xml         |  61 ----------
 .../apache-karaf/karaf-demo-server/pom.xml         | 128 ---------------------
 .../apache-karaf/karaf-ethernet-ip-feature/pom.xml |  61 ----------
 .../apache-karaf/karaf-modbus-feature/pom.xml      |  61 ----------
 .../apache-karaf/karaf-opcua-feature/pom.xml       |  61 ----------
 .../apache-karaf/karaf-s7-feature/pom.xml          |  61 ----------
 .../apache-karaf/karaf-simulated-feature/pom.xml   |  61 ----------
 plc4j/integrations/apache-karaf/pom.xml            | 121 -------------------
 plc4j/integrations/pom.xml                         |   1 -
 plc4j/karaf-features/README.md                     |  42 +++++++
 plc4j/karaf-features/karaf-itest/pom.xml           |  35 ++++++
 .../karaf/{FeatureITest.java => FeatureIT.java}    |   2 +-
 .../src/test/resources/etc/system.properties       |  18 ---
 .../karaf-features/s7/src/main/feature/feature.xml |  18 +--
 14 files changed, 87 insertions(+), 644 deletions(-)


[plc4x] 15/15: - Configured the test to work with failsafe instead of surefire - Cleaned up the maven config

Posted by cd...@apache.org.
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 95c37c05aba323e02f619789cbb60d930f3f87ee
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Fri Oct 18 15:16:30 2019 +0200

    - Configured the test to work with failsafe instead of surefire
    - Cleaned up the maven config
---
 plc4j/karaf-features/karaf-itest/pom.xml | 60 +++++++++++++++++---------------
 plc4j/karaf-features/pom.xml             | 32 +++++++++++++++--
 plc4j/karaf-features/s7/pom.xml          |  5 ++-
 pom.xml                                  | 13 +++++++
 4 files changed, 78 insertions(+), 32 deletions(-)

diff --git a/plc4j/karaf-features/karaf-itest/pom.xml b/plc4j/karaf-features/karaf-itest/pom.xml
index 00e4988..67a06d4 100644
--- a/plc4j/karaf-features/karaf-itest/pom.xml
+++ b/plc4j/karaf-features/karaf-itest/pom.xml
@@ -29,6 +29,8 @@
 
   <artifactId>karaf-itest</artifactId>
 
+  <name>PLC4J: Karaf-Features: Integration-Tests</name>
+
   <properties>
     <karaf.version>4.2.6</karaf.version>
     <pax.version>4.13.1</pax.version>
@@ -60,6 +62,13 @@
       <type>tar.gz</type>
     </dependency>
 
+    <!-- Add the surefire logger api as failsafe doesn't provide this -->
+    <dependency>
+      <groupId>org.apache.maven.surefire</groupId>
+      <artifactId>surefire-logger-api</artifactId>
+      <version>${surefire.version}</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
@@ -130,7 +139,7 @@
       <!-- See https://issues.apache.org/jira/browse/KARAF-6457 -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
+        <artifactId>maven-failsafe-plugin</artifactId>
         <configuration>
           <forkCount>1</forkCount>
           <reuseForks>false</reuseForks>
@@ -152,34 +161,29 @@
           </systemPropertyVariables>
         </configuration>
       </plugin>
-      <!-- Run in the verify Phase -->
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <excludes>
-            <exclude>**/*IT.java</exclude>
-          </excludes>
-        </configuration>
-        <executions>
-          <execution>
-            <id>integration-test</id>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <phase>integration-test</phase>
-            <configuration>
-              <excludes>
-                <exclude>none</exclude>
-              </excludes>
-              <includes>
-                <include>**/*IT.java</include>
-              </includes>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
     </plugins>
   </build>
 
+  <!-- Karaf currently doesn't work with Java 12 and above -->
+  <!-- See: https://issues.apache.org/jira/projects/KARAF/issues/KARAF-6203 -->
+  <profiles>
+    <profile>
+      <id>java12andAbove</id>
+      <activation>
+        <jdk>(12,]</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-failsafe-plugin</artifactId>
+            <configuration>
+              <skip>true</skip>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>
\ No newline at end of file
diff --git a/plc4j/karaf-features/pom.xml b/plc4j/karaf-features/pom.xml
index 1400fd1..1d5d27f 100644
--- a/plc4j/karaf-features/pom.xml
+++ b/plc4j/karaf-features/pom.xml
@@ -20,22 +20,48 @@
 <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">
+  <modelVersion>4.0.0</modelVersion>
+
   <parent>
-    <!-- TODO Currnelty thats the easeist way to avoid importing of slf4j -->
-    <artifactId>plc4x-parent</artifactId>
     <groupId>org.apache.plc4x</groupId>
+    <artifactId>plc4j</artifactId>
     <version>0.5.0-SNAPSHOT</version>
   </parent>
-  <modelVersion>4.0.0</modelVersion>
 
   <artifactId>karaf-features</artifactId>
   <packaging>pom</packaging>
 
+  <name>PLC4J: Karaf-Features</name>
+
   <modules>
     <module>s7</module>
     <module>karaf-itest</module>
   </modules>
 
+  <dependencies>
+    <!-- Forcefully exclude slf4j -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.glassfish.jaxb</groupId>
+        <artifactId>jaxb-runtime</artifactId>
+        <version>2.3.2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.configadmin</artifactId>
+        <version>1.9.14</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
   <build>
     <resources>
       <resource>
diff --git a/plc4j/karaf-features/s7/pom.xml b/plc4j/karaf-features/s7/pom.xml
index 36043d4..4ef3301 100644
--- a/plc4j/karaf-features/s7/pom.xml
+++ b/plc4j/karaf-features/s7/pom.xml
@@ -20,16 +20,19 @@
 <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">
+  <modelVersion>4.0.0</modelVersion>
+
   <parent>
     <artifactId>karaf-features</artifactId>
     <groupId>org.apache.plc4x</groupId>
     <version>0.5.0-SNAPSHOT</version>
   </parent>
-  <modelVersion>4.0.0</modelVersion>
 
   <artifactId>driver-s7-feature</artifactId>
   <packaging>feature</packaging>
 
+  <name>PLC4J: Karaf-Features: S7</name>
+
   <!-- This would be necessary with the kar goal which works not fine, yet -->
 <!--  <dependencies>-->
 <!--    <dependency>-->
diff --git a/pom.xml b/pom.xml
index 3812323..9c2d9ae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -904,6 +904,19 @@
         </configuration>
       </plugin>
 
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>integration-test</goal>
+              <goal>verify</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
       <!-- Generate the legally required text files in the jars -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>


[plc4x] 04/15: [OSGi] Added initial Implementation of a Exam Test.

Posted by cd...@apache.org.
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 1f557741cf8d2f8c1b77adb322408f154aaeea62
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Tue Oct 15 21:35:46 2019 +0200

    [OSGi] Added initial Implementation of a Exam Test.
---
 plc4j/karaf-features/karaf-itest/pom.xml           | 142 +++++++++++++++++++++
 .../java/org/apache/plc4x/karaf/FeatureITest.java  | 131 +++++++++++++++++++
 .../karaf-itest/src/test/resources/exam.properties |   1 +
 plc4j/karaf-features/pom.xml                       |   1 +
 plc4j/karaf-features/s7/pom.xml                    |  99 ++++++++++++++
 .../karaf-features/s7/src/main/feature/feature.xml |   2 +-
 .../java/org/apache/plc4x/karaf/FeatureTest.java   |  91 +++++++++++++
 7 files changed, 466 insertions(+), 1 deletion(-)

diff --git a/plc4j/karaf-features/karaf-itest/pom.xml b/plc4j/karaf-features/karaf-itest/pom.xml
new file mode 100644
index 0000000..9d4e3f5
--- /dev/null
+++ b/plc4j/karaf-features/karaf-itest/pom.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+  <parent>
+    <artifactId>karaf-features</artifactId>
+    <groupId>org.apache.plc4x</groupId>
+    <version>0.5.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>karaf-itest</artifactId>
+
+  <properties>
+    <dependency.karaf.version>4.2.1</dependency.karaf.version>
+    <pax.version>4.13.1</pax.version>
+  </properties>
+
+  <dependencies>
+<!--    &lt;!&ndash; S7 Driver for Build &ndash;&gt;-->
+<!--    <dependency>-->
+<!--      <groupId>org.apache.plc4x</groupId>-->
+<!--      <artifactId>driver-s7-feature</artifactId>-->
+<!--      <version>0.5.0-SNAPSHOT</version>-->
+<!--      <scope>test</scope>-->
+<!--    </dependency>-->
+
+    <!-- Pax Exam Test setup -->
+    <dependency>
+      <groupId>org.ops4j.pax.exam.samples</groupId>
+      <artifactId>pax-exam-sample8-ds</artifactId>
+      <version>${pax.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.karaf.features</groupId>
+      <artifactId>standard</artifactId>
+      <version>${dependency.karaf.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <version>6.0.0</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <!-- Dependencies for pax exam karaf container -->
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-container-karaf</artifactId>
+      <version>${pax.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-junit4</artifactId>
+      <version>${pax.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam</artifactId>
+      <version>${pax.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.url</groupId>
+      <artifactId>pax-url-aether</artifactId>
+      <version>2.6.1</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>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.plc4x</groupId>
+      <artifactId>plc4j-api</artifactId>
+      <version>0.5.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.karaf.features</groupId>
+      <artifactId>org.apache.karaf.features.core</artifactId>
+      <version>${dependency.karaf.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.karaf.bundle</groupId>
+      <artifactId>org.apache.karaf.bundle.core</artifactId>
+      <version>${dependency.karaf.version}</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.4.0</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>${dependency.karaf.version}</pax.exam.karaf.version>
+          </systemPropertyVariables>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
\ No newline at end of file
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
new file mode 100644
index 0000000..1efc1db
--- /dev/null
+++ b/plc4j/karaf-features/karaf-itest/src/test/java/org/apache/plc4x/karaf/FeatureITest.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed 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.
+ */
+package org.apache.plc4x.karaf;
+
+import org.apache.karaf.bundle.core.BundleService;
+import org.apache.karaf.features.FeaturesService;
+import org.apache.plc4x.java.spi.PlcDriver;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.ConfigurationManager;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
+import org.ops4j.pax.exam.options.MavenUrlReference;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import java.io.File;
+import java.util.Arrays;
+import java.util.Optional;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+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.configureConsole;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
+
+@RunWith(PaxExam.class)
+public class FeatureITest {
+
+    private static Logger LOG = LoggerFactory.getLogger(FeatureITest.class);
+
+    @Inject
+    private FeaturesService featuresService;
+
+    @Inject
+    private BundleContext bundleContext;
+
+    @Configuration
+    public Option[] config() {
+        MavenArtifactUrlReference karafUrl = maven()
+            .groupId("org.apache.karaf")
+            .artifactId("apache-karaf")
+            .version(karafVersion())
+            .type("zip");
+
+        MavenUrlReference karafStandardRepo = maven()
+            .groupId("org.apache.karaf.features")
+            .artifactId("standard")
+            .version(karafVersion())
+            .classifier("features")
+            .type("xml");
+
+        final MavenArtifactUrlReference plc4xRepo = maven()
+            .groupId("org.apache.plc4x")
+            .artifactId("driver-s7-feature")
+            .version("0.5.0-SNAPSHOT")
+            .classifier("features")
+            .type("xml");
+        return new Option[] {
+            // KarafDistributionOption.debugConfiguration("5005", true),
+            karafDistributionConfiguration()
+                .frameworkUrl(karafUrl)
+                .unpackDirectory(new File("target", "exam"))
+                .useDeployFolder(false),
+            keepRuntimeFolder(),
+            configureConsole().ignoreLocalConsole(),
+            features(karafStandardRepo , "scr"),
+            features(plc4xRepo, "driver-s7-feature"),
+            mavenBundle()
+                .groupId("org.apache.plc4x")
+                .artifactId("plc4j-driver-s7")
+                .version("0.5.0-SNAPSHOT")
+                .start()
+        };
+    }
+
+    public static String karafVersion() {
+        ConfigurationManager cm = new ConfigurationManager();
+        String karafVersion = cm.getProperty("pax.exam.karaf.version", "3.0.0");
+        return karafVersion;
+    }
+
+
+    @Test
+    public void checkFeatureInstalled() throws Exception {
+        assertTrue(
+            featuresService.isInstalled(featuresService.getFeature("driver-s7-feature"))
+        );
+    }
+
+    @Test
+    public void checkBundleStarted() throws Exception {
+        for (Bundle bundle : bundleContext.getBundles()) {
+            System.out.println(bundle.getSymbolicName());
+        }
+
+        // Try to find the bundle
+        final Optional<Bundle> optionalBundle = Arrays.stream(bundleContext.getBundles())
+            .filter(bundle -> "org.apache.plc4x.plc4j-driver-s7".equals(bundle.getSymbolicName()))
+            .findFirst();
+
+        // Ensure that the bundle is resolved
+        assertTrue(optionalBundle.isPresent());
+
+        // Check if the bundle is active
+        assertEquals(Bundle.ACTIVE, optionalBundle.get().getState());
+    }
+
+}
diff --git a/plc4j/karaf-features/karaf-itest/src/test/resources/exam.properties b/plc4j/karaf-features/karaf-itest/src/test/resources/exam.properties
new file mode 100644
index 0000000..db2c7db
--- /dev/null
+++ b/plc4j/karaf-features/karaf-itest/src/test/resources/exam.properties
@@ -0,0 +1 @@
+pax.exam.karaf.version = 4.2.1
\ No newline at end of file
diff --git a/plc4j/karaf-features/pom.xml b/plc4j/karaf-features/pom.xml
index 76ab877..1400fd1 100644
--- a/plc4j/karaf-features/pom.xml
+++ b/plc4j/karaf-features/pom.xml
@@ -33,6 +33,7 @@
 
   <modules>
     <module>s7</module>
+    <module>karaf-itest</module>
   </modules>
 
   <build>
diff --git a/plc4j/karaf-features/s7/pom.xml b/plc4j/karaf-features/s7/pom.xml
index 36043d4..472b868 100644
--- a/plc4j/karaf-features/s7/pom.xml
+++ b/plc4j/karaf-features/s7/pom.xml
@@ -30,6 +30,105 @@
   <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 6bf41bb..aebf22a 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>
diff --git a/plc4j/karaf-features/s7/src/test/java/org/apache/plc4x/karaf/FeatureTest.java b/plc4j/karaf-features/s7/src/test/java/org/apache/plc4x/karaf/FeatureTest.java
new file mode 100644
index 0000000..eb74608
--- /dev/null
+++ b/plc4j/karaf-features/s7/src/test/java/org/apache/plc4x/karaf/FeatureTest.java
@@ -0,0 +1,91 @@
+/*
+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.
+*/
+package org.apache.plc4x.karaf;
+
+import org.apache.plc4x.java.spi.PlcDriver;
+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.options.MavenArtifactUrlReference;
+import org.ops4j.pax.exam.options.MavenUrlReference;
+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 javax.inject.Inject;
+
+import java.io.File;
+
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class FeatureTest {
+
+    @Inject
+    private PlcDriver plcDriver;
+
+    @Configuration
+    public Option[] config() {
+        MavenArtifactUrlReference karafUrl = maven()
+            .groupId("org.apache.karaf")
+            .artifactId("apache-karaf")
+            .version("3.0.0")
+            .type("tar.gz");
+        MavenUrlReference karafStandardRepo = maven()
+            .groupId("org.apache.karaf.features")
+            .artifactId("standard")
+            .classifier("features")
+            .version("4.2.1")
+            .type("xml")
+            .versionAsInProject();
+        return new Option[] {
+            // KarafDistributionOption.debugConfiguration("5005", true),
+            karafDistributionConfiguration()
+                .frameworkUrl(karafUrl)
+                .unpackDirectory(new File("target/exam"))
+                .useDeployFolder(false),
+            keepRuntimeFolder(),
+            features(karafStandardRepo , "scr"),
+            mavenBundle()
+                .groupId("org.ops4j.pax.exam.samples")
+                .artifactId("pax-exam-sample8-ds")
+                .version("4.2.1")
+                //.versionAsInProject()
+            .start(),
+        };
+    }
+
+    @Test
+    public void getHelloService() {
+        assertNotNull(plcDriver);
+        // assertEquals("Hello Pax!", helloService.getMessage());
+    }
+
+}


[plc4x] 03/15: [OSGi] Refactoring.

Posted by cd...@apache.org.
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 ac8b7e806a4ea4cc870607882eceb0f2491756bc
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Thu Oct 17 21:58:28 2019 +0200

    [OSGi] Refactoring.
---
 .../java/org/apache/plc4x/karaf/FeatureITest.java  | 82 ----------------------
 1 file changed, 82 deletions(-)

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 f38cdc1..33a7722 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
@@ -31,8 +31,6 @@ 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.features;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
 
 @RunWith(PaxExam.class)
@@ -44,88 +42,8 @@ public class FeatureITest extends KarafTestSupport {
         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)
-//            };
-//        }
     }
 
     /**


[plc4x] 08/15: Merge remote-tracking branch 'jfeinauer/feature/resolve-split-package-osgi' into feature/resolve-split-package-osgi

Posted by cd...@apache.org.
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 296efd2f2555a33b5f77581357512facb3160ad5
Merge: ac8b7e8 a14fe10
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Fri Oct 18 13:20:23 2019 +0200

    Merge remote-tracking branch 'jfeinauer/feature/resolve-split-package-osgi' into feature/resolve-split-package-osgi

 plc4j/drivers/ads/pom.xml                          |  9 ++++-
 .../org/apache/plc4x/java/ads/AdsPlcDriver.java    |  2 +
 plc4j/drivers/ethernet-ip/pom.xml                  |  7 ++++
 .../plc4x/java/ethernetip/EtherNetIpPlcDriver.java |  2 +
 plc4j/drivers/modbus/pom.xml                       |  7 ++++
 .../apache/plc4x/java/modbus/ModbusPlcDriver.java  |  2 +
 plc4j/drivers/opcua/pom.xml                        |  6 +++
 .../apache/plc4x/java/opcua/OpcuaPlcDriver.java    |  2 +
 plc4j/drivers/simulated/pom.xml                    |  7 ++++
 .../plc4x/java/simulated/SimulatedPlcDriver.java   |  2 +
 .../apache-karaf/karaf-demo-server/pom.xml         |  8 ++++
 .../pom.xml                                        | 37 ++---------------
 .../apache-karaf/karaf-s7-feature/pom.xml          | 29 -------------
 .../karaf-s7-feature/src/main/feature/feature.xslt | 47 ----------------------
 plc4j/integrations/apache-karaf/pom.xml            |  2 +-
 15 files changed, 58 insertions(+), 111 deletions(-)