Search in sources :

Example 1 with ProxyConnectorConfigurationOrderComparator

use of org.apache.archiva.configuration.model.functors.ProxyConnectorConfigurationOrderComparator in project archiva by apache.

the class ProxyConnectorConfigurationOrderComparatorTest method testSortNormal.

@Test
public void testSortNormal() {
    List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
    proxies.add(createConnector("corporate", 3));
    proxies.add(createConnector("snapshots", 1));
    proxies.add(createConnector("3rdparty", 2));
    proxies.add(createConnector("sandbox", 4));
    Collections.sort(proxies, new ProxyConnectorConfigurationOrderComparator());
    assertProxyOrder(new String[] { "snapshots", "3rdparty", "corporate", "sandbox" }, proxies);
}
Also used : ProxyConnectorConfigurationOrderComparator(org.apache.archiva.configuration.model.functors.ProxyConnectorConfigurationOrderComparator) ArrayList(java.util.ArrayList) ProxyConnectorConfiguration(org.apache.archiva.configuration.model.ProxyConnectorConfiguration) Test(org.junit.Test)

Example 2 with ProxyConnectorConfigurationOrderComparator

use of org.apache.archiva.configuration.model.functors.ProxyConnectorConfigurationOrderComparator in project archiva by apache.

the class ProxyConnectorConfigurationOrderComparatorTest method testSortPartial.

@Test
public void testSortPartial() {
    List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
    proxies.add(createConnector("corporate", 3));
    proxies.add(createConnector("snapshots", 0));
    proxies.add(createConnector("3rdparty", 2));
    proxies.add(createConnector("sandbox", 0));
    Collections.sort(proxies, new ProxyConnectorConfigurationOrderComparator());
    assertProxyOrder(new String[] { "3rdparty", "corporate", "snapshots", "sandbox" }, proxies);
}
Also used : ProxyConnectorConfigurationOrderComparator(org.apache.archiva.configuration.model.functors.ProxyConnectorConfigurationOrderComparator) ArrayList(java.util.ArrayList) ProxyConnectorConfiguration(org.apache.archiva.configuration.model.ProxyConnectorConfiguration) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)2 ProxyConnectorConfiguration (org.apache.archiva.configuration.model.ProxyConnectorConfiguration)2 ProxyConnectorConfigurationOrderComparator (org.apache.archiva.configuration.model.functors.ProxyConnectorConfigurationOrderComparator)2 Test (org.junit.Test)2