Package org.apache.maven.archiva.database

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


        // Set some mandatory values
        artifact.getModel().setLastModified( new Date() );
        artifact.getModel().setOrigin( "test" );

        // Save it.
        ArchivaArtifact savedArtifact = artiDao.saveArtifact( artifact );
        assertNotNull( savedArtifact );
        String savedKeyId = JDOHelper.getObjectId( savedArtifact.getModel() ).toString();
        assertEquals( "org.apache.maven.archiva:archiva-test-module:1.0::jar", savedKeyId );

        // Test that something has been saved.
View Full Code Here


        assertEquals( "", firstArtifact.getClassifier() );
        assertEquals( "jar", firstArtifact.getType() );

        // Change value and save.
        savedArtifact.getModel().setOrigin( "changed" );
        artiDao.saveArtifact( savedArtifact );

        // Test that only 1 object is saved.
        assertEquals( 1, artiDao.queryArtifacts( null ).size() );

        // Get the specific artifact.
View Full Code Here

        sqlArtifact.getModel().setLastModified( new Date() );
        sqlArtifact.getModel().setSize( 1234 );
        sqlArtifact.getModel().setOrigin( "testcase" );
        sqlArtifact.getModel().setWhenProcessed( null );

        adao.saveArtifact( sqlArtifact );

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

        assertNotNull( artifact );
View Full Code Here

        sqlArtifact.getModel().setLastModified( new Date() );
        sqlArtifact.getModel().setSize( 1234 );
        sqlArtifact.getModel().setOrigin( "testcase" );
        sqlArtifact.getModel().setWhenProcessed( null );

        adao.saveArtifact( sqlArtifact );

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

        assertNotNull( artifact );
View Full Code Here

        sqlArtifact.getModel().setLastModified( new Date() );
        sqlArtifact.getModel().setSize( 1234 );
        sqlArtifact.getModel().setOrigin( "testcase" );
        sqlArtifact.getModel().setWhenProcessed( null );

        adao.saveArtifact( sqlArtifact );

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

        assertNotNull( artifact );
View Full Code Here

        super.setUp();

        ArtifactDAO adao = dao.getArtifactDAO();
        assertNotNull( "Artifact DAO should not be null.", adao );

        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-common", "1.0-SNAPSHOT", null ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-utils", "1.0-SNAPSHOT",
                                           "2006/08/22 19:01:00" ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-old", "0.1", "2004/02/15 9:01:00" ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-database", "1.0-SNAPSHOT", null ) );
    }
View Full Code Here

        ArtifactDAO adao = dao.getArtifactDAO();
        assertNotNull( "Artifact DAO should not be null.", adao );

        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-common", "1.0-SNAPSHOT", null ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-utils", "1.0-SNAPSHOT",
                                           "2006/08/22 19:01:00" ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-old", "0.1", "2004/02/15 9:01:00" ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-database", "1.0-SNAPSHOT", null ) );
    }
View Full Code Here

        assertNotNull( "Artifact DAO should not be null.", adao );

        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-common", "1.0-SNAPSHOT", null ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-utils", "1.0-SNAPSHOT",
                                           "2006/08/22 19:01:00" ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-old", "0.1", "2004/02/15 9:01:00" ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-database", "1.0-SNAPSHOT", null ) );
    }

    public void testNotProcessed()
        throws Exception
View Full Code Here

        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-common", "1.0-SNAPSHOT", null ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-utils", "1.0-SNAPSHOT",
                                           "2006/08/22 19:01:00" ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-old", "0.1", "2004/02/15 9:01:00" ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-database", "1.0-SNAPSHOT", null ) );
    }

    public void testNotProcessed()
        throws Exception
    {
View Full Code Here

        super.setUp();

        ArtifactDAO adao = dao.getArtifactDAO();
        assertNotNull( "Artifact DAO should not be null.", adao );

        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-common", "1.0-SNAPSHOT", null ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-utils", "1.0-SNAPSHOT", null ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-old", "0.1", "2004/02/15 9:01:00" ) );
        adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-database", "1.0-SNAPSHOT", null ) );

        dbupdater = (DatabaseUpdater) lookup( DatabaseUpdater.class, "jdo" );
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.