use of io.mantisrx.common.Label in project mantis by Netflix.
the class JobClusterManagerTest method testJobClusterArtifactUpdate.
@Test
public void testJobClusterArtifactUpdate() throws MalformedURLException {
TestKit probe = new TestKit(system);
String clusterName = "testJobClusterArtifactUpdate";
List<Label> labels = Lists.newLinkedList();
final JobClusterDefinitionImpl fakeJobCluster = createFakeJobClusterDefn(clusterName, labels);
jobClusterManagerActor.tell(new JobClusterManagerProto.CreateJobClusterRequest(fakeJobCluster, "user"), probe.getRef());
JobClusterManagerProto.CreateJobClusterResponse createResp = probe.expectMsgClass(JobClusterManagerProto.CreateJobClusterResponse.class);
assertEquals(SUCCESS_CREATED, createResp.responseCode);
UpdateJobClusterArtifactRequest req = new JobClusterManagerProto.UpdateJobClusterArtifactRequest(clusterName, "myjar", "1.0.1", true, "user");
jobClusterManagerActor.tell(req, probe.getRef());
JobClusterManagerProto.UpdateJobClusterArtifactResponse updateResp = probe.expectMsgClass(JobClusterManagerProto.UpdateJobClusterArtifactResponse.class);
assertEquals(SUCCESS, updateResp.responseCode);
jobClusterManagerActor.tell(new GetJobClusterRequest(clusterName), probe.getRef());
GetJobClusterResponse getResp = probe.expectMsgClass(GetJobClusterResponse.class);
assertEquals(SUCCESS, getResp.responseCode);
// assertEquals("myjar", getResp.getJobCluster().get().g.getArtifactName());
assertEquals("1.0.1", getResp.getJobCluster().get().getLatestVersion());
}
use of io.mantisrx.common.Label in project mantis by Netflix.
the class DataFormatAdapterTest method completedJobToNamedJobCompletedJobTest.
@Test
public void completedJobToNamedJobCompletedJobTest() {
String name = "name";
String jobId = "name-1";
String version = "0.0.1";
JobState jobState = JobState.Completed;
long submittedAt = 1234l;
long terminatedAt = 2234l;
String me = "me";
List<Label> labels = new ArrayList<>();
labels.add(new Label("l1", "v1"));
JobClusterDefinitionImpl.CompletedJob cJob = new JobClusterDefinitionImpl.CompletedJob(name, jobId, version, jobState, submittedAt, terminatedAt, me, labels);
NamedJob.CompletedJob njobCJob = DataFormatAdapter.convertCompletedJobToNamedJobCompletedJob(cJob);
assertEquals(name, njobCJob.getName());
assertEquals(jobId, njobCJob.getJobId());
assertEquals(version, njobCJob.getVersion());
assertEquals(MantisJobState.Completed, njobCJob.getState());
assertEquals(submittedAt, njobCJob.getSubmittedAt());
assertEquals(terminatedAt, njobCJob.getTerminatedAt());
JobClusterDefinitionImpl.CompletedJob reconverted = DataFormatAdapter.convertNamedJobCompletedJobToCompletedJob(njobCJob);
assertEquals(cJob, reconverted);
}
Aggregations