Search in sources :

Example 1 with AgentKeyImpl

use of org.eclipse.che.api.agent.shared.model.impl.AgentKeyImpl in project che by eclipse.

the class AgentKeyImplTest method testAgentKeyWithNameAndVersion.

@Test
public void testAgentKeyWithNameAndVersion() {
    AgentKeyImpl agentKey = AgentKeyImpl.parse("id:1");
    assertEquals(agentKey.getId(), "id");
    assertEquals(agentKey.getVersion(), "1");
}
Also used : AgentKeyImpl(org.eclipse.che.api.agent.shared.model.impl.AgentKeyImpl) Test(org.testng.annotations.Test)

Example 2 with AgentKeyImpl

use of org.eclipse.che.api.agent.shared.model.impl.AgentKeyImpl in project che by eclipse.

the class AgentRegistryImplTest method shouldReturnAgentByIdAndVersion.

@Test(dataProvider = "AgentKeys")
public void shouldReturnAgentByIdAndVersion(String id, String version) throws Exception {
    Agent agent = registry.getAgent(new AgentKeyImpl(id, version));
    assertNotNull(agent);
    assertEquals(agent.getName(), String.format("%s:%s", id, (version == null ? "latest" : version)));
}
Also used : Agent(org.eclipse.che.api.agent.shared.model.Agent) AgentKeyImpl(org.eclipse.che.api.agent.shared.model.impl.AgentKeyImpl) Test(org.testng.annotations.Test)

Example 3 with AgentKeyImpl

use of org.eclipse.che.api.agent.shared.model.impl.AgentKeyImpl in project che by eclipse.

the class AgentKeyImplTest method testParseAgentKeyWithId.

@Test
public void testParseAgentKeyWithId() {
    AgentKeyImpl agentKey = AgentKeyImpl.parse("id");
    assertEquals(agentKey.getId(), "id");
    assertEquals(agentKey.getVersion(), "latest");
}
Also used : AgentKeyImpl(org.eclipse.che.api.agent.shared.model.impl.AgentKeyImpl) Test(org.testng.annotations.Test)

Aggregations

AgentKeyImpl (org.eclipse.che.api.agent.shared.model.impl.AgentKeyImpl)3 Test (org.testng.annotations.Test)3 Agent (org.eclipse.che.api.agent.shared.model.Agent)1