]> source.dussan.org Git - archiva.git/commitdiff
fix repository-statistics compilation
authorOlivier Lamy <olamy@apache.org>
Thu, 26 May 2011 20:55:58 +0000 (20:55 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 26 May 2011 20:55:58 +0000 (20:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1128083 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsFactory.java
archiva-modules/plugins/repository-statistics/src/main/resources/META-INF/spring-context.xml [new file with mode: 0644]
archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/JcrRepositoryStatisticsGatheringTest.java
archiva-modules/plugins/repository-statistics/src/test/resources/spring-context.xml [new file with mode: 0644]

index 540df56d15b32ec5b90bd5fa4f441a40d472c5eb..dbaf6b341ca2eb18a9de65045ee5f3101d557572 100644 (file)
@@ -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
 {
index 49716a99c3b797689c7fcbacb47960394be138a1..cb419640f31ac8d2bbcbb9ec9fd73611015ad9dc 100644 (file)
@@ -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 (file)
index 0000000..8751f65
--- /dev/null
@@ -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
index aeab2404074492adb94b53d32efbbac8722d4815..b8105daeca2353b9a19fd416c0a1e61516cd47df 100644 (file)
@@ -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 (file)
index 0000000..867fbb2
--- /dev/null
@@ -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>