Package org.apache.archiva.rest.api.services

Examples of org.apache.archiva.rest.api.services.BrowseService


    public void metadatainbatchmode()
        throws Exception
    {
        scanRepo( TEST_REPO_ID );

        BrowseService browseService = getBrowseService( authorizationHeader, false );

        Map<String, String> inputMetadata = new HashMap<>( 3 );
        inputMetadata.put( "buildNumber", "1" );
        inputMetadata.put( "author", "alecharp" );
        inputMetadata.put( "jenkins_version", "1.486" );

        MetadataAddRequest metadataAddRequest = new MetadataAddRequest();
        metadataAddRequest.setGroupId( "commons-cli" );
        metadataAddRequest.setArtifactId( "commons-cli" );
        metadataAddRequest.setVersion( "1.0" );
        metadataAddRequest.setMetadatas( inputMetadata );
        browseService.importMetadata( metadataAddRequest, TEST_REPO_ID );

        Map<String, String> metadatas =
            toMap( browseService.getMetadatas( "commons-cli", "commons-cli", "1.0", TEST_REPO_ID ) );

        assertThat( metadatas ).isNotNull().isNotEmpty().contains( MapEntry.entry( "buildNumber", "1" ) ).contains(
            MapEntry.entry( "author", "alecharp" ) ).contains( MapEntry.entry( "jenkins_version", "1.486" ) );
    }
View Full Code Here


            assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
        }

        createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath() );

        BrowseService browseService = getBrowseService( authorizationHeader, false );

        Map<String, String> inputMetadata = new HashMap<>( 3 );
        inputMetadata.put( "buildNumber", "1" );
        inputMetadata.put( "author", "alecharp" );
        inputMetadata.put( "jenkins_version", "1.486" );

        MetadataAddRequest metadataAddRequest = new MetadataAddRequest();
        metadataAddRequest.setGroupId( "commons-cli" );
        metadataAddRequest.setArtifactId( "commons-cli" );
        metadataAddRequest.setVersion( "1.0" );
        metadataAddRequest.setMetadatas( inputMetadata );
        browseService.importMetadata( metadataAddRequest, testRepoId );

        Map<String, String> metadatas =
            toMap( browseService.getMetadatas( "commons-cli", "commons-cli", "1.0", testRepoId ) );

        assertThat( metadatas ).isNotNull().isNotEmpty().contains( MapEntry.entry( "buildNumber", "1" ) ).contains(
            MapEntry.entry( "author", "alecharp" ) ).contains( MapEntry.entry( "jenkins_version", "1.486" ) );

        deleteTestRepo( testRepoId );
View Full Code Here

            assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
        }

        createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath() );

        BrowseService browseService = getBrowseService( authorizationHeader, false );

        Map<String, String> metadatas =
            toMap( browseService.getMetadatas( "commons-cli", "commons-cli", "1.0", testRepoId ) );

        assertThat( metadatas ).isNotNull().isEmpty();

        browseService.addMetadata( "commons-cli", "commons-cli", "1.0", "wine", "bordeaux", testRepoId );

        metadatas = toMap( browseService.getMetadatas( "commons-cli", "commons-cli", "1.0", testRepoId ) );

        assertThat( metadatas ).isNotNull().isNotEmpty().contains( MapEntry.entry( "wine", "bordeaux" ) );

        deleteTestRepo( testRepoId );
View Full Code Here

            assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
        }

        createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath() );

        BrowseService browseService = getBrowseService( authorizationHeader, false );

        Map<String, String> metadatas =
            toMap( browseService.getMetadatas( "commons-cli", "commons-cli", "1.0", testRepoId ) );

        assertThat( metadatas ).isNotNull().isEmpty();

        browseService.addMetadata( "commons-cli", "commons-cli", "1.0", "wine", "bordeaux", testRepoId );

        metadatas = toMap( browseService.getMetadatas( "commons-cli", "commons-cli", "1.0", testRepoId ) );

        assertThat( metadatas ).isNotNull().isNotEmpty().contains( MapEntry.entry( "wine", "bordeaux" ) );

        browseService.deleteMetadata( "commons-cli", "commons-cli", "1.0", "wine", testRepoId );

        metadatas = toMap( browseService.getMetadatas( "commons-cli", "commons-cli", "1.0", testRepoId ) );

        assertThat( metadatas ).isNotNull().isEmpty();

        deleteTestRepo( testRepoId );
View Full Code Here

            assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
        }

        createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false );

        BrowseService browseService = getBrowseService( authorizationHeader, false );

        BrowseResult browseResult = browseService.getRootGroups( testRepoId );
        assertThat( browseResult ).isNotNull();
        assertThat( browseResult.getBrowseResultEntries() ).isNotNull().isNotEmpty().hasSize( 3 ).contains(
            new BrowseResultEntry( "commons-cli", false ), new BrowseResultEntry( "commons-logging", false ),
            new BrowseResultEntry( "org.apache", false ) );
View Full Code Here

            assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
        }

        createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false );

        BrowseService browseService = getBrowseService( authorizationHeader, false );

        BrowseResult browseResult = browseService.browseGroupId( "org.apache", testRepoId );
        assertThat( browseResult ).isNotNull();
        assertThat( browseResult.getBrowseResultEntries() ).isNotNull().isNotEmpty().hasSize( 2 ).contains(
            new BrowseResultEntry( "org.apache.felix", false ),
            new BrowseResultEntry( "org.apache.karaf.features", false ) );
View Full Code Here

            assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
        }

        createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false );

        BrowseService browseService = getBrowseService( authorizationHeader, false );
        BrowseResult browseResult = browseService.browseGroupId( "commons-logging.commons-logging", testRepoId );
        log.info( "browseResult: {}", browseResult );

        deleteTestRepo( testRepoId );

    }
View Full Code Here

            assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
        }

        createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false );

        BrowseService browseService = getBrowseService( authorizationHeader, false );

        VersionsList versions =
            browseService.getVersionsList( "org.apache.karaf.features", "org.apache.karaf.features.core", testRepoId );
        assertThat( versions ).isNotNull();
        assertThat( versions.getVersions() ).isNotNull().isNotEmpty().hasSize( 2 ).contains( "2.2.1", "2.2.2" );

        deleteTestRepo( testRepoId );
View Full Code Here

            assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
        }

        createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false );

        BrowseService browseService = getBrowseService( authorizationHeader, true );

        ProjectVersionMetadata metadata =
            browseService.getProjectVersionMetadata( "org.apache.karaf.features", "org.apache.karaf.features.core",
                                                     testRepoId );

        assertThat( metadata ).isNotNull();

        deleteTestRepo( testRepoId );
View Full Code Here

            assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
        }

        createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false );

        BrowseService browseService = getBrowseService( authorizationHeader, true );

        List<ArtifactContentEntry> artifactContentEntries =
            browseService.getArtifactContentEntries( "commons-logging", "commons-logging", "1.1", null, null, null,
                                                     testRepoId );

        log.info( "artifactContentEntries: {}", artifactContentEntries );

        assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 2 ).contains(
View Full Code Here

TOP

Related Classes of org.apache.archiva.rest.api.services.BrowseService

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.