logging-log4j2 git commit: Refactoring in test framework before porting to Apache Commons Testing.

2018-02-07 Thread ggregory
Repository: logging-log4j2
Updated Branches:
  refs/heads/master c7c7aaa46 -> 113611db5


Refactoring in test framework before porting to Apache Commons Testing.

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

Branch: refs/heads/master
Commit: 113611db542cf6566909239323a5795927e8d3cf
Parents: c7c7aaa
Author: Gary Gregory 
Authored: Wed Feb 7 12:01:24 2018 -0700
Committer: Gary Gregory 
Committed: Wed Feb 7 12:01:24 2018 -0700

--
 .../apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java   | 3 ---
 1 file changed, 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/113611db/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 8b0a665..5b63c65 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
@@ -26,7 +26,6 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
-import org.osgi.framework.launch.FrameworkFactory;
 
 /**
  * Tests a basic Log4J 'setup' in an OSGi container.
@@ -55,8 +54,6 @@ public abstract class AbstractLoadBundleTest extends 
AbstractOsgiTest {
 }
 
 
-protected abstract FrameworkFactory getFactory();
-
 private void log(final Bundle dummy) throws ReflectiveOperationException {
 // use reflection to log in the context of the dummy bundle
 



logging-log4j2 git commit: Javadoc.

2018-02-07 Thread ggregory
Repository: logging-log4j2
Updated Branches:
  refs/heads/master 9774e05ec -> c7c7aaa46


Javadoc.

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

Branch: refs/heads/master
Commit: c7c7aaa460ba0f387abf9079415c0ad9576d2fd3
Parents: 9774e05
Author: Gary Gregory 
Authored: Wed Feb 7 11:51:55 2018 -0700
Committer: Gary Gregory 
Committed: Wed Feb 7 11:51:55 2018 -0700

--
 .../java/org/apache/logging/log4j/osgi/tests/AbstractOsgiTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c7c7aaa4/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractOsgiTest.java
--
diff --git 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractOsgiTest.java
 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractOsgiTest.java
index bd47a89..a717c46 100644
--- 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractOsgiTest.java
+++ 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/AbstractOsgiTest.java
@@ -27,7 +27,7 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.launch.FrameworkFactory;
 
 /**
- * Tests a basic Log4J 'setup' in an OSGi container.
+ * Subclasses can tests a basic setup in an OSGi container.
  */
 public abstract class AbstractOsgiTest {
 



logging-log4j2 git commit: Refactoring in test framework before porting to Apache Commons Testing.

2018-02-07 Thread ggregory
Repository: logging-log4j2
Updated Branches:
  refs/heads/master ae6d9c15b -> 9774e05ec


Refactoring in test framework before porting to Apache Commons Testing.

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

Branch: refs/heads/master
Commit: 9774e05ec9d3cd2394e5736fb8902b90c54e4165
Parents: ae6d9c1
Author: Gary Gregory 
Authored: Wed Feb 7 11:51:20 2018 -0700
Committer: Gary Gregory 
Committed: Wed Feb 7 11:51:20 2018 -0700

--
 .../osgi/tests/AbstractLoadBundleTest.java  | 52 +++---
 .../log4j/osgi/tests/AbstractOsgiTest.java  | 74 
 2 files changed, 84 insertions(+), 42 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9774e05e/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 80f4dc7..8b0a665 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
@@ -21,69 +21,37 @@ import java.io.PrintStream;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 
-import org.apache.logging.log4j.osgi.tests.junit.BundleTestInfo;
-import org.apache.logging.log4j.osgi.tests.junit.OsgiTestRule;
 import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
 import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.launch.FrameworkFactory;
 
 /**
  * Tests a basic Log4J 'setup' in an OSGi container.
  */
-public abstract class AbstractLoadBundleTest {
-
-private BundleContext bundleContext;
-
-private final BundleTestInfo bundleTestInfo;
-
-private Path here;
-
-@Rule
-public OsgiTestRule osgi = new OsgiTestRule(getFactory());
-/**
- * Constructs a test for a given bundle.
- */
-public AbstractLoadBundleTest() {
-super();
-this.bundleTestInfo = new BundleTestInfo();
-}
-
-/**
- * Called before each @Test.
- */
-@Before
-public void before() {
-bundleContext = osgi.getFramework().getBundleContext();
-
-here = Paths.get(".").toAbsolutePath().normalize();
-}
+public abstract class AbstractLoadBundleTest extends AbstractOsgiTest {
 
 private Bundle getApiBundle() throws BundleException {
-final Path apiPath = 
here.resolveSibling("log4j-api").resolve("target").resolve(bundleTestInfo.buildJarFileName("log4j-api"));
-return bundleContext.installBundle(apiPath.toUri().toString());
+final Path apiPath = 
getHere().resolveSibling("log4j-api").resolve("target").resolve(getBundleTestInfo().buildJarFileName("log4j-api"));
+return getBundleContext().installBundle(apiPath.toUri().toString());
 }
 
 
 private Bundle getCoreBundle() throws BundleException {
-final Path corePath = 
here.resolveSibling("log4j-core").resolve("target").resolve(bundleTestInfo.buildJarFileName("log4j-core"));
-return bundleContext.installBundle(corePath.toUri().toString());
+final Path corePath = 
getHere().resolveSibling("log4j-core").resolve("target").resolve(getBundleTestInfo().buildJarFileName("log4j-core"));
+return getBundleContext().installBundle(corePath.toUri().toString());
 }
 
 private Bundle getDummyBundle() throws BundleException {
-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());
+final Path dumyPath = 
getHere().resolveSibling("log4j-samples").resolve("log4j-samples-configuration").resolve("target").resolve(getBundleTestInfo().buildJarFileName("log4j-samples-configuration"));
+return getBundleContext().installBundle(dumyPath.toUri().toString());
 }
 
 private Bundle get12ApiBundle() throws BundleException {
-final Path apiPath = 
here.resolveSibling("log4j-1.2-api").resolve("target").resolve(bundleTestInfo.buildJarFileName("log4j-1.2-api"));
-return 

logging-log4j2 git commit: Minor refactoring in test framework.

2018-02-07 Thread ggregory
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 
Authored: Wed Feb 7 10:41:05 2018 -0700
Committer: Gary Gregory 
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 + "]";
 }
-
 }



logging-log4j2 git commit: Remove exceptions that are not thrown from method signatures.

2018-02-07 Thread ggregory
Repository: logging-log4j2
Updated Branches:
  refs/heads/master 5f248ef7a -> ad2ee803e


Remove exceptions that are not thrown from method signatures.

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

Branch: refs/heads/master
Commit: ad2ee803e0348036349ea776514cf243a7b76fee
Parents: 5f248ef
Author: Gary Gregory 
Authored: Wed Feb 7 10:30:35 2018 -0700
Committer: Gary Gregory 
Committed: Wed Feb 7 10:30:35 2018 -0700

--
 .../apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ad2ee803/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 9882631..6edf48a 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
@@ -59,7 +59,7 @@ public abstract class AbstractLoadBundleTest {
  * Called before each @Test.
  */
 @Before
-public void before() throws BundleException {
+public void before() {
 bundleContext = osgi.getFramework().getBundleContext();
 
 here = Paths.get(".").toAbsolutePath().normalize();
@@ -150,7 +150,7 @@ public abstract class AbstractLoadBundleTest {
  * Tests starting, then stopping, then restarting, then stopping, and 
finally uninstalling the API and Core bundles
  */
 @Test
-public void testApiCoreStartStopStartStop() throws BundleException, 
ReflectiveOperationException {
+public void testApiCoreStartStopStartStop() throws BundleException {
 
 final Bundle api = getApiBundle();
 final Bundle core = getCoreBundle();



logging-log4j2 git commit: Better test class name.

2018-02-07 Thread ggregory
Repository: logging-log4j2
Updated Branches:
  refs/heads/master 3d07263d8 -> 5f248ef7a


Better test class name.

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

Branch: refs/heads/master
Commit: 5f248ef7a498aa5c8cfe3ae9e0bf7ab644890435
Parents: 3d07263
Author: Gary Gregory 
Authored: Wed Feb 7 10:16:26 2018 -0700
Committer: Gary Gregory 
Committed: Wed Feb 7 10:16:26 2018 -0700

--
 .../apache/logging/log4j/osgi/tests/AbstractLoadBundleTest.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5f248ef7/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 dde3f7d..9882631 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
@@ -24,7 +24,7 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 
 import org.apache.logging.log4j.osgi.tests.junit.BundleTestInfo;
-import org.apache.logging.log4j.osgi.tests.junit.OsgiRule;
+import org.apache.logging.log4j.osgi.tests.junit.OsgiTestRule;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Rule;
@@ -46,7 +46,7 @@ public abstract class AbstractLoadBundleTest {
 private Path here;
 
 @Rule
-public OsgiRule osgi = new OsgiRule(getFactory());
+public OsgiTestRule osgi = new OsgiTestRule(getFactory());
 /**
  * Constructs a test for a given bundle.
  */



logging-log4j2 git commit: Better test class name.

2018-02-07 Thread ggregory
Repository: logging-log4j2
Updated Branches:
  refs/heads/master f8479bc53 -> 3d07263d8


Better test class name.

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

Branch: refs/heads/master
Commit: 3d07263d8a1a70c6a64bcb08a5396edb92eafa7b
Parents: f8479bc
Author: Gary Gregory 
Authored: Wed Feb 7 10:14:59 2018 -0700
Committer: Gary Gregory 
Committed: Wed Feb 7 10:14:59 2018 -0700

--
 .../org/apache/logging/log4j/osgi/tests/junit/OsgiTestRule.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3d07263d/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiTestRule.java
--
diff --git 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiTestRule.java
 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiTestRule.java
index 6832157..4e68368 100644
--- 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiTestRule.java
+++ 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiTestRule.java
@@ -28,12 +28,12 @@ import org.osgi.framework.launch.FrameworkFactory;
 /**
  * JUnit rule to initialize and shutdown an OSGi framework.
  */
-public class OsgiRule extends ExternalResource {
+public class OsgiTestRule extends ExternalResource {
 
 private final FrameworkFactory factory;
 private Framework framework;
 
-public OsgiRule(final FrameworkFactory factory) {
+public OsgiTestRule(final FrameworkFactory factory) {
 this.factory = factory;
 }
 



logging-log4j2 git commit: Better test class name.

2018-02-07 Thread ggregory
Repository: logging-log4j2
Updated Branches:
  refs/heads/master a9e8f525a -> f8479bc53


Better test class name.

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

Branch: refs/heads/master
Commit: f8479bc534f68a3a7cd1e1a9babc5d33a66aa805
Parents: a9e8f52
Author: Gary Gregory 
Authored: Wed Feb 7 10:12:08 2018 -0700
Committer: Gary Gregory 
Committed: Wed Feb 7 10:12:08 2018 -0700

--
 .../log4j/osgi/tests/junit/OsgiRule.java| 77 
 .../log4j/osgi/tests/junit/OsgiTestRule.java| 77 
 2 files changed, 77 insertions(+), 77 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f8479bc5/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiRule.java
--
diff --git 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiRule.java
 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiRule.java
deleted file mode 100644
index 6832157..000
--- 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiRule.java
+++ /dev/null
@@ -1,77 +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.
- */
-
-package org.apache.logging.log4j.osgi.tests.junit;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.rules.ExternalResource;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
-
-/**
- * JUnit rule to initialize and shutdown an OSGi framework.
- */
-public class OsgiRule extends ExternalResource {
-
-private final FrameworkFactory factory;
-private Framework framework;
-
-public OsgiRule(final FrameworkFactory factory) {
-this.factory = factory;
-}
-
-@Override
-protected void after() {
-if (framework != null) {
-try {
-framework.stop();
-} catch (final BundleException e) {
-throw new RuntimeException(e);
-} finally {
-framework = null;
-}
-}
-}
-
-@Override
-protected void before() throws Throwable {
-final Map configMap = new HashMap<>(2);
-// Cleans framework before first init. Subsequent init invocations do 
not clean framework.
-configMap.put("org.osgi.framework.storage.clean", "onFirstInit");
-configMap.put("felix.log.level", "4");
-configMap.put("eclipse.log.level", "ALL");
-// Hack to get the build working on Windows. Could try newer versions 
of Felix.
-configMap.put("felix.cache.locking", "false");
-// Delegates loading of endorsed libraries to JVM classloader
-// config.put("org.osgi.framework.bootdelegation", 
"javax.*,org.w3c.*,org.xml.*");
-framework = factory.newFramework(configMap);
-framework.init();
-framework.start();
-}
-
-public Framework getFramework() {
-return framework;
-}
-
-@Override
-public String toString() {
-return "OsgiRule [factory=" + factory + ", framework=" + framework + 
"]";
-}
-}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f8479bc5/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiTestRule.java
--
diff --git 
a/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiTestRule.java
 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiTestRule.java
new file mode 100644
index 000..6832157
--- /dev/null
+++ 
b/log4j-osgi/src/test/java/org/apache/logging/log4j/osgi/tests/junit/OsgiTestRule.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache