mirror of https://github.com/apache/archiva.git
Changing to hsqldb for unit testing.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@520921 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1451e3ef75
commit
2087d187e7
|
@ -90,12 +90,17 @@
|
|||
<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>
|
||||
|
|
|
@ -51,12 +51,13 @@ import javax.jdo.spi.PersistenceCapable;
|
|||
*
|
||||
* @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;
|
||||
|
||||
|
|
|
@ -18,15 +18,14 @@ import java.util.List;
|
|||
* @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;
|
||||
|
||||
|
|
|
@ -48,12 +48,6 @@ public class AbstractArchivaDatabaseTestCase
|
|||
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" );
|
||||
|
@ -61,9 +55,19 @@ public class AbstractArchivaDatabaseTestCase
|
|||
|
||||
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.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" ) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue