From 407f0a36f5ced80c1ebef8e3e6b419cd1e237a92 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 26 Nov 2013 20:27:58 +0900 Subject: [PATCH] Simplify bundle generation / Add io.netty.versions.properties to all JARs - Fixes #2003 properly - Instead of using 'bundle' packaging, use 'jar' packaging. This is more robust because some strict build tools fail to retrieve the artifacts from a Maven repository unless their packaging is not 'jar'. - All artifacts now contain META-INF/io.netty.version.properties, which provides the detailed information about the build and repository. - Removed OSGi testsuite temporarily because it gives false errors during split package test and examination. - Add io.netty.util.Version for easy retrieval of version information --- .gitignore | 2 - all/pom.xml | 140 ++++++-- buffer/pom.xml | 3 +- codec-http/pom.xml | 4 +- codec-socks/pom.xml | 3 +- codec/pom.xml | 3 +- common/pom.xml | 83 +---- .../src/main/java/io/netty/util/Version.java | 201 +++++++++++ example/pom.xml | 1 + handler/pom.xml | 6 +- pom.xml | 185 +++++++++- testsuite-osgi/.gitignore | 3 - testsuite-osgi/README.md | 2 - testsuite-osgi/pom.xml | 61 ---- testsuite-osgi/testsuite-osgi-deps/README.md | 67 ---- testsuite-osgi/testsuite-osgi-deps/pom.xml | 180 ---------- .../main/java/io/netty/verify/osgi/Dummy.java | 26 -- .../io/netty/verify/osgi/package-info.java | 19 -- .../io/netty/verify/osgi/DependencyIT.java | 69 ---- testsuite-osgi/testsuite-osgi-exam/.gitignore | 2 - testsuite-osgi/testsuite-osgi-exam/README.md | 10 - testsuite-osgi/testsuite-osgi-exam/pom.xml | 320 ------------------ .../io/netty/verify/osgi/NettyService.java | 26 -- .../verify/osgi/NettyServiceProvider.java | 47 --- .../io/netty/verify/osgi/package-info.java | 20 -- .../links/org.ops4j.pax.logging.api.link | 1 - .../main/resources/META-INF/links/readme.md | 6 - .../netty/verify/osgi/BasicFrameworkIT.java | 56 --- .../NioUdtMessageRendezvousChannelIT.java | 70 ---- .../java/io/netty/verify/osgi/UnitHelp.java | 142 -------- .../src/test/resources/logback-test.xml | 43 --- testsuite-osgi/testsuite-osgi-split/README.md | 17 - testsuite-osgi/testsuite-osgi-split/pom.xml | 116 ------- .../main/java/io/netty/verify/osgi/Dummy.java | 26 -- .../io/netty/verify/osgi/package-info.java | 19 -- .../java/io/netty/verify/osgi/TestDummy.java | 23 -- transport-rxtx/pom.xml | 4 +- transport-sctp/pom.xml | 6 +- transport-udt/pom.xml | 5 +- transport/pom.xml | 3 +- 40 files changed, 518 insertions(+), 1502 deletions(-) create mode 100644 common/src/main/java/io/netty/util/Version.java delete mode 100644 testsuite-osgi/.gitignore delete mode 100644 testsuite-osgi/README.md delete mode 100644 testsuite-osgi/pom.xml delete mode 100644 testsuite-osgi/testsuite-osgi-deps/README.md delete mode 100644 testsuite-osgi/testsuite-osgi-deps/pom.xml delete mode 100644 testsuite-osgi/testsuite-osgi-deps/src/main/java/io/netty/verify/osgi/Dummy.java delete mode 100644 testsuite-osgi/testsuite-osgi-deps/src/main/java/io/netty/verify/osgi/package-info.java delete mode 100644 testsuite-osgi/testsuite-osgi-deps/src/test/java/io/netty/verify/osgi/DependencyIT.java delete mode 100644 testsuite-osgi/testsuite-osgi-exam/.gitignore delete mode 100644 testsuite-osgi/testsuite-osgi-exam/README.md delete mode 100644 testsuite-osgi/testsuite-osgi-exam/pom.xml delete mode 100644 testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/NettyService.java delete mode 100644 testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/NettyServiceProvider.java delete mode 100644 testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/package-info.java delete mode 100644 testsuite-osgi/testsuite-osgi-exam/src/main/resources/META-INF/links/org.ops4j.pax.logging.api.link delete mode 100644 testsuite-osgi/testsuite-osgi-exam/src/main/resources/META-INF/links/readme.md delete mode 100644 testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/BasicFrameworkIT.java delete mode 100644 testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/NioUdtMessageRendezvousChannelIT.java delete mode 100644 testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/UnitHelp.java delete mode 100644 testsuite-osgi/testsuite-osgi-exam/src/test/resources/logback-test.xml delete mode 100644 testsuite-osgi/testsuite-osgi-split/README.md delete mode 100644 testsuite-osgi/testsuite-osgi-split/pom.xml delete mode 100644 testsuite-osgi/testsuite-osgi-split/src/main/java/io/netty/verify/osgi/Dummy.java delete mode 100644 testsuite-osgi/testsuite-osgi-split/src/main/java/io/netty/verify/osgi/package-info.java delete mode 100644 testsuite-osgi/testsuite-osgi-split/src/test/java/io/netty/verify/osgi/TestDummy.java diff --git a/.gitignore b/.gitignore index d6bcaacc78..6416fff4ad 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,4 @@ /reports */reports .DS_Store -/common/src/main/java/io/netty/util/Version.java - diff --git a/all/pom.xml b/all/pom.xml index 971c35b3d7..1e8a257680 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -30,6 +30,8 @@ true + ${project.build.directory}/src + ${project.build.directory}/versions @@ -181,6 +183,17 @@ maven-dependency-plugin + + + locate-dependencies + initialize + + properties + + + + unpack-sources prepare-package @@ -191,9 +204,11 @@ sources io/netty/** ${project.groupId} - ${project.build.directory}/src + ${generatedSourceDir} + + unpack-jars prepare-package @@ -208,6 +223,64 @@ + + + maven-antrun-plugin + + + + write-version-properties + none + + + merge-version-properties + prepare-package + + run + + + + + + + + + + + + + + + + + + + + + + + + + clean-source-directory + package + + run + + + + + + + + + + + + + org.codehaus.mojo build-helper-maven-plugin @@ -220,13 +293,50 @@ - target/src + ${generatedSourceDir} + + + org.apache.felix + maven-bundle-plugin + + + generate-manifest + none + + + + + + maven-jar-plugin + + + default-jar + none + + + all-in-one-jar + package + + jar + + + + + true + + true + + + + + + org.codehaus.mojo @@ -238,6 +348,7 @@ + maven-checkstyle-plugin @@ -248,6 +359,7 @@ + maven-resources-plugin @@ -284,6 +396,8 @@ + + maven-jxr-plugin @@ -311,6 +425,8 @@ + + maven-javadoc-plugin @@ -326,7 +442,7 @@ *.internal,*.example true ${project.build.directory}/api - ${basedir}/src/javadoc/overview.html + ${project.basedir}/src/javadoc/overview.html Netty API Reference (${project.version}) Netty API Reference (${project.version}) false @@ -347,24 +463,6 @@ en_US - - maven-antrun-plugin - - - clean-source-directory - package - - run - - - - - - - - - - diff --git a/buffer/pom.xml b/buffer/pom.xml index ce8bedfdcf..4a4ee48bce 100644 --- a/buffer/pom.xml +++ b/buffer/pom.xml @@ -24,7 +24,7 @@ netty-buffer - bundle + jar Netty/Buffer @@ -35,5 +35,4 @@ ${project.version} - diff --git a/codec-http/pom.xml b/codec-http/pom.xml index 489d860316..4b24151395 100644 --- a/codec-http/pom.xml +++ b/codec-http/pom.xml @@ -24,7 +24,7 @@ netty-codec-http - bundle + jar Netty/Codec/HTTP @@ -45,7 +45,5 @@ true - - diff --git a/codec-socks/pom.xml b/codec-socks/pom.xml index 46f8b5db2a..6bc1332f48 100644 --- a/codec-socks/pom.xml +++ b/codec-socks/pom.xml @@ -24,7 +24,7 @@ netty-codec-socks - bundle + jar Netty/Codec/Socks @@ -41,3 +41,4 @@ + diff --git a/codec/pom.xml b/codec/pom.xml index 3bb4d6c5df..f25d0b1a57 100644 --- a/codec/pom.xml +++ b/codec/pom.xml @@ -24,7 +24,7 @@ netty-codec - bundle + jar Netty/Codec @@ -62,6 +62,5 @@ test - diff --git a/common/pom.xml b/common/pom.xml index 4ef39610cb..291c7c81fc 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -25,7 +25,7 @@ netty-common - bundle + jar Netty/Common @@ -55,84 +55,5 @@ true - - - - - org.apache.felix - maven-bundle-plugin - - - - - sun.misc.*;resolution:=optional, - * - - - - !* - - - - - - maven-antrun-plugin - - - write-version - validate - - run - - - - - - - - - - - - - - - - - - - Build number: ${buildNumber} - - - - - - - - - - org.apache.ant - ant - 1.8.2 - - - org.apache.ant - ant-launcher - 1.8.2 - - - ant-contrib - ant-contrib - 1.0b3 - - - ant - ant - - - - - - - + diff --git a/common/src/main/java/io/netty/util/Version.java b/common/src/main/java/io/netty/util/Version.java new file mode 100644 index 0000000000..7de1582398 --- /dev/null +++ b/common/src/main/java/io/netty/util/Version.java @@ -0,0 +1,201 @@ +/* + * Copyright 2013 The Netty Project + * + * The Netty Project 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 io.netty.util; + +import java.io.InputStream; +import java.net.URL; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.TreeMap; + +/** + * Retrieves the version information of available Netty artifacts. + *

+ * This class retrieves the version information from {@code META-INF/io.netty.versions.properties}, which is + * generated in build time. Note that it may not be possible to retrieve the information completely, depending on + * your environment, such as the specified {@link ClassLoader}, the current {@link SecurityManager}. + *

+ */ +public final class Version { + + private static final String PROP_VERSION = ".version"; + private static final String PROP_BUILD_DATE = ".buildDate"; + private static final String PROP_COMMIT_DATE = ".commitDate"; + private static final String PROP_SHORT_COMMIT_HASH = ".shortCommitHash"; + private static final String PROP_LONG_COMMIT_HASH = ".longCommitHash"; + private static final String PROP_REPO_STATUS = ".repoStatus"; + + /** + * Retrieves the version information of Netty artifacts using the current + * {@linkplain Thread#getContextClassLoader() context class loader}. + * + * @return A {@link Map} whose keys are Maven artifact IDs and whose values are {@link Version}s + */ + public static Map identify() { + return identify(null); + } + + /** + * Retrieves the version information of Netty artifacts using the specified {@link ClassLoader}. + * + * @return A {@link Map} whose keys are Maven artifact IDs and whose values are {@link Version}s + */ + public static Map identify(ClassLoader classLoader) { + if (classLoader == null) { + classLoader = Thread.currentThread().getContextClassLoader(); + } + + // Collect all properties. + Properties props = new Properties(); + try { + Enumeration resources = classLoader.getResources("META-INF/io.netty.versions.properties"); + while (resources.hasMoreElements()) { + URL url = resources.nextElement(); + InputStream in = url.openStream(); + try { + props.load(in); + } finally { + try { + in.close(); + } catch (Exception ignore) { + // Ignore. + } + } + } + } catch (Exception ignore) { + // Not critical. Just ignore. + } + + // Collect all artifactIds. + Set artifactIds = new HashSet(); + for (Object o: props.keySet()) { + String k = (String) o; + + int dotIndex = k.indexOf('.'); + if (dotIndex <= 0) { + continue; + } + + String artifactId = k.substring(0, dotIndex); + + // Skip the entries without required information. + if (!props.containsKey(artifactId + PROP_VERSION) || + !props.containsKey(artifactId + PROP_BUILD_DATE) || + !props.containsKey(artifactId + PROP_COMMIT_DATE) || + !props.containsKey(artifactId + PROP_SHORT_COMMIT_HASH) || + !props.containsKey(artifactId + PROP_LONG_COMMIT_HASH) || + !props.containsKey(artifactId + PROP_REPO_STATUS)) { + continue; + } + + artifactIds.add(artifactId); + } + + Map versions = new TreeMap(); + for (String artifactId: artifactIds) { + versions.put( + artifactId, + new Version( + artifactId, + props.getProperty(artifactId + PROP_VERSION), + parseIso8601(props.getProperty(artifactId + PROP_BUILD_DATE)), + parseIso8601(props.getProperty(artifactId + PROP_COMMIT_DATE)), + props.getProperty(artifactId + PROP_SHORT_COMMIT_HASH), + props.getProperty(artifactId + PROP_LONG_COMMIT_HASH), + props.getProperty(artifactId + PROP_REPO_STATUS))); + } + + return versions; + } + + private static long parseIso8601(String value) { + try { + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(value).getTime(); + } catch (ParseException e) { + return 0; + } + } + + /** + * Prints the version information to {@link System#err}. + */ + public static void main(String[] args) { + for (Version v: identify().values()) { + System.err.println(v); + } + } + + private final String artifactId; + private final String artifactVersion; + private final long buildTimeMillis; + private final long commitTimeMillis; + private final String shortCommitHash; + private final String longCommitHash; + private final String repositoryStatus; + + private Version( + String artifactId, String artifactVersion, + long buildTimeMillis, long commitTimeMillis, + String shortCommitHash, String longCommitHash, String repositoryStatus) { + this.artifactId = artifactId; + this.artifactVersion = artifactVersion; + this.buildTimeMillis = buildTimeMillis; + this.commitTimeMillis = commitTimeMillis; + this.shortCommitHash = shortCommitHash; + this.longCommitHash = longCommitHash; + this.repositoryStatus = repositoryStatus; + } + + public String artifactId() { + return artifactId; + } + + public String artifactVersion() { + return artifactVersion; + } + + public long buildTimeMillis() { + return buildTimeMillis; + } + + public long commitTimeMillis() { + return commitTimeMillis; + } + + public String shortCommitHash() { + return shortCommitHash; + } + + public String longCommitHash() { + return longCommitHash; + } + + public String repositoryStatus() { + return repositoryStatus; + } + + @Override + public String toString() { + return artifactId + '-' + artifactVersion + '.' + shortCommitHash + + ("clean".equals(repositoryStatus)? "" : " (repository: " + repositoryStatus + ')'); + } +} diff --git a/example/pom.xml b/example/pom.xml index 927adfc72c..f0e45c1bb1 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -87,3 +87,4 @@ + diff --git a/handler/pom.xml b/handler/pom.xml index b7a93a7c06..cbb30ddda5 100644 --- a/handler/pom.xml +++ b/handler/pom.xml @@ -24,7 +24,7 @@ netty-handler - bundle + jar Netty/Handler @@ -45,5 +45,5 @@ ${project.version} - - + + diff --git a/pom.xml b/pom.xml index 674cbc1ba6..fd6aebcee3 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,6 @@ handler example testsuite - testsuite-osgi microbench all tarball @@ -400,8 +399,25 @@ org.apache.felix maven-bundle-plugin - 2.3.7 - true + 2.4.0 + + + generate-manifest + process-classes + + manifest + + + + ${project.groupId}.* + + sun.misc.*;resolution:=optional,* + + !* + + + + maven-source-plugin @@ -457,7 +473,154 @@ netty-@{project.version} - + + + + maven-antrun-plugin + + + + write-version-properties + initialize + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Current commit: ${shortCommitHash} on ${commitDate} + + + + + + + + + + + + + + + + + + + + + + + org.apache.ant + ant + 1.8.2 + + + org.apache.ant + ant-launcher + 1.8.2 + + + ant-contrib + ant-contrib + 1.0b3 + + + ant + ant + + + + + @@ -483,6 +646,20 @@ maven-jar-plugin 2.4 + + + default-jar + + + + true + + true + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + maven-dependency-plugin diff --git a/testsuite-osgi/.gitignore b/testsuite-osgi/.gitignore deleted file mode 100644 index c98243a4c0..0000000000 --- a/testsuite-osgi/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ - -target/ -reports/ diff --git a/testsuite-osgi/README.md b/testsuite-osgi/README.md deleted file mode 100644 index 133aa068ce..0000000000 --- a/testsuite-osgi/README.md +++ /dev/null @@ -1,2 +0,0 @@ - -parent for build constrains modules diff --git a/testsuite-osgi/pom.xml b/testsuite-osgi/pom.xml deleted file mode 100644 index 7db2d1aaf1..0000000000 --- a/testsuite-osgi/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - 4.0.0 - - - io.netty - netty-parent - 4.0.13.Final-SNAPSHOT - - - netty-testsuite-osgi-parent - pom - - Netty/Testsuite/OSGi - parent for build constrains modules - - - - - no-osgi - - true - true - - - - - - testsuite-osgi-split - testsuite-osgi-deps - testsuite-osgi-exam - - - - - - - maven-deploy-plugin - - true - - - - - diff --git a/testsuite-osgi/testsuite-osgi-deps/README.md b/testsuite-osgi/testsuite-osgi-deps/README.md deleted file mode 100644 index f2da2f0e9d..0000000000 --- a/testsuite-osgi/testsuite-osgi-deps/README.md +++ /dev/null @@ -1,67 +0,0 @@ -### info - -this module build will fail if any dependencies are not osgi bundles - -http://en.wikipedia.org/wiki/OSGi#Bundles - -on failure, build log will show error message similar to the following: -(org.rxtx/rxtx/2.1.7 is not osgi bundle) -``` -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running io.netty.verify.osgi.IT - - - -
verify osgi compliance: all transitive dependencies are osgi bundles
- mvn:io.netty/netty-buffer/4.0.0.Beta1-SNAPSHOT - mvn:io.netty/netty-common/4.0.0.Beta1-SNAPSHOT - mvn:io.netty/netty-codec/4.0.0.Beta1-SNAPSHOT - mvn:io.netty/netty-transport/4.0.0.Beta1-SNAPSHOT - mvn:io.netty/netty-codec-http/4.0.0.Beta1-SNAPSHOT - mvn:io.netty/netty-handler/4.0.0.Beta1-SNAPSHOT - mvn:io.netty/netty-codec-socks/4.0.0.Beta1-SNAPSHOT - mvn:io.netty/netty-transport-rxtx/4.0.0.Beta1-SNAPSHOT - wrap:mvn:org.rxtx/rxtx/2.1.7 - mvn:io.netty/netty-transport-sctp/4.0.0.Beta1-SNAPSHOT - mvn:io.netty/netty-transport-udt/4.0.0.Beta1-SNAPSHOT - mvn:com.barchart.udt/barchart-udt-bundle/2.2.0 -
-
- -Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.038 sec <<< FAILURE! -verifyNoWrapProtocol(io.netty.verify.osgi.IT) Time elapsed: 0.014 sec <<< FAILURE! -java.lang.AssertionError: karaf feature.xml contains 'wrap:' protocol: some transitive dependencies are not osgi bundles - at org.junit.Assert.fail(Assert.java:93) - at io.netty.verify.osgi.IT.verifyNoWrapProtocol(IT.java:48) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) - at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) - at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) - at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) - at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) -``` diff --git a/testsuite-osgi/testsuite-osgi-deps/pom.xml b/testsuite-osgi/testsuite-osgi-deps/pom.xml deleted file mode 100644 index b60c7726ee..0000000000 --- a/testsuite-osgi/testsuite-osgi-deps/pom.xml +++ /dev/null @@ -1,180 +0,0 @@ - - - - - 4.0.0 - - - io.netty - netty-testsuite-osgi-parent - 4.0.13.Final-SNAPSHOT - - - netty-testsuite-osgi-deps - bundle - - Netty/Testsuite/OSGi/Deps - verify osgi compliance: all transitive dependencies must be osgi bundles - - - - - - ${project.groupId} - netty-buffer - ${project.version} - - - ${project.groupId} - netty-codec - ${project.version} - - - ${project.groupId} - netty-codec-http - ${project.version} - - - ${project.groupId} - netty-codec-socks - ${project.version} - - - ${project.groupId} - netty-common - ${project.version} - - - ${project.groupId} - netty-handler - ${project.version} - - - ${project.groupId} - netty-transport - ${project.version} - - - - - ${project.groupId} - netty-transport-sctp - ${project.version} - - - ${project.groupId} - netty-transport-udt - ${project.version} - - - - - - - commons-io - commons-io - 1.3.2 - test - - - - - - - - - - org.apache.karaf.tooling - karaf-maven-plugin - 3.0.0.RC1 - true - - - - features-generate-descriptor - - - - - - - - maven-failsafe-plugin - - - test - - integration-test - verify - - - - - - - - maven-deploy-plugin - - true - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.karaf.tooling - karaf-maven-plugin - [0,) - - features-generate-descriptor - - - - - - - - - - - - - - - diff --git a/testsuite-osgi/testsuite-osgi-deps/src/main/java/io/netty/verify/osgi/Dummy.java b/testsuite-osgi/testsuite-osgi-deps/src/main/java/io/netty/verify/osgi/Dummy.java deleted file mode 100644 index f87020c7a7..0000000000 --- a/testsuite-osgi/testsuite-osgi-deps/src/main/java/io/netty/verify/osgi/Dummy.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - -/** - * Placeholder class to generate valid OSGI bundle. - *

- * maven-bundle-plugin enforces OSGI specification and rejects to build non - * fragment bundles which export no packages / no classes. - */ -public class Dummy { - -} diff --git a/testsuite-osgi/testsuite-osgi-deps/src/main/java/io/netty/verify/osgi/package-info.java b/testsuite-osgi/testsuite-osgi-deps/src/main/java/io/netty/verify/osgi/package-info.java deleted file mode 100644 index 0ccefab6dd..0000000000 --- a/testsuite-osgi/testsuite-osgi-deps/src/main/java/io/netty/verify/osgi/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - diff --git a/testsuite-osgi/testsuite-osgi-deps/src/test/java/io/netty/verify/osgi/DependencyIT.java b/testsuite-osgi/testsuite-osgi-deps/src/test/java/io/netty/verify/osgi/DependencyIT.java deleted file mode 100644 index 09e692df9d..0000000000 --- a/testsuite-osgi/testsuite-osgi-deps/src/test/java/io/netty/verify/osgi/DependencyIT.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - -import io.netty.util.internal.StringUtil; -import io.netty.util.internal.logging.InternalLogger; -import io.netty.util.internal.logging.InternalLoggerFactory; -import org.apache.commons.io.FileUtils; -import org.junit.Test; - -import java.io.File; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static org.junit.Assert.*; - -/** - * Dependency Integration Tests. - */ -public class DependencyIT { - - private static final InternalLogger logger = InternalLoggerFactory.getInstance(DependencyIT.class); - - /** - * Default location of generated karaf features file. - *

- * See karaf-maven-plugin - */ - public static final String FEATURE = "./target/feature/feature.xml"; - private static final Pattern WRAPPED_MODULE_PATTERN = Pattern.compile("wrap:mvn:io\\.netty/"); - - @Test - public void verifyKarafFeatureHasNoWrapProtocol() throws Exception { - String text = FileUtils.readFileToString(new File(FEATURE)); - - // Ignore wrap:mvn:io.netty - it occurs when Maven didn't give the Netty modules to karaf-maven-plugin - // as class directories. - Matcher matcher = WRAPPED_MODULE_PATTERN.matcher(text); - if (matcher.find()) { - text = matcher.replaceAll("mvn:io.netty/"); - logger.info("Ignored wrap:mvn:io.netty"); - } - - if (text.contains("wrap:")) { - fail( - "feature.xml generated by karaf-maven-plugin contains 'wrap:' protocol; " + - "some transitive dependencies are not OSGi bundles: " + StringUtil.NEWLINE + - text - ); - } else { - logger.info("All transitive dependencies are OSGi bundles."); - } - } -} diff --git a/testsuite-osgi/testsuite-osgi-exam/.gitignore b/testsuite-osgi/testsuite-osgi-exam/.gitignore deleted file mode 100644 index 646490c9fa..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ - -lib/ diff --git a/testsuite-osgi/testsuite-osgi-exam/README.md b/testsuite-osgi/testsuite-osgi-exam/README.md deleted file mode 100644 index 71893546e9..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/README.md +++ /dev/null @@ -1,10 +0,0 @@ -### info - -this module build will fail if -* netty osgi modules can not be loaded by osgi framework -* netty tests fail inside osgi framework - -for example -``` -ERROR: Bundle io.netty.buffer [15] Error starting mvn:io.netty/netty-buffer/4.0.0.Beta1-SNAPSHOT (org.osgi.framework.BundleException: Unresolved constraint in bundle io.netty.buffer [15]: Unable to resolve 15.0: missing requirement [15.0] osgi.wiring.package; (osgi.wiring.package=io.netty.util.internal)) -``` diff --git a/testsuite-osgi/testsuite-osgi-exam/pom.xml b/testsuite-osgi/testsuite-osgi-exam/pom.xml deleted file mode 100644 index 9e6e843356..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/pom.xml +++ /dev/null @@ -1,320 +0,0 @@ - - - - - 4.0.0 - - - io.netty - netty-testsuite-osgi-parent - 4.0.13.Final-SNAPSHOT - - - netty-testsuite-osgi-exam - bundle - - Netty/Testsuite/OSGi/Exam - verify osgi compliance: run tests inside osgi framework - - - 3.0.3 - 1.5.2 - - - - - - - ${project.groupId} - netty-buffer - ${project.version} - - - ${project.groupId} - netty-codec - ${project.version} - - - ${project.groupId} - netty-codec-http - ${project.version} - - - ${project.groupId} - netty-codec-socks - ${project.version} - - - ${project.groupId} - netty-common - ${project.version} - - - ${project.groupId} - netty-handler - ${project.version} - - - ${project.groupId} - netty-transport - ${project.version} - - - ${project.groupId} - netty-transport-rxtx - ${project.version} - - - ${project.groupId} - netty-transport-sctp - ${project.version} - - - ${project.groupId} - netty-transport-udt - ${project.version} - - - - - org.slf4j - slf4j-api - - - - - org.apache.felix - org.apache.felix.scr - 1.6.2 - - - - - org.osgi - org.osgi.core - 4.3.1 - provided - - - org.osgi - org.osgi.compendium - 4.3.1 - provided - - - - - - - ${project.groupId} - netty-transport-udt - ${project.version} - tests - test - - - com.yammer.metrics - metrics-core - test - - - com.google.caliper - caliper - test - - - - - org.ops4j.pax.exam - pax-exam-container-native - ${pax.exam.version} - test - - - org.ops4j.pax.exam - pax-exam-junit4 - ${pax.exam.version} - test - - - org.ops4j.pax.exam - pax-exam-invoker-junit - ${pax.exam.version} - test - - - org.ops4j.pax.exam - pax-exam-inject - ${pax.exam.version} - test - - - org.ops4j.pax.exam - pax-exam-extender-service - ${pax.exam.version} - test - - - org.ops4j.pax.exam - pax-exam-link-mvn - ${pax.exam.version} - test - - - org.ops4j.pax.url - pax-url-aether - ${pax.url.version} - test - - - org.ops4j.pax.url - pax-url-wrap - ${pax.url.version} - test - - - org.apache.felix - org.apache.felix.framework - 4.0.3 - test - - - - - - - - - - org.apache.servicemix.tooling - depends-maven-plugin - 1.2 - - - generate-depends-file - generate-resources - - generate-depends-file - - - - - - - - com.carrotgarden.maven - carrot-maven-scr-plugin - 3.0.3 - - OSGI-INF/service-component - - - - generate-test-sources - - generate - - - - - - - - org.apache.felix - maven-bundle-plugin - - - generate-test-sources - - manifest - - - - - - OSGI-INF/service-component/*.xml - - - - - - - maven-failsafe-plugin - - - test - - integration-test - verify - - - - - - - - maven-deploy-plugin - - true - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.servicemix.tooling - depends-maven-plugin - [0,) - - generate-depends-file - - - - - - - - - org.apache.felix - maven-bundle-plugin - [0,) - - manifest - - - - - - - - - - - - - - diff --git a/testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/NettyService.java b/testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/NettyService.java deleted file mode 100644 index a3857da6a1..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/NettyService.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - -/** - * Service for testing inside OSGI framework. - */ -public interface NettyService { - - /** verify osgi startup */ - String getHelloNetty(); - -} diff --git a/testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/NettyServiceProvider.java b/testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/NettyServiceProvider.java deleted file mode 100644 index da7175db0a..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/NettyServiceProvider.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - -import org.osgi.service.component.annotations.Activate; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Deactivate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Tester Service Component/Implementation. - */ -@Component -public class NettyServiceProvider implements NettyService { - - protected final Logger log = LoggerFactory.getLogger(getClass()); - - @Override - public String getHelloNetty() { - return "hello netty"; - } - - @Activate - protected void activate() { - log.info("activate"); - } - - @Deactivate - protected void deactivate() { - log.info("deactivate"); - } - -} diff --git a/testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/package-info.java b/testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/package-info.java deleted file mode 100644 index 33c490ab50..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/src/main/java/io/netty/verify/osgi/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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. - */ -/** - * OSGI Framework Tests. - */ -package io.netty.verify.osgi; - diff --git a/testsuite-osgi/testsuite-osgi-exam/src/main/resources/META-INF/links/org.ops4j.pax.logging.api.link b/testsuite-osgi/testsuite-osgi-exam/src/main/resources/META-INF/links/org.ops4j.pax.logging.api.link deleted file mode 100644 index d636fe68d8..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/src/main/resources/META-INF/links/org.ops4j.pax.logging.api.link +++ /dev/null @@ -1 +0,0 @@ -mvn:org.ops4j.pax.logging/pax-logging-api/1.7.0 diff --git a/testsuite-osgi/testsuite-osgi-exam/src/main/resources/META-INF/links/readme.md b/testsuite-osgi/testsuite-osgi-exam/src/main/resources/META-INF/links/readme.md deleted file mode 100644 index 5632d674c8..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/src/main/resources/META-INF/links/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -### info - -override select links from - -http://search.maven.org/#search%7Cga%7C1%7Cpax-exam-link-mvn - diff --git a/testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/BasicFrameworkIT.java b/testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/BasicFrameworkIT.java deleted file mode 100644 index ed83971c73..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/BasicFrameworkIT.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - -import static org.junit.Assert.*; - -import javax.inject.Inject; - -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.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.osgi.framework.BundleContext; - -/** - * Invoke Netty Tests inside configured OSGI framework. - */ -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class BasicFrameworkIT { - - @Inject - private BundleContext bundleContext; - - @Inject - private NettyService nettyService; - - @Configuration - public Option[] config() { - return UnitHelp.config(); - } - - @Test - public void verifyNettyService() { - assertNotNull(bundleContext); - assertNotNull(nettyService); - assertEquals("hello netty", nettyService.getHelloNetty()); - } - -} diff --git a/testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/NioUdtMessageRendezvousChannelIT.java b/testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/NioUdtMessageRendezvousChannelIT.java deleted file mode 100644 index f736cea6e4..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/NioUdtMessageRendezvousChannelIT.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - -import static org.junit.Assert.*; -import static org.ops4j.pax.exam.CoreOptions.*; -import io.netty.test.udt.nio.NioUdtMessageRendezvousChannelTest; - -import javax.inject.Inject; - -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.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.osgi.framework.BundleContext; - -/** - * Invoke UDT Test inside configured OSGI framework. - */ -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class NioUdtMessageRendezvousChannelIT extends - NioUdtMessageRendezvousChannelTest { - - @Inject - private BundleContext bundleContext; - - @Configuration - public Option[] config() { - - return UnitHelp.config( - - /** install UDT tests bundle */ - wrappedBundle(maven().groupId("io.netty") - .artifactId("netty-transport-udt").classifier("tests") - .versionAsInProject()), - - /** install tests dependency */ - wrappedBundle(maven().groupId("com.yammer.metrics") - .artifactId("metrics-core").versionAsInProject()), - /** install tests dependency */ - wrappedBundle(maven().groupId("com.google.caliper") - .artifactId("caliper").versionAsInProject()) - - ); - } - - @Test - public void verify() throws Exception { - assertNotNull(bundleContext); - super.basicEcho(); - } - -} diff --git a/testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/UnitHelp.java b/testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/UnitHelp.java deleted file mode 100644 index cae5d4a61e..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/src/test/java/io/netty/verify/osgi/UnitHelp.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - -import static org.ops4j.pax.exam.CoreOptions.*; - -import java.util.Arrays; -import java.util.List; - -import org.ops4j.pax.exam.Option; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.wiring.BundleWire; -import org.osgi.framework.wiring.BundleWiring; - -/** - * Unit Test Utilities. - */ -public final class UnitHelp { - - private UnitHelp() { - } - - /** - * Default framework test configuration. - */ - public static Option[] config() { - return options( - - /** set test logging level inside osgi container */ - systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level") - .value("INFO"), - - /** install logging */ - // mavenBundle().groupId("org.ops4j.pax.logging").artifactId( - // "pax-logging-api"), - // mavenBundle().groupId("org.ops4j.pax.logging").artifactId( - // "pax-logging-service"), - - /** install scr runtime provider */ - mavenBundle("org.apache.felix", "org.apache.felix.scr") - .versionAsInProject(), - - /** install netty bundle */ - mavenBundle("io.netty", "netty-common").versionAsInProject(), - - /** install netty bundle */ - mavenBundle("io.netty", "netty-buffer").versionAsInProject(), - - /** install netty bundle */ - mavenBundle("io.netty", "netty-codec").versionAsInProject(), - - /** install netty bundle */ - mavenBundle("io.netty", "netty-codec-http") - .versionAsInProject(), - - /** install netty bundle */ - mavenBundle("io.netty", "netty-codec-socks") - .versionAsInProject(), - - /** install netty bundle */ - mavenBundle("io.netty", "netty-handler").versionAsInProject(), - - /** install netty bundle */ - mavenBundle("io.netty", "netty-transport").versionAsInProject(), - - /** - * DO NOT install netty-transport-rxtx bundle due to rxtx - * depencency: - *

- * 1) rxtx does not have automatic native library loader - *

- * 2) rxtx does not have osgi bundle - */ - // mavenBundle("io.netty", "netty-transport-rxtx") - // .versionAsInProject(), - - /** install netty bundle */ - mavenBundle("io.netty", "netty-transport-sctp") - .versionAsInProject(), - - /** install netty bundle with dependency */ - mavenBundle("io.netty", "netty-transport-udt") - .versionAsInProject(), - mavenBundle("com.barchart.udt", "barchart-udt-bundle") - .versionAsInProject(), - - /** install this module bundle */ - bundle("reference:file:target/classes"), - - /** install java unit bundles */ - junitBundles()); - } - - /** - * Combine default framework options with custom options. - */ - public static Option[] config(final Option... options) { - return concat(config(), options); - } - - /** - * Concatenate generic arrays. - */ - public static T[] concat(final T[] first, final T[] second) { - final T[] result = Arrays.copyOf(first, first.length + second.length); - System.arraycopy(second, 0, result, first.length, second.length); - return result; - } - - /** - * Display bundle dependencies. - */ - public static void logBundleWires(final BundleContext context) { - for (final Bundle bundle : context.getBundles()) { - final BundleWiring wiring = bundle.adapt(BundleWiring.class); - System.out.println("# bundle=" + bundle); - final List provided = wiring.getProvidedWires(null); - for (final BundleWire wire : provided) { - System.out.println("# provided=" + wire); - } - final List required = wiring.getRequiredWires(null); - for (final BundleWire wire : required) { - System.out.println("# required=" + wire); - } - } - } - -} diff --git a/testsuite-osgi/testsuite-osgi-exam/src/test/resources/logback-test.xml b/testsuite-osgi/testsuite-osgi-exam/src/test/resources/logback-test.xml deleted file mode 100644 index 24423b51c0..0000000000 --- a/testsuite-osgi/testsuite-osgi-exam/src/test/resources/logback-test.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - //%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - target/test.log - - //%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - - diff --git a/testsuite-osgi/testsuite-osgi-split/README.md b/testsuite-osgi/testsuite-osgi-split/README.md deleted file mode 100644 index 69097b799b..0000000000 --- a/testsuite-osgi/testsuite-osgi-split/README.md +++ /dev/null @@ -1,17 +0,0 @@ -### info - -this module build will fail if any dependencies introduce osgi split package - -http://wiki.osgi.org/wiki/Split_Packages - -on failure, build log will show error message similar to the following: - -``` -[INFO] --- maven-bundle-plugin:2.3.7:bundle (default-bundle) @ netty-verify-osgi --- -[ERROR] Bundle io.netty:netty-verify-osgi:bundle:4.0.0.Beta1-SNAPSHOT : Split package io/netty/buffer -Use directive -split-package:=(merge-first|merge-last|error|first) on Export/Private Package instruction to get rid of this warning -Package found in [Jar:netty-buffer, Jar:netty-transport-udt] -Reference from /home/user1/.m2/repository/io/netty/netty-transport-udt/4.0.0.Beta1-SNAPSHOT/netty-transport-udt-4.0.0.Beta1-SNAPSHOT.jar -Classpath [Jar:., Jar:netty-buffer, Jar:netty-codec, Jar:netty-codec-http, Jar:netty-codec-socks, Jar:netty-common, Jar:netty-handler, Jar:netty-transport, Jar:netty-transport-rxtx, Jar:rxtx, Jar:netty-transport-sctp, Jar:netty-transport-udt, Jar:barchart-udt-bundle] -[ERROR] Error(s) found in bundle configuration -``` diff --git a/testsuite-osgi/testsuite-osgi-split/pom.xml b/testsuite-osgi/testsuite-osgi-split/pom.xml deleted file mode 100644 index cc4e887b24..0000000000 --- a/testsuite-osgi/testsuite-osgi-split/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - 4.0.0 - - - io.netty - netty-testsuite-osgi-parent - 4.0.13.Final-SNAPSHOT - - - netty-testsuite-osgi-split - bundle - - Netty/Testsuite/OSGi/Split - verify osgi compliance: prohibit split packages - - - - - - ${project.groupId} - netty-buffer - ${project.version} - - - ${project.groupId} - netty-codec - ${project.version} - - - ${project.groupId} - netty-codec-http - ${project.version} - - - ${project.groupId} - netty-codec-socks - ${project.version} - - - ${project.groupId} - netty-common - ${project.version} - - - ${project.groupId} - netty-handler - ${project.version} - - - ${project.groupId} - netty-transport - ${project.version} - - - ${project.groupId} - netty-transport-rxtx - ${project.version} - - - ${project.groupId} - netty-transport-sctp - ${project.version} - - - ${project.groupId} - netty-transport-udt - ${project.version} - - - - - - - - - - org.apache.felix - maven-bundle-plugin - - - - !META-INF, - *;-split-package:=error - - - - - - - - maven-deploy-plugin - - true - - - - - - diff --git a/testsuite-osgi/testsuite-osgi-split/src/main/java/io/netty/verify/osgi/Dummy.java b/testsuite-osgi/testsuite-osgi-split/src/main/java/io/netty/verify/osgi/Dummy.java deleted file mode 100644 index f87020c7a7..0000000000 --- a/testsuite-osgi/testsuite-osgi-split/src/main/java/io/netty/verify/osgi/Dummy.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - -/** - * Placeholder class to generate valid OSGI bundle. - *

- * maven-bundle-plugin enforces OSGI specification and rejects to build non - * fragment bundles which export no packages / no classes. - */ -public class Dummy { - -} diff --git a/testsuite-osgi/testsuite-osgi-split/src/main/java/io/netty/verify/osgi/package-info.java b/testsuite-osgi/testsuite-osgi-split/src/main/java/io/netty/verify/osgi/package-info.java deleted file mode 100644 index 0ccefab6dd..0000000000 --- a/testsuite-osgi/testsuite-osgi-split/src/main/java/io/netty/verify/osgi/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - diff --git a/testsuite-osgi/testsuite-osgi-split/src/test/java/io/netty/verify/osgi/TestDummy.java b/testsuite-osgi/testsuite-osgi-split/src/test/java/io/netty/verify/osgi/TestDummy.java deleted file mode 100644 index fc59ce03c7..0000000000 --- a/testsuite-osgi/testsuite-osgi-split/src/test/java/io/netty/verify/osgi/TestDummy.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2013 The Netty Project - * - * The Netty Project 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 io.netty.verify.osgi; - -/** - * Placeholder class. - */ -public class TestDummy { - -} diff --git a/transport-rxtx/pom.xml b/transport-rxtx/pom.xml index 4a42ae2403..7bb23cc9ec 100644 --- a/transport-rxtx/pom.xml +++ b/transport-rxtx/pom.xml @@ -25,7 +25,7 @@ netty-transport-rxtx - bundle + jar Netty/Transport/RXTX @@ -46,5 +46,5 @@ rxtx - + diff --git a/transport-sctp/pom.xml b/transport-sctp/pom.xml index 7fdd26fd71..10e8e5ed4d 100644 --- a/transport-sctp/pom.xml +++ b/transport-sctp/pom.xml @@ -24,7 +24,7 @@ netty-transport-sctp - bundle + jar Netty/Transport/SCTP @@ -48,7 +48,6 @@ - org.apache.maven.plugins maven-jar-plugin @@ -59,10 +58,7 @@ - - - diff --git a/transport-udt/pom.xml b/transport-udt/pom.xml index 4c27f0f9f5..ccea253bbe 100644 --- a/transport-udt/pom.xml +++ b/transport-udt/pom.xml @@ -25,7 +25,7 @@ netty-transport-udt - bundle + jar Netty/Transport/UDT @@ -85,7 +85,6 @@ - org.apache.maven.plugins @@ -98,7 +97,7 @@ - + diff --git a/transport/pom.xml b/transport/pom.xml index 85cf7dd638..78b764428d 100644 --- a/transport/pom.xml +++ b/transport/pom.xml @@ -24,7 +24,7 @@ netty-transport - bundle + jar Netty/Transport @@ -35,6 +35,5 @@ ${project.version} -