Repository: logging-log4j2
Updated Branches:
  refs/heads/master ad2ee803e -> ae6d9c15b


Minor refactoring in test framework.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ae6d9c15
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ae6d9c15
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ae6d9c15

Branch: refs/heads/master
Commit: ae6d9c15b0e8e9a754e5396a4ee968f7465efc3e
Parents: ad2ee80
Author: Gary Gregory <garydgreg...@gmail.com>
Authored: Wed Feb 7 10:41:05 2018 -0700
Committer: Gary Gregory <garydgreg...@gmail.com>
Committed: Wed Feb 7 10:41:05 2018 -0700

----------------------------------------------------------------------
 .../logging/log4j/osgi/tests/AbstractLoadBundleTest.java     | 8 ++++----
 .../logging/log4j/osgi/tests/junit/BundleTestInfo.java       | 5 ++++-
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ae6d9c15/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
----------------------------------------------------------------------
diff --git 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
index 6edf48a..80f4dc7 100644
--- 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
+++ 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java
@@ -66,23 +66,23 @@ public abstract class AbstractLoadBundleTest {
     }
 
     private Bundle getApiBundle() throws BundleException {
-        final Path apiPath = 
here.resolveSibling("log4j-api").resolve("target").resolve("log4j-api-" + 
bundleTestInfo.getVersion() + ".jar");
+        final Path apiPath = 
here.resolveSibling("log4j-api").resolve("target").resolve(bundleTestInfo.buildJarFileName("log4j-api"));
         return bundleContext.installBundle(apiPath.toUri().toString());
     }
 
 
     private Bundle getCoreBundle() throws BundleException {
-        final Path corePath = 
here.resolveSibling("log4j-core").resolve("target").resolve("log4j-core-" + 
bundleTestInfo.getVersion() + ".jar");
+        final Path corePath = 
here.resolveSibling("log4j-core").resolve("target").resolve(bundleTestInfo.buildJarFileName("log4j-core"));
         return bundleContext.installBundle(corePath.toUri().toString());
     }
     
     private Bundle getDummyBundle() throws BundleException {
-        final Path dumyPath = 
here.resolveSibling("log4j-samples").resolve("log4j-samples-configuration").resolve("target").resolve("log4j-samples-configuration-"
 + bundleTestInfo.getVersion() + ".jar");
+        final Path dumyPath = 
here.resolveSibling("log4j-samples").resolve("log4j-samples-configuration").resolve("target").resolve(bundleTestInfo.buildJarFileName("log4j-samples-configuration"));
         return bundleContext.installBundle(dumyPath.toUri().toString());
     }
 
     private Bundle get12ApiBundle() throws BundleException {
-        final Path apiPath = 
here.resolveSibling("log4j-1.2-api").resolve("target").resolve("log4j-1.2-api-" 
+ bundleTestInfo.getVersion() + ".jar");
+        final Path apiPath = 
here.resolveSibling("log4j-1.2-api").resolve("target").resolve(bundleTestInfo.buildJarFileName("log4j-1.2-api"));
         return bundleContext.installBundle(apiPath.toUri().toString());
     }
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ae6d9c15/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/BundleTestInfo.java
----------------------------------------------------------------------
diff --git 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/BundleTestInfo.java
 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/BundleTestInfo.java
index 9a4f8a8..0259616 100644
--- 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/BundleTestInfo.java
+++ 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/BundleTestInfo.java
@@ -45,6 +45,10 @@ public class BundleTestInfo {
         }
     }
 
+    public String buildJarFileName(final String artifactId) {
+        return artifactId + "-" + getVersion() + ".jar";
+    }
+
     /**
      * Gets the Maven artifact ID.
      *
@@ -67,5 +71,4 @@ public class BundleTestInfo {
     public String toString() {
         return "BundleTestInfo [project=" + project + "]";
     }
-
 }

Reply via email to