use of org.eclipse.che.ide.macro.CustomMacro in project che by eclipse.
the class ServerHostNameMacroTest method getMacros.
@Test
public void getMacros() throws Exception {
final Set<Macro> providers = provider.getMacros(devMachine);
assertEquals(providers.size(), 2);
final Iterator<Macro> iterator = providers.iterator();
final Macro provider1 = iterator.next();
assertTrue(provider1 instanceof CustomMacro);
assertEquals(provider1.getName(), ServerHostNameMacro.KEY.replace("%", WS_AGENT_PORT));
provider1.expand().then(new Operation<String>() {
@Override
public void apply(String address) throws OperationException {
assertEquals(address, PROTOCOL);
}
});
final Macro provider2 = iterator.next();
assertTrue(provider2 instanceof CustomMacro);
assertEquals(provider2.getName(), ServerHostNameMacro.KEY.replace("%", WS_AGENT_PORT.substring(0, WS_AGENT_PORT.length() - 4)));
provider2.expand().then(new Operation<String>() {
@Override
public void apply(String address) throws OperationException {
assertEquals(address, PROTOCOL);
}
});
}
use of org.eclipse.che.ide.macro.CustomMacro in project che by eclipse.
the class ServerProtocolMacroTest method getMacros.
@Test
public void getMacros() throws Exception {
final Set<Macro> providers = provider.getMacros(devMachine);
assertEquals(providers.size(), 2);
final Iterator<Macro> iterator = providers.iterator();
final Macro provider1 = iterator.next();
assertTrue(provider1 instanceof CustomMacro);
assertEquals(provider1.getName(), ServerProtocolMacro.KEY.replace("%", WS_AGENT_PORT));
provider1.expand().then(new Operation<String>() {
@Override
public void apply(String address) throws OperationException {
assertEquals(address, PROTOCOL);
}
});
final Macro provider2 = iterator.next();
assertTrue(provider2 instanceof CustomMacro);
assertEquals(provider2.getName(), ServerProtocolMacro.KEY.replace("%", WS_AGENT_PORT.substring(0, WS_AGENT_PORT.length() - 4)));
provider2.expand().then(new Operation<String>() {
@Override
public void apply(String address) throws OperationException {
assertEquals(address, PROTOCOL);
}
});
}
use of org.eclipse.che.ide.macro.CustomMacro in project che by eclipse.
the class ServerMacroTest method getMacros.
@Test
public void getMacros() throws Exception {
final Set<Macro> providers = provider.getMacros(devMachine);
assertEquals(providers.size(), 2);
final Iterator<Macro> iterator = providers.iterator();
final Macro provider1 = iterator.next();
assertTrue(provider1 instanceof CustomMacro);
assertEquals(provider1.getName(), ServerMacro.KEY.replace("%", WS_AGENT_PORT.substring(0, WS_AGENT_PORT.length() - 4)));
provider1.expand().then(new Operation<String>() {
@Override
public void apply(String address) throws OperationException {
assertEquals(address, ADDRESS);
}
});
final Macro provider2 = iterator.next();
assertTrue(provider2 instanceof CustomMacro);
assertEquals(provider2.getName(), ServerMacro.KEY.replace("%", WS_AGENT_PORT));
provider2.expand().then(new Operation<String>() {
@Override
public void apply(String address) throws OperationException {
assertEquals(address, ADDRESS);
}
});
}
use of org.eclipse.che.ide.macro.CustomMacro in project che by eclipse.
the class ServerPortMacroTest method getMacros.
@Test
public void getMacros() throws Exception {
final Set<Macro> providers = provider.getMacros(devMachine);
assertEquals(providers.size(), 2);
final Iterator<Macro> iterator = providers.iterator();
final Macro provider1 = iterator.next();
assertTrue(provider1 instanceof CustomMacro);
assertEquals(provider1.getName(), ServerPortMacro.KEY.replace("%", WS_AGENT_PORT.substring(0, WS_AGENT_PORT.length() - 4)));
provider1.expand().then(new Operation<String>() {
@Override
public void apply(String address) throws OperationException {
assertEquals(address, PORT);
}
});
final Macro provider2 = iterator.next();
assertTrue(provider2 instanceof CustomMacro);
assertEquals(provider2.getName(), ServerPortMacro.KEY.replace("%", WS_AGENT_PORT));
provider2.expand().then(new Operation<String>() {
@Override
public void apply(String address) throws OperationException {
assertEquals(address, PORT);
}
});
}
Aggregations