From 04e602f65272c571a5e8e5c2dc21a95b51816a2c Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Tue, 19 Sep 2006 05:09:52 +0000 Subject: [PATCH] adjust tests to work even if they are exported from SVN rather than a checkout git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@447735 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/discoverer/DefaultArtifactDiscovererTest.java | 3 ++- .../maven/archiva/discoverer/LegacyArtifactDiscovererTest.java | 3 ++- archiva-discoverer/src/test/legacy-repository/CVS/Root | 1 + archiva-discoverer/src/test/repository/CVS/Root | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 archiva-discoverer/src/test/legacy-repository/CVS/Root create mode 100644 archiva-discoverer/src/test/repository/CVS/Root diff --git a/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscovererTest.java b/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscovererTest.java index 0eb757826..5c1529f3d 100644 --- a/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscovererTest.java +++ b/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscovererTest.java @@ -63,7 +63,7 @@ public class DefaultArtifactDiscovererTest String path = dPath.getPath(); - boolean b = path.indexOf( ".svn" ) >= 0; + boolean b = path.indexOf( "CVS" ) >= 0; if ( b ) { found = true; @@ -75,6 +75,7 @@ public class DefaultArtifactDiscovererTest for ( Iterator i = artifacts.iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); + assertFalse( "Check not CVS", a.getFile().getPath().indexOf( "CVS" ) >= 0 ); assertFalse( "Check not .svn", a.getFile().getPath().indexOf( ".svn" ) >= 0 ); } } diff --git a/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/LegacyArtifactDiscovererTest.java b/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/LegacyArtifactDiscovererTest.java index 9694c87bf..b8b2b9889 100644 --- a/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/LegacyArtifactDiscovererTest.java +++ b/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/LegacyArtifactDiscovererTest.java @@ -60,7 +60,7 @@ public class LegacyArtifactDiscovererTest String path = dPath.getPath(); - if ( path.indexOf( ".svn" ) >= 0 ) + if ( path.indexOf( "CVS" ) >= 0 ) { found = true; assertEquals( "Check comment", "Artifact was in the specified list of exclusions", dPath.getComment() ); @@ -71,6 +71,7 @@ public class LegacyArtifactDiscovererTest for ( Iterator i = artifacts.iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); + assertFalse( "Check not CVS", a.getFile().getPath().indexOf( "CVS" ) >= 0 ); assertFalse( "Check not .svn", a.getFile().getPath().indexOf( ".svn" ) >= 0 ); } } diff --git a/archiva-discoverer/src/test/legacy-repository/CVS/Root b/archiva-discoverer/src/test/legacy-repository/CVS/Root new file mode 100644 index 000000000..2e65f24a6 --- /dev/null +++ b/archiva-discoverer/src/test/legacy-repository/CVS/Root @@ -0,0 +1 @@ +not a real CVS root - for testing exclusions diff --git a/archiva-discoverer/src/test/repository/CVS/Root b/archiva-discoverer/src/test/repository/CVS/Root new file mode 100644 index 000000000..2e65f24a6 --- /dev/null +++ b/archiva-discoverer/src/test/repository/CVS/Root @@ -0,0 +1 @@ +not a real CVS root - for testing exclusions