From e62d96a1fa22bc477ef1e3cbfdc8404e07864cad Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 1 Oct 2015 14:51:45 +1000 Subject: [PATCH] add a new module with mock for test --- .../archiva-base/archiva-mock/pom.xml | 55 +++++++++++++++++++ .../mock/MockRepositorySessionFactory.java | 7 ++- .../resources/META-INF/spring-context.xml | 33 +++++++++++ .../archiva-repository-admin-default/pom.xml | 6 ++ archiva-modules/archiva-base/pom.xml | 1 + pom.xml | 5 ++ 6 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 archiva-modules/archiva-base/archiva-mock/pom.xml rename archiva-modules/archiva-base/{archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin => archiva-mock/src/main/java/org/apache/archiva}/mock/MockRepositorySessionFactory.java (93%) create mode 100644 archiva-modules/archiva-base/archiva-mock/src/main/resources/META-INF/spring-context.xml diff --git a/archiva-modules/archiva-base/archiva-mock/pom.xml b/archiva-modules/archiva-base/archiva-mock/pom.xml new file mode 100644 index 000000000..bbe2e8cb3 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-mock/pom.xml @@ -0,0 +1,55 @@ + + + + + + org.apache.archiva + archiva-base + 2.2.1-SNAPSHOT + + 4.0.0 + archiva-mock + jar + Archiva Base :: Mocks + + + + commons-lang + commons-lang + + + commons-io + commons-io + + + org.slf4j + slf4j-api + + + org.apache.archiva + metadata-repository-api + + + org.springframework + spring-context + + + + 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-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java similarity index 93% rename from archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java rename to archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java index d26a70443..303d2e08a 100644 --- 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-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java @@ -1,4 +1,5 @@ -package org.apache.archiva.admin.mock; +package org.apache.archiva.mock; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -51,7 +52,9 @@ public class MockRepositorySessionFactory @Override public MetadataRepository getRepository() { - return new AbstractMetadataRepository() {}; + return new AbstractMetadataRepository() + { + }; } }; } diff --git a/archiva-modules/archiva-base/archiva-mock/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-mock/src/main/resources/META-INF/spring-context.xml new file mode 100644 index 000000000..2c9156d19 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-mock/src/main/resources/META-INF/spring-context.xml @@ -0,0 +1,33 @@ + + + + + + + + + + \ No newline at end of file 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 @@ test + + org.apache.archiva + archiva-mock + test + + diff --git a/archiva-modules/archiva-base/pom.xml b/archiva-modules/archiva-base/pom.xml index cf2c25fa1..3a5da0d66 100644 --- a/archiva-modules/archiva-base/pom.xml +++ b/archiva-modules/archiva-base/pom.xml @@ -32,6 +32,7 @@ archiva-test-utils archiva-common + archiva-mock archiva-filelock archiva-model archiva-configuration diff --git a/pom.xml b/pom.xml index 3d58f71a1..692b5fdc9 100644 --- a/pom.xml +++ b/pom.xml @@ -285,6 +285,11 @@ archiva-common ${project.version} + + org.apache.archiva + archiva-mock + ${project.version} + org.apache.archiva archiva-filelock -- 2.39.5