From fe46c1491d89ddf36d5da3f2731075977d40b65b Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 11 Jun 2013 11:38:30 +0000 Subject: remove commented code git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1491750 13f79535-47bb-0310-9956-ffa450edef68 --- .../repository/AbstractMetadataRepositoryTest.java | 27 ++++++---------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'archiva-modules/metadata/metadata-repository-api/src') diff --git a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java index a5ec38a80..3f10e0624 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java +++ b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java @@ -250,12 +250,10 @@ public abstract class AbstractMetadataRepositoryTest Assertions.assertThat( mailingLists ).isNotNull().isNotEmpty().hasSize( 1 ); - //assertEquals( 1, metadata.getMailingLists().size() ); mailingList = metadata.getMailingLists().get( 0 ); assertEquals( "Foo List", mailingList.getName() ); List others = mailingList.getOtherArchives(); - //assertEquals( Collections.emptyList(), mailingList.getOtherArchives() ); Assertions.assertThat( others ).isNotNull().isEmpty(); } @@ -451,7 +449,7 @@ public abstract class AbstractMetadataRepositoryTest repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); - //assertEquals( Collections.singleton( TEST_FACET_ID ), metadata.getFacetIds() ); + Assertions.assertThat( metadata.getFacetIds() ).isNotNull().isNotEmpty().hasSize( 1 ).contains( TEST_FACET_ID ); TestMetadataFacet testFacet = (TestMetadataFacet) metadata.getFacet( TEST_FACET_ID ); @@ -467,7 +465,7 @@ public abstract class AbstractMetadataRepositoryTest repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); - //assertEquals( Collections.singleton( TEST_FACET_ID ), metadata.getFacetIds() ); + Assertions.assertThat( metadata.getFacetIds() ).isNotNull().isNotEmpty().hasSize( 1 ).contains( TEST_FACET_ID ); testFacet = (TestMetadataFacet) metadata.getFacet( TEST_FACET_ID ); assertFalse( testFacet.toProperties().containsKey( "deleteKey" ) ); @@ -520,10 +518,10 @@ public abstract class AbstractMetadataRepositoryTest Collection artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); - //assertEquals( 1, artifacts.size() ); + Assertions.assertThat( artifacts ).isNotNull().isNotEmpty().hasSize( 1 ); metadata = artifacts.iterator().next(); - //assertEquals( Collections.singleton( TEST_FACET_ID ), metadata.getFacetIds() ); + Collection ids = metadata.getFacetIds(); Assertions.assertThat( ids ).isNotNull().isNotEmpty().hasSize( 1 ).contains( TEST_FACET_ID ); @@ -540,15 +538,15 @@ public abstract class AbstractMetadataRepositoryTest repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); - //assertEquals( 1, artifacts.size() ); + Assertions.assertThat( artifacts ).isNotNull().isNotEmpty().hasSize( 1 ); metadata = artifacts.iterator().next(); - //assertEquals( Collections.singleton( TEST_FACET_ID ), metadata.getFacetIds() ); + ids = metadata.getFacetIds(); Assertions.assertThat( ids ).isNotNull().isNotEmpty().hasSize( 1 ).contains( TEST_FACET_ID ); testFacet = (TestMetadataFacet) metadata.getFacet( TEST_FACET_ID ); - //assertFalse( testFacet.toProperties().containsKey( "deleteKey" ) ); + Map props = testFacet.toProperties(); Assertions.assertThat( props ).isNotNull().doesNotContainKey( "deleteKey" ); } @@ -842,7 +840,6 @@ public abstract class AbstractMetadataRepositoryTest Assertions.assertThat( versions ).isNotNull().isNotEmpty().hasSize( 1 ).containsExactly( TEST_PROJECT_VERSION ); - //assertEquals( Collections.singleton( TEST_PROJECT_VERSION ), versions ); } @Test @@ -945,8 +942,6 @@ public abstract class AbstractMetadataRepositoryTest List artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper ); - //assertTrue( .isEmpty() ); - Assertions.assertThat( artifacts ).isNotNull().isEmpty(); } @@ -1030,18 +1025,14 @@ public abstract class AbstractMetadataRepositoryTest Collection namespaces = repository.getRootNamespaces( TEST_REPO_ID ); - //assertEquals( Arrays.asList( "org" ), repository.getRootNamespaces( TEST_REPO_ID ) ); Assertions.assertThat( namespaces ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "org" ); - //assertEquals( Arrays.asList( "apache" ), repository.getNamespaces( TEST_REPO_ID, "org" ) ); namespaces = repository.getNamespaces( TEST_REPO_ID, "org" ); Assertions.assertThat( namespaces ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "apache" ); - //assertEquals( Arrays.asList( "maven" ), repository.getNamespaces( TEST_REPO_ID, "org.apache" ) ); namespaces = repository.getNamespaces( TEST_REPO_ID, "org.apache" ); Assertions.assertThat( namespaces ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "maven" ); - //assertEquals( Arrays.asList( "shared" ), repository.getNamespaces( TEST_REPO_ID, "org.apache.maven" ) ); namespaces = repository.getNamespaces( TEST_REPO_ID, "org.apache.maven" ); Assertions.assertThat( namespaces ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "shared" ); } @@ -1061,7 +1052,6 @@ public abstract class AbstractMetadataRepositoryTest Assertions.assertThat( namespaces ).isNotNull().isEmpty(); - //assertEquals( Collections.emptyList(), ); } @Test @@ -1344,9 +1334,6 @@ public abstract class AbstractMetadataRepositoryTest log.info( "artifactMetadatas: {}", artifactMetadatas ); - //assertEquals( Collections.singletonList( artifact ), new ArrayList( - // repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT" ) ) ); - repository.removeArtifact( artifactOne, "2.0-SNAPSHOT" ); artifactMetadatas = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT" ); -- cgit v1.2.3