Author: joakime
Date: Mon Feb 26 11:20:59 2007
New Revision: 511956

URL: http://svn.apache.org/viewvc?view=rev&rev=511956
Log:
Correcting unit test failures.

Added:
    maven/archiva/trunk/archiva-repository-layer/src/main/resources/
    maven/archiva/trunk/archiva-repository-layer/src/main/resources/META-INF/
    
maven/archiva/trunk/archiva-repository-layer/src/main/resources/META-INF/plexus/
    
maven/archiva/trunk/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml
   (with props)
    
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java
   (with props)
    
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java
   (with props)
    
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java
   (with props)
    maven/archiva/trunk/archiva-repository-layer/src/test/resources/
    maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/
    maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/
    
maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/
    
maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/
    
maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/layer/
    
maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.xml
   (with props)
Modified:
    maven/archiva/trunk/archiva-repository-layer/pom.xml
    
maven/archiva/trunk/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java
    
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java

Modified: maven/archiva/trunk/archiva-repository-layer/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-repository-layer/pom.xml?view=diff&rev=511956&r1=511955&r2=511956
==============================================================================
--- maven/archiva/trunk/archiva-repository-layer/pom.xml (original)
+++ maven/archiva/trunk/archiva-repository-layer/pom.xml Mon Feb 26 11:20:59 
2007
@@ -51,5 +51,34 @@
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-repository-metadata</artifactId>
     </dependency>
+    <!-- TEST DEPS -->
+    <dependency>
+      <groupId>org.codehaus.plexus.cache</groupId>
+      <artifactId>plexus-cache-hashmap</artifactId>
+      <version>1.0-alpha-1</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>merge</id>
+            <goals>
+              <goal>merge-descriptors</goal>
+            </goals>
+            <configuration>
+              <descriptors>
+                
<descriptor>${basedir}/src/main/resources/META-INF/plexus/components.xml</descriptor>
+                
<descriptor>${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
 </project>

Modified: 
maven/archiva/trunk/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java?view=diff&rev=511956&r1=511955&r2=511956
==============================================================================
--- 
maven/archiva/trunk/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java
 (original)
+++ 
maven/archiva/trunk/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java
 Mon Feb 26 11:20:59 2007
@@ -35,7 +35,7 @@
     implements RepositoryQueryLayer
 {
     /**
-     * @plexus.requirement
+     * @plexus.requirement role-hint="repository-query"
      */
     private Cache cache;
 
@@ -43,16 +43,10 @@
      * @plexus.requirement
      */
     private RepositoryQueryLayer layer;
-
-    public CachedRepositoryQueryLayer( RepositoryQueryLayer layer )
-    {
-        this.layer = layer;
-    }
-
-    public CachedRepositoryQueryLayer( RepositoryQueryLayer layer, Cache cache 
)
+    
+    public CachedRepositoryQueryLayer()
     {
-        this.cache = cache;
-        this.layer = layer;
+        
     }
 
     public boolean containsArtifact( Artifact artifact )

Added: 
maven/archiva/trunk/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=511956
==============================================================================
--- 
maven/archiva/trunk/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml
 (added)
+++ 
maven/archiva/trunk/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml
 Mon Feb 26 11:20:59 2007
@@ -0,0 +1,43 @@
+<?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.
+  -->
+  
+<component-set>
+  <components>
+    <component>
+      <role>org.codehaus.plexus.cache.Cache</role>
+      <role-hint>repository-query</role-hint>
+      
<implementation>org.codehaus.plexus.cache.ehcache.EhcacheCache</implementation>
+      <description>EhcacheCache</description>
+      <configuration>
+        
<disk-expiry-thread-interval-seconds>600</disk-expiry-thread-interval-seconds>
+        <disk-persistent>true</disk-persistent>
+        <disk-store-path>${java.io.tmpdir}/ehcache/repo-query</disk-store-path>
+        <eternal>false</eternal>
+        <max-elements-in-memory>1000</max-elements-in-memory>
+        <memory-eviction-policy>LRU</memory-eviction-policy>
+        <name>repository-query</name>
+        <overflow-to-disk>false</overflow-to-disk>
+        <time-to-idle-seconds>600</time-to-idle-seconds>
+        <time-to-live-seconds>300</time-to-live-seconds>
+      </configuration>
+    </component>  
+  </components>
+</component-set>

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java?view=auto&rev=511956
==============================================================================
--- 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java
 (added)
+++ 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java
 Mon Feb 26 11:20:59 2007
@@ -0,0 +1,44 @@
+package org.apache.maven.archiva;
+
+/*
+ * 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 junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * AllTests - conveinence test suite for IDE users. 
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class AllTests
+{
+
+    public static Test suite()
+    {
+        TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva" );
+        //$JUnit-BEGIN$
+        suite.addTest( org.apache.maven.archiva.repository.AllTests.suite() );
+        suite.addTest( org.apache.maven.archiva.layer.AllTests.suite() );
+        //$JUnit-END$
+        return suite;
+    }
+
+}

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java?view=auto&rev=511956
==============================================================================
--- 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java
 (added)
+++ 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java
 Mon Feb 26 11:20:59 2007
@@ -0,0 +1,44 @@
+package org.apache.maven.archiva.layer;
+
+/*
+ * 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 junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * AllTests 
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class AllTests
+{
+
+    public static Test suite()
+    {
+        TestSuite suite = new TestSuite( "Test for 
org.apache.maven.archiva.layer" );
+        //$JUnit-BEGIN$
+        suite.addTestSuite( CachedRepositoryQueryLayerTest.class );
+        suite.addTestSuite( DefaultRepositoryQueryLayerTest.class );
+        //$JUnit-END$
+        return suite;
+    }
+
+}

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java?view=diff&rev=511956&r1=511955&r2=511956
==============================================================================
--- 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java
 (original)
+++ 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java
 Mon Feb 26 11:20:59 2007
@@ -1,7 +1,5 @@
 package org.apache.maven.archiva.layer;
 
-import org.codehaus.plexus.cache.Cache;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -21,22 +19,22 @@
  * under the License.
  */
 
+
 /**
+ * CachedRepositoryQueryLayerTest 
  *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Joakim Erdfelt</a>
+ * @version $Id$
  */
 public class CachedRepositoryQueryLayerTest
     extends AbstractRepositoryQueryLayerTestCase
 {
-    private Cache cache;
-
     protected void setUp()
         throws Exception
     {
         super.setUp();
 
-        cache = (Cache) lookup( Cache.ROLE, "test" );
-
-        queryLayer = new CachedRepositoryQueryLayer( new 
DefaultRepositoryQueryLayer( repository ), cache );
+        queryLayer = (RepositoryQueryLayer) lookup( RepositoryQueryLayer.ROLE, 
"test-cached" );
     }
 
     public void testUseFileCache()

Added: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java?view=auto&rev=511956
==============================================================================
--- 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java
 (added)
+++ 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java
 Mon Feb 26 11:20:59 2007
@@ -0,0 +1,43 @@
+package org.apache.maven.archiva.repository;
+
+/*
+ * 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 junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * AllTests 
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class AllTests
+{
+
+    public static Test suite()
+    {
+        TestSuite suite = new TestSuite( "Test for 
org.apache.maven.archiva.repository" );
+        //$JUnit-BEGIN$
+        suite.addTestSuite( RepositoryURLTest.class );
+        //$JUnit-END$
+        return suite;
+    }
+
+}

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.xml
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.xml?view=auto&rev=511956
==============================================================================
--- 
maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.xml
 (added)
+++ 
maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.xml
 Mon Feb 26 11:20:59 2007
@@ -0,0 +1,52 @@
+<?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.
+  -->
+
+<component-set>
+  <components>
+    <component>
+      <role>org.apache.maven.archiva.layer.RepositoryQueryLayer</role>
+      <role-hint>test-cached</role-hint>
+      
<implementation>org.apache.maven.archiva.layer.CachedRepositoryQueryLayer</implementation>
+      <description>CachedRepositoryQueryLayer - simple wrapper around another 
non-cached Repository Query Layer.</description>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.cache.Cache</role>
+          <role-hint>test-repository-query</role-hint>
+          <field-name>cache</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.layer.RepositoryQueryLayer</role>
+          <field-name>layer</field-name>
+        </requirement>
+      </requirements>
+    </component>
+  
+    <component>
+      <role>org.codehaus.plexus.cache.Cache</role>
+      <role-hint>test-repository-query</role-hint>
+      
<implementation>org.codehaus.plexus.cache.hashmap.HashMapCache</implementation>
+      <configuration>
+        <cache-hit-ratio>1.0</cache-hit-ratio>
+        <cache-max-size>0</cache-max-size>
+      </configuration>
+    </component>
+  </components>
+</component-set>
\ No newline at end of file

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/archiva/trunk/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml


Reply via email to