use of org.eclipse.che.api.environment.server.model.CheServiceImpl in project che by eclipse.
the class DefaultServicesStartStrategyTest method shouldFailIfMachineLinksByItSelf.
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "A machine can not link to itself: .*")
public void shouldFailIfMachineLinksByItSelf() {
// given
CheServicesEnvironmentImpl composeEnvironment = new CheServicesEnvironmentImpl();
composeEnvironment.getServices().put("first", new CheServiceImpl().withLinks(singletonList("first")));
// when
strategy.order(composeEnvironment);
}
use of org.eclipse.che.api.environment.server.model.CheServiceImpl in project che by eclipse.
the class AgentConfigApplier method apply.
/**
* Applies docker specific properties to an environment of machines.
*
* @param envConfig
* environment config with the list of agents that should be injected into machine
* @param internalEnv
* affected environment of machines
* @throws AgentException
* if any error occurs
*/
public void apply(Environment envConfig, CheServicesEnvironmentImpl internalEnv) throws AgentException {
for (Map.Entry<String, ? extends ExtendedMachine> machineEntry : envConfig.getMachines().entrySet()) {
String machineName = machineEntry.getKey();
ExtendedMachine machineConf = machineEntry.getValue();
CheServiceImpl internalMachine = internalEnv.getServices().get(machineName);
apply(machineConf, internalMachine);
}
}
use of org.eclipse.che.api.environment.server.model.CheServiceImpl in project che by eclipse.
the class CheEnvironmentEngine method normalizeNames.
/**
* Sets specific names for this environment instance where it is required.
*
* @param environment
* environment in which names will be normalized
*/
private void normalizeNames(CheServicesEnvironmentImpl environment) {
Map<String, CheServiceImpl> services = environment.getServices();
for (Map.Entry<String, CheServiceImpl> serviceEntry : services.entrySet()) {
CheServiceImpl service = serviceEntry.getValue();
normalizeVolumesFrom(service, services);
normalizeLinks(service, services);
}
}
use of org.eclipse.che.api.environment.server.model.CheServiceImpl in project che by eclipse.
the class MachineProviderImplTest method createInstanceFromSnapshot.
private void createInstanceFromSnapshot(int memorySizeInMB) throws ServerException {
CheServiceImpl machine = createService();
machine.setMemLimit(memorySizeInMB * 1024L * 1024L);
createInstanceFromSnapshot(machine, false, WORKSPACE_ID);
}
use of org.eclipse.che.api.environment.server.model.CheServiceImpl in project che by eclipse.
the class MachineProviderImplTest method createInstanceFromRecipe.
private void createInstanceFromRecipe(int memorySizeInMB) throws Exception {
CheServiceImpl machine = createService();
machine.setMemLimit(memorySizeInMB * 1024L * 1024L);
createInstanceFromRecipe(machine);
}
Aggregations