archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1131428 [2/2] - in /archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src: main/java/org/apache/maven/archiva/webdav/util/ test/java/org/apache/maven/archiva/webdav/ test/java/org/apache/maven/archiva/webdav/util/ test/resources/ te...
Date Sat, 04 Jun 2011 16:30:31 GMT
Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedReleasePolicyTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedReleasePolicyTest.java?rev=1131428&r1=1131427&r2=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedReleasePolicyTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedReleasePolicyTest.java Sat Jun  4 16:30:30 2011
@@ -25,6 +25,7 @@ import com.meterware.httpunit.WebRequest
 import com.meterware.httpunit.WebResponse;
 
 import org.apache.maven.archiva.policies.ReleasesPolicy;
+import org.junit.Test;
 
 import java.io.File;
 
@@ -36,6 +37,7 @@ import java.io.File;
 public class RepositoryServletProxiedReleasePolicyTest
     extends AbstractRepositoryServletProxiedTestCase
 {
+    @Test
     public void testGetProxiedReleaseArtifactPolicyAlwaysManagedNewer()
         throws Exception
     {
@@ -43,6 +45,7 @@ public class RepositoryServletProxiedRel
                                                    ( NEWER * OVER_ONE_DAY ) );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyAlwaysManagedOlder()
         throws Exception
     {
@@ -50,12 +53,14 @@ public class RepositoryServletProxiedRel
                                                    ( OLDER * OVER_ONE_DAY ) );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyAlwaysNoManagedContent()
         throws Exception
     {
         assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.ALWAYS, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyDailyFail()
         throws Exception
     {
@@ -63,12 +68,14 @@ public class RepositoryServletProxiedRel
                                                    ( NEWER * ONE_MINUTE ) );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyDailyNoManagedContent()
         throws Exception
     {
         assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.DAILY, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyDailyPass()
         throws Exception
     {
@@ -76,24 +83,28 @@ public class RepositoryServletProxiedRel
                                                    ( OLDER * OVER_ONE_DAY ) );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyRejectFail()
         throws Exception
     {
         assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.NEVER, HAS_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyRejectNoManagedContentFail()
         throws Exception
     {
         assertGetProxiedReleaseArtifactWithPolicy( EXPECT_NOT_FOUND, ReleasesPolicy.NEVER, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyRejectPass()
         throws Exception
     {
         assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.NEVER, HAS_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyHourlyFail()
         throws Exception
     {
@@ -101,12 +112,14 @@ public class RepositoryServletProxiedRel
                                                    ( NEWER * ONE_MINUTE ) );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyHourlyNoManagedContent()
         throws Exception
     {
         assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.HOURLY, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyHourlyPass()
         throws Exception
     {
@@ -114,18 +127,21 @@ public class RepositoryServletProxiedRel
                                                    ( OLDER * OVER_ONE_HOUR ) );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyOnceFail()
         throws Exception
     {
         assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.ONCE, HAS_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyOnceNoManagedContent()
         throws Exception
     {
         assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.ONCE, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedReleaseArtifactPolicyOncePass()
         throws Exception
     {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedRelocatedTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedRelocatedTest.java?rev=1131428&r1=1131427&r2=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedRelocatedTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedRelocatedTest.java Sat Jun  4 16:30:30 2011
@@ -25,6 +25,7 @@ import com.meterware.httpunit.WebRequest
 import com.meterware.httpunit.WebResponse;
 
 import org.apache.maven.archiva.policies.ReleasesPolicy;
+import org.junit.Test;
 
 /**
  * RepositoryServlet Tests, Proxied, Get of Release Artifacts, with varying policy settings.
@@ -34,6 +35,8 @@ import org.apache.maven.archiva.policies
 public class RepositoryServletProxiedRelocatedTest
     extends AbstractRepositoryServletProxiedTestCase
 {
+
+    @Test
     public void testGetProxiedReleaseArtifactPolicyOncePass()
         throws Exception
     {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedSnapshotPolicyTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedSnapshotPolicyTest.java?rev=1131428&r1=1131427&r2=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedSnapshotPolicyTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedSnapshotPolicyTest.java Sat Jun  4 16:30:30 2011
@@ -25,6 +25,7 @@ import com.meterware.httpunit.WebRequest
 import com.meterware.httpunit.WebResponse;
 
 import org.apache.maven.archiva.policies.SnapshotsPolicy;
+import org.junit.Test;
 
 import java.io.File;
 
@@ -36,6 +37,8 @@ import java.io.File;
 public class RepositoryServletProxiedSnapshotPolicyTest
     extends AbstractRepositoryServletProxiedTestCase
 {
+
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedNewer()
         throws Exception
     {
@@ -43,6 +46,7 @@ public class RepositoryServletProxiedSna
                                                      HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedOlder()
         throws Exception
     {
@@ -50,12 +54,14 @@ public class RepositoryServletProxiedSna
                                                      ( OLDER * OVER_ONE_DAY ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysNoManagedContent()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyDailyFail()
         throws Exception
     {
@@ -63,12 +69,14 @@ public class RepositoryServletProxiedSna
                                                      ( NEWER * ONE_MINUTE ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyDailyNoManagedContent()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.DAILY, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyDailyPass()
         throws Exception
     {
@@ -76,6 +84,7 @@ public class RepositoryServletProxiedSna
                                                      ( OLDER * OVER_ONE_DAY ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyRejectFail()
         throws Exception
     {
@@ -83,12 +92,14 @@ public class RepositoryServletProxiedSna
                                                      HAS_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyRejectNoManagedContentFail()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.NEVER, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyRejectPass()
         throws Exception
     {
@@ -96,6 +107,7 @@ public class RepositoryServletProxiedSna
                                                      HAS_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyHourlyFail()
         throws Exception
     {
@@ -103,12 +115,14 @@ public class RepositoryServletProxiedSna
                                                      ( NEWER * ONE_MINUTE ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyHourlyNoManagedContent()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.HOURLY, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyHourlyPass()
         throws Exception
     {
@@ -116,18 +130,21 @@ public class RepositoryServletProxiedSna
                                                      ( OLDER * OVER_ONE_HOUR ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyOnceFail()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ONCE, HAS_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyOnceNoManagedContent()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ONCE, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyOncePass()
         throws Exception
     {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedTimestampedSnapshotPolicyTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedTimestampedSnapshotPolicyTest.java?rev=1131428&r1=1131427&r2=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedTimestampedSnapshotPolicyTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedTimestampedSnapshotPolicyTest.java Sat Jun  4 16:30:30 2011
@@ -25,6 +25,7 @@ import com.meterware.httpunit.WebRequest
 import com.meterware.httpunit.WebResponse;
 
 import org.apache.maven.archiva.policies.SnapshotsPolicy;
+import org.junit.Test;
 
 import java.io.File;
 
@@ -36,6 +37,8 @@ import java.io.File;
 public class RepositoryServletProxiedTimestampedSnapshotPolicyTest
     extends AbstractRepositoryServletProxiedTestCase
 {
+
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedNewer()
         throws Exception
     {
@@ -43,6 +46,7 @@ public class RepositoryServletProxiedTim
                                                      HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedOlder()
         throws Exception
     {
@@ -50,12 +54,14 @@ public class RepositoryServletProxiedTim
                                                      ( OLDER * OVER_ONE_DAY ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysNoManagedContent()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyDailyFail()
         throws Exception
     {
@@ -63,12 +69,14 @@ public class RepositoryServletProxiedTim
                                                      ( NEWER * ONE_MINUTE ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyDailyNoManagedContent()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.DAILY, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyDailyPass()
         throws Exception
     {
@@ -76,6 +84,7 @@ public class RepositoryServletProxiedTim
                                                      ( OLDER * OVER_ONE_DAY ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyRejectFail()
         throws Exception
     {
@@ -83,12 +92,14 @@ public class RepositoryServletProxiedTim
                                                      HAS_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyRejectNoManagedContentFail()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.NEVER, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyRejectPass()
         throws Exception
     {
@@ -96,6 +107,7 @@ public class RepositoryServletProxiedTim
                                                      HAS_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyHourlyFail()
         throws Exception
     {
@@ -103,12 +115,14 @@ public class RepositoryServletProxiedTim
                                                      ( NEWER * ONE_MINUTE ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyHourlyNoManagedContent()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.HOURLY, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyHourlyPass()
         throws Exception
     {
@@ -116,18 +130,21 @@ public class RepositoryServletProxiedTim
                                                      ( OLDER * OVER_ONE_HOUR ) );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyOnceFail()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ONCE, HAS_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyOnceNoManagedContent()
         throws Exception
     {
         assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ONCE, NO_MANAGED_COPY );
     }
 
+    @Test
     public void testGetProxiedSnapshotsArtifactPolicyOncePass()
         throws Exception
     {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java?rev=1131428&r1=1131427&r2=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java Sat Jun  4 16:30:30 2011
@@ -19,13 +19,10 @@ package org.apache.maven.archiva.webdav;
  * under the License.
  */
 
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletResponse;
-
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.PutMethodWebRequest;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.configuration.Configuration;
@@ -33,282 +30,299 @@ import org.apache.maven.archiva.configur
 import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration;
 import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.maven.archiva.repository.metadata.RepositoryMetadataReader;
+import org.junit.After;
+import org.junit.Before;
 
-import com.meterware.httpunit.GetMethodWebRequest;
-import com.meterware.httpunit.PutMethodWebRequest;
-import com.meterware.httpunit.WebRequest;
-import com.meterware.httpunit.WebResponse;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
 
 
 /**
  * RepositoryServletRepositoryGroupTest
- * 
+ * <p/>
  * Test Case 1.  Accessing a valid repository group root url (e.g. http://machine.com/repository/repository-group/) returns a Bad Request (HTTP 400)
  * Test Case 2.  Accessing an invalid repository group root url is forwarded to managed repository checking (this is not covered here)
  * Test Case 3.  Accessing an artifact in a valid repository group will iterate over the managed repositories in the repository group
- *     Test Case 3.a.  If an invalid managed repository is encountered (managed repository doesn't exist),
- *                     a Not Found (HTTP 404) is returned and the iteration is broken
- *     Test Case 3.b.  If an artifact is not found in a valid managed repository (after proxying, etc.),
- *                     a Not Found (HTTP 404) is set but not returned yet, the iteration continues to the next managed repository.
- *                     The Not Found (HTTP 404) is returned after exhausting all valid managed repositories
- *     Test Case 3.c.  If an artifact is found in a valid managed repository,
- *                     the artifact is returned, the iteration is broken and any Not Found (HTTP 404) is disregarded
+ * Test Case 3.a.  If an invalid managed repository is encountered (managed repository doesn't exist),
+ * a Not Found (HTTP 404) is returned and the iteration is broken
+ * Test Case 3.b.  If an artifact is not found in a valid managed repository (after proxying, etc.),
+ * a Not Found (HTTP 404) is set but not returned yet, the iteration continues to the next managed repository.
+ * The Not Found (HTTP 404) is returned after exhausting all valid managed repositories
+ * Test Case 3.c.  If an artifact is found in a valid managed repository,
+ * the artifact is returned, the iteration is broken and any Not Found (HTTP 404) is disregarded
  * Test Case 4.  Accessing a valid repository group with any http write method returns a Bad Request (HTTP 400)
- *                     
- *
  */
 public class RepositoryServletRepositoryGroupTest
     extends AbstractRepositoryServletTestCase
 {
     protected File repoRootFirst;
-    
+
     protected File repoRootLast;
-    
+
     protected File repoRootInvalid;
-    
+
     protected static final String MANAGED_REPO_FIRST = "first";
-    
+
     protected static final String MANAGED_REPO_LAST = "last";
-    
+
     protected static final String MANAGED_REPO_INVALID = "invalid";
-    
+
     protected static final String REPO_GROUP_WITH_VALID_REPOS = "group-with-valid-repos";
 
     protected static final String REPO_GROUP_WITH_INVALID_REPOS = "group-with-invalid-repos";
-    
-    
+
+
     @Override
-    protected void setUp()
+    @Before
+    public void setUp()
         throws Exception
     {
         super.setUp();
-        
+
         String appserverBase = System.getProperty( "appserver.base" );
-        
+
         Configuration configuration = archivaConfiguration.getConfiguration();
-        
+
         repoRootFirst = new File( appserverBase, "data/repositories/" + MANAGED_REPO_FIRST );
         repoRootLast = new File( appserverBase, "data/repositories/" + MANAGED_REPO_LAST );
-        
-        configuration.addManagedRepository( createManagedRepository( MANAGED_REPO_FIRST, "First Test Repo", repoRootFirst, true ) );
-        configuration.addManagedRepository( createManagedRepository( MANAGED_REPO_LAST, "Last Test Repo", repoRootLast, true ) );
-        
+
+        configuration.addManagedRepository(
+            createManagedRepository( MANAGED_REPO_FIRST, "First Test Repo", repoRootFirst, true ) );
+        configuration.addManagedRepository(
+            createManagedRepository( MANAGED_REPO_LAST, "Last Test Repo", repoRootLast, true ) );
+
         List<String> managedRepoIds = new ArrayList<String>();
         managedRepoIds.add( MANAGED_REPO_FIRST );
         managedRepoIds.add( MANAGED_REPO_LAST );
-        
+
         configuration.addRepositoryGroup( createRepositoryGroup( REPO_GROUP_WITH_VALID_REPOS, managedRepoIds ) );
-        
+
         // Create the repository group with an invalid managed repository
         repoRootInvalid = new File( appserverBase, "data/repositories/" + MANAGED_REPO_INVALID );
-        ManagedRepositoryConfiguration managedRepositoryConfiguration = createManagedRepository( MANAGED_REPO_INVALID, "Invalid Test Repo", repoRootInvalid, true );
-        
-        configuration.addManagedRepository( createManagedRepository( MANAGED_REPO_FIRST, "First Test Repo", repoRootFirst, true ) );
+        ManagedRepositoryConfiguration managedRepositoryConfiguration =
+            createManagedRepository( MANAGED_REPO_INVALID, "Invalid Test Repo", repoRootInvalid, true );
+
+        configuration.addManagedRepository(
+            createManagedRepository( MANAGED_REPO_FIRST, "First Test Repo", repoRootFirst, true ) );
         configuration.addManagedRepository( managedRepositoryConfiguration );
-        configuration.addManagedRepository( createManagedRepository( MANAGED_REPO_LAST, "Last Test Repo", repoRootLast, true ) );
-        
+        configuration.addManagedRepository(
+            createManagedRepository( MANAGED_REPO_LAST, "Last Test Repo", repoRootLast, true ) );
+
         List<String> invalidManagedRepoIds = new ArrayList<String>();
         invalidManagedRepoIds.add( MANAGED_REPO_FIRST );
         invalidManagedRepoIds.add( MANAGED_REPO_INVALID );
         invalidManagedRepoIds.add( MANAGED_REPO_LAST );
-        
-        configuration.addRepositoryGroup( createRepositoryGroup( REPO_GROUP_WITH_INVALID_REPOS, invalidManagedRepoIds ) );
-        
+
+        configuration.addRepositoryGroup(
+            createRepositoryGroup( REPO_GROUP_WITH_INVALID_REPOS, invalidManagedRepoIds ) );
+
         configuration.removeManagedRepository( managedRepositoryConfiguration );
         FileUtils.deleteDirectory( repoRootInvalid );
-        
+
         saveConfiguration( archivaConfiguration );
     }
-    
+
     @Override
-    protected void tearDown()
+    @After
+    public void tearDown()
         throws Exception
     {
         setupCleanRepo( repoRootFirst );
         setupCleanRepo( repoRootLast );
-        
+
         super.tearDown();
     }
-        
+
     /*
-     * Test Case 3.c
-     */
+    * Test Case 3.c
+    */
     public void testGetFromFirstManagedRepositoryReturnOk()
         throws Exception
     {
         String resourceName = "dummy/dummy-first-resource/1.0/dummy-first-resource-1.0.txt";
-        
+
         File dummyInternalResourceFile = new File( repoRootFirst, resourceName );
         dummyInternalResourceFile.getParentFile().mkdirs();
         FileUtils.writeStringToFile( dummyInternalResourceFile, "first", null );
-        
-        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName );
+
+        WebRequest request = new GetMethodWebRequest(
+            "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName );
         WebResponse response = sc.getResponse( request );
-        
+
         assertResponseOK( response );
         assertEquals( "Expected file contents", "first", response.getText() );
     }
-    
+
     /*
-     * Test Case 3.c
-     */
+    * Test Case 3.c
+    */
     public void testGetFromLastManagedRepositoryReturnOk()
         throws Exception
-    {        
+    {
         String resourceName = "dummy/dummy-last-resource/1.0/dummy-last-resource-1.0.txt";
-        
+
         File dummyReleasesResourceFile = new File( repoRootLast, resourceName );
         dummyReleasesResourceFile.getParentFile().mkdirs();
         FileUtils.writeStringToFile( dummyReleasesResourceFile, "last", null );
-    
-        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName );
+
+        WebRequest request = new GetMethodWebRequest(
+            "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName );
         WebResponse response = sc.getResponse( request );
-        
+
         assertResponseOK( response );
         assertEquals( "Expected file contents", "last", response.getText() );
     }
-    
+
     /*
-     * Test Case 3.b
-     */
+    * Test Case 3.b
+    */
     public void testGetFromValidRepositoryGroupReturnNotFound()
         throws Exception
     {
         String resourceName = "dummy/dummy-no-resource/1.0/dummy-no-resource-1.0.txt";
-        
-        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName );
+
+        WebRequest request = new GetMethodWebRequest(
+            "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName );
         WebResponse response = sc.getResponse( request );
-        
+
         assertResponseNotFound( response );
-    } 
-    
+    }
+
     /*
-     * Test Case 3.a
-     */
+    * Test Case 3.a
+    */
     public void testGetInvalidManagedRepositoryInGroupReturnNotFound()
         throws Exception
     {
         String resourceName = "dummy/dummy-no-resource/1.0/dummy-no-resource-1.0.txt";
-        
-        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_INVALID_REPOS + "/" + resourceName );
+
+        WebRequest request = new GetMethodWebRequest(
+            "http://machine.com/repository/" + REPO_GROUP_WITH_INVALID_REPOS + "/" + resourceName );
         WebResponse response = sc.getResponse( request );
-        
+
         assertResponseInternalServerError( response );
     }
-    
+
     /*
-     * Test Case 4
-     */
+    * Test Case 4
+    */
     public void testPutValidRepositoryGroupReturnBadRequest()
         throws Exception
     {
         String resourceName = "dummy/dummy-put-resource/1.0/dummy-put-resource-1.0.txt";
         String putUrl = "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName;
         InputStream is = getClass().getResourceAsStream( "/artifact.jar" );
-        
+
         WebRequest request = new PutMethodWebRequest( putUrl, is, "text/plain" );
         WebResponse response = sc.getResponse( request );
-         
+
         assertResponseMethodNotAllowed( response );
     }
-        
+
     // MRM-872
     public void testGetMergedMetadata()
         throws Exception
-    {   
+    {
         // first metadata file        
-        String resourceName = "dummy/dummy-merged-metadata-resource/maven-metadata.xml";  
-        
+        String resourceName = "dummy/dummy-merged-metadata-resource/maven-metadata.xml";
+
         File dummyInternalResourceFile = new File( repoRootFirst, resourceName );
         dummyInternalResourceFile.getParentFile().mkdirs();
-        FileUtils.writeStringToFile( dummyInternalResourceFile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-        		"<metadata>\n<groupId>dummy</groupId>\n<artifactId>dummy-merged-metadata-resource</artifactId>\n" +
-        		"<versioning>\n<latest>1.0</latest>\n<release>1.0</release>\n<versions>\n<version>1.0</version>\n" +
-        		"<version>2.5</version>\n</versions>\n<lastUpdated>20080708095554</lastUpdated>\n</versioning>\n</metadata>", null );
-        
+        FileUtils.writeStringToFile( dummyInternalResourceFile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+            + "<metadata>\n<groupId>dummy</groupId>\n<artifactId>dummy-merged-metadata-resource</artifactId>\n"
+            + "<versioning>\n<latest>1.0</latest>\n<release>1.0</release>\n<versions>\n<version>1.0</version>\n"
+            + "<version>2.5</version>\n</versions>\n<lastUpdated>20080708095554</lastUpdated>\n</versioning>\n</metadata>",
+                                     null );
+
         //second metadata file
-        resourceName = "dummy/dummy-merged-metadata-resource/maven-metadata.xml";        
+        resourceName = "dummy/dummy-merged-metadata-resource/maven-metadata.xml";
         dummyInternalResourceFile = new File( repoRootLast, resourceName );
         dummyInternalResourceFile.getParentFile().mkdirs();
-        FileUtils.writeStringToFile( dummyInternalResourceFile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
-                "<metadata><groupId>dummy</groupId><artifactId>dummy-merged-metadata-resource</artifactId>" +
-                "<versioning><latest>2.0</latest><release>2.0</release><versions><version>1.0</version>" +
-                "<version>1.5</version><version>2.0</version></versions><lastUpdated>20080709095554</lastUpdated>" +
-                "</versioning></metadata>", null );
-        
-        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/" +
-                "dummy-merged-metadata-resource/maven-metadata.xml" );
-        WebResponse response = sc.getResource( request );              
-        
-        File returnedMetadata = new File( getBasedir(), "/target/test-classes/retrievedMetadataFile.xml");
+        FileUtils.writeStringToFile( dummyInternalResourceFile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+            + "<metadata><groupId>dummy</groupId><artifactId>dummy-merged-metadata-resource</artifactId>"
+            + "<versioning><latest>2.0</latest><release>2.0</release><versions><version>1.0</version>"
+            + "<version>1.5</version><version>2.0</version></versions><lastUpdated>20080709095554</lastUpdated>"
+            + "</versioning></metadata>", null );
+
+        WebRequest request = new GetMethodWebRequest(
+            "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/"
+                + "dummy-merged-metadata-resource/maven-metadata.xml" );
+        WebResponse response = sc.getResource( request );
+
+        File returnedMetadata = new File( "target/test-classes/retrievedMetadataFile.xml" );
         FileUtils.writeStringToFile( returnedMetadata, response.getText() );
-        ArchivaRepositoryMetadata metadata = RepositoryMetadataReader.read( returnedMetadata );        
-        
+        ArchivaRepositoryMetadata metadata = RepositoryMetadataReader.read( returnedMetadata );
+
         assertResponseOK( response );
         assertEquals( "Versions list size", 4, metadata.getAvailableVersions().size() );
         assertTrue( "Versions list contains version 1.0", metadata.getAvailableVersions().contains( "1.0" ) );
         assertTrue( "Versions list contains version 1.5", metadata.getAvailableVersions().contains( "1.5" ) );
         assertTrue( "Versions list contains version 2.0", metadata.getAvailableVersions().contains( "2.0" ) );
         assertTrue( "Versions list contains version 2.5", metadata.getAvailableVersions().contains( "2.5" ) );
-        
+
         //check if the checksum files were generated
         File checksumFileSha1 = new File( repoRootFirst, resourceName + ".sha1" );
         checksumFileSha1.getParentFile().mkdirs();
         FileUtils.writeStringToFile( checksumFileSha1, "3290853214d3687134", null );
-        
+
         File checksumFileMd5 = new File( repoRootFirst, resourceName + ".md5" );
         checksumFileMd5.getParentFile().mkdirs();
         FileUtils.writeStringToFile( checksumFileMd5, "98745897234eda12836423", null );
-        
+
         // request the sha1 checksum of the metadata
-        request =
-            new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/" +
-                "dummy-merged-metadata-resource/maven-metadata.xml.sha1" );
+        request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/"
+                                               + "dummy-merged-metadata-resource/maven-metadata.xml.sha1" );
         response = sc.getResource( request );
-        
+
         assertResponseOK( response );
-        assertEquals( "add113b0d7f8c6adb92a5015a7a3701081edf998  maven-metadata-group-with-valid-repos.xml", response.getText() );
-        
+        assertEquals( "add113b0d7f8c6adb92a5015a7a3701081edf998  maven-metadata-group-with-valid-repos.xml",
+                      response.getText() );
+
         // request the md5 checksum of the metadata
-        request =
-            new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/" +
-                "dummy-merged-metadata-resource/maven-metadata.xml.md5" );
+        request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/"
+                                               + "dummy-merged-metadata-resource/maven-metadata.xml.md5" );
         response = sc.getResource( request );
-                
+
         assertResponseOK( response );
-        assertEquals( "5b85ea4aa5f52bb76760041a52f98de8  maven-metadata-group-with-valid-repos.xml", response.getText().trim() );
+        assertEquals( "5b85ea4aa5f52bb76760041a52f98de8  maven-metadata-group-with-valid-repos.xml",
+                      response.getText().trim() );
     }
-    
+
     // MRM-901
     public void testBrowseWithTwoArtifactsWithSameGroupIdInRepos()
         throws Exception
     {
         String resourceName = "dummy/dummy-artifact/1.0/dummy-artifact-1.0.txt";
-        
+
         File dummyInternalResourceFile = new File( repoRootFirst, resourceName );
         dummyInternalResourceFile.getParentFile().mkdirs();
         FileUtils.writeStringToFile( dummyInternalResourceFile, "first", null );
-        
+
         resourceName = "dummy/dummy-artifact/2.0/dummy-artifact-2.0.txt";
-        
+
         File dummyReleasesResourceFile = new File( repoRootLast, resourceName );
         dummyReleasesResourceFile.getParentFile().mkdirs();
         FileUtils.writeStringToFile( dummyReleasesResourceFile, "last", null );
-        
-        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/dummy-artifact/" );
+
+        WebRequest request = new GetMethodWebRequest(
+            "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/dummy-artifact/" );
         WebResponse response = sc.getResource( request );
-        
+
         assertResponseOK( response );
         assertTrue( StringUtils.contains( response.getText(), "Collection" ) );
         assertTrue( StringUtils.contains( response.getText(), "dummy/dummy-artifact" ) );
         assertTrue( StringUtils.contains( response.getText(), "1.0" ) );
         assertTrue( StringUtils.contains( response.getText(), "2.0" ) );
     }
-        
+
     protected void assertResponseMethodNotAllowed( WebResponse response )
     {
         assertNotNull( "Should have recieved a response", response );
-        assertEquals( "Should have been an 405/Method Not Allowed response code.", HttpServletResponse.SC_METHOD_NOT_ALLOWED, response.getResponseCode() );
+        assertEquals( "Should have been an 405/Method Not Allowed response code.",
+                      HttpServletResponse.SC_METHOD_NOT_ALLOWED, response.getResponseCode() );
     }
 
     protected RepositoryGroupConfiguration createRepositoryGroup( String id, List<String> repositories )

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java?rev=1131428&r1=1131427&r2=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java Sat Jun  4 16:30:30 2011
@@ -27,6 +27,7 @@ import com.meterware.httpunit.WebRespons
 import com.meterware.servletunit.InvocationContext;
 import com.meterware.servletunit.ServletRunner;
 import com.meterware.servletunit.ServletUnitClient;
+import junit.framework.TestCase;
 import net.sf.ehcache.CacheManager;
 import org.apache.archiva.repository.audit.TestAuditListener;
 import org.apache.commons.io.FileUtils;
@@ -43,16 +44,21 @@ import org.codehaus.plexus.redback.syste
 import org.codehaus.plexus.redback.system.SecuritySession;
 import org.codehaus.plexus.redback.users.User;
 import org.codehaus.plexus.redback.users.memory.SimpleUser;
-import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.codehaus.redback.integration.filter.authentication.HttpAuthenticator;
 import org.codehaus.redback.integration.filter.authentication.basic.HttpBasicAuthentication;
 import org.easymock.MockControl;
 import org.easymock.classextension.MockClassControl;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import javax.servlet.http.HttpServletResponse;
 
 /**
  * RepositoryServletSecurityTest Test the flow of the authentication and authorization checks. This does not necessarily
@@ -60,8 +66,10 @@ import javax.servlet.http.HttpServletRes
  * 
  * @version $Id$
  */
+@RunWith( SpringJUnit4ClassRunner.class )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
 public class RepositoryServletSecurityTest
-    extends PlexusInSpringTestCase
+    extends TestCase
 {
     protected static final String REPOID_INTERNAL = "internal";
 
@@ -71,6 +79,7 @@ public class RepositoryServletSecurityTe
 
     private ServletRunner sr;
 
+    @Inject
     protected ArchivaConfiguration archivaConfiguration;
 
     private DavSessionProvider davSessionProvider;
@@ -85,19 +94,19 @@ public class RepositoryServletSecurityTe
 
     private RepositoryServlet servlet;
 
+    @Before
     public void setUp()
         throws Exception
     {
         super.setUp();
 
-        String appserverBase = getTestFile( "target/appserver-base" ).getAbsolutePath();
+        String appserverBase = new File( "target/appserver-base" ).getAbsolutePath();
         System.setProperty( "appserver.base", appserverBase );
 
-        File testConf = getTestFile( "src/test/resources/repository-archiva.xml" );
+        File testConf = new File( "src/test/resources/repository-archiva.xml" );
         File testConfDest = new File( appserverBase, "conf/archiva.xml" );
         FileUtils.copyFile( testConf, testConfDest );
 
-        archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class );
         repoRootInternal = new File( appserverBase, "data/repositories/internal" );
         Configuration config = archivaConfiguration.getConfiguration();
 
@@ -108,7 +117,7 @@ public class RepositoryServletSecurityTe
 
         HttpUnitOptions.setExceptionsThrownOnErrorStatus( false );
 
-        sr = new ServletRunner( getTestFile( "src/test/resources/WEB-INF/repository-servlet-security-test/web.xml" ) );
+        sr = new ServletRunner( new File( "src/test/resources/WEB-INF/repository-servlet-security-test/web.xml" ) );
         sr.registerServlet( "/repository/*", RepositoryServlet.class.getName() );
         sc = sr.newClient();
 
@@ -156,12 +165,7 @@ public class RepositoryServletSecurityTe
     }
 
     @Override
-    protected String getPlexusConfigLocation()
-    {
-        return "org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml";
-    }
-
-    @Override
+    @After
     protected void tearDown()
         throws Exception
     {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java?rev=1131428&r1=1131427&r2=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java Sat Jun  4 16:30:30 2011
@@ -27,6 +27,7 @@ import org.apache.maven.archiva.webdav.R
 import com.meterware.httpunit.GetMethodWebRequest;
 import com.meterware.httpunit.WebRequest;
 import com.meterware.httpunit.WebResponse;
+import org.junit.Test;
 
 import java.io.File;
 
@@ -44,6 +45,7 @@ public class RepositoryServletTest
 
     private static final String NEW_REPOSITORY_NAME = "New Repository";
 
+    @Test
     public void testGetRepository()
         throws Exception
     {
@@ -53,6 +55,7 @@ public class RepositoryServletTest
         assertRepositoryValid( servlet, REPOID_INTERNAL );
     }
 
+    @Test
     public void testGetRepositoryAfterDelete()
         throws Exception
     {
@@ -68,6 +71,7 @@ public class RepositoryServletTest
         assertNull( repository );
     }
 
+    @Test
     public void testGetRepositoryAfterAdd()
         throws Exception
     {
@@ -79,7 +83,7 @@ public class RepositoryServletTest
         ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
         repo.setId( NEW_REPOSITORY_ID );
         repo.setName( NEW_REPOSITORY_NAME );
-        File repoRoot = new File( getBasedir(), "target/test-repository-root" );
+        File repoRoot = new File( "target/test-repository-root" );
         if ( !repoRoot.exists() )
         {
             repoRoot.mkdirs();
@@ -96,6 +100,7 @@ public class RepositoryServletTest
         assertRepositoryValid( servlet, REPOID_INTERNAL );
     }
 
+    @Test
     public void testGetRepositoryInvalidPathPassthroughPresent()
         throws Exception
     {
@@ -109,6 +114,7 @@ public class RepositoryServletTest
         assertEquals( "index file", response.getText() );        
     }
 
+    @Test
     public void testGetRepositoryInvalidPathPassthroughMissing()
         throws Exception
     {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/MimeTypesTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/MimeTypesTest.java?rev=1131428&r1=1131427&r2=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/MimeTypesTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/MimeTypesTest.java Sat Jun  4 16:30:30 2011
@@ -19,18 +19,31 @@ package org.apache.maven.archiva.webdav.
  * under the License.
  */
 
-import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+import junit.framework.TestCase;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import javax.inject.Inject;
 
 /**
- * MimeTypesTest 
+ * MimeTypesTest
  *
  * @version $Id: MimeTypesTest.java 6556 2007-06-20 20:44:46Z joakime $
  */
-public class MimeTypesTest extends PlexusInSpringTestCase
+@RunWith( SpringJUnit4ClassRunner.class )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
+public class MimeTypesTest
+    extends TestCase
 {
-    public void testGetMimeType() throws Exception
+    @Inject
+    MimeTypes mime;
+
+    @Test
+    public void testGetMimeType()
+        throws Exception
     {
-        MimeTypes mime = (MimeTypes) lookup( MimeTypes.class );
         assertNotNull( "MimeTypes should not be null.", mime );
 
         assertEquals( "application/pdf", mime.getMimeType( "big-book.pdf" ) );

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/RepositoryPathUtilTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/RepositoryPathUtilTest.java?rev=1131428&r1=1131427&r2=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/RepositoryPathUtilTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/RepositoryPathUtilTest.java Sat Jun  4 16:30:30 2011
@@ -23,28 +23,29 @@ import junit.framework.TestCase;
 
 /**
  */
-public class RepositoryPathUtilTest extends TestCase
+public class RepositoryPathUtilTest
+    extends TestCase
 {
     public void testGetRepositoryId()
     {
         String href = "/path/to/my/resource";
-        assertEquals("to", RepositoryPathUtil.getRepositoryName(href));
+        assertEquals( "to", RepositoryPathUtil.getRepositoryName( href ) );
 
         href = "path/to/my/resource";
-        assertEquals("to", RepositoryPathUtil.getRepositoryName(href));
+        assertEquals( "to", RepositoryPathUtil.getRepositoryName( href ) );
 
         href = "mypath";
-        assertEquals("/", RepositoryPathUtil.getLogicalResource(href));
+        assertEquals( "/", RepositoryPathUtil.getLogicalResource( href ) );
     }
 
     public void testGetLogicalPath()
     {
         String href = "/repository/internal/org/apache/maven/someartifact.jar";
-        assertEquals("/org/apache/maven/someartifact.jar", RepositoryPathUtil.getLogicalResource(href));
+        assertEquals( "/org/apache/maven/someartifact.jar", RepositoryPathUtil.getLogicalResource( href ) );
 
         href = "repository/internal/org/apache/maven/someartifact.jar";
-        assertEquals("/org/apache/maven/someartifact.jar", RepositoryPathUtil.getLogicalResource(href));
-        
+        assertEquals( "/org/apache/maven/someartifact.jar", RepositoryPathUtil.getLogicalResource( href ) );
+
         href = "repository/internal/org/apache/maven/";
         assertEquals( "/org/apache/maven/", RepositoryPathUtil.getLogicalResource( href ) );
     }

Copied: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml (from r1131427, archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/webapp/WEB-INF/web.xml)
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml?p2=archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml&p1=archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/webapp/WEB-INF/web.xml&r1=1131427&r2=1131428&rev=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/webapp/WEB-INF/web.xml (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml Sat Jun  4 16:30:30 2011
@@ -1,4 +1,5 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0"?>
+
 <!--
   ~ Licensed to the Apache Software Foundation (ASF) under one
   ~ or more contributor license agreements.  See the NOTICE file
@@ -17,27 +18,16 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           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"
+       default-lazy-init="true">
 
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
-  <display-name>Apache Archiva</display-name>
-
-  <listener>
-    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
-  </listener>
-
-  <context-param>
-    <param-name>contextClass</param-name>
-    <param-value>org.codehaus.plexus.spring.PlexusWebApplicationContext</param-value>
-  </context-param>
-
-   <context-param>
-    <param-name>contextConfigLocation</param-name>
-    <param-value>
-        classpath*:/META-INF/plexus/components.xml
-    </param-value>
-  </context-param>
+  <context:annotation-config/>
+  <context:component-scan base-package="org.apache.maven.archiva.webdav"/>
 
-</web-app>
+</beans>
\ No newline at end of file

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/webapp/WEB-INF/web.xml?rev=1131428&r1=1131427&r2=1131428&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/webapp/WEB-INF/web.xml (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/webapp/WEB-INF/web.xml Sat Jun  4 16:30:30 2011
@@ -29,14 +29,10 @@
   </listener>
 
   <context-param>
-    <param-name>contextClass</param-name>
-    <param-value>org.codehaus.plexus.spring.PlexusWebApplicationContext</param-value>
-  </context-param>
-
-   <context-param>
     <param-name>contextConfigLocation</param-name>
     <param-value>
-        classpath*:/META-INF/plexus/components.xml
+      classpath*:/META-INF/spring-context.xml,
+      classpath*:spring-context.xml
     </param-value>
   </context-param>
 



Mime
View raw message