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<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() );
// Execute the database task.
DatabaseTask dataTask = new DatabaseTask();
dataTask.setName( "testDataTask" );
taskExecutor.executeTask( dataTask );
// Test for artifact existance.
artifactList = adao.queryArtifacts( null );
assertNotNull( "Artifact list should not be null.", artifactList );
assertEquals( "Artifact list size", 1, artifactList.size() );
// Test for processed artifacts.
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() );
}