openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r777551 - in /openjpa/trunk: ./ openjpa-examples/ openjpa-examples/src/main/java/hellojpa/ openjpa-integration/ openjpa-integration/osgi-itests/ openjpa-integration/osgi-itests/src/ openjpa-integration/osgi-itests/src/test/ openjpa-integrat...
Date Fri, 22 May 2009 14:50:18 GMT
Author: dwoods
Date: Fri May 22 14:50:17 2009
New Revision: 777551

URL: http://svn.apache.org/viewvc?rev=777551&view=rev
Log:
OPENJPA-1062 OSGi integration tests, which are commented out of the builds for now as they
fail and need some more work...

Added:
    openjpa/trunk/openjpa-integration/osgi-itests/
    openjpa/trunk/openjpa-integration/osgi-itests/pom.xml   (with props)
    openjpa/trunk/openjpa-integration/osgi-itests/src/
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/AbstractIntegrationTest.java
  (with props)
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/TestOpenJPA.java
  (with props)
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/resources/
    openjpa/trunk/openjpa-integration/osgi-itests/src/test/resources/log4j.properties   (with
props)
Modified:
    openjpa/trunk/openjpa-examples/pom.xml
    openjpa/trunk/openjpa-examples/src/main/java/hellojpa/Main.java
    openjpa/trunk/openjpa-integration/pom.xml
    openjpa/trunk/openjpa/pom.xml
    openjpa/trunk/pom.xml

Modified: openjpa/trunk/openjpa-examples/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/pom.xml?rev=777551&r1=777550&r2=777551&view=diff
==============================================================================
--- openjpa/trunk/openjpa-examples/pom.xml (original)
+++ openjpa/trunk/openjpa-examples/pom.xml Fri May 22 14:50:17 2009
@@ -55,6 +55,11 @@
             <artifactId>commons-collections</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
     <build>
         <plugins>
@@ -73,6 +78,41 @@
                     </excludes>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-Name>${artifactId}</Bundle-Name>
+                        <Bundle-SymbolicName>${groupId}.${artifactId};singleton=true</Bundle-SymbolicName>
+                        <Bundle-DocURL>http://openjpa.apache.org/documentation.html</Bundle-DocURL>
+                        <Bundle-Activator>hellojpa.Main</Bundle-Activator>
+                        <!-- Eclipse metadata -->
+                        <Eclipse-Autostart>false</Eclipse-Autostart>
+                        <Bundle-ClassPath>.</Bundle-ClassPath>
+                    </instructions>
+                    <unpackBundle>true</unpackBundle>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>bundle-manifest</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>manifest</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>

Modified: openjpa/trunk/openjpa-examples/src/main/java/hellojpa/Main.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/src/main/java/hellojpa/Main.java?rev=777551&r1=777550&r2=777551&view=diff
==============================================================================
--- openjpa/trunk/openjpa-examples/src/main/java/hellojpa/Main.java (original)
+++ openjpa/trunk/openjpa-examples/src/main/java/hellojpa/Main.java Fri May 22 14:50:17 2009
@@ -20,13 +20,15 @@
 
 import java.util.*;
 import javax.persistence.*;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
 
 
 /** 
  * A very simple, stand-alone program that stores a new entity in the
  * database and then performs a query to retrieve it.
  */
-public class Main {
+public class Main implements BundleActivator {
 
     @SuppressWarnings("unchecked")
     public static void main(String[] args) {
@@ -73,4 +75,14 @@
         em2.close();
         factory.close();
     }
+
+    public void start(BundleContext context) {
+        System.out.println("Bundle start");
+        main(null);
+    }
+
+    public void stop(BundleContext context) {
+        System.out.println("Bundle stop");
+    }
 }
+

Added: openjpa/trunk/openjpa-integration/osgi-itests/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-integration/osgi-itests/pom.xml?rev=777551&view=auto
==============================================================================
--- openjpa/trunk/openjpa-integration/osgi-itests/pom.xml (added)
+++ openjpa/trunk/openjpa-integration/osgi-itests/pom.xml Fri May 22 14:50:17 2009
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!--
+    Maven release plugin requires the project tag to be on a single line.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.apache.openjpa</groupId>
+        <artifactId>openjpa-integration</artifactId>
+        <version>2.0.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.openjpa.openjpa-integration</groupId>
+    <artifactId>osgi-itests</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+    <name>OpenJPA Integration osgi-itests</name>
+
+    <dependencies>
+        <!--
+            Note: Scope should be set to test for all depends
+        -->
+        <!-- OpenJPA runtime and depends -->
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa</artifactId>
+            <version>${version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jms_1.1_spec</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jta_1.1_spec</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-validation_1.0_spec</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- Note: Overriding parent versions as these have bundle metadata -->
+        <dependency>
+            <groupId>commons-collections</groupId>
+            <artifactId>commons-collections</artifactId>
+            <version>3.2.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.4</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-pool</groupId>
+            <artifactId>commons-pool</artifactId>
+            <version>1.4</version>
+            <scope>test</scope>
+        </dependency>
+        <!-- Testcase depends -->
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-examples</artifactId>
+            <version>${version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- use the bundlized version of commons-dbcp from servicemix -->
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.commons-dbcp</artifactId>
+            <version>1.2.2_3</version>
+            <scope>test</scope>
+        </dependency>
+        <!-- Test framework depends -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam</artifactId>
+            <version>0.5.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit</artifactId>
+            <version>0.5.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-default</artifactId>
+            <version>0.5.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit-extender-impl</artifactId>
+            <version>0.5.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+            <version>1.3.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-service</artifactId>
+            <version>1.3.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-mvn</artifactId>
+            <version>0.3.3</version>
+            <scope>test</scope>
+        </dependency>
+        <!-- Apache Felix framework -->
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.configadmin</artifactId>
+            <version>1.0.10</version>
+            <scope>test</scope>
+        </dependency>
+        <!-- Note: This depend has to be after all the rest -->
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.main</artifactId>
+            <version>1.6.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <repositories>
+        <repository>
+            <id>ops4j.releases</id>
+            <url>http://repository.ops4j.org/maven2</url>
+        </repository>
+        <repository>
+            <id>ops4j.snapshots</id>
+            <url>http://repository.ops4j.org/mvn-snapshots</url>
+        </repository>
+    </repositories>
+    <pluginRepositories>
+        <pluginRepository>
+            <id>ops4j.releases</id>
+            <url>http://repository.ops4j.org/maven2</url>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/test/resources</directory>
+            </resource>
+            <!-- also include license and notice files in all the jars -->
+            <resource>
+                <directory>${basedir}/../../openjpa-project/</directory>
+                <includes>
+                    <include>NOTICE.txt</include>
+                    <include>LICENSE.txt</include>
+                    <include>DISCLAIMER.txt</include>
+                </includes>
+                <targetPath>META-INF</targetPath>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+                <version>1.1</version>
+                <executions>
+                    <execution>
+                        <id>generate-depends-file</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <forkMode>pertest</forkMode>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Propchange: openjpa/trunk/openjpa-integration/osgi-itests/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/AbstractIntegrationTest.java?rev=777551&view=auto
==============================================================================
--- openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/AbstractIntegrationTest.java
(added)
+++ openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/AbstractIntegrationTest.java
Fri May 22 14:50:17 2009
@@ -0,0 +1,95 @@
+/*
+ * 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.openjpa.integration.osgi.itests;
+
+import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Inject;
+import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.util.tracker.ServiceTracker;
+
+public abstract class AbstractIntegrationTest {
+
+    public static final long DEFAULT_TIMEOUT = 30000;
+
+    @Inject
+    protected BundleContext bundleContext;
+
+
+    protected <T> T getOsgiService(Class<T> type, long timeout) {
+        return getOsgiService(type, null, timeout);
+    }
+
+    protected <T> T getOsgiService(Class<T> type) {
+        return getOsgiService(type, null, DEFAULT_TIMEOUT);
+    }
+
+    protected <T> T getOsgiService(Class<T> type, String filter, long timeout)
{
+        ServiceTracker tracker = null;
+        try {
+            String flt;
+            if (filter != null) {
+                if (filter.startsWith("(")) {
+                    flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")"
+ filter + ")";
+                } else {
+                    flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")("
+ filter + "))";
+                }
+            } else {
+                flt = "(" + Constants.OBJECTCLASS + "=" + type.getName() + ")";
+            }
+            Filter osgiFilter = FrameworkUtil.createFilter(flt);
+            tracker = new ServiceTracker(bundleContext, osgiFilter, null);
+            tracker.open();
+            // Note that the tracker is not closed to keep the reference
+            // This is buggy, has the service reference may change i think
+            Object svc = type.cast(tracker.waitForService(timeout));
+            if (svc == null) {
+                throw new RuntimeException("Gave up waiting for service " + flt);
+            }
+            return type.cast(svc);
+        } catch (InvalidSyntaxException e) {
+            throw new IllegalArgumentException("Invalid filter", e);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    protected Bundle installBundle(String groupId, String artifactId) throws Exception {
+        MavenArtifactProvisionOption mvnUrl = mavenBundle(groupId, artifactId);
+        return bundleContext.installBundle(mvnUrl.getURL());
+    }
+
+    protected Bundle getInstalledBundle(String symbolicName) {
+        for (Bundle b : bundleContext.getBundles()) {
+            if (symbolicName.equals(b.getSymbolicName())) {
+                return b;
+            }
+        }
+        return null;
+    }
+
+    public static MavenArtifactProvisionOption mavenBundle(String groupId, String artifactId)
{
+        return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject();
+    }
+}

Propchange: openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/AbstractIntegrationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/TestOpenJPA.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/TestOpenJPA.java?rev=777551&view=auto
==============================================================================
--- openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/TestOpenJPA.java
(added)
+++ openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/TestOpenJPA.java
Fri May 22 14:50:17 2009
@@ -0,0 +1,119 @@
+/*
+ * 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.openjpa.integration.osgi.itests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import static org.ops4j.pax.exam.CoreOptions.felix;
+import static org.ops4j.pax.exam.CoreOptions.mavenConfiguration;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.OptionUtils;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.framework.Bundle;
+
+
+@RunWith(JUnit4TestRunner.class)
+public class TestOpenJPA extends AbstractIntegrationTest {
+
+    @Test
+    public void testExamples() throws Exception {
+        System.out.println("********** testExamples starting");
+        System.out.println("***** Checking that openjpa-examples is installed");
+        // check for our openjpa-examples via the SymbolicName
+        Bundle bundle = getInstalledBundle("org.apache.openjpa.openjpa-examples");
+        assertNotNull(bundle);
+        System.out.println("***** Starting openjpa-examples bundle");
+        bundle.start();
+        System.out.println("***** Stopping openjpa-examples bundle");
+        bundle.stop();
+        System.out.println("********** testExamples returning");
+    }
+    
+    @Test
+    public void testEMF() throws Exception {
+        System.out.println("********** testEMF starting");
+        System.out.println("***** Creating a EMF");
+        EntityManagerFactory emf = Persistence.
+            createEntityManagerFactory("hellojpa", System.getProperties());
+        assertNotNull(emf);
+        System.out.println("***** After createEMF");
+        //OpenJPAConfiguration conf = emf.getConfiguration();
+        //System.out.println("***** After Config *****");
+        //assertNotNull(conf);
+        System.out.println("********** testEMF returning");
+    }
+
+    @org.ops4j.pax.exam.junit.Configuration
+    public static Option[] configuration() {
+        Option[] options = options(
+            // Log
+            mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
+            mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
+            // Felix Config Admin
+            mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
+            // Maven url handler
+            mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
+
+            // this is how you set the default log level when using pax logging
+            systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level")
+                .value("DEBUG"),
+
+            // OpenJPA runtime depends
+            mavenBundle("org.apache.geronimo.specs", "geronimo-jpa_2.0_spec"),
+            mavenBundle("org.apache.geronimo.specs",
+                "geronimo-validation_1.0_spec"),
+            //mavenBundle("org.apache.geronimo.specs", "geronimo-jms_1.1_spec"),
+            //mavenBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec"),
+            mavenBundle("commons-collections", "commons-collections"),
+            mavenBundle("commons-lang", "commons-lang"),
+            mavenBundle("commons-pool", "commons-pool"),
+            mavenBundle("org.apache.openjpa", "openjpa"),
+            
+            // Testcase depends
+            mavenBundle("org.apache.derby", "derby"),
+            mavenBundle("org.apache.servicemix.bundles",
+                "org.apache.servicemix.bundles.commons-dbcp"),
+            mavenBundle("org.apache.openjpa", "openjpa-examples"),
+            //vmOption("-Xdebug -Xrunjdwp:transport=dt_socket,
+            //server=y,suspend=y,address=5005"),
+
+            felix() //, equinox(), knopflerfish()
+        );
+
+        // use config generated by the Maven plugin (until PAXEXAM-62/64 fixed)
+        if (TestOpenJPA.class.getClassLoader().getResource(
+                "META-INF/maven/paxexam-config.args") != null) {
+            options = OptionUtils.combine(options, mavenConfiguration());
+        }
+
+        return options;
+    }
+}
+

Propchange: openjpa/trunk/openjpa-integration/osgi-itests/src/test/java/org/apache/openjpa/integration/osgi/itests/TestOpenJPA.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-integration/osgi-itests/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-integration/osgi-itests/src/test/resources/log4j.properties?rev=777551&view=auto
==============================================================================
--- openjpa/trunk/openjpa-integration/osgi-itests/src/test/resources/log4j.properties (added)
+++ openjpa/trunk/openjpa-integration/osgi-itests/src/test/resources/log4j.properties Fri
May 22 14:50:17 2009
@@ -0,0 +1,33 @@
+################################################################################
+#
+#    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.
+#
+################################################################################
+
+# Root logger
+log4j.rootLogger=DEBUG, stdout
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1}
| %-32.32C %4L | %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1}
| %-32.32C %4L | %m%n
+log4j.appender.out.file=${karaf.base}/data/log/karaf.log
+log4j.appender.out.append=true

Propchange: openjpa/trunk/openjpa-integration/osgi-itests/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openjpa/trunk/openjpa-integration/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-integration/pom.xml?rev=777551&r1=777550&r2=777551&view=diff
==============================================================================
--- openjpa/trunk/openjpa-integration/pom.xml (original)
+++ openjpa/trunk/openjpa-integration/pom.xml Fri May 22 14:50:17 2009
@@ -34,5 +34,6 @@
     <modules>
         <module>examples</module>
         <module>tck</module>
+        <!-- <module>osgi-itests</module> -->
     </modules>
 </project>

Modified: openjpa/trunk/openjpa/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa/pom.xml?rev=777551&r1=777550&r2=777551&view=diff
==============================================================================
--- openjpa/trunk/openjpa/pom.xml (original)
+++ openjpa/trunk/openjpa/pom.xml Fri May 22 14:50:17 2009
@@ -125,7 +125,7 @@
                         <!-- OSGi Bundle Metadata -->
                         <Private-Package>org.openjpa.lib.ant*,org.apache.jdbc.ant*,META-INF*</Private-Package>
                         <Export-Package>!META-INF*,!org.openjpa.lib.ant*,!org.apache.jdbc.ant*,org.apache.openjpa*</Export-Package>
-                        <Import-Package>com.ibm.*;resolution:=optional,org.postgresql.*;resolution:=optional,org.apache.tools.ant.*;resolution:=optional,org.apache.log4j.*;resolution:=optional,javax.activation.*;resolution:=optional,javax.xml.bind.*;resolution:=optional,serp.*;resolution:=optional,*</Import-Package>
+                        <Import-Package>com.ibm.*;resolution:=optional,org.postgresql.*;resolution:=optional,org.apache.tools.ant.*;resolution:=optional,org.apache.log4j.*;resolution:=optional,javax.activation.xa*;resolution:=optional,javax.jms.*;resolution:=optional,javax.transaction.*;resolution:=optional,javax.xml.bind.*;resolution:=optional,serp.*;resolution:=optional,*</Import-Package>
                         <!-- Eclipse metadata -->
                         <Eclipse-Autostart>false</Eclipse-Autostart>
                         <Bundle-ClassPath>.</Bundle-ClassPath>

Modified: openjpa/trunk/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/pom.xml?rev=777551&r1=777550&r2=777551&view=diff
==============================================================================
--- openjpa/trunk/pom.xml (original)
+++ openjpa/trunk/pom.xml Fri May 22 14:50:17 2009
@@ -494,6 +494,11 @@
                 <artifactId>ant</artifactId>
                 <version>1.6.5</version>
             </dependency>
+            <dependency>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>org.osgi.core</artifactId>
+                <version>1.2.0</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
     <dependencies>



Mime
View raw message