From 532dd24896a775c933becf9d287a65ba2962fd6d Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 6 Jun 2011 11:06:00 +0000 Subject: [PATCH] fix some unit tests initializationError git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1132596 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/archiva/webdav/DavResourceTest.java | 2 +- .../webdav/RepositoryServletRepositoryGroupTest.java | 8 ++++++++ .../archiva/webdav/RepositoryServletSecurityTest.java | 11 ++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java index 27a6f9837..c737f8e68 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java @@ -95,7 +95,7 @@ public class DavResourceTest } @After - protected void tearDown() + public void tearDown() throws Exception { super.tearDown(); diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java index bcf8c26d4..e8b0a07d4 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java @@ -32,6 +32,7 @@ import org.apache.maven.archiva.model.ArchivaRepositoryMetadata; import org.apache.maven.archiva.repository.metadata.RepositoryMetadataReader; import org.junit.After; import org.junit.Before; +import org.junit.Test; import javax.servlet.http.HttpServletResponse; import java.io.File; @@ -139,6 +140,7 @@ public class RepositoryServletRepositoryGroupTest /* * Test Case 3.c */ + @Test public void testGetFromFirstManagedRepositoryReturnOk() throws Exception { @@ -159,6 +161,7 @@ public class RepositoryServletRepositoryGroupTest /* * Test Case 3.c */ + @Test public void testGetFromLastManagedRepositoryReturnOk() throws Exception { @@ -179,6 +182,7 @@ public class RepositoryServletRepositoryGroupTest /* * Test Case 3.b */ + @Test public void testGetFromValidRepositoryGroupReturnNotFound() throws Exception { @@ -194,6 +198,7 @@ public class RepositoryServletRepositoryGroupTest /* * Test Case 3.a */ + @Test public void testGetInvalidManagedRepositoryInGroupReturnNotFound() throws Exception { @@ -209,6 +214,7 @@ public class RepositoryServletRepositoryGroupTest /* * Test Case 4 */ + @Test public void testPutValidRepositoryGroupReturnBadRequest() throws Exception { @@ -223,6 +229,7 @@ public class RepositoryServletRepositoryGroupTest } // MRM-872 + @Test public void testGetMergedMetadata() throws Exception { @@ -292,6 +299,7 @@ public class RepositoryServletRepositoryGroupTest } // MRM-901 + @Test public void testBrowseWithTwoArtifactsWithSameGroupIdInRepos() throws Exception { diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java index 66913606c..29c7a5282 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java @@ -50,6 +50,7 @@ import org.easymock.MockControl; import org.easymock.classextension.MockClassControl; import org.junit.After; import org.junit.Before; +import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -166,7 +167,7 @@ public class RepositoryServletSecurityTest @Override @After - protected void tearDown() + public void tearDown() throws Exception { if ( sc != null ) @@ -191,6 +192,7 @@ public class RepositoryServletSecurityTest // test deploy with invalid user, and guest has no write access to repo // 401 must be returned + @Test public void testPutWithInvalidUserAndGuestHasNoWriteAccess() throws Exception { @@ -226,6 +228,7 @@ public class RepositoryServletSecurityTest } // test deploy with invalid user, but guest has write access to repo + @Test public void testPutWithInvalidUserAndGuestHasWriteAccess() throws Exception { @@ -282,6 +285,7 @@ public class RepositoryServletSecurityTest } // test deploy with a valid user with no write access + @Test public void testPutWithValidUserWithNoWriteAccess() throws Exception { @@ -329,6 +333,7 @@ public class RepositoryServletSecurityTest } // test deploy with a valid user with write access + @Test public void testPutWithValidUserWithWriteAccess() throws Exception { @@ -385,6 +390,7 @@ public class RepositoryServletSecurityTest } // test get with invalid user, and guest has read access to repo + @Test public void testGetWithInvalidUserAndGuestHasReadAccess() throws Exception { @@ -440,6 +446,7 @@ public class RepositoryServletSecurityTest } // test get with invalid user, and guest has no read access to repo + @Test public void testGetWithInvalidUserAndGuestHasNoReadAccess() throws Exception { @@ -477,6 +484,7 @@ public class RepositoryServletSecurityTest } // test get with valid user with read access to repo + @Test public void testGetWithAValidUserWithReadAccess() throws Exception { @@ -527,6 +535,7 @@ public class RepositoryServletSecurityTest } // test get with valid user with no read access to repo + @Test public void testGetWithAValidUserWithNoReadAccess() throws Exception { -- 2.39.5