Package org.apache.maven.archiva.database.constraints

Examples of org.apache.maven.archiva.database.constraints.ArtifactsRelatedConstraint


    private ArchivaArtifact getArtifact( final String principal, final List<String> observableRepositoryIds,
                                         final String groupId, final String artifactId, final String version )
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        ArchivaArtifact pomArtifact = null;
        Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version );

        try
        {
            List<ArchivaArtifact> artifacts = dao.getArtifactDAO().queryArtifacts( constraint );
View Full Code Here


                if ( VersionUtil.getBaseVersion( uniqueVersion ).equals( version ) )
                {
                    try
                    {
                        log.debug( "Retrieving artifact with version " + uniqueVersion );
                        Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, uniqueVersion );
                        List<ArchivaArtifact> artifacts = dao.getArtifactDAO().queryArtifacts( constraint );

                        for ( ArchivaArtifact artifact : artifacts )
                        {
                            if ( artifact.getRepositoryId().equals( repositoryId ) )
View Full Code Here

        String type = "jar";

        try
        {
            List<ArchivaArtifact> artifacts =
                dao.getArtifactDAO().queryArtifacts( new ArtifactsRelatedConstraint( groupId, artifactId, version ) );

            if ( artifacts.size() > 0 )
            {
                type = artifacts.get( 0 ).getType();
            }
View Full Code Here

    }

    private void assertArtifactWasSaved(String groupId, String artifactId, String version)
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version );
        List<ArchivaArtifact> artifacts = artifactDao.queryArtifacts( constraint );
       
        assertFalse( "Artifact '" + groupId + ":" + artifactId + ":" + version + "' should have been found.",
                     artifacts.isEmpty() );
    }
View Full Code Here

        // underneath it - those sections will be adjusted with a mock content repository later
        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

    {
        StringBuffer sb = new StringBuffer();

        try
        {
            Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version );
            List<ArchivaArtifact> relatedArtifacts = dao.getArtifactDAO().queryArtifacts( constraint );

            if ( relatedArtifacts != null && relatedArtifacts.size() > 0 )
            {
                String prefix = req.getContextPath() + "/repository/";
View Full Code Here

    {
        StringBuffer sb = new StringBuffer();

        try
        {
            Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version );
            List<ArchivaArtifact> relatedArtifacts = dao.getArtifactDAO().queryArtifacts( constraint );

            if ( relatedArtifacts != null )
            {
                String repoId = ( (ArchivaArtifact) relatedArtifacts.get( 0 ) ).getModel().getRepositoryId();
View Full Code Here

    {
        StringBuffer sb = new StringBuffer();

        try
        {
            Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version );
            List<ArchivaArtifact> relatedArtifacts = dao.getArtifactDAO().queryArtifacts( constraint );

            if ( relatedArtifacts != null && relatedArtifacts.size() > 0 )
            {
                String prefix = req.getContextPath() + "/repository/";
View Full Code Here

        // underneath it - those sections will be adjusted with a mock content repository later
        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

    }

    private void assertArtifactWasSaved(String groupId, String artifactId, String version)
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version );
        List<ArchivaArtifact> artifacts = artifactDao.queryArtifacts( constraint );
       
        assertFalse( "Artifact '" + groupId + ":" + artifactId + ":" + version + "' should have been found.",
                     artifacts.isEmpty() );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.database.constraints.ArtifactsRelatedConstraint

Copyright © 2018 www.massapicom. 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.