Search in sources :

Example 1 with RepositoryConnectionInfo

use of org.jboss.pnc.spi.repositorymanager.model.RepositoryConnectionInfo in project pnc by project-ncl.

the class BuildGroupIndySidecarActivatedTest method verifyGroupComposition_ProductVersion_WithConfSet.

@Test
public void verifyGroupComposition_ProductVersion_WithConfSet() throws Exception {
    // create a dummy composed (chained) build execution and a repo session based on it
    BuildExecution execution = new TestBuildExecution("build_myproject_1111");
    Indy indy = driver.getIndy(accessToken);
    RepositorySession repositoryConfiguration = driver.createBuildRepository(execution, accessToken, accessToken, RepositoryType.MAVEN, Collections.emptyMap(), false);
    RepositoryConnectionInfo info = repositoryConfiguration.getConnectionInfo();
    assertThat(info.getDependencyUrl()).startsWith(sideCarUrl);
    assertThat(info.getDeployUrl()).startsWith(sideCarUrl);
}
Also used : TestBuildExecution(org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution) Indy(org.commonjava.indy.client.core.Indy) TestBuildExecution(org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution) BuildExecution(org.jboss.pnc.spi.repositorymanager.BuildExecution) RepositoryConnectionInfo(org.jboss.pnc.spi.repositorymanager.model.RepositoryConnectionInfo) RepositorySession(org.jboss.pnc.spi.repositorymanager.model.RepositorySession) ContainerTest(org.jboss.pnc.test.category.ContainerTest) Test(org.junit.Test)

Example 2 with RepositoryConnectionInfo

use of org.jboss.pnc.spi.repositorymanager.model.RepositoryConnectionInfo in project pnc by project-ncl.

the class BuildGroupIndySidecarDeActivatedTest method verifyGroupComposition_ProductVersion_WithConfSet.

@Test
public void verifyGroupComposition_ProductVersion_WithConfSet() throws Exception {
    // create a dummy composed (chained) build execution and a repo session based on it
    BuildExecution execution = new TestBuildExecution("build_myproject_1111");
    Indy indy = driver.getIndy(accessToken);
    RepositorySession repositoryConfiguration = driver.createBuildRepository(execution, accessToken, accessToken, RepositoryType.MAVEN, Collections.emptyMap(), false);
    RepositoryConnectionInfo info = repositoryConfiguration.getConnectionInfo();
    assertThat(info.getDependencyUrl()).doesNotStartWith(sideCarUrl);
    assertThat(info.getDeployUrl()).doesNotStartWith(sideCarUrl);
}
Also used : TestBuildExecution(org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution) Indy(org.commonjava.indy.client.core.Indy) TestBuildExecution(org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution) BuildExecution(org.jboss.pnc.spi.repositorymanager.BuildExecution) RepositoryConnectionInfo(org.jboss.pnc.spi.repositorymanager.model.RepositoryConnectionInfo) RepositorySession(org.jboss.pnc.spi.repositorymanager.model.RepositorySession) ContainerTest(org.jboss.pnc.test.category.ContainerTest) Test(org.junit.Test)

Example 3 with RepositoryConnectionInfo

use of org.jboss.pnc.spi.repositorymanager.model.RepositoryConnectionInfo in project pnc by project-ncl.

the class DependencyUrlIncludesTrackingIdAndGeneratedBuildGroupNameTest method formatRepositoryURLForSimpleInfo_CheckDependencyURL.

@Test
public void formatRepositoryURLForSimpleInfo_CheckDependencyURL() throws Exception {
    // create a dummy non-chained build execution and repo session based on it
    BuildExecution execution = new TestBuildExecution();
    RepositorySession repositoryConfiguration = driver.createBuildRepository(execution, accessToken, accessToken, RepositoryType.MAVEN, Collections.emptyMap(), false);
    assertThat(repositoryConfiguration, notNullValue());
    // verify the URLs in the connection info reference this build, and refer to a tracked repository group URL
    RepositoryConnectionInfo connectionInfo = repositoryConfiguration.getConnectionInfo();
    assertThat(connectionInfo, notNullValue());
    String expectedUrlPrefix = String.format("%sfolo/track/%s", url, execution.getBuildContentId());
    String expectedGroupPathPrefix = String.format("/group/%s", execution.getBuildContentId());
    assertThat("Expected URL prefix: " + expectedUrlPrefix + "\nActual URL was: " + connectionInfo.getDependencyUrl(), connectionInfo.getDependencyUrl().startsWith(expectedUrlPrefix), equalTo(true));
    assertThat("Expected URL to contain group path prefix: " + expectedGroupPathPrefix + "\nActual URL was: " + connectionInfo.getDependencyUrl(), connectionInfo.getDependencyUrl().contains(expectedGroupPathPrefix), equalTo(true));
}
Also used : TestBuildExecution(org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution) TestBuildExecution(org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution) BuildExecution(org.jboss.pnc.spi.repositorymanager.BuildExecution) RepositoryConnectionInfo(org.jboss.pnc.spi.repositorymanager.model.RepositoryConnectionInfo) RepositorySession(org.jboss.pnc.spi.repositorymanager.model.RepositorySession) ContainerTest(org.jboss.pnc.test.category.ContainerTest) Test(org.junit.Test)

Example 4 with RepositoryConnectionInfo

use of org.jboss.pnc.spi.repositorymanager.model.RepositoryConnectionInfo in project pnc by project-ncl.

the class AllSessionUrlsForBuildAreAlikeTest method formatRepositoryURLForSimpleInfo_AllURLsMatch.

@Test
public void formatRepositoryURLForSimpleInfo_AllURLsMatch() throws Exception {
    // create a dummy non-chained build execution and a repo session based on it
    BuildExecution execution = new TestBuildExecution();
    RepositorySession repositoryConfiguration = driver.createBuildRepository(execution, accessToken, accessToken, RepositoryType.MAVEN, Collections.emptyMap(), false);
    assertThat(repositoryConfiguration, notNullValue());
    RepositoryConnectionInfo connectionInfo = repositoryConfiguration.getConnectionInfo();
    assertThat(connectionInfo, notNullValue());
    // check that all URLs in the connection info are the same (this might be different in another repo driver)
    String expectedUrl = connectionInfo.getDependencyUrl();
    assertThat(connectionInfo.getToolchainUrl(), equalTo(expectedUrl));
// assertThat(connectionInfo.getDeployPath(), equalTo(expectedUrl));
}
Also used : TestBuildExecution(org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution) TestBuildExecution(org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution) BuildExecution(org.jboss.pnc.spi.repositorymanager.BuildExecution) RepositoryConnectionInfo(org.jboss.pnc.spi.repositorymanager.model.RepositoryConnectionInfo) RepositorySession(org.jboss.pnc.spi.repositorymanager.model.RepositorySession) ContainerTest(org.jboss.pnc.test.category.ContainerTest) Test(org.junit.Test)

Aggregations

TestBuildExecution (org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution)4 BuildExecution (org.jboss.pnc.spi.repositorymanager.BuildExecution)4 RepositoryConnectionInfo (org.jboss.pnc.spi.repositorymanager.model.RepositoryConnectionInfo)4 RepositorySession (org.jboss.pnc.spi.repositorymanager.model.RepositorySession)4 ContainerTest (org.jboss.pnc.test.category.ContainerTest)4 Test (org.junit.Test)4 Indy (org.commonjava.indy.client.core.Indy)2