Package org.apache.maven.archiva.database

Examples of org.apache.maven.archiva.database.ArtifactDAO.queryArtifacts()


        MockControl control = MockControl.createNiceControl( ArtifactDAO.class );
        ArtifactDAO dao = (ArtifactDAO) control.getMock();
        archivaDao.setArtifactDao( dao );

        ArtifactsRelatedConstraint c = new ArtifactsRelatedConstraint( TEST_GROUP_ID, TEST_ARTIFACT_ID, version );
        dao.queryArtifacts( c );
        control.setReturnValue( artifacts, count );

        control.replay();
        return control;
    }
View Full Code Here


        ArchivaArtifact artifact = adao.getArtifact( "javax.sql", "jdbc", "2.0", null, "jar" );

        assertNotNull( artifact );

        // Test for artifact existance.
        List 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 ) );
View Full Code Here

        List 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 ) );
        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();
View Full Code Here

        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 processedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( true ) );
View Full Code Here

        artifactList = adao.queryArtifacts( null );
        assertNotNull( "Artifact list should not be null.", artifactList );
        assertEquals( "Artifact list size", 1, artifactList.size() );
       
        // Test for processed artifacts.
        List processedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( true ) );
        assertNotNull( "Processed Results should not be null.", processedResultList );
        assertEquals( "Incorrect number of processed artifacts detected.", 1, processedResultList.size() );
    }
   
    protected ManagedRepositoryConfiguration createRepository( String id, String name, File location )
View Full Code Here

        repoTask.setRepositoryId( "testRepo" );
       
        taskExecutor.executeTask( repoTask );

        ArtifactDAO adao = dao.getArtifactDAO();
        List unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) );
       
        assertNotNull( unprocessedResultList );
        assertEquals("Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() );
    }
   
View Full Code Here

       
        List<Artifact> results = new ArrayList<Artifact>();
        ArtifactDAO artifactDAO = archivaDAO.getArtifactDAO();
       
        ArtifactsByChecksumConstraint constraint = new ArtifactsByChecksumConstraint( checksum );
        List<ArchivaArtifact> artifacts = artifactDAO.queryArtifacts( constraint );
       
        for( ArchivaArtifact archivaArtifact : artifacts )
        {
            Artifact artifact = new Artifact( archivaArtifact.getModel().getRepositoryId(), archivaArtifact.getModel().getGroupId(),
                          archivaArtifact.getModel().getArtifactId(), archivaArtifact.getModel().getVersion(), archivaArtifact.getType() );
View Full Code Here

        MockControl control = MockControl.createNiceControl( ArtifactDAO.class );
        ArtifactDAO dao = (ArtifactDAO) control.getMock();
        archivaDao.setArtifactDao( dao );

        ArtifactsRelatedConstraint c = new ArtifactsRelatedConstraint( TEST_GROUP_ID, TEST_ARTIFACT_ID, version );
        dao.queryArtifacts( c );
        control.setReturnValue( artifacts, count );

        control.replay();
        return control;
    }
View Full Code Here

        assertTrue( newArtifactGroup.exists() );

        taskExecutor.executeTask( repoTask );

        unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) );
        assertNotNull( unprocessedResultList );
        assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
                      unprocessedResultList.size() );

        // check correctness of new stats
View Full Code Here

        // scan using the really long previous duration
        taskExecutor.executeTask( repoTask );

        // check no artifacts processed
        ArtifactDAO adao = dao.getArtifactDAO();
        List<ArchivaArtifact> unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) );
        assertNotNull( unprocessedResultList );
        assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
                      unprocessedResultList.size() );

        // check correctness of new stats
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.