continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r652244 - in /continuum/trunk/continuum-test/src/main: java/org/apache/maven/continuum/ java/org/apache/maven/continuum/jdo/ resources/ resources/META-INF/ resources/META-INF/plexus/
Date Wed, 30 Apr 2008 03:39:58 GMT
Author: carlos
Date: Tue Apr 29 20:39:58 2008
New Revision: 652244

URL: http://svn.apache.org/viewvc?rev=652244&view=rev
Log:
Configure the jdo factory in Spring

Added:
    continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/jdo/
    continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/jdo/MemoryJdoFactory.java
  (with props)
    continuum/trunk/continuum-test/src/main/resources/META-INF/spring-context.xml   (with
props)
    continuum/trunk/continuum-test/src/main/resources/jdo.properties   (with props)
Modified:
    continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
    continuum/trunk/continuum-test/src/main/resources/META-INF/plexus/components.xml

Modified: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java?rev=652244&r1=652243&r2=652244&view=diff
==============================================================================
--- continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
(original)
+++ continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
Tue Apr 29 20:39:58 2008
@@ -32,6 +32,7 @@
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
+import org.apache.maven.continuum.jdo.MemoryJdoFactory;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -40,7 +41,6 @@
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
 import org.codehaus.plexus.jdo.JdoFactory;
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.jpox.SchemaTool;
@@ -137,25 +137,45 @@
 
         Object o = lookup( JdoFactory.ROLE, "continuum" );
 
-        assertEquals( DefaultConfigurableJdoFactory.class.getName(), o.getClass().getName()
);
+        assertEquals( MemoryJdoFactory.class.getName(), o.getClass().getName() );
 
-        DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) o;
+        MemoryJdoFactory jdoFactory = (MemoryJdoFactory) o;
 
-        jdoFactory.setPersistenceManagerFactoryClass( "org.jpox.PersistenceManagerFactoryImpl"
);
+//        jdoFactory.setPersistenceManagerFactoryClass( "org.jpox.PersistenceManagerFactoryImpl"
);
+//
+//        jdoFactory.setDriverName( "org.hsqldb.jdbcDriver" );
+
+        String url = "jdbc:hsqldb:mem:" + getClass().getName() + "." + getName();
+
+        jdoFactory.setUrl( url );
+
+//        jdoFactory.setUserName( "sa" );
+//
+//        jdoFactory.setPassword( "" );
+//
+//        jdoFactory.setProperty( "org.jpox.transactionIsolation", "READ_UNCOMMITTED" );
+//
+//        jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_UNCOMMITTED"
);
+//
+//        jdoFactory.setProperty( "org.jpox.autoCreateTables", "true" );
 
-        jdoFactory.setDriverName( "org.hsqldb.jdbcDriver" );
+        // ----------------------------------------------------------------------
+        // Check the configuration
+        // ----------------------------------------------------------------------
 
-        jdoFactory.setUrl( "jdbc:hsqldb:mem:" + getClass().getName() + "." + getName() );
+        PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory();
 
-        jdoFactory.setUserName( "sa" );
+        assertNotNull( pmf );
 
-        jdoFactory.setPassword( "" );
+        assertEquals( url, pmf.getConnectionURL() );
 
-        jdoFactory.setProperty( "org.jpox.transactionIsolation", "READ_UNCOMMITTED" );
+        PersistenceManager pm = pmf.getPersistenceManager();
 
-        jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_UNCOMMITTED"
);
+        pm.close();
 
-        jdoFactory.setProperty( "org.jpox.autoCreateTables", "true" );
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
 
         Properties properties = jdoFactory.getProperties();
 
@@ -168,18 +188,6 @@
                                        false, null );
 
         // ----------------------------------------------------------------------
-        // Check the configuration
-        // ----------------------------------------------------------------------
-
-        PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory();
-
-        assertNotNull( pmf );
-
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        pm.close();
-
-        // ----------------------------------------------------------------------
         //
         // ----------------------------------------------------------------------
 

Added: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/jdo/MemoryJdoFactory.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/jdo/MemoryJdoFactory.java?rev=652244&view=auto
==============================================================================
--- continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/jdo/MemoryJdoFactory.java
(added)
+++ continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/jdo/MemoryJdoFactory.java
Tue Apr 29 20:39:58 2008
@@ -0,0 +1,19 @@
+package org.apache.maven.continuum.jdo;
+
+import java.util.Properties;
+
+import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
+
+public class MemoryJdoFactory
+    extends DefaultConfigurableJdoFactory
+{
+    public Properties getOtherProperties()
+    {
+        return otherProperties;
+    }
+
+    public void setOtherProperties( Properties otherProperties )
+    {
+        this.otherProperties = otherProperties;
+    }
+}

Propchange: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/jdo/MemoryJdoFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/jdo/MemoryJdoFactory.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: continuum/trunk/continuum-test/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/resources/META-INF/plexus/components.xml?rev=652244&r1=652243&r2=652244&view=diff
==============================================================================
--- continuum/trunk/continuum-test/src/main/resources/META-INF/plexus/components.xml (original)
+++ continuum/trunk/continuum-test/src/main/resources/META-INF/plexus/components.xml Tue Apr
29 20:39:58 2008
@@ -19,18 +19,61 @@
 
 <component-set>
   <components>
+<!--
     <component>
       <role>org.codehaus.plexus.jdo.JdoFactory</role>
       <role-hint>continuum</role-hint>
-      <implementation>org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory</implementation>
+      <implementation>org.apache.maven.continuum.jdo.MemoryJdoFactory</implementation>
       <configuration>
         <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
+        <driverName>org.hsqldb.jdbcDriver</driverName>
+        <url>jdbc:hsqldb:${plexus.home}/database</url>
+        <userName>sa</userName>
+        <password></password>
+        <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
+
+        <otherProperties>
+          <property>
+            <name>org.jpox.autoCreateSchema</name>
+            <value>true</value>
+          </property>
+          <property>
+            <name>org.jpox.validateTables</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.validateColumns</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.validateConstraints</name>
+            <value>false</value>
+          </property>
+
+          <property>
+            <name>org.jpox.autoStartMechanism</name>
+            <value>SchemaTable</value>
+          </property>
+          <property>
+            <name>org.jpox.autoStartMechanismMode</name>
+            <value>Ignored</value>
+          </property>
+          <property>
+            <name>org.jpox.transactionIsolation</name>
+            <value>READ_COMMITTED</value>
+          </property>
+          <property>
+            <name>org.jpox.poid.transactionIsolation</name>
+            <value>READ_COMMITTED</value>
+          </property>
+        </otherProperties>
       </configuration>
     </component>
+-->
     <component>
       <role>org.codehaus.plexus.jdo.JdoFactory</role>
       <role-hint>users</role-hint>
-      <implementation>org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory</implementation>
+      <implementation>org.apache.maven.continuum.jdo.MemoryJdoFactory</implementation>
       <configuration>
         <!-- Database Configuration -->
         <driverName>org.hsqldb.jdbcDriver</driverName>

Added: continuum/trunk/continuum-test/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/resources/META-INF/spring-context.xml?rev=652244&view=auto
==============================================================================
--- continuum/trunk/continuum-test/src/main/resources/META-INF/spring-context.xml (added)
+++ continuum/trunk/continuum-test/src/main/resources/META-INF/spring-context.xml Tue Apr
29 20:39:58 2008
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:p="http://www.springframework.org/schema/p"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:util="http://www.springframework.org/schema/util"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
+
+<!--
+  <bean id="jdoProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+    <property name="location" value="classpath:jdo.properties"/>
+  </bean>
+-->
+  <util:properties id="jdoProperties" location="classpath:jdo.properties"/>
+
+  <bean name="jdoFactory#continuum" depends-on="jdoProperties"
+        class="org.apache.maven.continuum.jdo.MemoryJdoFactory"
+        p:persistenceManagerFactoryClass="org.jpox.PersistenceManagerFactoryImpl"
+        p:driverName="org.hsqldb.jdbcDriver"
+        p:userName="sa"
+        p:password="">
+
+<!-- 
+        <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/>
+-->
+    <property name="otherProperties" ref="jdoProperties"/>
+  </bean>
+<!--
+        p:url="jdbc:hsqldb:${plexus.home}/database"
+-->
+
+</beans>

Propchange: continuum/trunk/continuum-test/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-test/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/trunk/continuum-test/src/main/resources/jdo.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/resources/jdo.properties?rev=652244&view=auto
==============================================================================
--- continuum/trunk/continuum-test/src/main/resources/jdo.properties (added)
+++ continuum/trunk/continuum-test/src/main/resources/jdo.properties Tue Apr 29 20:39:58 2008
@@ -0,0 +1,9 @@
+org.jpox.autoCreateSchema=true
+org.jpox.autoCreateTables=true
+org.jpox.validateTables=false
+org.jpox.validateColumns=false
+org.jpox.validateConstraints=false
+org.jpox.autoStartMechanism=SchemaTable
+org.jpox.autoStartMechanismMode=Ignored
+org.jpox.transactionIsolation=READ_UNCOMMITTED
+org.jpox.poid.transactionIsolation=READ_UNCOMMITTED

Propchange: continuum/trunk/continuum-test/src/main/resources/jdo.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-test/src/main/resources/jdo.properties
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message