archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationMRM789Test.java
/**
     * Ensures that the provided configuration matches the details present in the archiva-default.xml file.
     */
Ensures that the provided configuration matches the details present in the archiva-default.xml file.
Ensures that the provided configuration matches the details present in the archiva - default . xml file .
private void assertConfiguration( Configuration configuration, int managedExpected, int remoteExpected,
                                      int proxyConnectorExpected )
        throws Exception
    {
        assertEquals( "check managed repositories: " + configuration.getManagedRepositories(), managedExpected,
                      configuration.getManagedRepositories().size() );
        assertEquals( "check remote repositories: " + configuration.getRemoteRepositories(), remoteExpected,
                      configuration.getRemoteRepositories().size() );
        assertEquals( "check proxy connectors:" + configuration.getProxyConnectors(), proxyConnectorExpected,
                      configuration.getProxyConnectors().size() );
        RepositoryScanningConfiguration repoScanning = configuration.getRepositoryScanning();
        assertNotNull( "check repository scanning", repoScanning );
        assertEquals( "check file types", 4, repoScanning.getFileTypes().size() );
        assertEquals( "check known consumers", 9, repoScanning.getKnownContentConsumers().size() );
        assertEquals( "check invalid consumers", 1, repoScanning.getInvalidContentConsumers().size() );
        List<String> patterns = filetypes.getFileTypePatterns( "artifacts" );
        assertNotNull( "check 'artifacts' file type", patterns );
        assertEquals( "check 'artifacts' patterns", 13, patterns.size() );
        WebappConfiguration webapp = configuration.getWebapp();
        assertNotNull( "check webapp", webapp );
        UserInterfaceOptions ui = webapp.getUi();
        assertNotNull( "check webapp ui", ui );
        assertTrue( "check showFindArtifacts", ui.isShowFindArtifacts() );
        assertTrue( "check appletFindEnabled", ui.isAppletFindEnabled() );
    }
private void assertConfiguration ( Configuration configuration , int managedExpected , int remoteExpected , int proxyConnectorExpected ) throws Exception { assertEquals ( "check managed repositories: " + configuration . getManagedRepositories ( ) , managedExpected , configuration . getManagedRepositories ( ) . size ( ) ) ; assertEquals ( "check remote repositories: " + configuration . getRemoteRepositories ( ) , remoteExpected , configuration . getRemoteRepositories ( ) . size ( ) ) ; assertEquals ( "check proxy connectors:" + configuration . getProxyConnectors ( ) , proxyConnectorExpected , configuration . getProxyConnectors ( ) . size ( ) ) ; RepositoryScanningConfiguration repoScanning = configuration . getRepositoryScanning ( ) ; assertNotNull ( "check repository scanning" , repoScanning ) ; assertEquals ( "check file types" , 4 , repoScanning . getFileTypes ( ) . size ( ) ) ; assertEquals ( "check known consumers" , 9 , repoScanning . getKnownContentConsumers ( ) . size ( ) ) ; assertEquals ( "check invalid consumers" , 1 , repoScanning . getInvalidContentConsumers ( ) . size ( ) ) ; List < String > patterns = filetypes . getFileTypePatterns ( "artifacts" ) ; assertNotNull ( "check 'artifacts' file type" , patterns ) ; assertEquals ( "check 'artifacts' patterns" , 13 , patterns . size ( ) ) ; WebappConfiguration webapp = configuration . getWebapp ( ) ; assertNotNull ( "check webapp" , webapp ) ; UserInterfaceOptions ui = webapp . getUi ( ) ; assertNotNull ( "check webapp ui" , ui ) ; assertTrue ( "check showFindArtifacts" , ui . isShowFindArtifacts ( ) ) ; assertTrue ( "check appletFindEnabled" , ui . isAppletFindEnabled ( ) ) ; }
Ensures that the provided configuration matches the details present in the archiva-default.xml file.
Ensures that the provided configuration matches the details present in the archiva - default . xml file .