From 3dce54c7fbf91ab1484cf07c8ada97affd54a13d Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Fri, 18 May 2007 22:35:12 +0000 Subject: [MRM-346]: Show Artifact results in error 500. git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@539619 13f79535-47bb-0310-9956-ffa450edef68 --- .../database/ProjectModelToDatabaseConsumer.java | 4 + .../maven/archiva/model/ArchivaModelCloner.java | 59 +----- .../archiva-model/src/main/mdo/archiva-base.xml | 210 +-------------------- .../repository/project/ProjectModelMerge.java | 91 +-------- .../filters/EffectiveProjectModelFilter.java | 6 +- .../filters/ProjectModelExpressionFilter.java | 5 +- .../project/readers/ProjectModel400Reader.java | 19 +- .../filters/EffectiveProjectModelFilterTest.java | 25 ++- .../ProjectModelExpressionExpanderTest.java | 20 +- .../project/readers/ProjectModel400ReaderTest.java | 11 +- 10 files changed, 46 insertions(+), 404 deletions(-) (limited to 'archiva-base') diff --git a/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumer.java b/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumer.java index cc4558d9d..0b13f8b1a 100644 --- a/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumer.java +++ b/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumer.java @@ -38,6 +38,7 @@ import org.apache.maven.archiva.repository.project.ProjectModelReader; import java.io.File; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -130,6 +131,9 @@ public class ProjectModelToDatabaseConsumer try { ArchivaProjectModel model = project400Reader.read( artifactFile ); + + model.setOrigin( "filesystem" ); + dao.getProjectModelDAO().saveProjectModel( model ); } catch ( ProjectModelException e ) diff --git a/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java b/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java index c77a7ef34..cf0d5f274 100644 --- a/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java +++ b/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java @@ -62,7 +62,7 @@ public class ArchivaModelCloner cloned.setOrganization( clone( model.getOrganization() ) ); cloned.setScm( clone( model.getScm() ) ); cloned.setRepositories( cloneRepositories( model.getRepositories() ) ); - cloned.setDependencyTree( clone( model.getDependencyTree() ) ); + cloned.setDependencies( cloneDependencies( model.getDependencies() ) ); cloned.setPlugins( clonePlugins( model.getPlugins() ) ); cloned.setReports( cloneReports( model.getReports() ) ); cloned.setDependencyManagement( cloneDependencies( model.getDependencyManagement() ) ); @@ -130,37 +130,6 @@ public class ArchivaModelCloner return cloned; } - public static DependencyEdge clone( DependencyEdge edge ) - { - if ( edge == null ) - { - return null; - } - - DependencyEdge cloned = new DependencyEdge(); - - cloned.setFromDependency( clone( edge.getFromDependency() ) ); - cloned.setToDependency( clone( edge.getToDependency() ) ); - cloned.setType( edge.getType() ); - - return cloned; - } - - public static DependencyTree clone( DependencyTree dependencyTree ) - { - if ( dependencyTree == null ) - { - return null; - } - - DependencyTree cloned = new DependencyTree(); - - cloned.setDependencyNodes( cloneDependencies( dependencyTree.getDependencyNodes() ) ); - cloned.setDependencyEdges( cloneDependencyEdges( dependencyTree.getDependencyEdges() ) ); - - return cloned; - } - public static IssueManagement clone( IssueManagement issueManagement ) { if ( issueManagement == null ) @@ -323,32 +292,6 @@ public class ArchivaModelCloner return ret; } - public static List cloneDependencyEdges( List dependencyEdges ) - { - if ( dependencyEdges == null ) - { - return null; - } - - List ret = new ArrayList(); - - Iterator it = dependencyEdges.iterator(); - while ( it.hasNext() ) - { - DependencyEdge edge = (DependencyEdge) it.next(); - - if ( edge == null ) - { - // Skip empty edge. - continue; - } - - ret.add( clone( edge ) ); - } - - return ret; - } - public static List cloneExclusions( List exclusions ) { if ( exclusions == null ) diff --git a/archiva-base/archiva-model/src/main/mdo/archiva-base.xml b/archiva-base/archiva-model/src/main/mdo/archiva-base.xml index 02089dbad..244bc41f4 100644 --- a/archiva-base/archiva-model/src/main/mdo/archiva-base.xml +++ b/archiva-base/archiva-model/src/main/mdo/archiva-base.xml @@ -998,7 +998,7 @@ whenIndexed false 1.0.0+ - true + false Date The timestamp when this model was indexed. @@ -1080,14 +1080,15 @@ - dependencyTree + dependencies 1.0.0+ - DependencyTree + Dependency + * @@ -1441,129 +1442,6 @@ - - - DependencyTree - The Dependency Tree - 1.0.0+ - - - dependencyNodes - 1.0.0+ - The nodes for this dependency tree. - - Dependency - * - - - - dependencyEdges - 1.0.0+ - The edges for this dependency tree. - - DependencyEdge - * - - - - - - 1.0.0+ - - - - @@ -1602,6 +1480,7 @@ 1.0.0+ String false + - - DependencyEdge - 1.0.0+ - - - fromDependency - 1.0.0+ - true - The dependency reference for the 'from' node - - ArtifactReference - - - - toDependency - 1.0.0+ - true - The dependency reference for the 'to' node - - ArtifactReference - - - - type - 1.0.0+ - true - - The type of edge you have. -

- -
-
runtime
-
A dependency node that is required for runtime of the project
- -
test
-
A dependency node that is used by the project for testing purposes.
- -
build
-
A dependency node that is used in the build/extension capacity.
- -
plugin
-
A dependency node that is used as, or by a, declared plugin in this project. - This includes the plugin itself, and any defined plugins/plugin/dependencies/dependency references. -
- -
report
-
A dependency node that is used as, or by a, declared report in this project. - This includes the report itself, and any defined reporting/plugins/plugin/dependencies/dependency references.
-
- ]]>
- String -
-
- - - 1.0.0+ - " ); - key.append( ArtifactReference.toVersionlessKey( edge.getToDependency() ) ); - - return key.toString(); - } - - public String toString() - { - return DependencyEdge.toKey( this ); - } - ]]> - - -
- Exclusion diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java index a08646add..7da66c5a4 100644 --- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java +++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java @@ -25,8 +25,6 @@ import org.apache.maven.archiva.model.ArchivaProjectModel; import org.apache.maven.archiva.model.ArtifactReference; import org.apache.maven.archiva.model.CiManagement; import org.apache.maven.archiva.model.Dependency; -import org.apache.maven.archiva.model.DependencyEdge; -import org.apache.maven.archiva.model.DependencyTree; import org.apache.maven.archiva.model.Exclusion; import org.apache.maven.archiva.model.Individual; import org.apache.maven.archiva.model.IssueManagement; @@ -94,7 +92,7 @@ public class ProjectModelMerge merged.setOrganization( merge( mainProject.getOrganization(), parentProject.getOrganization() ) ); merged.setScm( merge( mainProject.getScm(), parentProject.getScm() ) ); merged.setRepositories( mergeRepositories( mainProject.getRepositories(), parentProject.getRepositories() ) ); - merged.setDependencyTree( merge( mainProject.getDependencyTree(), parentProject.getDependencyTree() ) ); + merged.setDependencies( mergeDependencies( mainProject.getDependencies(), parentProject.getDependencies() ) ); merged.setDependencyManagement( mergeDependencyManagement( mainProject.getDependencyManagement(), parentProject .getDependencyManagement() ) ); merged.setPlugins( mergePlugins( mainProject.getPlugins(), parentProject.getPlugins() ) ); @@ -181,21 +179,6 @@ public class ProjectModelMerge return ret; } - private static Map createEdgeMap( List dependencyEdges ) - { - Map ret = new HashMap(); - - Iterator it = dependencyEdges.iterator(); - while ( it.hasNext() ) - { - DependencyEdge edge = (DependencyEdge) it.next(); - String key = toKey( edge ); - ret.put( key, edge ); - } - - return ret; - } - private static boolean empty( String val ) { if ( val == null ) @@ -233,28 +216,6 @@ public class ProjectModelMerge return merged; } - private static DependencyTree merge( DependencyTree mainDependencyTree, DependencyTree parentDependencyTree ) - { - if ( parentDependencyTree == null ) - { - return mainDependencyTree; - } - - if ( mainDependencyTree == null ) - { - return ArchivaModelCloner.clone( parentDependencyTree ); - } - - DependencyTree merged = ArchivaModelCloner.clone( mainDependencyTree ); - - merged.setDependencyNodes( mergeDependencies( mainDependencyTree.getDependencyNodes(), parentDependencyTree - .getDependencyNodes() ) ); - merged.setDependencyEdges( mergeDependencyEdges( mainDependencyTree.getDependencyEdges(), parentDependencyTree - .getDependencyEdges() ) ); - - return merged; - } - private static CiManagement merge( CiManagement mainCim, CiManagement parentCim ) { if ( parentCim == null ) @@ -675,45 +636,6 @@ public class ProjectModelMerge return merged; } - private static List mergeDependencyEdges( List mainDependencyEdges, List parentDependencyEdges ) - { - if ( parentDependencyEdges == null ) - { - return mainDependencyEdges; - } - - if ( mainDependencyEdges == null ) - { - return ArchivaModelCloner.cloneDependencyEdges( parentDependencyEdges ); - } - - List merged = new ArrayList(); - - Map mainEdgesMap = createEdgeMap( mainDependencyEdges ); - Map parentEdgesMap = createEdgeMap( parentDependencyEdges ); - - Iterator it = mainEdgesMap.entrySet().iterator(); - while ( it.hasNext() ) - { - Map.Entry entry = (Entry) it.next(); - String key = (String) entry.getKey(); - DependencyEdge mainEdge = (DependencyEdge) entry.getValue(); - DependencyEdge parentEdge = (DependencyEdge) parentEdgesMap.get( key ); - - if ( parentEdge == null ) - { - merged.add( mainEdge ); - } - else - { - // Not merging. Local wins. - merged.add( parentEdge ); - } - } - - return merged; - } - private static String toVersionlessArtifactKey( ArtifactReference artifactReference ) { StringBuffer key = new StringBuffer(); @@ -735,15 +657,4 @@ public class ProjectModelMerge return key.toString(); } - - private static String toKey( DependencyEdge edge ) - { - StringBuffer key = new StringBuffer(); - - key.append( toVersionlessArtifactKey( edge.getFromDependency() ) ); - key.append( "->" ); - key.append( toVersionlessArtifactKey( edge.getToDependency() ) ); - - return key.toString(); - } } diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilter.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilter.java index 2141c2b02..33083768b 100644 --- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilter.java +++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilter.java @@ -118,20 +118,20 @@ public class EffectiveProjectModelFilter implements ProjectModelFilter private void applyDependencyManagement( ArchivaProjectModel pom ) { - if ( ( pom.getDependencyManagement() == null ) || ( pom.getDependencyTree() == null ) ) + if ( ( pom.getDependencyManagement() == null ) || ( pom.getDependencies() == null ) ) { // Nothing to do. All done! return; } - if ( pom.getDependencyManagement().isEmpty() || pom.getDependencyTree().isEmpty() ) + if ( pom.getDependencyManagement().isEmpty() || pom.getDependencies().isEmpty() ) { // Nothing to do. All done! return; } Map managedDependencies = createDependencyMap( pom.getDependencyManagement() ); - Iterator it = pom.getDependencyTree().getDependencyNodes().iterator(); + Iterator it = pom.getDependencies().iterator(); while ( it.hasNext() ) { Dependency dep = (Dependency) it.next(); diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java index e2abca0cc..d845897be 100644 --- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java +++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository.project.filters; * under the License. */ +import org.apache.commons.collections.CollectionUtils; import org.apache.maven.archiva.model.ArchivaModelCloner; import org.apache.maven.archiva.model.ArchivaProjectModel; import org.apache.maven.archiva.model.Dependency; @@ -73,9 +74,9 @@ public class ProjectModelExpressionFilter ret.setVersion( evaluator.expand( ret.getVersion() ) ); ret.setGroupId( evaluator.expand( ret.getGroupId() ) ); - if ( ( ret.getDependencyTree() != null ) && !ret.getDependencyTree().isEmpty() ) + if ( CollectionUtils.isNotEmpty( ret.getDependencies() ) ) { - evaluateExpressionsInDependencyList( evaluator, ret.getDependencyTree().getDependencyNodes() ); + evaluateExpressionsInDependencyList( evaluator, ret.getDependencies() ); } evaluateExpressionsInDependencyList( evaluator, ret.getDependencyManagement() ); diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java index 9d8033f0c..a10722025 100644 --- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java +++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java @@ -25,7 +25,6 @@ import org.apache.maven.archiva.model.ArtifactReference; import org.apache.maven.archiva.model.CiManagement; import org.apache.maven.archiva.model.Dependency; import org.apache.maven.archiva.model.DependencyScope; -import org.apache.maven.archiva.model.DependencyTree; import org.apache.maven.archiva.model.Exclusion; import org.apache.maven.archiva.model.Individual; import org.apache.maven.archiva.model.IssueManagement; @@ -100,7 +99,7 @@ public class ProjectModel400Reader model.setScm( getSCM( xml ) ); model.setRepositories( getRepositories( xml ) ); - model.setDependencyTree( getDependencyTree( xml ) ); + model.setDependencies( getDependencies( xml ) ); model.setDependencyManagement( getDependencyManagement( xml ) ); model.setPlugins( getPlugins( xml ) ); model.setReports( getReports( xml ) ); @@ -142,20 +141,10 @@ public class ProjectModel400Reader return null; } - private DependencyTree getDependencyTree( XMLReader xml ) + private List getDependencies( XMLReader xml ) throws XMLException { - DependencyTree tree = new DependencyTree(); - List dependencies = getDependencyList( xml, new String[] { "dependencies" } ); - - Iterator it = dependencies.iterator(); - while ( it.hasNext() ) - { - Dependency dependency = (Dependency) it.next(); - tree.addDependencyNode( dependency ); - } - - return tree; + return getDependencyList( xml, new String[] { "dependencies" } ); } private List getDependencyList( XMLReader xml, String parts[] ) @@ -187,7 +176,7 @@ public class ProjectModel400Reader dependency.setArtifactId( elemDependency.elementTextTrim( "artifactId" ) ); dependency.setVersion( elemDependency.elementTextTrim( "version" ) ); - dependency.setClassifier( elemDependency.elementTextTrim( "classifier" ) ); + dependency.setClassifier( StringUtils.defaultString( elemDependency.elementTextTrim( "classifier" ) ) ); dependency.setType( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "type" ), "jar" ) ); dependency.setScope( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "scope" ), "compile" ) ); // Not for v4.0.0 -> dependency.setUrl( elemDependency.elementTextTrim("url") ); diff --git a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java index 5092df2e6..7ac0c506f 100644 --- a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java +++ b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java @@ -22,7 +22,6 @@ package org.apache.maven.archiva.repository.project.filters; import org.apache.maven.archiva.model.ArchivaProjectModel; import org.apache.maven.archiva.model.ArchivaRepository; import org.apache.maven.archiva.model.Dependency; -import org.apache.maven.archiva.model.DependencyTree; import org.apache.maven.archiva.model.Individual; import org.apache.maven.archiva.repository.project.ProjectModelException; import org.apache.maven.archiva.repository.project.ProjectModelFilter; @@ -100,30 +99,28 @@ public class EffectiveProjectModelFilterTest assertEquals( "Equivalent Models", expectedModel, effectiveModel ); assertContainsSameIndividuals( "Individuals", expectedModel.getIndividuals(), effectiveModel.getIndividuals() ); - dumpDependencyList( "Expected", expectedModel.getDependencyTree() ); - dumpDependencyList( "Effective", effectiveModel.getDependencyTree() ); - assertContainsSameDependencies( "Dependencies", expectedModel.getDependencyTree().getDependencyNodes(), - effectiveModel.getDependencyTree().getDependencyNodes() ); - assertContainsSameDependencies( "DependencyManagement", expectedModel.getDependencyManagement(), effectiveModel - .getDependencyManagement() ); + dumpDependencyList( "Expected", expectedModel.getDependencies() ); + dumpDependencyList( "Effective", effectiveModel.getDependencies() ); + assertContainsSameDependencies( "Dependencies", expectedModel.getDependencies(), + effectiveModel.getDependencies() ); + assertContainsSameDependencies( "DependencyManagement", expectedModel.getDependencyManagement(), + effectiveModel.getDependencyManagement() ); } - private void dumpDependencyList( String type, DependencyTree tree ) + private void dumpDependencyList( String type, List deps ) { - if ( tree == null ) + if ( deps == null ) { - System.out.println( " Tree [" + type + "] is null." ); + System.out.println( " Dependencies [" + type + "] is null." ); return; } - if ( tree.getDependencyNodes() == null ) + if ( deps.isEmpty() ) { - System.out.println( " Tree [" + type + "] dependency list (nodes) is null." ); + System.out.println( " Dependencies [" + type + "] dependency list is empty." ); return; } - List deps = tree.getDependencyNodes(); - System.out.println( ".\\ [" + type + "] Dependency List (size:" + deps.size() + ") \\.________________" ); Iterator it = deps.iterator(); while ( it.hasNext() ) diff --git a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java index b63c7b13e..99a00c407 100644 --- a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java +++ b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java @@ -21,11 +21,12 @@ package org.apache.maven.archiva.repository.project.filters; import org.apache.maven.archiva.model.ArchivaProjectModel; import org.apache.maven.archiva.model.Dependency; -import org.apache.maven.archiva.model.DependencyTree; import org.apache.maven.archiva.repository.project.ProjectModelFilter; import org.codehaus.plexus.PlexusTestCase; +import java.util.ArrayList; import java.util.Iterator; +import java.util.List; /** * ProjectModelExpressionExpanderTest @@ -49,13 +50,13 @@ public class ProjectModelExpressionExpanderTest model.setArtifactId( "archiva-test-project" ); model.setVersion( "1.0-SNAPSHOT" ); - DependencyTree depTree = new DependencyTree(); + List deps = new ArrayList(); - depTree.addDependencyEdge( model.asDependency(), createDependency( "org.apache.maven.archiva", "archiva-model", "${archiva.version}" ) ); - depTree.addDependencyEdge( model.asDependency(), createDependency( "org.apache.maven.archiva", "archiva-common", "${archiva.version}" ) ); - depTree.addDependencyEdge( model.asDependency(), createDependency( "org.apache.maven.archiva", "archiva-indexer", "${archiva.version}" ) ); + deps.add( createDependency( "org.apache.maven.archiva", "archiva-model", "${archiva.version}" ) ); + deps.add( createDependency( "org.apache.maven.archiva", "archiva-common", "${archiva.version}" ) ); + deps.add( createDependency( "org.apache.maven.archiva", "archiva-indexer", "${archiva.version}" ) ); - model.setDependencyTree( depTree ); + model.setDependencies( deps ); model.addProperty( "archiva.version", "1.0-SNAPSHOT" ); @@ -67,11 +68,10 @@ public class ProjectModelExpressionExpanderTest assertEquals( "Group ID", "org.apache.maven.archiva", model.getGroupId() ); assertEquals( "Artifact ID", "archiva-test-project", model.getArtifactId() ); assertEquals( "Version", "1.0-SNAPSHOT", model.getVersion() ); - assertNotNull( "DependencyTree", model.getDependencyTree() ); - assertNotNull( "DependencyTree.dependencies", model.getDependencyTree().getDependencyNodes() ); - assertEquals( "Dependencies Size", 4, model.getDependencyTree().getDependencyNodes().size() ); + assertNotNull( "Dependencies", model.getDependencies() ); + assertEquals( "Dependencies Size", 3, model.getDependencies().size() ); - Iterator it = model.getDependencyTree().getDependencyNodes().iterator(); + Iterator it = model.getDependencies().iterator(); while ( it.hasNext() ) { Dependency dep = (Dependency) it.next(); diff --git a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java index aefe08f48..43cce058a 100644 --- a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java +++ b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java @@ -23,7 +23,6 @@ import org.apache.maven.archiva.model.ArchivaProjectModel; import org.apache.maven.archiva.model.VersionedReference; import org.apache.maven.archiva.repository.project.ProjectModelException; import org.apache.maven.archiva.repository.project.ProjectModelReader; -import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader; import org.codehaus.plexus.PlexusTestCase; import java.io.File; @@ -63,9 +62,8 @@ public class ProjectModel400ReaderTest assertEquals( "Parent Artifact ID", "maven-shared-components", parentRef.getArtifactId() ); assertEquals( "Parent Version", "4", parentRef.getVersion() ); - assertNotNull( "DependencyTree", project.getDependencyTree() ); - assertNotNull( "DependencyTree.dependencies", project.getDependencyTree().getDependencyNodes() ); - assertEquals( "Dependencies.size", 3, project.getDependencyTree().getDependencyNodes().size() ); + assertNotNull( "Dependencies", project.getDependencies() ); + assertEquals( "Dependencies.size", 3, project.getDependencies().size() ); } public void testLoadWithNamespace() @@ -93,8 +91,7 @@ public class ProjectModel400ReaderTest assertEquals( "Parent Artifact ID", "archiva-base", parentRef.getArtifactId() ); assertEquals( "Parent Version", "1.0-SNAPSHOT", parentRef.getVersion() ); - assertNotNull( "DependencyTree", project.getDependencyTree() ); - assertNotNull( "DependencyTree.dependencies", project.getDependencyTree().getDependencyNodes() ); - assertEquals( "Dependencies.size", 6, project.getDependencyTree().getDependencyNodes().size() ); + assertNotNull( "Dependencies", project.getDependencies() ); + assertEquals( "Dependencies.size", 6, project.getDependencies().size() ); } } -- cgit v1.2.3