+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <bean id="urlFailureCache" class="org.apache.maven.archiva.policies.urlcache.DefaultUrlFailureCache">
- <constructor-arg ref="cache#url-failures-cache" type="org.codehaus.plexus.cache.Cache"/>
- </bean>
-</beans>
\ No newline at end of file
import org.apache.maven.archiva.database.ArtifactDAO;
import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.repository.ManagedRepositoryContent;
-import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.jpox.SchemaTool;
import java.io.File;
* @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
*/
public abstract class AbstractRepositoryPurgeTest
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
public static final String TEST_REPO_ID = "test-repo";
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="urlFailureCache" class="org.apache.maven.archiva.policies.urlcache.DefaultUrlFailureCache">
+ <!-- collaborators and configuration for this bean go here -->
+ <constructor-arg ref="cache#url-failures-cache" type="org.codehaus.plexus.cache.Cache"/>
+ </bean>
+
+</beans>
\ No newline at end of file
<level value="error"/>
</logger>
+ <logger name="org.codehaus.plexus.spring">
+ <level value="warn"/>
+ </logger>
+
<logger name="org.springframework">
- <level value="DEBUG"/>
+ <level value="warn"/>
</logger>
<root>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <bean id="urlFailureCache" class="org.apache.maven.archiva.policies.urlcache.DefaultUrlFailureCache">
- <!-- collaborators and configuration for this bean go here -->
- <constructor-arg ref="cache#url-failures-cache" type="org.codehaus.plexus.cache.Cache"/>
- </bean>
-
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <bean id="urlFailureCache" class="org.apache.maven.archiva.policies.urlcache.DefaultUrlFailureCache">
- <constructor-arg ref="cache#url-failures-cache" type="org.codehaus.plexus.cache.Cache"/>
- </bean>
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <bean id="loggerManager" class="org.codehaus.plexus.logging.console.ConsoleLoggerManager"
- init-method="initialize"/>
-
- <bean id="urlFailureCache" class="org.apache.maven.archiva.policies.urlcache.DefaultUrlFailureCache">
- <constructor-arg ref="cache#url-failures-cache" type="org.codehaus.plexus.cache.Cache"/>
- </bean>
-</beans>
\ No newline at end of file
import org.apache.maven.archiva.database.updater.TestDatabaseUnprocessedConsumer;
import org.apache.maven.archiva.model.ArtifactReference;
import org.apache.maven.archiva.model.VersionedReference;
-import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.jpox.SchemaTool;
import java.io.File;
* @version $Id$
*/
public abstract class AbstractArchivaDatabaseTestCase
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
private static final String TIMESTAMP = "yyyy/MM/dd HH:mm:ss";
public RepositoryBrowsing lookupBrowser()
throws Exception
{
- RepositoryBrowsing browser = (RepositoryBrowsing) lookup( RepositoryBrowsing.class.getName() );
+ RepositoryBrowsing browser = (RepositoryBrowsing) lookup( RepositoryBrowsing.class );
assertNotNull( "RepositoryBrowsing should not be null.", browser );
return browser;
}
*/
import org.apache.commons.collections.CollectionUtils;
-import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import java.util.List;
* @version $Id$
*/
public class DatabaseConsumersTest
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
private DatabaseConsumers lookupDbConsumers()
throws Exception
*/
import org.apache.maven.archiva.database.ArchivaDAO;
-import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.jpox.SchemaTool;
import java.io.File;
* @version $Id$
*/
public abstract class AbstractArtifactReportsTestCase
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
protected ArchivaDAO dao;
import org.apache.maven.archiva.database.constraints.ArtifactsProcessedConstraint;
import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.scheduled.tasks.DatabaseTask;
-import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
import org.jpox.SchemaTool;
* @version $Id:$
*/
public class ArchivaDatabaseUpdateTaskExecutorTest
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
private TaskExecutor taskExecutor;
import org.apache.maven.archiva.database.ArtifactDAO;
import org.apache.maven.archiva.database.constraints.ArtifactsProcessedConstraint;
import org.apache.maven.archiva.scheduled.tasks.RepositoryTask;
-import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
import org.jpox.SchemaTool;
* @version $Id$
*/
public class ArchivaRepositoryScanningTaskExecutorTest
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
private TaskExecutor taskExecutor;
* under the License.
*/
-import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
/**
* SecurityStartupTest
* @version $Id$
*/
public class SecurityStartupTest
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
private SecurityStartup secStart;
import com.meterware.servletunit.ServletRunner;
import com.meterware.servletunit.ServletUnitClient;
import org.apache.commons.io.FileUtils;
-import org.apache.maven.archiva.common.spring.PlexusFactory;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
import org.codehaus.plexus.PlexusConstants;
-import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
* @version $Id$
*/
public abstract class AbstractRepositoryServletTestCase
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
protected static final String REPOID_INTERNAL = "internal";
throws Exception
{
super.setUp();
-
- String appserverBase = getTestFile( "target/appserver-base" ).getAbsolutePath();
- System.setProperty( "appserver.base", appserverBase );
-
- File testConf = getTestFile( "src/test/resources/repository-archiva.xml" );
- File testConfDest = new File( appserverBase, "conf/archiva.xml" );
- FileUtils.copyFile( testConf, testConfDest );
-
- BeanFactory factory = new XmlBeanFactory(
- new ClassPathResource( "/org/apache/maven/archiva/web/repository/spring-context.xml" ) );
- getContainer().getContext().put( BeanFactory.class, factory );
- PlexusFactory plexusFactory = (PlexusFactory) factory.getBean( "plexusCacheFactory" );
- plexusFactory.setContainer( container );
-
- archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class );
- repoRootInternal = new File( appserverBase, "data/repositories/internal" );
- Configuration config = archivaConfiguration.getConfiguration();
-
- config.addManagedRepository( createManagedRepository( REPOID_INTERNAL, "Internal Test Repo", repoRootInternal ) );
- saveConfiguration();
-
- sr = new ServletRunner();
- sr.registerServlet( "/repository/*", UnauthenticatedRepositoryServlet.class.getName() );
- sc = sr.newClient();
- HttpSession session = sc.getSession( true );
- ServletContext servletContext = session.getServletContext();
- servletContext.setAttribute( PlexusConstants.PLEXUS_KEY, getContainer() );
+
+ try
+ {
+ String appserverBase = getTestFile( "target/appserver-base" ).getAbsolutePath();
+ System.setProperty( "appserver.base", appserverBase );
+
+ File testConf = getTestFile( "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();
+
+ config.addManagedRepository( createManagedRepository( REPOID_INTERNAL, "Internal Test Repo", repoRootInternal ) );
+ saveConfiguration();
+
+ sr = new ServletRunner();
+ sr.registerServlet( "/repository/*", UnauthenticatedRepositoryServlet.class.getName() );
+ sc = sr.newClient();
+ }
+ finally
+ {
+ tearDown();
+ }
}
-
+
@Override
- protected String getConfigurationName( String subname )
+ protected String getPlexusConfigLocation()
throws Exception
{
return "org/apache/maven/archiva/web/repository/RepositoryServletTest.xml";
}
-
+
@Override
protected void tearDown()
throws Exception
{
- release( archivaConfiguration );
-
if ( sc != null )
{
sc.clearContents();
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <bean id="urlFailureCache" class="org.apache.maven.archiva.policies.urlcache.DefaultUrlFailureCache">
- <!-- collaborators and configuration for this bean go here -->
- <constructor-arg ref="urlCache" type="org.codehaus.plexus.cache.Cache"/>
- </bean>
- <bean id="urlCache" factory-bean="plexusCacheFactory" factory-method="createInstance"/>
- <bean id="plexusCacheFactory" class="org.apache.maven.archiva.common.spring.PlexusFactory">
- <constructor-arg index="0" value="org.codehaus.plexus.cache.Cache"/>
- <constructor-arg index="1" value="url-failures-cache"/>
- </bean>
-</beans>
\ No newline at end of file