summaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-05-26 20:55:58 +0000
committerOlivier Lamy <olamy@apache.org>2011-05-26 20:55:58 +0000
commit5bc6009a398e097660aaf8cb49cd5fe16ddc9a0a (patch)
tree4f67df19503ed9fb710f5483bac68466e9fa3ea0 /archiva-modules
parent4eb07f4a1ce3d23627e7e90ea3b9573edd7037ab (diff)
downloadarchiva-5bc6009a398e097660aaf8cb49cd5fe16ddc9a0a.tar.gz
archiva-5bc6009a398e097660aaf8cb49cd5fe16ddc9a0a.zip
fix repository-statistics compilation
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1128083 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java4
-rw-r--r--archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsFactory.java4
-rw-r--r--archiva-modules/plugins/repository-statistics/src/main/resources/META-INF/spring-context.xml33
-rw-r--r--archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java18
-rw-r--r--archiva-modules/plugins/repository-statistics/src/test/resources/spring-context.xml30
5 files changed, 78 insertions, 11 deletions
diff --git a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
index 540df56d1..dbaf6b341 100644
--- a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
+++ b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
@@ -27,6 +27,7 @@ import org.apache.archiva.metadata.repository.storage.maven2.MavenArtifactFacet;
import org.apache.jackrabbit.commons.JcrUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -47,8 +48,9 @@ import javax.jcr.query.QueryResult;
import javax.jcr.query.Row;
/**
- * @plexus.component role="org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager" role-hint="default"
+ * plexus.component role="org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager" role-hint="default"
*/
+@Service("repositoryStatisticsManager#default")
public class DefaultRepositoryStatisticsManager
implements RepositoryStatisticsManager
{
diff --git a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsFactory.java b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsFactory.java
index 49716a99c..cb419640f 100644
--- a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsFactory.java
+++ b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsFactory.java
@@ -21,10 +21,12 @@ package org.apache.archiva.metadata.repository.stats;
import org.apache.archiva.metadata.model.MetadataFacet;
import org.apache.archiva.metadata.model.MetadataFacetFactory;
+import org.springframework.stereotype.Service;
/**
- * @plexus.component role="org.apache.archiva.metadata.model.MetadataFacetFactory" role-hint="org.apache.archiva.metadata.repository.stats"
+ * plexus.component role="org.apache.archiva.metadata.model.MetadataFacetFactory" role-hint="org.apache.archiva.metadata.repository.stats"
*/
+@Service( "metadataFacetFactory#org.apache.archiva.metadata.repository.stats" )
public class RepositoryStatisticsFactory
implements MetadataFacetFactory
{
diff --git a/archiva-modules/plugins/repository-statistics/src/main/resources/META-INF/spring-context.xml b/archiva-modules/plugins/repository-statistics/src/main/resources/META-INF/spring-context.xml
new file mode 100644
index 000000000..8751f659f
--- /dev/null
+++ b/archiva-modules/plugins/repository-statistics/src/main/resources/META-INF/spring-context.xml
@@ -0,0 +1,33 @@
+<?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"
+ default-lazy-init="true">
+
+ <context:annotation-config/>
+ <context:component-scan base-package="org.apache.archiva.metadata.repository.stats"/>
+
+</beans> \ No newline at end of file
diff --git a/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java b/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java
index aeab24040..b8105daec 100644
--- a/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java
+++ b/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java
@@ -19,17 +19,12 @@ package org.apache.archiva.metadata.repository.stats;
* under the License.
*/
+import junit.framework.TestCase;
import org.apache.archiva.metadata.repository.MetadataRepository;
import org.apache.commons.io.FileUtils;
import org.apache.jackrabbit.commons.JcrUtils;
import org.apache.jackrabbit.core.TransientRepository;
-import org.codehaus.plexus.spring.PlexusInSpringTestCase;
-import java.io.File;
-import java.io.IOException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.zip.GZIPInputStream;
import javax.jcr.ImportUUIDBehavior;
import javax.jcr.NamespaceRegistry;
import javax.jcr.Node;
@@ -39,11 +34,16 @@ import javax.jcr.SimpleCredentials;
import javax.jcr.Workspace;
import javax.jcr.nodetype.NodeTypeManager;
import javax.jcr.nodetype.NodeTypeTemplate;
+import java.io.File;
+import java.io.IOException;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.zip.GZIPInputStream;
import static org.mockito.Mockito.*;
public class JcrRepositoryStatisticsGatheringTest
- extends PlexusInSpringTestCase
+ extends TestCase
{
private static final int TOTAL_FILE_COUNT = 1000;
@@ -63,8 +63,8 @@ public class JcrRepositoryStatisticsGatheringTest
{
super.setUp();
- File confFile = getTestFile( "src/test/repository.xml" );
- File dir = getTestFile( "target/jcr" );
+ File confFile = new File( "src/test/repository.xml" );
+ File dir = new File( "target/jcr" );
FileUtils.deleteDirectory( dir );
TransientRepository repository = new TransientRepository( confFile, dir );
diff --git a/archiva-modules/plugins/repository-statistics/src/test/resources/spring-context.xml b/archiva-modules/plugins/repository-statistics/src/test/resources/spring-context.xml
new file mode 100644
index 000000000..867fbb246
--- /dev/null
+++ b/archiva-modules/plugins/repository-statistics/src/test/resources/spring-context.xml
@@ -0,0 +1,30 @@
+<?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"
+ default-lazy-init="true">
+
+</beans>