From 86dbe01590cdced77a229c9e62a8f766d6ea93b3 Mon Sep 17 00:00:00 2001 From: Oleg Gusakov Date: Wed, 1 Apr 2009 17:50:50 +0000 Subject: [PATCH] Mercury repo system impl - enhanced UT for resolved tree git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@760982 13f79535-47bb-0310-9956-ffa450edef68 --- .../mercury/MercuryRepositorySystemTest.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/maven-repository-mercury/src/test/java/org/apache/maven/repository/mercury/MercuryRepositorySystemTest.java b/maven-repository-mercury/src/test/java/org/apache/maven/repository/mercury/MercuryRepositorySystemTest.java index 3debe1b636..9d64e1b6ba 100644 --- a/maven-repository-mercury/src/test/java/org/apache/maven/repository/mercury/MercuryRepositorySystemTest.java +++ b/maven-repository-mercury/src/test/java/org/apache/maven/repository/mercury/MercuryRepositorySystemTest.java @@ -20,6 +20,7 @@ under the License. package org.apache.maven.repository.mercury; import java.io.IOException; +import java.util.Collection; import java.util.Set; import org.apache.maven.artifact.Artifact; @@ -29,6 +30,7 @@ import org.apache.maven.mercury.artifact.ArtifactMetadata; import org.apache.maven.repository.AbstractMavenRepositorySystemTest; import org.apache.maven.repository.MavenArtifactMetadata; import org.apache.maven.repository.MetadataGraph; +import org.apache.maven.repository.MetadataGraphNode; import org.apache.maven.repository.MetadataResolutionRequest; import org.apache.maven.repository.MetadataResolutionResult; import org.apache.maven.repository.RepositorySystem; @@ -72,20 +74,22 @@ public class MercuryRepositorySystemTest assertNotNull( resGraph ); - assertNotNull( resGraph.getNodes() ); + Collection nodes = resGraph.getNodes(); + + assertNotNull( nodes ); + + assertEquals( 4, nodes.size() ); + + assertTrue( nodes.contains( new MetadataGraphNode( MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm-xml:3.0" ) ) ) ) ); + + assertTrue( nodes.contains( new MetadataGraphNode( MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm-util:3.0" ) ) ) ) ); + + assertTrue( nodes.contains( new MetadataGraphNode( MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm-tree:3.0" ) ) ) ) ); + + assertTrue( nodes.contains( new MetadataGraphNode( MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm:3.0" ) ) ) ) ); + + assertFalse( nodes.contains( new MetadataGraphNode( MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm-parent:3.0" ) ) ) ) ); - assertEquals( 4, resGraph.getNodes().size() ); -// -// assertTrue( checkExists( as, "asm:asm-xml:3.0" ) ); -// -// assertTrue( checkExists( as, "asm:asm-util:3.0" ) ); -// -// assertTrue( checkExists( as, "asm:asm-tree:3.0" ) ); -// -// assertTrue( checkExists( as, "asm:asm:3.0" ) ); -// -// assertFalse( checkExists( as, "asm:asm-parent:3.0" ) ); -// // for( Artifact a : as ) // { // assertTrue( a.getFile().exists() );