countComplete++;
}
- public List getIncludedTypes()
+ public List<String> getIncludedTypes()
{
return null;
}
countComplete++;
}
- public List getIncludedTypes()
+ public List<String> getIncludedTypes()
{
- List types = new ArrayList();
+ List<String> types = new ArrayList<String>();
types.add( "pom" );
types.add( "jar" );
return types;
* under the License.
*/
+import java.io.File;
+import java.net.URL;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.database.ArchivaDAO;
import org.apache.maven.archiva.database.ArtifactDAO;
import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
import org.jpox.SchemaTool;
-import java.io.File;
-import java.net.URL;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.jdo.PersistenceManager;
-import javax.jdo.PersistenceManagerFactory;
-
/**
* ArchivaDatabaseUpdateTaskExecutorTest
*
Properties properties = jdoFactory.getProperties();
- for ( Iterator it = properties.entrySet().iterator(); it.hasNext(); )
+ for ( Map.Entry<Object, Object> entry : properties.entrySet() )
{
- Map.Entry entry = (Map.Entry) it.next();
-
System.setProperty( (String) entry.getKey(), (String) entry.getValue() );
}
assertNotNull( artifact );
// Test for artifact existance.
- List artifactList = adao.queryArtifacts( null );
+ List<ArchivaArtifact> artifactList = adao.queryArtifacts( null );
assertNotNull( "Artifact list should not be null.", artifactList );
assertEquals( "Artifact list size", 1, artifactList.size() );
// Test for unprocessed artifacts.
- List unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) );
+ List<ArchivaArtifact> unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) );
assertNotNull( "Unprocessed Results should not be null.", unprocessedResultList );
assertEquals( "Incorrect number of unprocessed artifacts detected.", 1, unprocessedResultList.size() );
assertEquals( "Artifact list size", 1, artifactList.size() );
// Test for processed artifacts.
- List processedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( true ) );
+ List<ArchivaArtifact> processedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( true ) );
assertNotNull( "Processed Results should not be null.", processedResultList );
assertEquals( "Incorrect number of processed artifacts detected.", 1, processedResultList.size() );
}
* under the License.
*/
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.database.ArchivaDAO;
import org.apache.maven.archiva.database.ArtifactDAO;
import org.apache.maven.archiva.database.constraints.ArtifactsProcessedConstraint;
+import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.scheduled.tasks.RepositoryTask;
import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
import org.codehaus.plexus.jdo.JdoFactory;
import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
import org.jpox.SchemaTool;
-import java.io.File;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.jdo.PersistenceManager;
-import javax.jdo.PersistenceManagerFactory;
-
/**
* ArchivaRepositoryScanningTaskExecutorTest
*
Properties properties = jdoFactory.getProperties();
- for ( Iterator it = properties.entrySet().iterator(); it.hasNext(); )
+ for ( Map.Entry<Object, Object> entry : properties.entrySet() )
{
- Map.Entry entry = (Map.Entry) it.next();
-
System.setProperty( (String) entry.getKey(), (String) entry.getValue() );
}
taskExecutor.executeTask( repoTask );
ArtifactDAO adao = dao.getArtifactDAO();
- List unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) );
+ List<ArchivaArtifact> unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) );
assertNotNull( unprocessedResultList );
assertEquals("Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() );
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.security.ArchivaRoleConstants;
import org.codehaus.plexus.redback.authentication.AuthenticationResult;
import org.codehaus.plexus.redback.authorization.AuthorizationException;
import org.codehaus.plexus.redback.rbac.RBACManager;
-import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
import org.codehaus.plexus.redback.rbac.RbacManagerException;
+import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
import org.codehaus.plexus.redback.rbac.Role;
import org.codehaus.plexus.redback.role.RoleManager;
import org.codehaus.plexus.redback.role.RoleManagerException;
try
{
- Collection roleList = rbacManager.getEffectivelyAssignedRoles( principal );
+ Collection<Role> roleList = rbacManager.getEffectivelyAssignedRoles( principal );
- Iterator it = roleList.iterator();
-
- while ( it.hasNext() )
+ for ( Role role : roleList )
{
- Role role = (Role) it.next();
-
String roleName = role.getName();
if ( roleName.startsWith( ArchivaRoleConstants.REPOSITORY_MANAGER_ROLE_PREFIX ) )
*/
private ArchivaConfiguration archivaConfiguration;
- /**
- * @plexus.requirement
- */
- private ArchivaXworkUser archivaXworkUser;
-
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
{
if ( ConfigurationNames.isManagedRepositories( propertyName ) )