summaryrefslogtreecommitdiffstats
path: root/archiva-modules/plugins
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-06-01 14:37:32 +0000
committerOlivier Lamy <olamy@apache.org>2011-06-01 14:37:32 +0000
commitf378a857ebf36348caedbd78890c71cd96e02a9d (patch)
treeece67be82642972fd6d0182da0819d152b678c39 /archiva-modules/plugins
parent76386bfcb1f4476f25eca5ac215263c1451a1cfd (diff)
downloadarchiva-f378a857ebf36348caedbd78890c71cd96e02a9d.tar.gz
archiva-f378a857ebf36348caedbd78890c71cd96e02a9d.zip
[MRM-1473] remove use of plexus-spring
fix module metadata-store-jcr git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1130164 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins')
-rw-r--r--archiva-modules/plugins/metadata-store-file/pom.xml5
-rw-r--r--archiva-modules/plugins/metadata-store-file/src/test/java/org/apache/archiva/metadata/repository/file/FileMetadataRepositoryTest.java2
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/pom.xml5
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java21
4 files changed, 29 insertions, 4 deletions
diff --git a/archiva-modules/plugins/metadata-store-file/pom.xml b/archiva-modules/plugins/metadata-store-file/pom.xml
index 00556ffbc..0dd237306 100644
--- a/archiva-modules/plugins/metadata-store-file/pom.xml
+++ b/archiva-modules/plugins/metadata-store-file/pom.xml
@@ -65,5 +65,10 @@
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/archiva-modules/plugins/metadata-store-file/src/test/java/org/apache/archiva/metadata/repository/file/FileMetadataRepositoryTest.java b/archiva-modules/plugins/metadata-store-file/src/test/java/org/apache/archiva/metadata/repository/file/FileMetadataRepositoryTest.java
index 05693af32..77229cf3b 100644
--- a/archiva-modules/plugins/metadata-store-file/src/test/java/org/apache/archiva/metadata/repository/file/FileMetadataRepositoryTest.java
+++ b/archiva-modules/plugins/metadata-store-file/src/test/java/org/apache/archiva/metadata/repository/file/FileMetadataRepositoryTest.java
@@ -25,6 +25,7 @@ import org.apache.commons.io.FileUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.junit.Before;
import java.io.File;
import java.util.Map;
@@ -36,6 +37,7 @@ public class FileMetadataRepositoryTest
extends AbstractMetadataRepositoryTest
{
+ @Before
public void setUp()
throws Exception
{
diff --git a/archiva-modules/plugins/metadata-store-jcr/pom.xml b/archiva-modules/plugins/metadata-store-jcr/pom.xml
index f501ca131..b5de67f2a 100644
--- a/archiva-modules/plugins/metadata-store-jcr/pom.xml
+++ b/archiva-modules/plugins/metadata-store-jcr/pom.xml
@@ -69,6 +69,11 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<testResources>
diff --git a/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java b/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java
index fbe1d5032..365135943 100644
--- a/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java
+++ b/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java
@@ -22,8 +22,13 @@ package org.apache.archiva.metadata.repository.jcr;
import org.apache.archiva.metadata.model.MetadataFacetFactory;
import org.apache.archiva.metadata.repository.AbstractMetadataRepositoryTest;
import org.apache.commons.io.FileUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.springframework.context.ApplicationContext;
+import java.io.File;
import java.util.Map;
+import javax.inject.Inject;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
@@ -33,17 +38,25 @@ public class JcrMetadataRepositoryTest
{
private JcrMetadataRepository jcrMetadataRepository;
+ @Inject
+ private ApplicationContext applicationContext;
+
+ @Before
public void setUp()
throws Exception
{
super.setUp();
- FileUtils.deleteDirectory( getTestFile( "target/test-repositories" ) );
+ File directory = new File( "target/test-repositories" );
+ if (directory.exists())
+ {
+ FileUtils.deleteDirectory( directory );
+ }
Map<String, MetadataFacetFactory> factories = createTestMetadataFacetFactories();
// TODO: probably don't need to use Spring for this
- Repository repository = (Repository) lookup( Repository.class );
+ Repository repository = applicationContext.getBean( Repository.class );
jcrMetadataRepository = new JcrMetadataRepository( factories, repository );
try
@@ -64,8 +77,8 @@ public class JcrMetadataRepositoryTest
this.repository = jcrMetadataRepository;
}
- @Override
- protected void tearDown()
+ @After
+ public void tearDown()
throws Exception
{
jcrMetadataRepository.close();