archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1403511 - in /archiva/trunk/archiva-modules: archiva-base/archiva-repository-layer/src/test/resources/ plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/ plugins/maven2-repository/src/test/java/o...
Date Mon, 29 Oct 2012 21:02:19 GMT
Author: olamy
Date: Mon Oct 29 21:02:19 2012
New Revision: 1403511

URL: http://svn.apache.org/viewvc?rev=1403511&view=rev
Log:
[MRM-1704] Refactor to remove maven specific part from various repository/metadata apis
fix some unit tests due to some move spring conf for test need to be adapted.

Added:
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-no-mock-conf.xml
  (contents, props changed)
      - copied, changed from r1403510, archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/spring-context.xml
Removed:
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/spring-context.xml
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractRepositoryLayerTestCase.java
Modified:
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/TestConfiguration.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataResolver.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractLegacyRepositoryContentTestCase.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedReleaseTest.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedSnapshotTest.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/legacy/LegacyPathParserTest.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/repositories/default-repository/org/apache/cocoon/cocoon/1/cocoon-1.pom
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-metadata-tools-test.xml

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
Mon Oct 29 21:02:19 2012
@@ -72,6 +72,7 @@ import org.apache.maven.model.io.xpp3.Ma
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.PostConstruct;
@@ -136,8 +137,7 @@ public class Maven2RepositoryStorage
     private WagonFactory wagonFactory;
 
     @Inject
-    @Named ( value = "repositoryProxyConnectors#default" )
-    private RepositoryProxyConnectors connectors;
+    private ApplicationContext applicationContext;
 
     private static final Logger log = LoggerFactory.getLogger( Maven2RepositoryStorage.class
);
 
@@ -644,6 +644,9 @@ public class Maven2RepositoryStorage
         pomReference.setVersion( artifact.getVersion() );
         pomReference.setType( "pom" );
 
+        RepositoryProxyConnectors connectors =
+            applicationContext.getBean( "repositoryProxyConnectors#default", RepositoryProxyConnectors.class
);
+
         // Get the artifact POM from proxied repositories if needed
         connectors.fetchFromProxies( managedRepository, pomReference );
 

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/TestConfiguration.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/TestConfiguration.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/TestConfiguration.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/TestConfiguration.java
Mon Oct 29 21:02:19 2012
@@ -47,17 +47,17 @@ public class TestConfiguration
 
     public void addListener( ConfigurationListener listener )
     {
-        throw new UnsupportedOperationException();
+        // no op
     }
 
     public void removeListener( ConfigurationListener listener )
     {
-        throw new UnsupportedOperationException();
+        // no op
     }
 
     public void addChangeListener( RegistryListener listener )
     {
-        throw new UnsupportedOperationException();
+        // no op
     }
 
     public void reload()

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataResolver.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataResolver.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataResolver.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataResolver.java
Mon Oct 29 21:02:19 2012
@@ -35,7 +35,7 @@ public class TestMetadataResolver
                                                          String projectId, String projectVersion
)
         throws MetadataResolutionException
     {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        return null;
     }
 
     public Collection<ProjectVersionReference> resolveProjectReferences( RepositorySession
session, String repoId,
@@ -43,38 +43,38 @@ public class TestMetadataResolver
                                                                          String projectVersion
)
         throws MetadataResolutionException
     {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        return null;
     }
 
     public Collection<String> resolveRootNamespaces( RepositorySession session, String
repoId )
         throws MetadataResolutionException
     {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        return null;
     }
 
     public Collection<String> resolveNamespaces( RepositorySession session, String
repoId, String namespace )
         throws MetadataResolutionException
     {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        return null;
     }
 
     public Collection<String> resolveProjects( RepositorySession session, String repoId,
String namespace )
         throws MetadataResolutionException
     {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        return null;
     }
 
     public Collection<String> resolveProjectVersions( RepositorySession session, String
repoId, String namespace,
                                                       String projectId )
         throws MetadataResolutionException
     {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        return null;
     }
 
     public Collection<ArtifactMetadata> resolveArtifacts( RepositorySession session,
String repoId, String namespace,
                                                           String projectId, String projectVersion
)
         throws MetadataResolutionException
     {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+        return null;
     }
 }

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java
Mon Oct 29 21:02:19 2012
@@ -20,6 +20,7 @@ package org.apache.archiva.metadata.repo
  */
 
 import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.repository.AbstractRepositoryLayerTestCase;
 import org.apache.archiva.repository.layout.LayoutException;
 import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
 import org.apache.commons.lang.StringUtils;
@@ -33,7 +34,7 @@ import static org.junit.Assert.*;
  * AbstractDefaultRepositoryContentTestCase
  */
 @RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
} )
+@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml"
} )
 public abstract class AbstractDefaultRepositoryContentTestCase
     extends AbstractRepositoryLayerTestCase
 {

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractLegacyRepositoryContentTestCase.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractLegacyRepositoryContentTestCase.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractLegacyRepositoryContentTestCase.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractLegacyRepositoryContentTestCase.java
Mon Oct 29 21:02:19 2012
@@ -20,6 +20,7 @@ package org.apache.archiva.metadata.repo
  */
 
 import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.repository.AbstractRepositoryLayerTestCase;
 import org.apache.archiva.repository.layout.LayoutException;
 import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
 import org.junit.Test;
@@ -32,10 +33,11 @@ import static org.junit.Assert.*;
  * AbstractLegacyRepositoryContentTestCase
  */
 @RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
} )
+@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml"
} )
 public abstract class AbstractLegacyRepositoryContentTestCase
     extends AbstractRepositoryLayerTestCase
 {
+
     @Test
     public void testBadPathArtifactIdMissingA()
     {
@@ -48,6 +50,7 @@ public abstract class AbstractLegacyRepo
         assertBadPath( "groupId/jars/1.0.jar", "artifactId is missing" );
     }
 
+
     @Test
     public void testBadPathMissingType()
     {
@@ -61,6 +64,7 @@ public abstract class AbstractLegacyRepo
         assertBadPath( "invalid/invalid-1.0.jar", "path is too short" );
     }
 
+
     @Test
     public void testBadPathWrongPackageExtension()
     {

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
Mon Oct 29 21:02:19 2012
@@ -50,8 +50,6 @@ import static org.junit.Assert.fail;
 /**
  * ManagedDefaultRepositoryContentTest
  */
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
} )
 public class ManagedDefaultRepositoryContentTest
     extends AbstractDefaultRepositoryContentTestCase
 {

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
Mon Oct 29 21:02:19 2012
@@ -47,8 +47,6 @@ import static org.junit.Assert.*;
  *
  *
  */
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
} )
 public class ManagedLegacyRepositoryContentTest
     extends AbstractDefaultRepositoryContentTestCase
 {

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
Mon Oct 29 21:02:19 2012
@@ -56,8 +56,10 @@ import java.util.List;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-@RunWith (ArchivaSpringJUnit4ClassRunner.class)
-@ContextConfiguration (locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
})
+
+@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
+@ContextConfiguration (
+    locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml"
} )
 public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
     extends TestCase
 {
@@ -92,6 +94,7 @@ public class Maven2RepositoryMetadataRes
     private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
 
     @Inject
+    @Named (value = "archivaConfiguration#default")
     private ArchivaConfiguration configuration;
 
     private WagonFactory wagonFactory;

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
Mon Oct 29 21:02:19 2012
@@ -58,14 +58,15 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 @RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
} )
+@ContextConfiguration (
+    locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml"
} )
 public class Maven2RepositoryMetadataResolverMRM1411Test
     extends TestCase
 {
     private static final Filter<String> ALL = new AllFilter<String>();
 
     @Inject
-    @Named ( value = "repositoryStorage#maven2" )
+    @Named (value = "repositoryStorage#maven2")
     private Maven2RepositoryStorage storage;
 
     private static final String TEST_REPO_ID = "test";
@@ -89,6 +90,7 @@ public class Maven2RepositoryMetadataRes
     private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
 
     @Inject
+    @Named (value = "archivaConfiguration#default")
     private ArchivaConfiguration configuration;
 
     private WagonFactory wagonFactory;

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedReleaseTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedReleaseTest.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedReleaseTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedReleaseTest.java
Mon Oct 29 21:02:19 2012
@@ -19,32 +19,26 @@ package org.apache.archiva.metadata.repo
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.repository.filter.AllFilter;
 import org.apache.archiva.metadata.repository.filter.Filter;
 import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
 import org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException;
 import org.apache.archiva.proxy.common.WagonFactory;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
 
 import javax.inject.Inject;
 import javax.inject.Named;
 
 
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
} )
 public class Maven2RepositoryMetadataResolverManagedReleaseTest
     extends Maven2RepositoryMetadataResolverTest
 {
     private static final Filter<String> ALL = new AllFilter<String>();
 
     @Inject
-    @Named ( value = "repositoryStorage#maven2" )
+    @Named (value = "repositoryStorage#maven2")
     private Maven2RepositoryStorage storage;
 
     private static final String TEST_REPO_ID = "test";
@@ -67,9 +61,6 @@ public class Maven2RepositoryMetadataRes
 
     private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
 
-    @Inject
-    private ArchivaConfiguration configuration;
-
     private WagonFactory wagonFactory;
 
     @Before
@@ -103,7 +94,7 @@ public class Maven2RepositoryMetadataRes
         ProjectVersionMetadata metadata = storage.readProjectVersionMetadata( readMetadataRequest
);
     }
 
-    @Test ( expected = RepositoryStorageRuntimeException.class )
+    @Test (expected = RepositoryStorageRuntimeException.class)
     @Override
     public void testGetProjectVersionMetadataForTimestampedSnapshotMissingMetadata()
         throws Exception
@@ -114,7 +105,7 @@ public class Maven2RepositoryMetadataRes
         storage.readProjectVersionMetadata( readMetadataRequest );
     }
 
-    @Test ( expected = RepositoryStorageRuntimeException.class )
+    @Test (expected = RepositoryStorageRuntimeException.class)
     @Override
     public void testGetProjectVersionMetadataForTimestampedSnapshotMalformedMetadata()
         throws Exception
@@ -125,7 +116,7 @@ public class Maven2RepositoryMetadataRes
         storage.readProjectVersionMetadata( readMetadataRequest );
     }
 
-    @Test ( expected = RepositoryStorageRuntimeException.class )
+    @Test (expected = RepositoryStorageRuntimeException.class)
     @Override
     public void testGetProjectVersionMetadataForTimestampedSnapshot()
         throws Exception
@@ -134,7 +125,7 @@ public class Maven2RepositoryMetadataRes
     }
 
 
-    @Test ( expected = RepositoryStorageRuntimeException.class )
+    @Test (expected = RepositoryStorageRuntimeException.class)
     @Override
     public void testGetProjectVersionMetadataForTimestampedSnapshotIncompleteMetadata()
         throws Exception

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedSnapshotTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedSnapshotTest.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedSnapshotTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedSnapshotTest.java
Mon Oct 29 21:02:19 2012
@@ -19,7 +19,6 @@ package org.apache.archiva.metadata.repo
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.repository.filter.AllFilter;
 import org.apache.archiva.metadata.repository.filter.Filter;
@@ -34,16 +33,16 @@ import org.springframework.test.context.
 import javax.inject.Inject;
 import javax.inject.Named;
 
-
 @RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
} )
+@ContextConfiguration (
+    locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml"
} )
 public class Maven2RepositoryMetadataResolverManagedSnapshotTest
     extends Maven2RepositoryMetadataResolverTest
 {
     private static final Filter<String> ALL = new AllFilter<String>();
 
     @Inject
-    @Named ( value = "repositoryStorage#maven2" )
+    @Named (value = "repositoryStorage#maven2")
     private Maven2RepositoryStorage storage;
 
     private static final String TEST_REPO_ID = "test";
@@ -64,10 +63,8 @@ public class Maven2RepositoryMetadataRes
 
     private static final String EMPTY_MD5 = "d41d8cd98f00b204e9800998ecf8427e";
 
-    private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
 
-    @Inject
-    private ArchivaConfiguration configuration;
+    private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
 
 
     @Before
@@ -86,7 +83,7 @@ public class Maven2RepositoryMetadataRes
         assertFalse( c.getManagedRepositories().get( 0 ).isReleases() );
     }
 
-    @Test ( expected = RepositoryStorageRuntimeException.class )
+    @Test (expected = RepositoryStorageRuntimeException.class)
     @Override
     public void testModelWithJdkProfileActivation()
         throws Exception
@@ -100,7 +97,7 @@ public class Maven2RepositoryMetadataRes
         ProjectVersionMetadata metadata = storage.readProjectVersionMetadata( readMetadataRequest
);
     }
 
-    @Test ( expected = RepositoryStorageRuntimeException.class )
+    @Test (expected = RepositoryStorageRuntimeException.class)
     @Override
     public void testGetProjectVersionMetadataForMislocatedPom()
         throws Exception
@@ -120,7 +117,7 @@ public class Maven2RepositoryMetadataRes
         // super test is on release
     }
 
-    @Test ( expected = RepositoryStorageRuntimeException.class )
+    @Test (expected = RepositoryStorageRuntimeException.class)
     @Override
     public void testGetProjectVersionMetadataForInvalidPom()
         throws Exception
@@ -131,7 +128,7 @@ public class Maven2RepositoryMetadataRes
         storage.readProjectVersionMetadata( readMetadataRequest );
     }
 
-    @Test ( expected = RepositoryStorageRuntimeException.class )
+    @Test (expected = RepositoryStorageRuntimeException.class)
     @Override
     public void testGetProjectVersionMetadataForMissingPom()
         throws Exception

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
Mon Oct 29 21:02:19 2012
@@ -62,15 +62,16 @@ import java.util.List;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
} )
+@RunWith (ArchivaSpringJUnit4ClassRunner.class)
+@ContextConfiguration (
+    locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml"
})
 public class Maven2RepositoryMetadataResolverTest
     extends TestCase
 {
     private static final Filter<String> ALL = new AllFilter<String>();
 
     @Inject
-    @Named ( value = "repositoryStorage#maven2" )
+    @Named (value = "repositoryStorage#maven2")
     private Maven2RepositoryStorage storage;
 
     private static final String TEST_REPO_ID = "test";
@@ -94,7 +95,8 @@ public class Maven2RepositoryMetadataRes
     private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
 
     @Inject
-    private ArchivaConfiguration configuration;
+    @Named ( value = "archivaConfiguration#default" )
+    protected ArchivaConfiguration configuration;
 
     private WagonFactory wagonFactory;
 

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java
Mon Oct 29 21:02:19 2012
@@ -34,8 +34,6 @@ import javax.inject.Named;
 /**
  * RemoteDefaultRepositoryContentTest
  */
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
} )
 public class RemoteDefaultRepositoryContentTest
     extends AbstractDefaultRepositoryContentTestCase
 {

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/legacy/LegacyPathParserTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/legacy/LegacyPathParserTest.java?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/legacy/LegacyPathParserTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/legacy/LegacyPathParserTest.java
Mon Oct 29 21:02:19 2012
@@ -41,7 +41,7 @@ import static org.junit.Assert.*;
  *
  */
 @RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"
} )
+@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml"
} )
 public class LegacyPathParserTest
 {
     private LegacyPathParser parser;

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/repositories/default-repository/org/apache/cocoon/cocoon/1/cocoon-1.pom
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/repositories/default-repository/org/apache/cocoon/cocoon/1/cocoon-1.pom?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/repositories/default-repository/org/apache/cocoon/cocoon/1/cocoon-1.pom
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/repositories/default-repository/org/apache/cocoon/cocoon/1/cocoon-1.pom
Mon Oct 29 21:02:19 2012
@@ -16,7 +16,7 @@
 -->
 <!--+
     | This is the main Maven file that contains all global settings, management and information.
-    | @version $Id$
+    | @version $Id: cocoon-1.pom 580582 2007-09-29 13:37:01Z joakime $
     +-->
 <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">
   

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-metadata-tools-test.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-metadata-tools-test.xml?rev=1403511&r1=1403510&r2=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-metadata-tools-test.xml
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-metadata-tools-test.xml
Mon Oct 29 21:02:19 2012
@@ -27,7 +27,8 @@
            http://www.springframework.org/schema/context/spring-context-3.0.xsd"
        default-lazy-init="true">
 
-
+  <bean name="archivaConfiguration#mock" class="org.apache.archiva.repository.MockConfiguration"/>
+  <alias name="archivaConfiguration#mock" alias="archivaConfiguration#default"/>
   <bean name="metadataTools#test" class="org.apache.archiva.repository.metadata.MetadataTools">
     <property name="configuration" ref="archivaConfiguration#mock"/>
   </bean>

Copied: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-no-mock-conf.xml
(from r1403510, archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/spring-context.xml)
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-no-mock-conf.xml?p2=archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-no-mock-conf.xml&p1=archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/spring-context.xml&r1=1403510&r2=1403511&rev=1403511&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/spring-context.xml
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-no-mock-conf.xml
Mon Oct 29 21:02:19 2012
@@ -25,6 +25,6 @@
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context 
            http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-
+  <alias name="archivaConfiguration#mock" alias="archivaConfiguration#default"/>
+  <alias name="archivaConfiguration#mock" alias="archivaConfiguration#test"/>
 </beans>
\ No newline at end of file

Propchange: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-no-mock-conf.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/resources/spring-context-no-mock-conf.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message