From: Olivier Lamy Date: Fri, 1 Jun 2012 23:46:25 +0000 (+0000) Subject: improve test X-Git-Tag: archiva-1.4-M3~652 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9375a7c4db6220adf7044d09fd6e9277b6112440;p=archiva.git improve test git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1345393 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java index 13a68befa..111653350 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java @@ -22,12 +22,15 @@ package org.apache.archiva.rest.services; import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.common.utils.FileUtil; import org.apache.archiva.rest.api.model.Artifact; +import org.apache.archiva.rest.api.services.BrowseService; import org.apache.archiva.rest.api.services.ManagedRepositoriesService; import org.apache.archiva.rest.api.services.RepositoriesService; import org.apache.cxf.jaxrs.client.ServerWebApplicationException; +import org.fest.assertions.Assertions; import org.junit.Test; import java.io.File; +import java.util.List; /** * @author Olivier Lamy @@ -127,6 +130,16 @@ public class RepositoriesServiceTest throws Exception { initSourceTargetRepo(); + + BrowseService browseService = getBrowseService( authorizationHeader, false ); + + List artifacts = + browseService.getArtifactDownloadInfos( "commons-logging", "commons-logging", "1.0.1", SOURCE_REPO_ID ); + + Assertions.assertThat( artifacts ).isNotNull().isNotEmpty().hasSize( 3 ); + + log.info( "artifacts.size: {}", artifacts.size() ); + try { File artifactFile = @@ -147,6 +160,11 @@ public class RepositoriesServiceTest assertFalse( "artifact not deleted exists:" + artifactFile.getPath(), artifactFile.exists() ); + artifacts = + browseService.getArtifactDownloadInfos( "commons-logging", "commons-logging", "1.0.1", SOURCE_REPO_ID ); + + Assertions.assertThat( artifacts ).isNotNull().isEmpty(); + } finally {