diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDependencyCollectorTest.java b/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDependencyCollectorTest.java index adf1e7ef4959cbea5733b787efe05acfbfd171cd..cfb8cdf170d5b9a318f0edb534d0e15e4bac1ddd 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDependencyCollectorTest.java +++ b/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDependencyCollectorTest.java @@ -221,7 +221,7 @@ public class DefaultDependencyCollectorTest public void testEqualSubtree() throws IOException, DependencyCollectionException { - DependencyNode root = parser.parse( "expectedSubtreeComparisonResult.txt" ); + DependencyNode root = parser.parseResource( "expectedSubtreeComparisonResult.txt" ); Dependency dependency = root.getDependency(); CollectRequest request = new CollectRequest( dependency, Arrays.asList( repository ) ); @@ -233,7 +233,7 @@ public class DefaultDependencyCollectorTest public void testCyclicDependencies() throws Exception { - DependencyNode root = parser.parse( "cycle.txt" ); + DependencyNode root = parser.parseResource( "cycle.txt" ); CollectRequest request = new CollectRequest( root.getDependency(), Arrays.asList( repository ) ); CollectResult result = collector.collectDependencies( session, request ); assertEqualSubtree( root, result.getRoot() ); @@ -243,7 +243,7 @@ public class DefaultDependencyCollectorTest public void testCyclicDependenciesBig() throws Exception { - DependencyNode root = parser.parse( "cycle-big.txt" ); + DependencyNode root = parser.parseResource( "cycle-big.txt" ); CollectRequest request = new CollectRequest( root.getDependency(), Arrays.asList( repository ) ); collector.setArtifactDescriptorReader( new IniArtifactDescriptorReader( "artifact-descriptions/cycle-big/" ) ); CollectResult result = collector.collectDependencies( session, request ); @@ -255,7 +255,7 @@ public class DefaultDependencyCollectorTest public void testPartialResultOnError() throws IOException { - DependencyNode root = parser.parse( "expectedPartialSubtreeOnError.txt" ); + DependencyNode root = parser.parseResource( "expectedPartialSubtreeOnError.txt" ); Dependency dependency = root.getDependency(); CollectRequest request = new CollectRequest( dependency, Arrays.asList( repository ) ); @@ -365,7 +365,7 @@ public class DefaultDependencyCollectorTest { collector.setArtifactDescriptorReader( new IniArtifactDescriptorReader( "artifact-descriptions/managed/" ) ); - DependencyNode root = parser.parse( "expectedSubtreeComparisonResult.txt" ); + DependencyNode root = parser.parseResource( "expectedSubtreeComparisonResult.txt" ); TestDependencyManager depMgmt = new TestDependencyManager(); depMgmt.addManagedDependency( dep( root, 0 ), "managed", null, null ); depMgmt.addManagedDependency( dep( root, 0, 1 ), "managed", "managed", null ); diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java b/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java index e611cd24a909bb8f9ffdaca36836c696a2f9f05f..f08339c96b3e796fd1bfe93df0eb8e47d83b5fe3 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java +++ b/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. + * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,6 +19,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; @@ -88,7 +89,7 @@ import org.eclipse.aether.graph.DependencyNode; * *

Multiple definitions in one resource

*

- * By using {@link #parseMultiple(String)}, definitions divided by a line beginning with "---" can be read from the same + * By using {@link #parseMultiResource(String)}, definitions divided by a line beginning with "---" can be read from the same * resource. The rest of the line is ignored. *

Substitutions

*

@@ -107,30 +108,15 @@ import org.eclipse.aether.graph.DependencyNode; */ public class DependencyGraphParser { - private Map nodes = new HashMap(); - private String prefix = ""; + private final String prefix; private Collection substitutions; - private Iterator substitutionIterator; - - /** - * Parse the given graph definition. - */ - public DependencyNode parseLiteral( String dependencyGraph ) - throws IOException - { - BufferedReader reader = new BufferedReader( new StringReader( dependencyGraph ) ); - DependencyNode node = parse( reader ); - reader.close(); - return node; - } - /** * Create a parser with the given prefix and the given substitution strings. * - * @see DependencyGraphParser#parse(String) + * @see DependencyGraphParser#parseResource(String) */ public DependencyGraphParser( String prefix, Collection substitutions ) { @@ -141,11 +127,11 @@ public class DependencyGraphParser /** * Create a parser with the given prefix. * - * @see DependencyGraphParser#parse(String) + * @see DependencyGraphParser#parseResource(String) */ public DependencyGraphParser( String prefix ) { - this( prefix, null ); + this( prefix, Collections. emptyList() ); } /** @@ -157,10 +143,22 @@ public class DependencyGraphParser } /** - * Parse the graph definition read from the given resource. If a prefix is set, this method will load the resource - * from 'prefix + resource'. + * Parse the given graph definition. */ - public DependencyNode parse( String resource ) + public DependencyNode parseLiteral( String dependencyGraph ) + throws IOException + { + BufferedReader reader = new BufferedReader( new StringReader( dependencyGraph ) ); + DependencyNode node = parse( reader ); + reader.close(); + return node; + } + + /** + * Parse the graph definition read from the given classpath resource. If a prefix is set, this method will load the + * resource from 'prefix + resource'. + */ + public DependencyNode parseResource( String resource ) throws IOException { URL res = this.getClass().getClassLoader().getResource( prefix + resource ); @@ -174,7 +172,7 @@ public class DependencyGraphParser /** * Parse multiple graphs in one resource, divided by "---". */ - public List parseMultiple( String resource ) + public List parseMultiResource( String resource ) throws IOException { URL res = this.getClass().getClassLoader().getResource( prefix + resource ); @@ -218,11 +216,7 @@ public class DependencyGraphParser private DependencyNode parse( BufferedReader in ) throws IOException { - - if ( substitutions != null ) - { - substitutionIterator = substitutions.iterator(); - } + Iterator substitutionIterator = ( substitutions != null ) ? substitutions.iterator() : null; String line = null; @@ -230,6 +224,7 @@ public class DependencyGraphParser DependencyNode node = null; int prevLevel = 0; + Map nodes = new HashMap(); LinkedList stack = new LinkedList(); boolean isRootNode = true; @@ -276,7 +271,12 @@ public class DependencyGraphParser if ( ctx.getDefinition() != null && ctx.getDefinition().isReference() ) { - DependencyNode child = reference( ctx.getDefinition().getReference() ); + String reference = ctx.getDefinition().getReference(); + DependencyNode child = nodes.get( reference ); + if ( child == null ) + { + throw new IllegalArgumentException( "undefined reference " + reference ); + } node.getChildren().add( child ); node = child; } @@ -293,15 +293,12 @@ public class DependencyGraphParser if ( ctx.getDefinition() != null && ctx.getDefinition().hasId() ) { - this.nodes.put( ctx.getDefinition().getId(), node ); + nodes.put( ctx.getDefinition().getId(), node ); } } } - this.nodes.clear(); - return root; - } private boolean isEOFMarker( String line ) @@ -309,16 +306,6 @@ public class DependencyGraphParser return line.startsWith( "---" ); } - private DependencyNode reference( String reference ) - { - if ( !nodes.containsKey( reference ) ) - { - throw new IllegalArgumentException( "undefined reference " + reference ); - } - - return this.nodes.get( reference ); - } - private static boolean isEmpty( String line ) { return line == null || line.length() == 0; @@ -353,7 +340,8 @@ public class DependencyGraphParser if ( def != null ) { builder.artifactId( def.getArtifactId() ).groupId( def.getGroupId() ); - builder.ext( def.getExtension() ).version( def.getVersion() ).scope( def.getScope() ); + builder.ext( def.getExtension() ).version( def.getVersion() ); + builder.scope( def.getScope() ).optional( def.isOptional() ); builder.properties( ctx.getProperties() ); } DependencyNode node = builder.build(); @@ -567,8 +555,7 @@ public class DependencyGraphParser public void setSubstitutions( String... substitutions ) { - this.setSubstitutions( Arrays.asList( substitutions ) ); - + setSubstitutions( Arrays.asList( substitutions ) ); } } diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeBuilder.java b/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeBuilder.java index 50d3aa56ec947dac19f86caaddaf1a2f714fd601..21d7bcda7443922d4531cbdf9fcf351ee6767127 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeBuilder.java +++ b/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. + * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -26,6 +26,7 @@ import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.VersionScheme; /** + * A builder to create dependency nodes for unit testing. */ public class NodeBuilder { @@ -92,6 +93,12 @@ public class NodeBuilder return this; } + public NodeBuilder optional( boolean optional ) + { + this.optional = optional; + return this; + } + public NodeBuilder context( String context ) { this.context = context; diff --git a/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/DependencyGraphParserTest.java b/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/DependencyGraphParserTest.java index b4280cb348bac58cbcab2b9964032d48d5020dcc..6839032e9c4fd2c662b9c7cc92dbf30d9c5de96f 100644 --- a/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/DependencyGraphParserTest.java +++ b/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/DependencyGraphParserTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. + * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -76,7 +76,6 @@ public class DependencyGraphParserTest Dependency dependency = node.getDependency(); assertNotNull( dependency ); assertEquals( "", dependency.getScope() ); - } @Test @@ -179,7 +178,7 @@ public class DependencyGraphParserTest String prefix = "org/eclipse/aether/internal/test/util/"; String name = "testResourceLoading.txt"; - DependencyNode node = parser.parse( prefix + name ); + DependencyNode node = parser.parseResource( prefix + name ); assertEquals( 0, node.getChildren().size() ); assertNodeProperties( node, "" ); } @@ -193,7 +192,7 @@ public class DependencyGraphParserTest String name = "testResourceLoading.txt"; - DependencyNode node = parser.parse( name ); + DependencyNode node = parser.parseResource( name ); assertEquals( 0, node.getChildren().size() ); assertNodeProperties( node, "" ); } @@ -242,7 +241,7 @@ public class DependencyGraphParserTest String prefix = "org/eclipse/aether/internal/test/util/"; String name = "testResourceLoading.txt"; - List nodes = parser.parseMultiple( prefix + name ); + List nodes = parser.parseMultiResource( prefix + name ); assertEquals( 2, nodes.size() ); assertEquals( "aid", nodes.get( 0 ).getDependency().getArtifact().getArtifactId() ); @@ -271,4 +270,22 @@ public class DependencyGraphParserTest assertEquals( 1, root.getChildren().size() ); assertNull( root.getChildren().get( 0 ).getDependency() ); } + + @Test + public void testOptional() + throws IOException + { + String def = "gid:aid:jar:1:compile:optional"; + + DependencyNode node = parser.parseLiteral( def ); + + assertNotNull( node ); + assertEquals( 0, node.getChildren().size() ); + + Dependency dependency = node.getDependency(); + assertNotNull( dependency ); + assertEquals( "compile", dependency.getScope() ); + assertEquals( true, dependency.isOptional() ); + } + } diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorterTest.java b/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorterTest.java index d6ead34d1b4605dc35a0d4dcc8297c8d8105fe12..6b5a4230c0f21320328dc3a142203b300b01f9d3 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorterTest.java +++ b/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorterTest.java @@ -80,7 +80,7 @@ public class ConflictIdSorterTest public void testSimple() throws Exception { - DependencyNode node = parser.parse( "simple.txt" ); + DependencyNode node = parser.parseResource( "simple.txt" ); assertSame( node, transform( node ) ); expectOrder( "gid2:aid::ext", "gid:aid::ext", "gid:aid2::ext" ); @@ -91,7 +91,7 @@ public class ConflictIdSorterTest public void testCycle() throws Exception { - DependencyNode node = parser.parse( "cycle.txt" ); + DependencyNode node = parser.parseResource( "cycle.txt" ); assertSame( node, transform( node ) ); expectOrder( "gid:aid::ext", "gid2:aid::ext" ); @@ -102,7 +102,7 @@ public class ConflictIdSorterTest public void testCycles() throws Exception { - DependencyNode node = parser.parse( "cycles.txt" ); + DependencyNode node = parser.parseResource( "cycles.txt" ); assertSame( node, transform( node ) ); expectOrder( "*", "*", "*", "gid:aid::ext" ); @@ -113,7 +113,7 @@ public class ConflictIdSorterTest public void testNoConflicts() throws Exception { - DependencyNode node = parser.parse( "no-conflicts.txt" ); + DependencyNode node = parser.parseResource( "no-conflicts.txt" ); assertSame( node, transform( node ) ); expectOrder( "gid:aid::ext", "gid3:aid::ext", "gid2:aid::ext", "gid4:aid::ext" ); diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelectorTest.java b/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelectorTest.java index 8d4f16e19722b109b61c4e6e11c84ae990814d67..9aed93224829880d8dc07327d96f8a7a3a177258 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelectorTest.java +++ b/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelectorTest.java @@ -12,7 +12,6 @@ package org.eclipse.aether.util.graph.transformer; import static org.junit.Assert.*; -import java.util.Arrays; import java.util.Locale; import org.eclipse.aether.collection.DependencyGraphTransformer; @@ -50,11 +49,11 @@ public class JavaScopeSelectorTest parser = new DependencyGraphParser( "transformer/scope-calculator/" ); } - private DependencyNode parse( String name, String... substitutions ) + private DependencyNode parse( String resource, String... substitutions ) throws Exception { - parser.setSubstitutions( Arrays.asList( substitutions ) ); - return parser.parse( name ); + parser.setSubstitutions( substitutions ); + return parser.parseResource( resource ); } private void expectScope( String expected, DependencyNode root, int... coords ) @@ -109,7 +108,7 @@ public class JavaScopeSelectorTest public void testConflictWinningScopeGetsUsedForInheritance() throws Exception { - DependencyNode root = parser.parse( "conflict-and-inheritance.txt" ); + DependencyNode root = parse( "conflict-and-inheritance.txt" ); assertSame( root, transform( root ) ); expectScope( "compile", root, 0, 0 ); @@ -120,7 +119,7 @@ public class JavaScopeSelectorTest public void testScopeOfDirectDependencyWinsConflictAndGetsUsedForInheritanceToChildrenEverywhereInGraph() throws Exception { - DependencyNode root = parser.parse( "direct-with-conflict-and-inheritance.txt" ); + DependencyNode root = parse( "direct-with-conflict-and-inheritance.txt" ); assertSame( root, transform( root ) ); expectScope( "test", root, 0, 0 ); @@ -130,7 +129,7 @@ public class JavaScopeSelectorTest public void testCycleA() throws Exception { - DependencyNode root = parser.parse( "cycle-a.txt" ); + DependencyNode root = parse( "cycle-a.txt" ); assertSame( root, transform( root ) ); expectScope( "compile", root, 0 ); @@ -141,7 +140,7 @@ public class JavaScopeSelectorTest public void testCycleB() throws Exception { - DependencyNode root = parser.parse( "cycle-b.txt" ); + DependencyNode root = parse( "cycle-b.txt" ); assertSame( root, transform( root ) ); expectScope( "runtime", root, 0 ); @@ -152,7 +151,7 @@ public class JavaScopeSelectorTest public void testCycleC() throws Exception { - DependencyNode root = parser.parse( "cycle-c.txt" ); + DependencyNode root = parse( "cycle-c.txt" ); assertSame( root, transform( root ) ); expectScope( "runtime", root, 0 ); @@ -165,7 +164,7 @@ public class JavaScopeSelectorTest public void testCycleD() throws Exception { - DependencyNode root = parser.parse( "cycle-d.txt" ); + DependencyNode root = parse( "cycle-d.txt" ); assertSame( root, transform( root ) ); expectScope( "compile", root, 0 ); @@ -181,8 +180,7 @@ public class JavaScopeSelectorTest { String direct = directScope.toString(); - parser.setSubstitutions( direct ); - DependencyNode root = parser.parse( "direct-nodes-winning.txt" ); + DependencyNode root = parse( "direct-nodes-winning.txt", direct ); String msg = String.format( "direct node should be setting scope ('%s') for all nodes.\n" + parser.dump( root ), @@ -202,8 +200,7 @@ public class JavaScopeSelectorTest { for ( Scope scope2 : Scope.values() ) { - parser.setSubstitutions( scope1.toString(), scope2.toString() ); - DependencyNode root = parser.parse( "multiple-inheritance.txt" ); + DependencyNode root = parse( "multiple-inheritance.txt", scope1.toString(), scope2.toString() ); String expected = scope1.compareTo( scope2 ) >= 0 ? scope1.toString() : scope2.toString(); String msg = String.format( "expected '%s' to win\n" + parser.dump( root ), expected ); @@ -224,8 +221,7 @@ public class JavaScopeSelectorTest { for ( Scope scope2 : Scope.values() ) { - parser.setSubstitutions( scope1.toString(), scope2.toString() ); - DependencyNode root = parser.parse( "dueling-scopes.txt" ); + DependencyNode root = parse( "dueling-scopes.txt", scope1.toString(), scope2.toString() ); String expected = scope1.compareTo( scope2 ) >= 0 ? scope1.toString() : scope2.toString(); String msg = String.format( "expected '%s' to win\n" + parser.dump( root ), expected ); @@ -249,8 +245,7 @@ public class JavaScopeSelectorTest { for ( Scope scope2 : Scope.values() ) { - parser.setSubstitutions( scope1.toString(), scope2.toString() ); - DependencyNode root = parser.parse( "conflicting-direct-nodes.txt" ); + DependencyNode root = parse( "conflicting-direct-nodes.txt", scope1.toString(), scope2.toString() ); String expected = scope1.toString(); String msg = String.format( "expected '%s' to win\n" + parser.dump( root ), expected ); diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java b/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java index cfa25d110c13c838e9850e4a9cb05587a78e1ab7..bf01095f8361499f4fe2795896c055b19fd568fc 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java +++ b/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java @@ -340,7 +340,7 @@ public class NearestVersionSelectorTest public void testCyclicGraph() throws Exception { - DependencyNode root = new DependencyGraphParser( "transformer/version-resolver/" ).parse( "cycle.txt" ); + DependencyNode root = new DependencyGraphParser( "transformer/version-resolver/" ).parseResource( "cycle.txt" ); assertSame( root, transform( root ) ); @@ -354,7 +354,7 @@ public class NearestVersionSelectorTest public void testLoop() throws Exception { - DependencyNode root = new DependencyGraphParser( "transformer/version-resolver/" ).parse( "loop.txt" ); + DependencyNode root = new DependencyGraphParser( "transformer/version-resolver/" ).parseResource( "loop.txt" ); assertSame( root, transform( root ) ); @@ -366,7 +366,7 @@ public class NearestVersionSelectorTest throws Exception { DependencyNode root = - new DependencyGraphParser( "transformer/version-resolver/" ).parse( "overlapping-cycles.txt" ); + new DependencyGraphParser( "transformer/version-resolver/" ).parseResource( "overlapping-cycles.txt" ); assertSame( root, transform( root ) ); @@ -378,7 +378,7 @@ public class NearestVersionSelectorTest throws Exception { DependencyNode root = - new DependencyGraphParser( "transformer/version-resolver/" ).parse( "scope-vs-version.txt" ); + new DependencyGraphParser( "transformer/version-resolver/" ).parseResource( "scope-vs-version.txt" ); assertSame( root, transform( root ) ); @@ -392,7 +392,7 @@ public class NearestVersionSelectorTest public void testVerboseMode() throws Exception { - DependencyNode root = new DependencyGraphParser( "transformer/version-resolver/" ).parse( "verbose.txt" ); + DependencyNode root = new DependencyGraphParser( "transformer/version-resolver/" ).parseResource( "verbose.txt" ); session.setConfigProperty( ConflictResolver.CONFIG_PROP_VERBOSE, Boolean.TRUE ); assertSame( root, transform( root ) ); diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitorTest.java b/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitorTest.java index 3359cb0546b21cffa0941bf23446aa891b94da60..5e73ef5026229e2fe55833406483db1cc3faeb46 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitorTest.java +++ b/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. + * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,7 +25,7 @@ public class FilteringDependencyVisitorTest private DependencyNode parse( String resource ) throws Exception { - return new DependencyGraphParser( "visitor/filtering/" ).parse( resource ); + return new DependencyGraphParser( "visitor/filtering/" ).parseResource( resource ); } @Test diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitorTest.java b/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitorTest.java index dc7fd1d9f17c04a1f57e2d89cfc79f36b9835889..c20d8572d4f8f7bfd65f75b07d23f01a83e16585 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitorTest.java +++ b/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. + * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,7 +25,7 @@ public class PathRecordingDependencyVisitorTest private DependencyNode parse( String resource ) throws Exception { - return new DependencyGraphParser( "visitor/path-recorder/" ).parse( resource ); + return new DependencyGraphParser( "visitor/path-recorder/" ).parseResource( resource ); } private void assertPath( List actual, String... expected ) diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGeneratorTest.java b/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGeneratorTest.java index 0c799bfa1c6963211673b77b6439af26f4d84c02..ad1c713c3fed04ae64ea699249cadb0b5beaee6c 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGeneratorTest.java +++ b/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGeneratorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. + * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,7 +24,7 @@ public class PostorderNodeListGeneratorTest private DependencyNode parse( String resource ) throws Exception { - return new DependencyGraphParser( "visitor/ordered-list/" ).parse( resource ); + return new DependencyGraphParser( "visitor/ordered-list/" ).parseResource( resource ); } private void assertSequence( List actual, String... expected ) diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGeneratorTest.java b/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGeneratorTest.java index 0a3f77588d28a943255570d57f9ab65577fab19f..e0d90ea248f234caaa2ba86bf30f427084cdb873 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGeneratorTest.java +++ b/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGeneratorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. + * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,7 +24,7 @@ public class PreorderNodeListGeneratorTest private DependencyNode parse( String resource ) throws Exception { - return new DependencyGraphParser( "visitor/ordered-list/" ).parse( resource ); + return new DependencyGraphParser( "visitor/ordered-list/" ).parseResource( resource ); } private void assertSequence( List actual, String... expected ) diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitorTest.java b/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitorTest.java index 9ae25c8bb862829f624d196ae050fa6321a40584..a3c9c88a90431ff194f1244d675da7d928c47320 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitorTest.java +++ b/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. + * Copyright (c) 2010, 2013 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -23,7 +23,7 @@ public class TreeDependencyVisitorTest private DependencyNode parse( String resource ) throws Exception { - return new DependencyGraphParser( "visitor/tree/" ).parse( resource ); + return new DependencyGraphParser( "visitor/tree/" ).parseResource( resource ); } @Test