+++ /dev/null
-<?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">
-
-
-</beans>
\ No newline at end of file
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
private WagonFactory wagonFactory;
@Inject
- @Named ( value = "repositoryProxyConnectors#default" )
- private RepositoryProxyConnectors connectors;
+ private ApplicationContext applicationContext;
private static final Logger log = LoggerFactory.getLogger( Maven2RepositoryStorage.class );
pomReference.setVersion( artifact.getVersion() );
pomReference.setType( "pom" );
+ RepositoryProxyConnectors connectors =
+ applicationContext.getBean( "repositoryProxyConnectors#default", RepositoryProxyConnectors.class );
+
// Get the artifact POM from proxied repositories if needed
connectors.fetchFromProxies( managedRepository, pomReference );
public void addListener( ConfigurationListener listener )
{
- throw new UnsupportedOperationException();
+ // no op
}
public void removeListener( ConfigurationListener listener )
{
- throw new UnsupportedOperationException();
+ // no op
}
public void addChangeListener( RegistryListener listener )
{
- throw new UnsupportedOperationException();
+ // no op
}
public void reload()
String projectId, String projectVersion )
throws MetadataResolutionException
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
public Collection<ProjectVersionReference> resolveProjectReferences( RepositorySession session, String repoId,
String projectVersion )
throws MetadataResolutionException
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
public Collection<String> resolveRootNamespaces( RepositorySession session, String repoId )
throws MetadataResolutionException
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
public Collection<String> resolveNamespaces( RepositorySession session, String repoId, String namespace )
throws MetadataResolutionException
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
public Collection<String> resolveProjects( RepositorySession session, String repoId, String namespace )
throws MetadataResolutionException
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
public Collection<String> resolveProjectVersions( RepositorySession session, String repoId, String namespace,
String projectId )
throws MetadataResolutionException
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
public Collection<ArtifactMetadata> resolveArtifacts( RepositorySession session, String repoId, String namespace,
String projectId, String projectVersion )
throws MetadataResolutionException
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
}
*/
import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.repository.AbstractRepositoryLayerTestCase;
import org.apache.archiva.repository.layout.LayoutException;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.apache.commons.lang.StringUtils;
* AbstractDefaultRepositoryContentTestCase
*/
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
public abstract class AbstractDefaultRepositoryContentTestCase
extends AbstractRepositoryLayerTestCase
{
*/
import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.repository.AbstractRepositoryLayerTestCase;
import org.apache.archiva.repository.layout.LayoutException;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.junit.Test;
* AbstractLegacyRepositoryContentTestCase
*/
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
public abstract class AbstractLegacyRepositoryContentTestCase
extends AbstractRepositoryLayerTestCase
{
+
@Test
public void testBadPathArtifactIdMissingA()
{
assertBadPath( "groupId/jars/1.0.jar", "artifactId is missing" );
}
+
@Test
public void testBadPathMissingType()
{
assertBadPath( "invalid/invalid-1.0.jar", "path is too short" );
}
+
@Test
public void testBadPathWrongPackageExtension()
{
+++ /dev/null
-package org.apache.archiva.metadata.repository.storage.maven2;
-
-/*
- * 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.archiva.admin.model.beans.ManagedRepository;
-import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.archiva.repository.ManagedRepositoryContent;
-import org.apache.archiva.repository.RemoteRepositoryContent;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.junit.runner.RunWith;
-import org.springframework.context.ApplicationContext;
-import org.springframework.test.context.ContextConfiguration;
-
-import javax.inject.Inject;
-import java.io.File;
-
-/**
- * AbstractRepositoryLayerTestCase
- *
- *
- */
-@RunWith( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
-public abstract class AbstractRepositoryLayerTestCase
-{
- @Rule
- public TestName name = new TestName();
-
- @Inject
- protected ApplicationContext applicationContext;
-
- protected ManagedRepository createRepository( String id, String name, File location )
- {
- ManagedRepository repo = new ManagedRepository();
- repo.setId( id );
- repo.setName( name );
- repo.setLocation( location.getAbsolutePath() );
- return repo;
- }
-
- protected RemoteRepository createRemoteRepository( String id, String name, String url )
- {
- RemoteRepository repo = new RemoteRepository();
- repo.setId( id );
- repo.setName( name );
- repo.setUrl( url );
- return repo;
- }
-
- protected ManagedRepositoryContent createManagedRepositoryContent( String id, String name, File location,
- String layout )
- throws Exception
- {
- ManagedRepository repo = new ManagedRepository();
- repo.setId( id );
- repo.setName( name );
- repo.setLocation( location.getAbsolutePath() );
- repo.setLayout( layout );
-
- ManagedRepositoryContent repoContent =
- applicationContext.getBean( "managedRepositoryContent#" + layout, ManagedRepositoryContent.class );
- repoContent.setRepository( repo );
-
- return repoContent;
- }
-
- protected RemoteRepositoryContent createRemoteRepositoryContent( String id, String name, String url, String layout )
- throws Exception
- {
- RemoteRepository repo = new RemoteRepository();
- repo.setId( id );
- repo.setName( name );
- repo.setUrl( url );
- repo.setLayout( layout );
-
- RemoteRepositoryContent repoContent =
- applicationContext.getBean( "remoteRepositoryContent#" + layout, RemoteRepositoryContent.class );
- repoContent.setRepository( repo );
-
- return repoContent;
- }
-}
/**
* ManagedDefaultRepositoryContentTest
*/
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public class ManagedDefaultRepositoryContentTest
extends AbstractDefaultRepositoryContentTestCase
{
*
*
*/
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public class ManagedLegacyRepositoryContentTest
extends AbstractDefaultRepositoryContentTestCase
{
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@RunWith (ArchivaSpringJUnit4ClassRunner.class)
-@ContextConfiguration (locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" })
+
+@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
+@ContextConfiguration (
+ locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
extends TestCase
{
private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
@Inject
+ @Named (value = "archivaConfiguration#default")
private ArchivaConfiguration configuration;
private WagonFactory wagonFactory;
import static org.mockito.Mockito.when;
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration (
+ locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
public class Maven2RepositoryMetadataResolverMRM1411Test
extends TestCase
{
private static final Filter<String> ALL = new AllFilter<String>();
@Inject
- @Named ( value = "repositoryStorage#maven2" )
+ @Named (value = "repositoryStorage#maven2")
private Maven2RepositoryStorage storage;
private static final String TEST_REPO_ID = "test";
private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
@Inject
+ @Named (value = "archivaConfiguration#default")
private ArchivaConfiguration configuration;
private WagonFactory wagonFactory;
* under the License.
*/
-import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.repository.filter.AllFilter;
import org.apache.archiva.metadata.repository.filter.Filter;
import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
import org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException;
import org.apache.archiva.proxy.common.WagonFactory;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
import javax.inject.Inject;
import javax.inject.Named;
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public class Maven2RepositoryMetadataResolverManagedReleaseTest
extends Maven2RepositoryMetadataResolverTest
{
private static final Filter<String> ALL = new AllFilter<String>();
@Inject
- @Named ( value = "repositoryStorage#maven2" )
+ @Named (value = "repositoryStorage#maven2")
private Maven2RepositoryStorage storage;
private static final String TEST_REPO_ID = "test";
private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
- @Inject
- private ArchivaConfiguration configuration;
-
private WagonFactory wagonFactory;
@Before
ProjectVersionMetadata metadata = storage.readProjectVersionMetadata( readMetadataRequest );
}
- @Test ( expected = RepositoryStorageRuntimeException.class )
+ @Test (expected = RepositoryStorageRuntimeException.class)
@Override
public void testGetProjectVersionMetadataForTimestampedSnapshotMissingMetadata()
throws Exception
storage.readProjectVersionMetadata( readMetadataRequest );
}
- @Test ( expected = RepositoryStorageRuntimeException.class )
+ @Test (expected = RepositoryStorageRuntimeException.class)
@Override
public void testGetProjectVersionMetadataForTimestampedSnapshotMalformedMetadata()
throws Exception
storage.readProjectVersionMetadata( readMetadataRequest );
}
- @Test ( expected = RepositoryStorageRuntimeException.class )
+ @Test (expected = RepositoryStorageRuntimeException.class)
@Override
public void testGetProjectVersionMetadataForTimestampedSnapshot()
throws Exception
}
- @Test ( expected = RepositoryStorageRuntimeException.class )
+ @Test (expected = RepositoryStorageRuntimeException.class)
@Override
public void testGetProjectVersionMetadataForTimestampedSnapshotIncompleteMetadata()
throws Exception
* under the License.
*/
-import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.repository.filter.AllFilter;
import org.apache.archiva.metadata.repository.filter.Filter;
import javax.inject.Inject;
import javax.inject.Named;
-
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration (
+ locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
public class Maven2RepositoryMetadataResolverManagedSnapshotTest
extends Maven2RepositoryMetadataResolverTest
{
private static final Filter<String> ALL = new AllFilter<String>();
@Inject
- @Named ( value = "repositoryStorage#maven2" )
+ @Named (value = "repositoryStorage#maven2")
private Maven2RepositoryStorage storage;
private static final String TEST_REPO_ID = "test";
private static final String EMPTY_MD5 = "d41d8cd98f00b204e9800998ecf8427e";
- private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
- @Inject
- private ArchivaConfiguration configuration;
+ private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
@Before
assertFalse( c.getManagedRepositories().get( 0 ).isReleases() );
}
- @Test ( expected = RepositoryStorageRuntimeException.class )
+ @Test (expected = RepositoryStorageRuntimeException.class)
@Override
public void testModelWithJdkProfileActivation()
throws Exception
ProjectVersionMetadata metadata = storage.readProjectVersionMetadata( readMetadataRequest );
}
- @Test ( expected = RepositoryStorageRuntimeException.class )
+ @Test (expected = RepositoryStorageRuntimeException.class)
@Override
public void testGetProjectVersionMetadataForMislocatedPom()
throws Exception
// super test is on release
}
- @Test ( expected = RepositoryStorageRuntimeException.class )
+ @Test (expected = RepositoryStorageRuntimeException.class)
@Override
public void testGetProjectVersionMetadataForInvalidPom()
throws Exception
storage.readProjectVersionMetadata( readMetadataRequest );
}
- @Test ( expected = RepositoryStorageRuntimeException.class )
+ @Test (expected = RepositoryStorageRuntimeException.class)
@Override
public void testGetProjectVersionMetadataForMissingPom()
throws Exception
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@RunWith (ArchivaSpringJUnit4ClassRunner.class)
+@ContextConfiguration (
+ locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" })
public class Maven2RepositoryMetadataResolverTest
extends TestCase
{
private static final Filter<String> ALL = new AllFilter<String>();
@Inject
- @Named ( value = "repositoryStorage#maven2" )
+ @Named (value = "repositoryStorage#maven2")
private Maven2RepositoryStorage storage;
private static final String TEST_REPO_ID = "test";
private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
@Inject
- private ArchivaConfiguration configuration;
+ @Named ( value = "archivaConfiguration#default" )
+ protected ArchivaConfiguration configuration;
private WagonFactory wagonFactory;
/**
* RemoteDefaultRepositoryContentTest
*/
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public class RemoteDefaultRepositoryContentTest
extends AbstractDefaultRepositoryContentTestCase
{
*
*/
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
public class LegacyPathParserTest
{
private LegacyPathParser parser;
-->
<!--+
| This is the main Maven file that contains all global settings, management and information.
- | @version $Id$
+ | @version $Id: cocoon-1.pom 580582 2007-09-29 13:37:01Z joakime $
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
http://www.springframework.org/schema/context/spring-context-3.0.xsd"
default-lazy-init="true">
-
+ <bean name="archivaConfiguration#mock" class="org.apache.archiva.repository.MockConfiguration"/>
+ <alias name="archivaConfiguration#mock" alias="archivaConfiguration#default"/>
<bean name="metadataTools#test" class="org.apache.archiva.repository.metadata.MetadataTools">
<property name="configuration" ref="archivaConfiguration#mock"/>
</bean>
--- /dev/null
+<?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">
+ <alias name="archivaConfiguration#mock" alias="archivaConfiguration#default"/>
+ <alias name="archivaConfiguration#mock" alias="archivaConfiguration#test"/>
+</beans>
\ No newline at end of file