You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2011/06/04 12:21:35 UTC
svn commit: r1131365 - in
/archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test:
java/org/apache/archiva/web/xmlrpc/services/ resources/
Author: olamy
Date: Sat Jun 4 10:21:34 2011
New Revision: 1131365
URL: http://svn.apache.org/viewvc?rev=1131365&view=rev
Log:
remove of plexus-spring : fix archiva-xmlrpc-services/
Added:
archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/resources/
archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/resources/spring-context.xml (with props)
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java
archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/SearchServiceImplTest.java
Modified: archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java?rev=1131365&r1=1131364&r2=1131365&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java Sat Jun 4 10:21:34 2011
@@ -19,6 +19,7 @@ package org.apache.archiva.web.xmlrpc.se
* under the License.
*/
+import junit.framework.TestCase;
import org.apache.archiva.audit.AuditEvent;
import org.apache.archiva.audit.AuditListener;
import org.apache.archiva.metadata.model.ArtifactMetadata;
@@ -53,9 +54,13 @@ import org.apache.maven.archiva.reposito
import org.apache.maven.archiva.repository.content.PathParser;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.codehaus.plexus.registry.Registry;
-import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.easymock.MockControl;
import org.easymock.classextension.MockClassControl;
+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;
import java.io.File;
import java.io.IOException;
@@ -74,8 +79,10 @@ import static org.mockito.Mockito.when;
*
* @version $Id: AdministrationServiceImplTest.java
*/
+@RunWith( SpringJUnit4ClassRunner.class )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
public class AdministrationServiceImplTest
- extends PlexusInSpringTestCase
+ extends TestCase
{
private MockControl archivaConfigControl;
@@ -139,7 +146,8 @@ public class AdministrationServiceImplTe
private static final String STAGE = "-stage";
- protected void setUp()
+ @Before
+ public void setUp()
throws Exception
{
super.setUp();
@@ -200,7 +208,7 @@ public class AdministrationServiceImplTe
}
/* Tests for repository consumers */
-
+ @Test
public void testGetAllRepoConsumers()
throws Exception
{
@@ -224,6 +232,7 @@ public class AdministrationServiceImplTe
assertTrue( repoConsumers.contains( "check-metadata" ) );
}
+ @Test
public void testConfigureValidRepositoryConsumer()
throws Exception
{
@@ -312,6 +321,7 @@ public class AdministrationServiceImplTe
}
}
+ @Test
public void testConfigureInvalidRepositoryConsumer()
throws Exception
{
@@ -337,7 +347,7 @@ public class AdministrationServiceImplTe
}
/* Tests for delete artifact */
-
+ @Test
public void testDeleteM2ArtifactArtifactExists()
throws Exception
{
@@ -385,6 +395,7 @@ public class AdministrationServiceImplTe
assertTrue( new File( managedRepo.getLocation(), "org/apache/archiva/archiva-test/1.1" ).exists() );
}
+ @Test
public void testDeleteM1ArtifactArtifactExists()
throws Exception
{
@@ -452,6 +463,7 @@ public class AdministrationServiceImplTe
assertTrue( new File( repo, "org.apache.archiva/poms/archiva-diff-1.0.pom" ).exists() );
}
+ @Test
public void testDeleteArtifactArtifactDoesNotExist()
throws Exception
{
@@ -487,9 +499,9 @@ public class AdministrationServiceImplTe
private ManagedRepositoryConfiguration createManagedRepo( String layout, String directory )
throws IOException
{
- File srcDir = new File( getBasedir(), "src/test/repositories/" + directory );
+ File srcDir = new File( "src/test/repositories/" + directory );
- File repoDir = getTestFile( "target/test-repos/" + directory );
+ File repoDir = new File( "target/test-repos/" + directory );
FileUtils.deleteDirectory( repoDir );
@@ -501,6 +513,7 @@ public class AdministrationServiceImplTe
return managedRepo;
}
+ @Test
public void testDeleteArtifacRepositoryDoesNotExist()
throws Exception
{
@@ -525,7 +538,7 @@ public class AdministrationServiceImplTe
}
/* Tests for repository scanning */
-
+ @Test
public void testExecuteRepoScannerRepoExistsAndNotBeingScanned()
throws Exception
{
@@ -564,6 +577,7 @@ public class AdministrationServiceImplTe
repositoryTaskSchedulerControl.verify();
}
+ @Test
public void testExecuteRepoScannerRepoExistsButBeingScanned()
throws Exception
{
@@ -596,6 +610,7 @@ public class AdministrationServiceImplTe
repositoryTaskSchedulerControl.verify();
}
+ @Test
public void testExecuteRepoScannerRepoDoesNotExist()
throws Exception
{
@@ -620,7 +635,7 @@ public class AdministrationServiceImplTe
}
/* Tests for querying repositories */
-
+ @Test
public void testGetAllManagedRepositories()
throws Exception
{
@@ -646,6 +661,7 @@ public class AdministrationServiceImplTe
assertManagedRepo( repos.get( 1 ), managedRepos.get( 1 ) );
}
+ @Test
public void testGetAllRemoteRepositories()
throws Exception
{
@@ -673,6 +689,7 @@ public class AdministrationServiceImplTe
assertRemoteRepo( repos.get( 1 ), remoteRepos.get( 1 ) );
}
+ @Test
public void testDeleteInvalidRepositoryContent()
{
archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
@@ -694,6 +711,7 @@ public class AdministrationServiceImplTe
configControl.verify();
}
+ @Test
public void testDeleteRepositoryContent()
throws Exception
{
@@ -720,7 +738,7 @@ public class AdministrationServiceImplTe
}
/* Merge method */
-
+ @Test
public void testMergeRepositoryWithInvalidRepository()
throws Exception
{
@@ -743,6 +761,7 @@ public class AdministrationServiceImplTe
configControl.verify();
}
+ @Test
public void testMergeWithNoStagingRepository()
throws Exception
{
@@ -768,6 +787,7 @@ public class AdministrationServiceImplTe
configControl.verify();
}
+ @Test
public void testMergeRepositoriesAndScan()
throws Exception
{
@@ -827,6 +847,7 @@ public class AdministrationServiceImplTe
repositoryTaskSchedulerControl.verify();
}
+ @Test
public void testMergeRepositoriesWithConflictsAndScan()
throws Exception
{
@@ -896,6 +917,7 @@ public class AdministrationServiceImplTe
repositoryTaskSchedulerControl.verify();
}
+ @Test
public void testAddManagedRepository()
throws Exception
{
@@ -953,6 +975,7 @@ public class AdministrationServiceImplTe
registryControl.verify();
}
+ @Test
public void testAddManagedRepositoryInvalidId()
throws Exception
{
@@ -997,6 +1020,7 @@ public class AdministrationServiceImplTe
}
}
+ @Test
public void testAddManagedRepositoryInvalidName()
throws Exception
{
@@ -1042,6 +1066,7 @@ public class AdministrationServiceImplTe
}
}
+ @Test
public void testAddManagedRepositoryInvalidLocation()
throws Exception
{
Modified: archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/SearchServiceImplTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/SearchServiceImplTest.java?rev=1131365&r1=1131364&r2=1131365&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/SearchServiceImplTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/SearchServiceImplTest.java Sat Jun 4 10:21:34 2011
@@ -20,6 +20,7 @@ package org.apache.archiva.web.xmlrpc.se
*/
+import junit.framework.TestCase;
import org.apache.archiva.indexer.search.RepositorySearch;
import org.apache.archiva.indexer.search.SearchResultHit;
import org.apache.archiva.indexer.search.SearchResultLimits;
@@ -38,9 +39,13 @@ import org.apache.archiva.web.xmlrpc.api
import org.apache.archiva.web.xmlrpc.api.beans.Artifact;
import org.apache.archiva.web.xmlrpc.api.beans.Dependency;
import org.apache.archiva.web.xmlrpc.security.XmlRpcUserRepositories;
-import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.easymock.MockControl;
import org.easymock.classextension.MockClassControl;
+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;
import java.util.ArrayList;
import java.util.Arrays;
@@ -56,8 +61,10 @@ import static org.mockito.Mockito.when;
*
* @version $Id: SearchServiceImplTest.java
*/
+@RunWith( SpringJUnit4ClassRunner.class )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
public class SearchServiceImplTest
- extends PlexusInSpringTestCase
+ extends TestCase
{
private SearchService searchService;
@@ -88,6 +95,7 @@ public class SearchServiceImplTest
private RepositorySession repositorySession;
@Override
+ @Before
public void setUp()
throws Exception
{
@@ -114,7 +122,7 @@ public class SearchServiceImplTest
}
// MRM-1230
-
+ @Test
public void testQuickSearchModelPackagingIsUsed()
throws Exception
{
@@ -177,6 +185,7 @@ public class SearchServiceImplTest
assertEquals( "repo1.mirror", artifact.getRepositoryId() );
}
+ @Test
public void testQuickSearchDefaultPackagingIsUsed()
throws Exception
{
@@ -240,6 +249,7 @@ public class SearchServiceImplTest
assertEquals( "public.releases", artifact.getRepositoryId() );
}
+ @Test
public void testQuickSearchArtifactRegularSearch()
throws Exception
{
@@ -302,6 +312,7 @@ public class SearchServiceImplTest
assertEquals( "repo1.mirror", artifact.getRepositoryId() );
}
+ @Test
public void testQuickSearchNoResults()
throws Exception
{
@@ -328,6 +339,7 @@ public class SearchServiceImplTest
assertEquals( 0, artifacts.size() );
}
+ @Test
public void testGetArtifactByChecksum()
throws Exception
{
@@ -358,6 +370,7 @@ public class SearchServiceImplTest
assertEquals( TEST_REPO, result.getRepositoryId() );
}
+ @Test
public void testGetArtifactVersionsArtifactExists()
throws Exception
{
@@ -401,18 +414,21 @@ public class SearchServiceImplTest
"1.2.1-SNAPSHOT", "pom" ), artifacts.get( 5 ) );
}
+ @Test
public void testGetArtifactVersionsByDateArtifactExists()
throws Exception
{
// TODO
}
+ @Test
public void testGetArtifactVersionsByDateArtifactDoesNotExist()
throws Exception
{
// TODO
}
+ @Test
public void testGetDependenciesArtifactExists()
throws Exception
{
@@ -458,6 +474,7 @@ public class SearchServiceImplTest
assertEquals( new Dependency( "junit", "junit", "2.4", null, null, "test" ), dependencies.get( 1 ) );
}
+ @Test
public void testGetDependenciesArtifactDoesNotExist()
throws Exception
{
@@ -486,18 +503,21 @@ public class SearchServiceImplTest
metadataResolverControl.verify();
}
+ @Test
public void testGetDependencyTreeArtifactExists()
throws Exception
{
// TODO
}
+ @Test
public void testGetDependencyTreeArtifactDoesNotExist()
throws Exception
{
// TODO
}
+ @Test
public void testGetDependees()
throws Exception
{
@@ -540,6 +560,7 @@ public class SearchServiceImplTest
1 ) );
}
+ @Test
public void testGetDependeesArtifactDoesNotExist()
throws Exception
{
Added: archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/resources/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/resources/spring-context.xml?rev=1131365&view=auto
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/resources/spring-context.xml (added)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/resources/spring-context.xml Sat Jun 4 10:21:34 2011
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ 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">
+
+</beans>
\ No newline at end of file
Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision