use of com.teamscale.client.TeamscaleServer in project teamscale-jacoco-agent by cqse.
the class AgentHttpServerTest method testOverridingPartition.
/**
* Test overwriting the partition
*/
@Test
public void testOverridingPartition() throws Exception {
String newPartition = "New Partition";
putText("/partition", newPartition);
TeamscaleServer teamscaleServer = agent.options.getTeamscaleServerOptions();
assertThat(teamscaleServer.partition).isEqualTo(newPartition);
}
use of com.teamscale.client.TeamscaleServer in project teamscale-jacoco-agent by cqse.
the class AgentHttpServerTest method testOverridingMessage.
/**
* Test overwriting the commit message
*/
@Test
public void testOverridingMessage() throws Exception {
String newMessage = "New Message";
putText("/message", newMessage);
TeamscaleServer teamscaleServer = agent.options.getTeamscaleServerOptions();
assertThat(teamscaleServer.getMessage()).isEqualTo(newMessage);
}
use of com.teamscale.client.TeamscaleServer in project teamscale-jacoco-agent by cqse.
the class AgentOptionsTest method testTeamscaleUploadOptions.
/**
* Tests the options for uploading coverage to teamscale.
*/
@Test
public void testTeamscaleUploadOptions() throws AgentOptionParseException {
AgentOptions agentOptions = getAgentOptionsParserWithDummyLogger().parse("" + "teamscale-server-url=127.0.0.1," + "teamscale-project=test," + "teamscale-user=build," + "teamscale-access-token=token," + "teamscale-partition=\"Unit Tests\"," + "teamscale-commit=default:HEAD," + "teamscale-message=\"This is my message\"");
TeamscaleServer teamscaleServer = agentOptions.getTeamscaleServerOptions();
assertThat(teamscaleServer.url.toString()).isEqualTo("http://127.0.0.1/");
assertThat(teamscaleServer.project).isEqualTo("test");
assertThat(teamscaleServer.userName).isEqualTo("build");
assertThat(teamscaleServer.userAccessToken).isEqualTo("token");
assertThat(teamscaleServer.partition).isEqualTo("Unit Tests");
assertThat(teamscaleServer.commit.toString()).isEqualTo("default:HEAD");
assertThat(teamscaleServer.getMessage()).isEqualTo("This is my message");
}
use of com.teamscale.client.TeamscaleServer in project teamscale-jacoco-agent by cqse.
the class CoverageToTeamscaleStrategyTest method mockOptions.
private AgentOptions mockOptions() throws IOException {
AgentOptions options = mock(AgentOptions.class);
when(options.createTeamscaleClient()).thenReturn(client);
when(options.createTempFile(any(), any())).thenReturn(new File(tempDir, "test"));
TeamscaleServer server = new TeamscaleServer();
server.commit = new CommitDescriptor("branch", "12345");
server.url = HttpUrl.get("http://doesnt-exist.io");
server.userName = "build";
server.userAccessToken = "token";
server.partition = "partition";
when(options.getTeamscaleServerOptions()).thenReturn(server);
when(options.createTeamscaleClient()).thenReturn(client);
return options;
}
use of com.teamscale.client.TeamscaleServer in project teamscale-jacoco-agent by cqse.
the class TestwiseCoverageAgentTest method mockOptions.
private AgentOptions mockOptions(int port) {
AgentOptions options = mock(AgentOptions.class);
when(options.createTeamscaleClient()).thenReturn(client);
TeamscaleServer server = new TeamscaleServer();
server.commit = new CommitDescriptor("branch", "12345");
server.url = HttpUrl.get("http://doesnt-exist.io");
server.userName = "build";
server.userAccessToken = "token";
server.partition = "partition";
when(options.getTeamscaleServerOptions()).thenReturn(server);
when(options.getHttpServerPort()).thenReturn(port);
when(options.getTestwiseCoverageMode()).thenReturn(ETestwiseCoverageMode.TEAMSCALE_UPLOAD);
when(options.createTeamscaleClient()).thenReturn(client);
return options;
}
Aggregations