diff options
author | Olivier Lamy <olamy@apache.org> | 2015-10-01 14:51:45 +1000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2015-10-01 14:51:45 +1000 |
commit | e62d96a1fa22bc477ef1e3cbfdc8404e07864cad (patch) | |
tree | 42443f0f77868257e7b459be523f7c8037d71c66 /archiva-modules/archiva-base/archiva-repository-admin | |
parent | be86b55e5c922687ab66e36a3363b99e6ecaa6a8 (diff) | |
download | archiva-e62d96a1fa22bc477ef1e3cbfdc8404e07864cad.tar.gz archiva-e62d96a1fa22bc477ef1e3cbfdc8404e07864cad.zip |
add a new module with mock for test
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-admin')
2 files changed, 6 insertions, 58 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml index 9927f885c..f91ed7789 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml @@ -229,6 +229,12 @@ <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-mock</artifactId> + <scope>test</scope> + </dependency> + </dependencies> <build> diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java deleted file mode 100644 index d26a70443..000000000 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.apache.archiva.admin.mock; -/* - * 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.metadata.repository.AbstractMetadataRepository; -import org.apache.archiva.metadata.repository.MetadataRepository; -import org.apache.archiva.metadata.repository.RepositorySession; -import org.apache.archiva.metadata.repository.RepositorySessionFactory; -import org.springframework.stereotype.Service; - -/** - * @author Olivier Lamy - */ -@Service( "repositorySessionFactory#mock" ) -public class MockRepositorySessionFactory - implements RepositorySessionFactory -{ - @Override - public RepositorySession createSession() - { - return new RepositorySession( null, null ) - { - @Override - public void close() - { - return; - } - - @Override - public void save() - { - // no op - } - - @Override - public MetadataRepository getRepository() - { - return new AbstractMetadataRepository() {}; - } - }; - } -} |