logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1522753 - in /logging/log4j/log4j2/trunk: ./ log4j-1.2-api/ log4j-1.2-api/src/test/java/org/apache/log4j/osgi/ log4j-1.2-api/src/test/java/org/apache/log4j/osgi/equinox/ log4j-1.2-api/src/test/java/org/apache/log4j/osgi/felix/ log4j-api/ l...
Date Fri, 13 Sep 2013 00:57:22 GMT
Author: ggregory
Date: Fri Sep 13 00:57:22 2013
New Revision: 1522753

URL: http://svn.apache.org/r1522753
Log:
OSGi tests for API, API-1.2 and CORE, using Apache Felix and Eclipse Equinox as embedded OSGi
containers. Note that all tests except the API tests are @Ignore due to reported bugs.

Added:
    logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/
    logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/equinox/
    logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/equinox/EquinoxLoadApi12BundleTest.java
  (with props)
    logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/felix/
    logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/felix/FelixLoadApi12BundleTest.java
  (with props)
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/AbstractLoadBundleTest.java
  (with props)
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/BundleTestInfo.java
  (with props)
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/AbstractEquinoxLoadBundleTest.java
  (with props)
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/EquinoxLoadApiBundleTest.java
  (with props)
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/AbstractFelixLoadBundleTest.java
  (with props)
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/FelixLoadApiBundleTest.java
  (with props)
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java
  (with props)
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java
  (with props)
Modified:
    logging/log4j/log4j2/trunk/BUILDING.txt
    logging/log4j/log4j2/trunk/log4j-1.2-api/   (props changed)
    logging/log4j/log4j2/trunk/log4j-1.2-api/pom.xml
    logging/log4j/log4j2/trunk/log4j-api/   (props changed)
    logging/log4j/log4j2/trunk/log4j-api/pom.xml
    logging/log4j/log4j2/trunk/log4j-core/   (props changed)
    logging/log4j/log4j2/trunk/log4j-core/pom.xml
    logging/log4j/log4j2/trunk/pom.xml

Modified: logging/log4j/log4j2/trunk/BUILDING.txt
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/BUILDING.txt?rev=1522753&r1=1522752&r2=1522753&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/BUILDING.txt (original)
+++ logging/log4j/log4j2/trunk/BUILDING.txt Fri Sep 13 00:57:22 2013
@@ -17,4 +17,14 @@ mvn site:stage-deploy -DstagingSiteURL=f
 
 To test, run:
 
+mvn test
+
+Then, to test OSGi, you must first create the jars:
+
+mvn install -DskipTests
+mvn package -DskipTests
+
+Next, you can run the tests as usual, which will pick up the jar files to use as OSGi bundles
from the various target 
+directories:
+
 mvn test
\ No newline at end of file

Propchange: logging/log4j/log4j2/trunk/log4j-1.2-api/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Sep 13 00:57:22 2013
@@ -5,3 +5,4 @@ target
 .classpath
 .project
 .pmd
+felix-cache

Modified: logging/log4j/log4j2/trunk/log4j-1.2-api/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-1.2-api/pom.xml?rev=1522753&r1=1522752&r2=1522753&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-1.2-api/pom.xml (original)
+++ logging/log4j/log4j2/trunk/log4j-1.2-api/pom.xml Fri Sep 13 00:57:22 2013
@@ -38,12 +38,29 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <!-- Place Felix before Equinox because Felix is signed. -->
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.framework</artifactId>
+      <scope>test</scope>
+    </dependency>    
+    <dependency>
+      <groupId>org.eclipse.osgi</groupId>
+      <artifactId>org.eclipse.osgi</artifactId>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
     </dependency>
     <dependency>

Added: logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/equinox/EquinoxLoadApi12BundleTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/equinox/EquinoxLoadApi12BundleTest.java?rev=1522753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/equinox/EquinoxLoadApi12BundleTest.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/equinox/EquinoxLoadApi12BundleTest.java
Fri Sep 13 00:57:22 2013
@@ -0,0 +1,36 @@
+/*
+ * 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.log4j.osgi.equinox;
+
+import org.apache.logging.log4j.osgi.equinox.AbstractEquinoxLoadBundleTest;
+import org.junit.Assume;
+import org.junit.Ignore;
+
+/**
+ * Tests loading the Core bundle into an Eclipse Equinox OSGi container.
+ * <p>
+ * Requires that "mvn package" has been previously run, otherwise test fails its JUnit {@link
Assume}.
+ * </p>
+ * <p>
+ * For example, on Windows: "mvn clean package -DskipTests & mvn test"
+ * </p>
+ */
+@Ignore
+public class EquinoxLoadApi12BundleTest extends AbstractEquinoxLoadBundleTest {
+
+    // more?
+}

Propchange: logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/equinox/EquinoxLoadApi12BundleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/equinox/EquinoxLoadApi12BundleTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/felix/FelixLoadApi12BundleTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/felix/FelixLoadApi12BundleTest.java?rev=1522753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/felix/FelixLoadApi12BundleTest.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/felix/FelixLoadApi12BundleTest.java
Fri Sep 13 00:57:22 2013
@@ -0,0 +1,36 @@
+/*
+ * 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.log4j.osgi.felix;
+
+import org.apache.logging.log4j.osgi.felix.AbstractFelixLoadBundleTest;
+import org.junit.Assume;
+import org.junit.Ignore;
+
+/**
+ * Tests loading the Core bundle into an Apache Felix OSGi container.
+ * <p>
+ * Requires that "mvn package" has been previously run, otherwise test fails its JUnit {@link
Assume}.
+ * </p>
+ * <p>
+ * For example, on Windows: "mvn clean package -DskipTests & mvn test"
+ * </p>
+ */
+@Ignore
+public class FelixLoadApi12BundleTest extends AbstractFelixLoadBundleTest {
+
+    // more?
+}

Propchange: logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/felix/FelixLoadApi12BundleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-1.2-api/src/test/java/org/apache/log4j/osgi/felix/FelixLoadApi12BundleTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: logging/log4j/log4j2/trunk/log4j-api/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Sep 13 00:57:22 2013
@@ -5,3 +5,4 @@ target
 .classpath
 .project
 .pmd
+felix-cache

Modified: logging/log4j/log4j2/trunk/log4j-api/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/pom.xml?rev=1522753&r1=1522752&r2=1522753&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/pom.xml (original)
+++ logging/log4j/log4j2/trunk/log4j-api/pom.xml Fri Sep 13 00:57:22 2013
@@ -43,10 +43,37 @@
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>
+    </dependency>    
+    <!-- Place Felix before Equinox because Felix is signed. -->
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.framework</artifactId>
+      <scope>test</scope>
+    </dependency>    
+    <dependency>
+      <groupId>org.eclipse.osgi</groupId>
+      <artifactId>org.eclipse.osgi</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <scope>test</scope>
     </dependency>
   </dependencies>
   <build>
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
       <!-- Include the standard NOTICE and LICENSE -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>

Added: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/AbstractLoadBundleTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/AbstractLoadBundleTest.java?rev=1522753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/AbstractLoadBundleTest.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/AbstractLoadBundleTest.java
Fri Sep 13 00:57:22 2013
@@ -0,0 +1,117 @@
+/*
+ * 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;
+
+import java.io.File;
+
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * Tests loading a bundle into an OSGi container.
+ * <p>
+ * Requires that "mvn package" has been previously run, otherwise test fails its JUnit {@link
Assume}.
+ * </p>
+ * <p>
+ * For example, on Windows: "mvn clean package -DskipTests & mvn test"
+ * </p>
+ */
+public abstract class AbstractLoadBundleTest {
+
+    protected static Framework OsgiFramework;
+
+    /**
+     * Uninstalls the OSGi framework.
+     * 
+     * @throws BundleException
+     */
+    @AfterClass
+    public static void afterClass() throws BundleException {
+        if (OsgiFramework != null) {
+            OsgiFramework.stop();
+            OsgiFramework = null;
+        }
+    }
+
+    private final BundleTestInfo bundleTestInfo;
+
+    /**
+     * Constructs a test for a given bundle.
+     */
+    public AbstractLoadBundleTest() {
+        super();
+        this.bundleTestInfo = new BundleTestInfo();
+    }
+
+    /**
+     * Called before each @Test.
+     */
+    @Before
+    public void before() {
+        final String bundlePath = getBundlePath();
+        Assume.assumeNotNull(bundlePath);
+        final File file = new File(bundlePath);
+        Assume.assumeTrue("File does not exist: " + file.getAbsolutePath() + ". Run 'mvn
package' before 'mvn test'",
+                file.exists());
+    }
+
+    protected String getBundlePath() {
+        return "target/" + bundleTestInfo.getArtifactId() + "-" + bundleTestInfo.getVersion()
+ ".jar";
+    }
+
+    /**
+     * Gets the expected bundle symbolic name.
+     * 
+     * @return the expected bundle symbolic name.
+     */
+    public String getExpectedBundleSymbolicName() {
+        return "org.apache.logging." + bundleTestInfo.getArtifactId();
+    }
+
+    /**
+     * Loads, starts, and stops a bundle.
+     * 
+     * @throws BundleException
+     */
+    @Test
+    public void testLoadStartStop() throws BundleException {
+        final BundleContext bundleContext = OsgiFramework.getBundleContext();
+        final Bundle bundle = bundleContext.installBundle("file:" + getBundlePath());
+        Assert.assertNotNull("Error loading bundle: null returned", bundle);
+        Assert.assertEquals("Error loading bundle: symbolic name mismatch", getExpectedBundleSymbolicName(),
+                bundle.getSymbolicName());
+        Assert.assertEquals("Bundle is not in INSTALLED state", Bundle.INSTALLED, bundle.getState());
+
+        // sanity check: start and stop bundle
+        bundle.start();
+        Assert.assertEquals("Bundle is not in ACTIVE state", Bundle.ACTIVE, bundle.getState());
+        bundle.stop();
+        Assert.assertEquals("Bundle is not in RESOLVED state", Bundle.RESOLVED, bundle.getState());
+        bundle.start();
+        Assert.assertEquals("Bundle is not in ACTIVE state", Bundle.ACTIVE, bundle.getState());
+        bundle.stop();
+        Assert.assertEquals("Bundle is not in RESOLVED state", Bundle.RESOLVED, bundle.getState());
+    }
+
+}

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/AbstractLoadBundleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/AbstractLoadBundleTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/BundleTestInfo.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/BundleTestInfo.java?rev=1522753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/BundleTestInfo.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/BundleTestInfo.java
Fri Sep 13 00:57:22 2013
@@ -0,0 +1,84 @@
+/*
+ * 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;
+
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+/**
+ * Provides tests with bundle information. Reads the {@code pom.xml} in the current directory
to get project settings.
+ */
+public class BundleTestInfo {
+
+    private final MavenProject project;
+
+    /**
+     * Constructs a new helper objects and initializes itself.
+     */
+    public BundleTestInfo() {
+        // get a raw POM view, not a fully realized POM object.
+        MavenXpp3Reader reader = new MavenXpp3Reader();
+        FileReader fileReader;
+        final String fileName = "pom.xml";
+        try {
+            fileReader = new FileReader(fileName);
+        } catch (FileNotFoundException e) {
+            throw new IllegalStateException("Could not find " + fileName, e);
+        }
+        try {
+            Model model = reader.read(fileReader);
+            this.project = new MavenProject(model);
+        } catch (FileNotFoundException e) {
+            throw new IllegalStateException(e);
+        } catch (IOException e) {
+            throw new IllegalStateException(e);
+        } catch (XmlPullParserException e) {
+            throw new IllegalStateException(e);
+        } finally {
+            try {
+                fileReader.close();
+            } catch (IOException e) {
+                throw new IllegalStateException(e);
+            }
+        }
+    }
+
+    /**
+     * Gets the Maven artifact ID.
+     * 
+     * @return the Maven artifact ID.
+     */
+    public String getArtifactId() {
+        return project.getArtifactId();
+    }
+
+    /**
+     * Gets the Maven version String.
+     * 
+     * @return the Maven version String.
+     */
+    public String getVersion() {
+        return project.getVersion();
+    }
+
+}

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/BundleTestInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/BundleTestInfo.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/AbstractEquinoxLoadBundleTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/AbstractEquinoxLoadBundleTest.java?rev=1522753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/AbstractEquinoxLoadBundleTest.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/AbstractEquinoxLoadBundleTest.java
Fri Sep 13 00:57:22 2013
@@ -0,0 +1,51 @@
+/*
+ * 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.equinox;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.logging.log4j.osgi.AbstractLoadBundleTest;
+import org.eclipse.osgi.launch.EquinoxFactory;
+import org.junit.BeforeClass;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * Tests loading the Core bundle into an Eclipse Equinox OSGi container.
+ */
+public abstract class AbstractEquinoxLoadBundleTest extends AbstractLoadBundleTest {
+
+    /**
+     * Initializes the OSGi framework.
+     * 
+     * @throws BundleException
+     */
+    @BeforeClass
+    public static void initOsgiFramework() throws BundleException {
+        final FrameworkFactory factory = new EquinoxFactory();
+        final Map<String, String> configMap = new HashMap<String, String>(2);
+        // Cleans framework before first init. Subsequent init invocations do not clean framework.
+        configMap.put("org.osgi.framework.storage.clean", "onFirstInit");
+        // Delegates loading of endorsed libraries to JVM classloader
+        // config.put("org.osgi.framework.bootdelegation", "javax.*,org.w3c.*,org.xml.*");
+        OsgiFramework = factory.newFramework(configMap);
+        OsgiFramework.init();
+        OsgiFramework.start();
+    }
+
+}

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/AbstractEquinoxLoadBundleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/AbstractEquinoxLoadBundleTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/EquinoxLoadApiBundleTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/EquinoxLoadApiBundleTest.java?rev=1522753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/EquinoxLoadApiBundleTest.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/EquinoxLoadApiBundleTest.java
Fri Sep 13 00:57:22 2013
@@ -0,0 +1,32 @@
+/*
+ * 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.equinox;
+
+import org.junit.Assume;
+
+/**
+ * Tests loading the Core bundle into an Eclipse Equinox OSGi container.
+ * 
+ * Requires that "mvn package" has been previously run, otherwise test fails its JUnit {@link
Assume}.
+ * <p>
+ * For example, on Windows: "mvn clean package -DskipTests & mvn test"
+ * </p>
+ */
+public class EquinoxLoadApiBundleTest extends AbstractEquinoxLoadBundleTest {
+
+    // more?
+}

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/EquinoxLoadApiBundleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/equinox/EquinoxLoadApiBundleTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/AbstractFelixLoadBundleTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/AbstractFelixLoadBundleTest.java?rev=1522753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/AbstractFelixLoadBundleTest.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/AbstractFelixLoadBundleTest.java
Fri Sep 13 00:57:22 2013
@@ -0,0 +1,57 @@
+/*
+ * 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.felix;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.logging.log4j.osgi.AbstractLoadBundleTest;
+import org.junit.Assume;
+import org.junit.BeforeClass;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * Tests loading the Core bundle into an Apache Felix OSGi container.
+ * <p>
+ * Requires that "mvn package" has been previously run, otherwise test fails its JUnit {@link
Assume}.
+ * </p>
+ * <p>
+ * For example, on Windows: "mvn clean package -DskipTests & mvn test"
+ * </p>
+ */
+public abstract class AbstractFelixLoadBundleTest extends AbstractLoadBundleTest {
+
+    /**
+     * Initializes the OSGi framework.
+     * 
+     * @throws BundleException
+     */
+    @BeforeClass
+    public static void initOsgiFramework() throws BundleException {
+        final FrameworkFactory factory = new org.apache.felix.framework.FrameworkFactory();
+        final Map<String, String> configMap = new HashMap<String, String>(2);
+        // Cleans framework before first init. Subsequent init invocations do not clean framework.
+        configMap.put("org.osgi.framework.storage.clean", "onFirstInit");
+        // Delegates loading of endorsed libraries to JVM classloader
+        // config.put("org.osgi.framework.bootdelegation", "javax.*,org.w3c.*,org.xml.*");
+        OsgiFramework = factory.newFramework(configMap);
+        OsgiFramework.init();
+        OsgiFramework.start();
+    }
+
+}

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/AbstractFelixLoadBundleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/AbstractFelixLoadBundleTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/FelixLoadApiBundleTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/FelixLoadApiBundleTest.java?rev=1522753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/FelixLoadApiBundleTest.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/FelixLoadApiBundleTest.java
Fri Sep 13 00:57:22 2013
@@ -0,0 +1,32 @@
+/*
+ * 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.felix;
+
+import org.junit.Assume;
+
+/**
+ * Tests loading the Core bundle into an Apache Felix OSGi container.
+ * <p>
+ * Requires that "mvn package" has been previously run, otherwise test fails its JUnit {@link
Assume}.
+ * </p>
+ * <p>
+ * For example, on Windows: "mvn clean package -DskipTests & mvn test"
+ * </p>
+ */
+public class FelixLoadApiBundleTest extends AbstractFelixLoadBundleTest {
+    // more?
+}

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/FelixLoadApiBundleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/osgi/felix/FelixLoadApiBundleTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: logging/log4j/log4j2/trunk/log4j-core/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Sep 13 00:57:22 2013
@@ -4,3 +4,4 @@ target
 .classpath
 .project
 .pmd
+felix-cache

Modified: logging/log4j/log4j2/trunk/log4j-core/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/pom.xml?rev=1522753&r1=1522752&r2=1522753&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/pom.xml (original)
+++ logging/log4j/log4j2/trunk/log4j-core/pom.xml Fri Sep 13 00:57:22 2013
@@ -38,6 +38,12 @@
       <artifactId>log4j-api</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>core</artifactId>
       <scope>provided</scope>
@@ -164,6 +170,16 @@
       <version>3.2.4.RELEASE</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.eclipse.osgi</groupId>
+      <artifactId>org.eclipse.osgi</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.framework</artifactId>
+      <scope>test</scope>
+    </dependency>    
   </dependencies>
   <build>
     <plugins>

Added: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java?rev=1522753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java
Fri Sep 13 00:57:22 2013
@@ -0,0 +1,36 @@
+/*
+ * 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.core.osgi.equinox;
+
+import org.apache.logging.log4j.osgi.equinox.AbstractEquinoxLoadBundleTest;
+import org.junit.Assume;
+import org.junit.Ignore;
+
+/**
+ * Tests loading the Core bundle into an Eclipse Equinox OSGi container.
+ * <p>
+ * Requires that "mvn package" has been previously run, otherwise test fails its JUnit {@link
Assume}.
+ * </p>
+ * <p>
+ * For example, on Windows: "mvn clean package -DskipTests & mvn test"
+ * </p>
+ */
+@Ignore
+public class EquinoxLoadCoreBundleTest extends AbstractEquinoxLoadBundleTest {
+
+    // more?
+}

Propchange: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java?rev=1522753&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java
Fri Sep 13 00:57:22 2013
@@ -0,0 +1,36 @@
+/*
+ * 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.core.osgi.felix;
+
+import org.apache.logging.log4j.osgi.felix.AbstractFelixLoadBundleTest;
+import org.junit.Assume;
+import org.junit.Ignore;
+
+/**
+ * Tests loading the Core bundle into an Apache Felix OSGi container.
+ * <p>
+ * Requires that "mvn package" has been previously run, otherwise test fails its JUnit {@link
Assume}.
+ * </p>
+ * <p>
+ * For example, on Windows: "mvn clean package -DskipTests & mvn test"
+ * </p>
+ */
+@Ignore
+public class FelixLoadCoreBundleTest extends AbstractFelixLoadBundleTest {
+
+    // more?
+}

Propchange: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: logging/log4j/log4j2/trunk/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/pom.xml?rev=1522753&r1=1522752&r2=1522753&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/pom.xml (original)
+++ logging/log4j/log4j2/trunk/pom.xml Fri Sep 13 00:57:22 2013
@@ -190,6 +190,24 @@
         <scope>test</scope>
       </dependency>
       <dependency>
+        <groupId>org.eclipse.osgi</groupId>
+        <artifactId>org.eclipse.osgi</artifactId>
+        <version>3.6.0.v20100517</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.framework</artifactId>
+        <version>4.2.1</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-core</artifactId>
+        <version>3.1.0</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
         <groupId>ch.qos.logback</groupId>
         <artifactId>logback-classic</artifactId>
         <version>${logback.version}</version>
@@ -207,6 +225,12 @@
       </dependency>
       <dependency>
         <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-api</artifactId>
+        <version>${project.version}</version>
+        <type>test-jar</type>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-core</artifactId>
         <version>${project.version}</version>
       </dependency>



Mime
View raw message