@Test public void testDependenciesForGAVs() throws Exception { final Collection<GAV> gavs = new ArrayList<GAV>(); gavs.add( new GAV( "junit", "junit", "4.11" ) ); gavs.add( new GAV( "org.guvnor", "guvnor-web-app", "5.0" ) ); Collection<Dependency> dependencies = service.loadDependencies( gavs ); assertEquals( 2, dependencies.size() ); final Iterator<Dependency> iterator = dependencies.iterator(); Dependency dependency = iterator.next(); assertEquals( "org.hamcrest", dependency.getGroupId() ); assertEquals( "hamcrest-core", dependency.getArtifactId() ); assertEquals( "1.3", dependency.getVersion() ); dependency = iterator.next(); assertEquals( "org.drools", dependency.getGroupId() ); assertEquals( "drools-core", dependency.getArtifactId() ); assertEquals( "5.0", dependency.getVersion() ); }
@Override public Collection<Dependency> loadDependencies(final Collection<GAV> gavs) { final ArrayList<Dependency> dependencies = new ArrayList<Dependency>(); for (final GAV gav : gavs) { dependencies.addAll(loadDependencies(gav)); } return dependencies; }
DependencyServiceImpl implements DependencyService { @Override public Collection<Dependency> loadDependencies(final Collection<GAV> gavs) { final ArrayList<Dependency> dependencies = new ArrayList<Dependency>(); for (final GAV gav : gavs) { dependencies.addAll(loadDependencies(gav)); } return dependencies; } }
DependencyServiceImpl implements DependencyService { @Override public Collection<Dependency> loadDependencies(final Collection<GAV> gavs) { final ArrayList<Dependency> dependencies = new ArrayList<Dependency>(); for (final GAV gav : gavs) { dependencies.addAll(loadDependencies(gav)); } return dependencies; } DependencyServiceImpl(); }
DependencyServiceImpl implements DependencyService { @Override public Collection<Dependency> loadDependencies(final Collection<GAV> gavs) { final ArrayList<Dependency> dependencies = new ArrayList<Dependency>(); for (final GAV gav : gavs) { dependencies.addAll(loadDependencies(gav)); } return dependencies; } DependencyServiceImpl(); @Override Collection<Dependency> loadDependencies(final Collection<GAV> gavs); @Override Collection<Dependency> loadDependencies(final GAV gav); @Override Set<String> loadPackageNames(final GAV gav); @Override EnhancedDependencies loadEnhancedDependencies(final Collection<Dependency> dependencies); }
DependencyServiceImpl implements DependencyService { @Override public Collection<Dependency> loadDependencies(final Collection<GAV> gavs) { final ArrayList<Dependency> dependencies = new ArrayList<Dependency>(); for (final GAV gav : gavs) { dependencies.addAll(loadDependencies(gav)); } return dependencies; } DependencyServiceImpl(); @Override Collection<Dependency> loadDependencies(final Collection<GAV> gavs); @Override Collection<Dependency> loadDependencies(final GAV gav); @Override Set<String> loadPackageNames(final GAV gav); @Override EnhancedDependencies loadEnhancedDependencies(final Collection<Dependency> dependencies);  }