<artifactId>log4j</artifactId>
<version>1.2.8</version>
</dependency>
- <!-- TEST DEPS -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.2.1.6</version>
</dependency>
+ <!-- TEST DEPS -->
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.7</version>
+ </dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
*
* @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
* @version $Id$
+ * @plexus.component role="org.apache.maven.archiva.database.jdo.JdoAccess" role-hint="default"
*/
public class JdoAccess
implements Initializable, InstanceLifecycleListener, StoreLifecycleListener
{
/**
- * @plexus.requirement role-hint="users"
+ * @plexus.requirement role-hint="archiva"
*/
private JdoFactory jdoFactory;
+ "' from jdo using null/empty id." );
}
- return getObjectById( clazz, (Object) id, fetchGroup );
+ return getObjectById( clazz, (Object) id, fetchGroup );
}
public boolean objectExists( Object object )
* @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
* @version $Id$
*
- * @plexus.component role="org.apache.maven.archiva.database.ArchivaDAO"
- * role-hint="jdo"
+ * @plexus.component role-hint="jdo"
*/
public class JdoArchivaDAO
extends AbstractLogEnabled
implements ArchivaDAO
{
/**
- * @plexus.requirement
+ * @plexus.requirement role-hint="default"
*/
private JdoAccess jdo;
protected void setUp()
throws Exception
{
- File derbyDbDir = new File( "target/plexus-home/testdb" );
- if ( derbyDbDir.exists() )
- {
- FileUtils.deleteDirectory( derbyDbDir );
- }
-
super.setUp();
DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup( JdoFactory.ROLE, "archiva" );
jdoFactory.setPersistenceManagerFactoryClass( "org.jpox.PersistenceManagerFactoryImpl" );
- jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.apache.derby.jdbc.EmbeddedDriver" ) );
+ /* derby version
+ File derbyDbDir = new File( "target/plexus-home/testdb" );
+ if ( derbyDbDir.exists() )
+ {
+ FileUtils.deleteDirectory( derbyDbDir );
+ }
- jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:derby:" + derbyDbDir.getAbsolutePath() + ";create=true" ) );
+ jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.apache.derby.jdbc.EmbeddedDriver" ) );
+ jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:derby:" + derbyDbDir.getAbsolutePath() + ";create=true" ) );
+ */
+ jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.hsqldb.jdbcDriver" ) );
+ jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:hsqldb:mem:" + getName() ) );
+
jdoFactory.setUserName( System.getProperty( "jdo.test.user", "sa" ) );
jdoFactory.setPassword( System.getProperty( "jdo.test.pass", "" ) );