<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-slf4j-logging</artifactId>
</dependency>
+ <!--
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</dependency>
- <!-- TODO: temporary spring dependencies for migration -->
+ removed for migration to spring -->
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>2.5.1</version>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-spring</artifactId>
+ <version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
* under the License.
*/
-import org.codehaus.plexus.PlexusTestCase;
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
import org.codehaus.plexus.registry.RegistryException;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.codehaus.plexus.util.FileUtils;
import org.custommonkey.xmlunit.XMLAssert;
import org.easymock.MockControl;
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
/**
* Test the configuration store.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
*/
public class ArchivaConfigurationTest
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
+ /**
+ * {@inheritDoc}
+ * @see org.codehaus.plexus.spring.PlexusInSpringTestCase#getSpringConfigLocation()
+ */
+ protected String getSpringConfigLocation()
+ throws Exception
+ {
+ return "org/apache/maven/archiva/configuration/spring-context.xml";
+ }
+
public void testGetConfigurationFromRegistryWithASingleNamedConfigurationResource()
throws Exception
{
(ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-not-allowed-to-write-to-user" );
Configuration config = archivaConfiguration.getConfiguration();
archivaConfiguration.save( config );
- // No Exception == test passes.
+ // No Exception == test passes.
// Expected Path is: Should not have thrown an exception.
}
archivaConfiguration.save( configuration );
// Release existing
- release( archivaConfiguration );
+// FIXME spring equivalent ? release( archivaConfiguration );
// Reload.
archivaConfiguration =
* under the License.
*/
-import org.codehaus.plexus.PlexusTestCase;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+
/**
* @author Edwin Punzalan
*/
public class MavenProxyPropertyLoaderTest
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
private MavenProxyPropertyLoader loader;
+ /**
+ * {@inheritDoc}
+ * @see org.codehaus.plexus.spring.PlexusInSpringTestCase#getSpringConfigLocation()
+ */
+ protected String getSpringConfigLocation()
+ throws Exception
+ {
+ return "org/apache/maven/archiva/configuration/spring-context.xml";
+ }
+
public void testLoadValidMavenProxyConfiguration()
throws IOException, InvalidConfigurationException
{
--- /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 junit.framework.TestSuite;
/**
- * Utility class to aide IDE developers.
+ * Utility class to aide IDE developers.
*
* @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
* @version $Id$
suite.addTestSuite( GraphvizDotTool.class );
suite.addTestSuite( DepManDeepVersionDependencyGraphTest.class );
suite.addTestSuite( SimpleDependencyGraphTest.class );
- suite.addTestSuite( MavenProjectInfoReportsPluginDependencyGraphTest.class );
+// suite.addTestSuite( MavenProjectInfoReportsPluginDependencyGraphTest.class );
suite.addTestSuite( ArchivaCommonDependencyGraphTest.class );
suite.addTestSuite( WagonManagerDependencyGraphTest.class );
suite.addTestSuite( ContinuumStoreDependencyGraphTest.class );
import java.util.Date;
import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
/**
- * ArchivaModelClonerTest
+ * ArchivaModelClonerTest
*
* @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
* @version $Id: ArchivaModelClonerTest.java 525951 2007-04-05 20:11:19Z joakime $
*/
public class ArchivaArtifactTest
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
public void testArtifactModelProcessed()
{
ArchivaArtifactModel model = new ArchivaArtifactModel();
-
+
assertNull( "whenProcessed", model.getWhenProcessed() );
assertFalse( "isProcessed", model.isProcessed() );
-
+
model.setWhenProcessed( new Date() );
-
+
assertTrue( "isProcessed", model.isProcessed() );
}
-
+
}
*/
import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
/**
- * ArchivaModelClonerTest
+ * ArchivaModelClonerTest
*
* @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
* @version $Id$
*/
public class ArchivaModelClonerTest
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
public void testCloneProjectModelWithParent()
{
<artifactId>archiva-repository-layer</artifactId>
<name>Archiva Repository Interface Layer</name>
<dependencies>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-spring</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-configuration</artifactId>
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
-import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import java.io.File;
/**
- * AbstractRepositoryLayerTestCase
+ * AbstractRepositoryLayerTestCase
*
* @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
* @version $Id$
*/
public abstract class AbstractRepositoryLayerTestCase
- extends PlexusTestCase
+ extends PlexusInSpringTestCase
{
+ /**
+ * {@inheritDoc}
+ * @see org.codehaus.plexus.spring.PlexusInSpringTestCase#getSpringConfigLocation()
+ */
+ @Override
+ protected String getSpringConfigLocation()
+ throws Exception
+ {
+ return "org/apache/maven/archiva/repository/spring-context.xml";
+ }
+
protected ManagedRepositoryConfiguration createRepository( String id, String name, File location )
{
ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
repo.setUrl( url );
return repo;
}
-
+
protected ManagedRepositoryContent createManagedRepositoryContent( String id, String name, File location, String layout )
throws Exception
{
--- /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
+++ /dev/null
-package org.apache.maven.archiva.web.startup;
-
-/*
- * 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.
- */
-
-import org.apache.maven.archiva.common.spring.PlexusFactory;
-import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.xwork.PlexusLifecycleListener;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.web.context.support.WebApplicationContextUtils;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-public class PlexusSpringListener
- implements ServletContextListener
-{
- public void contextInitialized( ServletContextEvent event )
- {
- BeanFactory factory = WebApplicationContextUtils.getRequiredWebApplicationContext( event.getServletContext() );
-
- PlexusContainer container =
- (PlexusContainer) event.getServletContext().getAttribute( PlexusLifecycleListener.KEY );
-
- container.getContext().put( BeanFactory.class, factory );
- PlexusFactory plexusFactory = (PlexusFactory) factory.getBean( "plexusCacheFactory" );
- plexusFactory.setContainer( container );
- }
-
- public void contextDestroyed( ServletContextEvent event )
- {
- // This space left intentionally blank
- }
-}
<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"
- default-lazy-init="true">
- <!-- default-lazy-init is required by the plexusCacheFactory -->
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="loggerManager" class="org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager"
+ init-method="initialize"/>
<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"/>
+ <constructor-arg ref="cache#url-failures-cache" 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 class="org.springframework.web.context.support.ServletContextAttributeExporter"
+ lazy-init="false" >
+ <property name="attributes">
+ <map>
+ <entry key="webwork.plexus.container" value-ref="plexusContainer"/>
+ </map>
+ </property>
</bean>
+
</beans>
\ No newline at end of file
<url-pattern>/*</url-pattern>
</filter-mapping>
- <listener>
- <listener-class>org.codehaus.plexus.xwork.PlexusLifecycleListener</listener-class>
- </listener>
-
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
- <listener>
- <listener-class>org.apache.maven.archiva.web.startup.PlexusSpringListener</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
+ /WEB-INF/applicationContext.xml
+ </param-value>
+ </context-param>
<servlet>
<servlet-name>RepositoryServlet</servlet-name>