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

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


            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, "org/",
                                                     testRepoId );

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

        assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 1 ).contains(
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,
                                                     "org/apache/commons/logging/", testRepoId );

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

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

            }

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

            BrowseService browseService = getBrowseService( authorizationHeader, true );

            List<Artifact> artifactDownloadInfos =
                browseService.getArtifactDownloadInfos( "commons-logging", "commons-logging", "1.1", testRepoId );

            log.info( "artifactDownloadInfos {}", artifactDownloadInfos );
            assertThat( artifactDownloadInfos ).isNotNull().isNotEmpty().hasSize( 3 );
            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 );

        WebClient.client( browseService ).accept( MediaType.TEXT_PLAIN );

        try
        {
            String text =
                browseService.getArtifactContentText( "commons-logging", "commons-logging", "1.1", "sources", null,
                                                      "org/apache/commons/logging/LogSource.java",
                                                      testRepoId ).getContent();

            log.debug( "text: {}", text );
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 );

        WebClient.client( browseService ).accept( MediaType.TEXT_PLAIN );

        try
        {
            String text =
                browseService.getArtifactContentText( "commons-logging", "commons-logging", "1.1", null, "pom", null,
                                                      testRepoId ).getContent();

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

            assertThat( text ).contains(
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 );

        //WebClient.client( browseService ).accept( MediaType.TEXT_PLAIN );

        try
        {
            int number = browseService.getArtifacts( testRepoId ).size();

            log.info( "getArtifactsNumber: {}", number );

            assertTrue( number > 1 );
        }
View Full Code Here

        return service;
    }

    protected BrowseService getBrowseService( String authzHeader, boolean useXml )
    {
        BrowseService service =
            JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
                                       BrowseService.class,
                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
        // to add authentification
        if ( authzHeader != null )
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

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.