diff options
author | Brett Porter <brett@apache.org> | 2006-09-05 07:00:52 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2006-09-05 07:00:52 +0000 |
commit | 63c171e2eb136117115bc2f964d92c8a30480d6e (patch) | |
tree | 5a802f4e4eae01cda1374229a75a87b99e96b1f5 /archiva-repository-layer | |
parent | d29cdf4ab1f77b962802f92f9d94c707fbb39037 (diff) | |
download | archiva-63c171e2eb136117115bc2f964d92c8a30480d6e.tar.gz archiva-63c171e2eb136117115bc2f964d92c8a30480d6e.zip |
[MRM-161] move the query layer tests, remove unnecessary mocks, and fix tests to test legitimate things. Remove tests for null artifact ids, etc since it is impossible that they would be created with a normal (non-mock) API and the reporting will get these errors fed through from the file positioning and model validation errors instead
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@440282 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-repository-layer')
12 files changed, 474 insertions, 142 deletions
diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayer.java deleted file mode 100644 index 60b0e5bb0..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayer.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Copyright 2005-2006 The Apache Software Foundation. - * - * Licensed 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.maven.artifact.Artifact; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata; -import org.apache.maven.artifact.repository.metadata.Metadata; -import org.apache.maven.artifact.repository.metadata.Snapshot; -import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.util.List; - -/** - * - */ -public abstract class AbstractRepositoryQueryLayer - implements RepositoryQueryLayer -{ - protected ArtifactRepository repository; - - public boolean containsArtifact( Artifact artifact ) - { - File f = new File( repository.getBasedir(), repository.pathOf( artifact ) ); - return f.exists(); - } - - public boolean containsArtifact( Artifact artifact, Snapshot snapshot ) - { - String artifactPath = getSnapshotArtifactRepositoryPath( artifact, snapshot ); - File artifactFile = new File( artifactPath ); - return artifactFile.exists(); - } - - public List getVersions( Artifact artifact ) - throws RepositoryQueryLayerException - { - Metadata metadata = getMetadata( artifact ); - - return metadata.getVersioning().getVersions(); - } - - protected String getSnapshotArtifactRepositoryPath( Artifact artifact, Snapshot snapshot ) - { - File f = new File( repository.getBasedir(), repository.pathOf( artifact ) ); - String snapshotInfo = artifact.getVersion().replaceFirst( "SNAPSHOT", snapshot.getTimestamp() + "-" + - snapshot.getBuildNumber() + ".pom" ); - File snapshotFile = new File( f.getParentFile(), artifact.getArtifactId() + "-" + snapshotInfo ); - return snapshotFile.getAbsolutePath(); - } - - protected Metadata getMetadata( Artifact artifact ) - throws RepositoryQueryLayerException - { - Metadata metadata; - - ArtifactRepositoryMetadata repositoryMetadata = new ArtifactRepositoryMetadata( artifact ); - String path = repository.pathOfRemoteRepositoryMetadata( repositoryMetadata ); - File metadataFile = new File( repository.getBasedir(), path ); - if ( metadataFile.exists() ) - { - MetadataXpp3Reader reader = new MetadataXpp3Reader(); - try - { - metadata = reader.read( new FileReader( metadataFile ) ); - } - catch ( FileNotFoundException e ) - { - throw new RepositoryQueryLayerException( "Error occurred while attempting to read metadata file", e ); - } - catch ( IOException e ) - { - throw new RepositoryQueryLayerException( "Error occurred while attempting to read metadata file", e ); - } - catch ( XmlPullParserException e ) - { - throw new RepositoryQueryLayerException( "Error occurred while attempting to read metadata file", e ); - } - } - else - { - throw new RepositoryQueryLayerException( "Metadata not found: " + metadataFile.getAbsolutePath() ); - } - - return metadata; - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java index 91f9c5ff9..9453588e9 100644 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java @@ -18,27 +18,35 @@ package org.apache.maven.archiva.layer; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.metadata.Metadata; -import org.apache.maven.artifact.repository.metadata.Snapshot; + +import java.util.List; /** * */ public class CachedRepositoryQueryLayer - extends AbstractRepositoryQueryLayer + implements RepositoryQueryLayer { private Cache cache; public static final double CACHE_HIT_RATIO = 0.5; - public CachedRepositoryQueryLayer( ArtifactRepository repository ) + private RepositoryQueryLayer layer; + + public CachedRepositoryQueryLayer( RepositoryQueryLayer layer ) { - this.repository = repository; + this.layer = layer; cache = new Cache( CACHE_HIT_RATIO ); } + public CachedRepositoryQueryLayer( RepositoryQueryLayer layer, Cache cache ) + { + this.cache = cache; + this.layer = layer; + } + public double getCacheHitRate() { return cache.getHitRate(); @@ -48,11 +56,11 @@ public class CachedRepositoryQueryLayer { boolean artifactFound = true; - String artifactPath = repository.getBasedir() + "/" + repository.pathOf( artifact ); + String artifactPath = layer.getRepository().pathOf( artifact ); if ( cache.get( artifactPath ) == null ) { - artifactFound = super.containsArtifact( artifact ); + artifactFound = layer.containsArtifact( artifact ); if ( artifactFound ) { cache.put( artifactPath, artifactPath ); @@ -62,38 +70,22 @@ public class CachedRepositoryQueryLayer return artifactFound; } - public boolean containsArtifact( Artifact artifact, Snapshot snapshot ) + public List getVersions( Artifact artifact ) + throws RepositoryQueryLayerException { - boolean artifactFound = true; + List list = (List) cache.get( artifact.getId() ); - String path = getSnapshotArtifactRepositoryPath( artifact, snapshot ); - - if ( cache.get( path ) == null ) + if ( list == null ) { - artifactFound = super.containsArtifact( artifact, snapshot ); - if ( artifactFound ) - { - cache.put( path, path ); - } + list = layer.getVersions( artifact ); + cache.put( artifact.getId(), list ); } - return artifactFound; + return list; } - /** - * Override method to utilize the cache - */ - protected Metadata getMetadata( Artifact artifact ) - throws RepositoryQueryLayerException + public ArtifactRepository getRepository() { - Metadata metadata = (Metadata) cache.get( artifact.getId() ); - - if ( metadata == null ) - { - metadata = super.getMetadata( artifact ); - cache.put( artifact.getId(), metadata ); - } - - return metadata; + return layer.getRepository(); } } diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayer.java index 582d5f377..0eadd6d2c 100644 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayer.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayer.java @@ -16,16 +16,84 @@ package org.apache.maven.archiva.layer; * limitations under the License. */ +import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata; +import org.apache.maven.artifact.repository.metadata.Metadata; +import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.List; /** * */ public class DefaultRepositoryQueryLayer - extends AbstractRepositoryQueryLayer + implements RepositoryQueryLayer { + protected ArtifactRepository repository; + public DefaultRepositoryQueryLayer( ArtifactRepository repository ) { this.repository = repository; } + + public boolean containsArtifact( Artifact artifact ) + { + File f = new File( repository.getBasedir(), repository.pathOf( artifact ) ); + return f.exists(); + } + + public List getVersions( Artifact artifact ) + throws RepositoryQueryLayerException + { + Metadata metadata = getMetadata( artifact ); + + return metadata.getVersioning().getVersions(); + } + + public ArtifactRepository getRepository() + { + return repository; + } + + private Metadata getMetadata( Artifact artifact ) + throws RepositoryQueryLayerException + { + Metadata metadata; + + ArtifactRepositoryMetadata repositoryMetadata = new ArtifactRepositoryMetadata( artifact ); + String path = repository.pathOfRemoteRepositoryMetadata( repositoryMetadata ); + File metadataFile = new File( repository.getBasedir(), path ); + if ( metadataFile.exists() ) + { + MetadataXpp3Reader reader = new MetadataXpp3Reader(); + try + { + metadata = reader.read( new FileReader( metadataFile ) ); + } + catch ( FileNotFoundException e ) + { + throw new RepositoryQueryLayerException( "Error occurred while attempting to read metadata file", e ); + } + catch ( IOException e ) + { + throw new RepositoryQueryLayerException( "Error occurred while attempting to read metadata file", e ); + } + catch ( XmlPullParserException e ) + { + throw new RepositoryQueryLayerException( "Error occurred while attempting to read metadata file", e ); + } + } + else + { + throw new RepositoryQueryLayerException( "Metadata not found: " + metadataFile.getAbsolutePath() ); + } + + return metadata; + } } diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayer.java index 93c57ef1f..874f52e05 100644 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayer.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayer.java @@ -17,7 +17,7 @@ package org.apache.maven.archiva.layer; */ import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.repository.metadata.Snapshot; +import org.apache.maven.artifact.repository.ArtifactRepository; import java.util.List; @@ -30,8 +30,8 @@ public interface RepositoryQueryLayer boolean containsArtifact( Artifact artifact ); - boolean containsArtifact( Artifact artifact, Snapshot snapshot ); - List getVersions( Artifact artifact ) throws RepositoryQueryLayerException; + + ArtifactRepository getRepository(); } diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayerTestCase.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayerTestCase.java new file mode 100644 index 000000000..76debd58e --- /dev/null +++ b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayerTestCase.java @@ -0,0 +1,113 @@ +package org.apache.maven.archiva.layer; + +/* + * Copyright 2005-2006 The Apache Software Foundation. + * + * Licensed 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.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.codehaus.plexus.PlexusTestCase; + +import java.io.File; +import java.util.List; + +/** + * + */ +public abstract class AbstractRepositoryQueryLayerTestCase + extends PlexusTestCase +{ + private ArtifactFactory artifactFactory; + + protected ArtifactRepository repository; + + protected RepositoryQueryLayer queryLayer; + + protected void setUp() + throws Exception + { + super.setUp(); + File repositoryDirectory = getTestFile( "src/test/repository" ); + + artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE ); + ArtifactRepositoryFactory factory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE ); + ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" ); + + repository = + factory.createArtifactRepository( "test", repositoryDirectory.toURL().toString(), layout, null, null ); + } + + public void testContainsArtifactTrue() + { + Artifact artifact = getArtifact( "groupId", "artifactId", "1.0-alpha-1" ); + + assertTrue( "check artifact", queryLayer.containsArtifact( artifact ) ); + } + + public void testContainsArtifactFalse() + { + Artifact artifact = getArtifact( "groupId", "artifactId", "1.0-beta-1" ); + + assertFalse( "check non-existent artifact", queryLayer.containsArtifact( artifact ) ); + } + + public void testContainsSnapshotArtifactTrue() + { + Artifact artifact = getArtifact( "groupId", "snapshot-artifact", "1.0-alpha-1-20050611.202024-1" ); + assertTrue( "check for snapshot artifact", queryLayer.containsArtifact( artifact ) ); + } + + public void testContainsSnapshotArtifactFalse() + { + Artifact artifact = getArtifact( "groupId", "snapshot-artifact", "1.0-alpha-1-20050611.202024-2" ); + assertFalse( "check for non-existent snapshot artifact", queryLayer.containsArtifact( artifact ) ); + } + + public void testArtifactVersions() + throws Exception + { + Artifact artifact = getArtifact( "groupId", "artifactId", "ignored" ); + + List versions = queryLayer.getVersions( artifact ); + + assertTrue( "check version 1.0-alpha-1", versions.contains( "1.0-alpha-1" ) ); + assertFalse( "check version 1.0-alpha-2", versions.contains( "1.0-alpha-2" ) ); + } + + public void testArtifactVersionsError() + { + Artifact artifact = getArtifact( "groupId", "none", "ignored" ); + + try + { + queryLayer.getVersions( artifact ); + fail( "expected error not thrown" ); + } + catch ( RepositoryQueryLayerException e ) + { + //expected + } + } + + private Artifact getArtifact( String groupId, String artifactId, String version ) + { + Artifact projectArtifact = artifactFactory.createProjectArtifact( groupId, artifactId, version ); + projectArtifact.isSnapshot(); + return projectArtifact; + } +} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CacheTest.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CacheTest.java new file mode 100644 index 000000000..a784c1373 --- /dev/null +++ b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CacheTest.java @@ -0,0 +1,143 @@ +package org.apache.maven.archiva.layer; + +/* + * Copyright 2005-2006 The Apache Software Foundation. + * + * Licensed 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.TestCase; + +/** + * + */ +public class CacheTest + extends TestCase +{ + private Cache cache; + + private static final double CACHE_HIT_RATIO = 0.5; + + private static final double CACHE_HIT_RATIO_THRESHOLD = 0.75; + + public void testCacheManagementBasedOnHitsRatio() + { + cache = new Cache( CACHE_HIT_RATIO ); + newCacheObjectTests(); + + String key = "key"; + String value = "value"; + for ( int ctr = 1; ctr < 10; ctr++ ) + { + cache.put( key + ctr, value + ctr ); + } + + while ( cache.getHitRate() < CACHE_HIT_RATIO_THRESHOLD ) + { + cache.get( "key2" ); + } + cache.put( "key10", "value10" ); + assertNull( "first key must be expired", cache.get( "key1" ) ); + } + + public void testCacheManagementBasedOnCacheSize() + { + cache = new Cache( 9 ); + newCacheObjectTests(); + + String key = "key"; + String value = "value"; + for ( int ctr = 1; ctr < 10; ctr++ ) + { + cache.put( key + ctr, value + ctr ); + } + + cache.put( "key10", "value10" ); + assertNull( "first key must be expired", cache.get( "key1" ) ); + assertEquals( "check cache size to be max size", 9, cache.size() ); + } + + public void testCacheManagementBasedOnCacheSizeAndHitRate() + { + cache = new Cache( CACHE_HIT_RATIO, 9 ); + newCacheObjectTests(); + + String key = "key"; + String value = "value"; + for ( int ctr = 1; ctr < 5; ctr++ ) + { + cache.put( key + ctr, value + ctr ); + } + + while ( cache.getHitRate() < CACHE_HIT_RATIO ) + { + cache.get( "key3" ); + } + + cache.put( "key10", "value10" ); + assertNull( "first key must be expired", cache.get( "key1" ) ); + + while ( cache.getHitRate() >= CACHE_HIT_RATIO ) + { + cache.get( "key11" ); + } + + for ( int ctr = 5; ctr < 10; ctr++ ) + { + cache.put( key + ctr, value + ctr ); + } + + cache.put( "key11", "value11" ); + assertNull( "second key must be expired", cache.get( "key2" ) ); + assertEquals( "check cache size to be max size", 9, cache.size() ); + } + + public void testCacheOnRedundantData() + { + cache = new Cache( CACHE_HIT_RATIO, 9 ); + newCacheObjectTests(); + + String key = "key"; + String value = "value"; + for ( int ctr = 1; ctr < 10; ctr++ ) + { + cache.put( key + ctr, value + ctr ); + } + + cache.put( "key1", "value1" ); + cache.put( "key10", "value10" ); + assertNull( "second key must be gone", cache.get( "key2" ) ); + assertEquals( "check cache size to be max size", 9, cache.size() ); + } + + private void newCacheObjectTests() + { + assertEquals( (double) 0, cache.getHitRate(), 0 ); + assertEquals( "check cache size", 0, cache.size() ); + + String value = "value"; + String key = "key"; + + cache.put( key, value ); + assertEquals( "check cache hit", value, cache.get( key ) ); + assertEquals( (double) 1, cache.getHitRate(), 0 ); + assertEquals( "check cache size", 1, cache.size() ); + assertNull( "check cache miss", cache.get( "none" ) ); + assertEquals( CACHE_HIT_RATIO, cache.getHitRate(), 0 ); + cache.clear(); + assertNull( "check flushed object", cache.get( "key" ) ); + assertEquals( (double) 0, cache.getHitRate(), 0 ); + assertEquals( "check flushed cache size", 0, cache.size() ); + cache.clear(); + } +} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java new file mode 100644 index 000000000..8f717973e --- /dev/null +++ b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java @@ -0,0 +1,61 @@ +package org.apache.maven.archiva.layer; + +/* + * Copyright 2005-2006 The Apache Software Foundation. + * + * Licensed 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. + */ + +/** + * + */ +public class CachedRepositoryQueryLayerTest + extends AbstractRepositoryQueryLayerTestCase +{ + private Cache cache; + + protected void setUp() + throws Exception + { + super.setUp(); + + cache = new Cache( CachedRepositoryQueryLayer.CACHE_HIT_RATIO ); + + queryLayer = new CachedRepositoryQueryLayer( new DefaultRepositoryQueryLayer( repository ), cache ); + } + + public void testUseFileCache() + { + testContainsArtifactTrue(); + assertEquals( 0, cache.getHitRate(), 0 ); + testContainsArtifactTrue(); + assertEquals( CachedRepositoryQueryLayer.CACHE_HIT_RATIO, cache.getHitRate(), 0 ); + } + + public void testUseMetadataCache() + throws Exception + { + testArtifactVersions(); + assertEquals( 0, cache.getHitRate(), 0 ); + testArtifactVersions(); + assertEquals( CachedRepositoryQueryLayer.CACHE_HIT_RATIO, cache.getHitRate(), 0 ); + } + + public void testUseFileCacheOnSnapshot() + { + testContainsSnapshotArtifactTrue(); + assertEquals( 0, cache.getHitRate(), 0 ); + testContainsSnapshotArtifactTrue(); + assertEquals( CachedRepositoryQueryLayer.CACHE_HIT_RATIO, cache.getHitRate(), 0 ); + } +} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerTest.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerTest.java new file mode 100644 index 000000000..1a1817cea --- /dev/null +++ b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerTest.java @@ -0,0 +1,29 @@ +package org.apache.maven.archiva.layer; + +/* + * Copyright 2005-2006 The Apache Software Foundation. + * + * Licensed 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. + */ + +public class DefaultRepositoryQueryLayerTest + extends AbstractRepositoryQueryLayerTestCase +{ + protected void setUp() + throws Exception + { + super.setUp(); + + queryLayer = new DefaultRepositoryQueryLayer( repository ); + } +} diff --git a/archiva-repository-layer/src/test/repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.jar b/archiva-repository-layer/src/test/repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.jar Binary files differnew file mode 100644 index 000000000..c2ea777c1 --- /dev/null +++ b/archiva-repository-layer/src/test/repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.jar diff --git a/archiva-repository-layer/src/test/repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.pom b/archiva-repository-layer/src/test/repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.pom new file mode 100644 index 000000000..c5f8bccb2 --- /dev/null +++ b/archiva-repository-layer/src/test/repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.pom @@ -0,0 +1,6 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>groupId</groupId> + <artifactId>artifactId</artifactId> + <version>1.0-alpha-1</version> +</project> diff --git a/archiva-repository-layer/src/test/repository/groupId/artifactId/maven-metadata.xml b/archiva-repository-layer/src/test/repository/groupId/artifactId/maven-metadata.xml new file mode 100644 index 000000000..bb105fbcb --- /dev/null +++ b/archiva-repository-layer/src/test/repository/groupId/artifactId/maven-metadata.xml @@ -0,0 +1,26 @@ +<!-- + ~ Copyright 2005-2006 The Apache Software Foundation. + ~ + ~ Licensed 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. + --> + +<metadata> + <groupId>groupId</groupId> + <artifactId>artifactId</artifactId> + <version>1.0-alpha-1</version> + <versioning> + <versions> + <version>1.0-alpha-1</version> + </versions> + </versioning> +</metadata> diff --git a/archiva-repository-layer/src/test/repository/groupId/snapshot-artifact/1.0-alpha-1-SNAPSHOT/snapshot-artifact-1.0-alpha-1-20050611.202024-1.pom b/archiva-repository-layer/src/test/repository/groupId/snapshot-artifact/1.0-alpha-1-SNAPSHOT/snapshot-artifact-1.0-alpha-1-20050611.202024-1.pom new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/archiva-repository-layer/src/test/repository/groupId/snapshot-artifact/1.0-alpha-1-SNAPSHOT/snapshot-artifact-1.0-alpha-1-20050611.202024-1.pom |