Search in sources :

Example 1 with IndyHostedByArchiveClientModule

use of org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule in project indy by Commonjava.

the class HostedByArcConflictTest method testUploadZipAndCreate.

@Test
public void testUploadZipAndCreate() throws Exception {
    final String hostedRepoName = "test";
    HostedRepository hosted = client.stores().create(new HostedRepository(MavenPackageTypeDescriptor.MAVEN_PKG_KEY, hostedRepoName), "create first", HostedRepository.class);
    waitForEventPropagation();
    assertThat(client.stores().exists(hosted.getKey()), equalTo(true));
    IndyHostedByArchiveClientModule module = client.module(IndyHostedByArchiveClientModule.class);
    try {
        module.createRepo(getZipFile(), hostedRepoName);
    } catch (IndyClientException e) {
        logger.info(e.getMessage());
        assertThat(e.getStatusCode(), equalTo(ApplicationStatus.CONFLICT.code()));
    }
}
Also used : IndyHostedByArchiveClientModule(org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule) IndyClientException(org.commonjava.indy.client.core.IndyClientException) HostedRepository(org.commonjava.indy.model.core.HostedRepository) Test(org.junit.Test)

Example 2 with IndyHostedByArchiveClientModule

use of org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule in project indy by Commonjava.

the class HostedByArcWithIgnoreRootUploadTest method testUploadZipAndCreate.

@Test
public void testUploadZipAndCreate() throws Exception {
    IndyHostedByArchiveClientModule module = client.module(IndyHostedByArchiveClientModule.class);
    final String hostedRepoName = "hosted-zip-ignore";
    HostedRepository repo = module.createRepo(getZipFile(), hostedRepoName, "maven-repository");
    assertThat(repo, notNullValue());
    assertThat(repo.getName(), equalTo(hostedRepoName));
    boolean exists = client.content().exists(repo.getKey(), "org/foo/bar/1.0/foo-bar-1.0.pom");
    assertTrue(exists);
}
Also used : IndyHostedByArchiveClientModule(org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule) HostedRepository(org.commonjava.indy.model.core.HostedRepository) Test(org.junit.Test)

Example 3 with IndyHostedByArchiveClientModule

use of org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule in project indy by Commonjava.

the class HostedByArcDisableTest method testUploadZipAndCreate.

@Test
public void testUploadZipAndCreate() throws Exception {
    IndyHostedByArchiveClientModule module = client.module(IndyHostedByArchiveClientModule.class);
    final String hostedRepoName = "hosted-zip-ignore";
    try {
        module.createRepo(getZipFile(), hostedRepoName, "maven-repository");
    } catch (IndyClientException e) {
        logger.info(e.getMessage());
        assertThat(e.getStatusCode(), equalTo(ApplicationStatus.METHOD_NOT_ALLOWED.code()));
    }
}
Also used : IndyHostedByArchiveClientModule(org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule) IndyClientException(org.commonjava.indy.client.core.IndyClientException) Test(org.junit.Test)

Example 4 with IndyHostedByArchiveClientModule

use of org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule in project indy by Commonjava.

the class HostedByArcWithoutIgnoreRootUploadTest method testUploadZipAndCreate.

@Test
public void testUploadZipAndCreate() throws Exception {
    IndyHostedByArchiveClientModule module = client.module(IndyHostedByArchiveClientModule.class);
    final String hostedRepoName = "hosted-zip-no-ignore";
    HostedRepository repo = module.createRepo(getZipFile(), hostedRepoName);
    assertThat(repo, notNullValue());
    assertThat(repo.getName(), equalTo(hostedRepoName));
    boolean exists = client.content().exists(repo.getKey(), "org/foo/bar/1.0/foo-bar-1.0.pom");
    assertTrue(exists);
}
Also used : IndyHostedByArchiveClientModule(org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule) HostedRepository(org.commonjava.indy.model.core.HostedRepository) Test(org.junit.Test)

Aggregations

IndyHostedByArchiveClientModule (org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule)4 Test (org.junit.Test)4 HostedRepository (org.commonjava.indy.model.core.HostedRepository)3 IndyClientException (org.commonjava.indy.client.core.IndyClientException)2