<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-mock</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<pluginManagement>
<redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
<redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
<archiva.user.configFileName>${project.build.directory}/archiva.xml</archiva.user.configFileName>
- <archiva.repositorySessionFactory.id>test</archiva.repositorySessionFactory.id>
+ <archiva.repositorySessionFactory.id>mock</archiva.repositorySessionFactory.id>
</systemPropertyVariables>
</configuration>
</plugin>
import org.apache.archiva.configuration.FileTypes;
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
import org.apache.archiva.consumers.functors.ConsumerWantsFilePredicate;
-import org.apache.archiva.metadata.repository.TestRepositorySessionFactory;
+import org.apache.archiva.mock.MockRepositorySessionFactory;
import org.apache.commons.io.FileUtils;
import org.custommonkey.xmlunit.XMLAssert;
import org.junit.After;
{
super.setUp();
- TestRepositorySessionFactory factory = applicationContext.getBean( TestRepositorySessionFactory.class );
+ MockRepositorySessionFactory factory = applicationContext.getBean( MockRepositorySessionFactory.class );
factory.setRepository( metadataRepository );
}
+++ /dev/null
-package org.apache.archiva.metadata.repository;
-
-import org.springframework.stereotype.Service;
-
-/*
-* 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.
-*/
-@Service( "repositorySessionFactory#test" )
-public class TestRepositorySessionFactory
- implements RepositorySessionFactory
-{
- private MetadataRepository repository = new AbstractMetadataRepository() {};
-
- private MetadataResolver resolver;
-
- @Override
- public RepositorySession createSession()
- {
- return new RepositorySession( repository, resolver )
- {
- @Override
- public void close()
- {
- return;
- }
- };
- }
-
- public void setRepository( MetadataRepository repository )
- {
- this.repository = repository;
- }
-
- public void setResolver( MetadataResolver resolver )
- {
- this.resolver = resolver;
- }
-}
public class MockRepositorySessionFactory
implements RepositorySessionFactory
{
+ private MetadataRepository repository = new AbstractMetadataRepository()
+ {
+ };
+
+ public void setRepository( MetadataRepository repository )
+ {
+ this.repository = repository;
+ }
+
@Override
public RepositorySession createSession()
{
- return new RepositorySession( null, null )
+ return new RepositorySession( repository, null )
{
@Override
public void close()
@Override
public MetadataRepository getRepository()
{
- return new AbstractMetadataRepository()
- {
- };
+ return repository;
}
};
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.AbstractFactoryBean;
-import org.springframework.stereotype.Service;
import java.util.Properties;
* @author Olivier Lamy
* @since 2.0.2
*/
-//@Service("repositorySessionFactoryBean#default")
public class RepositorySessionFactoryBean
extends AbstractFactoryBean<RepositorySessionFactory>
{
{
RepositorySessionFactory repositorySessionFactory =
getBeanFactory().getBean( "repositorySessionFactory#" + id, RepositorySessionFactory.class );
- logger.info( "create RepositorySessionFactory instance of {}", repositorySessionFactory.getClass().getName() );
+ logger.info( "create RepositorySessionFactory with id {} instance of {}", //
+ id, //
+ repositorySessionFactory.getClass().getName() );
return repositorySessionFactory;
}