environment.setName("Env1");
environment.setDescription("edededede");
environment.setIp("123.23.3.123");
PmDeployment.instance().persist(environment, em, context);
EnvironmentUsage eu = new EnvironmentUsage();
eu.setStartTime(scal);
eu.setEndTime(ecal);
eu.setImplementationPhase(ip);
eu.setEnvironment(environment);
eu.getProduct().add(product);
product.getEnvironmentUsage().add(eu);
PmDeployment.instance().persist(eu, em, context);
ip = new ImplementationPhase();
ip.setPhaseType(ImplementationPhaseType.INTEGRATION_TEST);
scal = GregorianCalendar.getInstance();
scal.setTimeInMillis(System.currentTimeMillis() + (22*24*60*60*1000));
ip.setStartTime(scal);
ecal = GregorianCalendar.getInstance();
ecal.setTimeInMillis(System.currentTimeMillis() + (30*24*60*60*1000));
ip.setEndTime(ecal);
ip.setDeployment(deployment);
PmDeployment.instance().persist(ip, em, context);
environment = new Environment();
environment.setName("Env2");
environment.setDescription("wwwwwwwwww");
environment.setIp("123.23.3.125");
PmDeployment.instance().persist(environment, em, context);
eu = new EnvironmentUsage();
eu.setStartTime(scal);
eu.setEndTime(ecal);
eu.setImplementationPhase(ip);
eu.setEnvironment(environment);
eu.getProduct().add(product);
product.getEnvironmentUsage().add(eu);
PmDeployment.instance().persist(eu, em, context);
}