Search in sources :

Example 6 with EnvironmentClient

use of org.jboss.pnc.client.EnvironmentClient in project pnc by project-ncl.

the class EnvironmentEndpointTest method prepareData.

@BeforeClass
public static void prepareData() throws Exception {
    EnvironmentClient client = new EnvironmentClient(RestClientConfiguration.asAnonymous());
    environmentId = client.getAll().iterator().next().getId();
}
Also used : EnvironmentClient(org.jboss.pnc.client.EnvironmentClient) BeforeClass(org.junit.BeforeClass)

Example 7 with EnvironmentClient

use of org.jboss.pnc.client.EnvironmentClient in project pnc by project-ncl.

the class EnvironmentEndpointTest method testGetAllEnvironments.

@Test
@InSequence(10)
public void testGetAllEnvironments() throws RemoteResourceException {
    EnvironmentClient client = new EnvironmentClient(RestClientConfiguration.asAnonymous());
    RemoteCollection<Environment> all = client.getAll();
    // from DatabaseDataInitializer
    assertThat(all).hasSize(2);
}
Also used : EnvironmentClient(org.jboss.pnc.client.EnvironmentClient) Environment(org.jboss.pnc.dto.Environment) Test(org.junit.Test) ContainerTest(org.jboss.pnc.test.category.ContainerTest) InSequence(org.jboss.arquillian.junit.InSequence)

Example 8 with EnvironmentClient

use of org.jboss.pnc.client.EnvironmentClient in project pnc by project-ncl.

the class SecondLevelCacheStoreTest method prepareData.

/**
 * At first we need to create testing data and commit it.
 */
@Test
@InSequence(-2)
public void prepareData() throws Exception {
    EnvironmentClient client = new EnvironmentClient(RestClientConfiguration.asAnonymous());
    environmentId = client.getAll().iterator().next().getId();
    SCMRepositoryClient scmrc = new SCMRepositoryClient(RestClientConfiguration.asAnonymous());
    final Iterator<SCMRepository> scmrIt = scmrc.getAll(null, null).iterator();
    repositoryConfigurationBCId = scmrIt.next().getId();
    repositoryConfigurationDepBCId = scmrIt.next().getId();
    Project projectBC = createProjectAndValidateResults("https://github.com/project-ncl/dependency-analysis", null, "Dependency Analysis New", "Dependency Analysis - Analise project dependencies.");
    Project projectDepBC = createProjectAndValidateResults("https://github.com/project-ncl/pnc", null, "Project Newcastle Demo Project 1 New", "Example Project for Newcastle Demo");
    projectBCId = projectBC.getId();
    projectDepBCId = projectDepBC.getId();
    BuildConfiguration dependencyBC = createBuildConfigurationAndValidateResults(projectDepBCId, environmentId, repositoryConfigurationDepBCId, "pnc-1.0.0.DR1-new", UUID.randomUUID().toString());
    BuildConfiguration buildConfiguration = createBuildConfigurationAndValidateResults(projectBCId, environmentId, repositoryConfigurationBCId, "dependency-analysis-master-new", UUID.randomUUID().toString());
    dependencyBCId = dependencyBC.getId();
    buildConfigurationId = buildConfiguration.getId();
}
Also used : BuildConfiguration(org.jboss.pnc.dto.BuildConfiguration) SCMRepositoryClient(org.jboss.pnc.client.SCMRepositoryClient) Project(org.jboss.pnc.dto.Project) EnvironmentClient(org.jboss.pnc.client.EnvironmentClient) SCMRepository(org.jboss.pnc.dto.SCMRepository) ContainerTest(org.jboss.pnc.test.category.ContainerTest) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Aggregations

EnvironmentClient (org.jboss.pnc.client.EnvironmentClient)8 InSequence (org.jboss.arquillian.junit.InSequence)6 ContainerTest (org.jboss.pnc.test.category.ContainerTest)6 Test (org.junit.Test)6 Environment (org.jboss.pnc.dto.Environment)5 SCMRepositoryClient (org.jboss.pnc.client.SCMRepositoryClient)2 BuildConfiguration (org.jboss.pnc.dto.BuildConfiguration)2 SCMRepository (org.jboss.pnc.dto.SCMRepository)2 BeforeClass (org.junit.BeforeClass)2 BuildConfigurationClient (org.jboss.pnc.client.BuildConfigurationClient)1 ClientException (org.jboss.pnc.client.ClientException)1 ProductClient (org.jboss.pnc.client.ProductClient)1 ProjectClient (org.jboss.pnc.client.ProjectClient)1 RemoteResourceException (org.jboss.pnc.client.RemoteResourceException)1 Project (org.jboss.pnc.dto.Project)1