@Test public void addVMTest() { Deployment deployment = new Deployment(); assertEquals(null, deployment.getVms()); VM vm = new VM(); deployment.addVM(vm); assertEquals(1, deployment.getVms().size()); assertEquals(vm, deployment.getVms().get(0)); }
public void addVM(VM vm) { if(vms == null) vms = new ArrayList<VM>(); vms.add(vm); }
Deployment { public void addVM(VM vm) { if(vms == null) vms = new ArrayList<VM>(); vms.add(vm); } }
Deployment { public void addVM(VM vm) { if(vms == null) vms = new ArrayList<VM>(); vms.add(vm); }  }
Deployment { public void addVM(VM vm) { if(vms == null) vms = new ArrayList<VM>(); vms.add(vm); }  @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "deployment_id", unique = true, nullable = false) int getId(); void setId(int id); @Column(name = "deploymentName", nullable = true, unique = true) String getDeploymentName(); void setDeploymentName(String deploymentName); @Column(name = "provider_id", nullable = true, unique = true) String getProviderId(); void setProviderId(String providerId); @Column(name = "status", nullable = false) String getStatus(); void setStatus(String status); @Column(name = "sla_uuid", nullable = true) String getSlaUUID(); void setSlaUUID(String slaUUID); @Transient String getHref(); void setHref(String href); @Column(name = "price", nullable = true) String getPrice(); void setPrice(String price); @Column(name = "price_schema", nullable = true) int getSchema(); void setSchema(int schema); @Transient List<Link> getLinks(); void setLinks(List<Link> links); void addLink(Link link); @Column(name = "ovf", length=900000) String getOvf(); void setOvf(String ovf); @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) @JoinColumn(name = "deployment_id", referencedColumnName="deployment_id", nullable = true) List<VM> getVms(); void setVms(List<VM> vms); void addVM(VM vm); @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) @JoinColumn(name = "deployment_id", referencedColumnName="deployment_id", nullable = true) List<Agreement> getAgreements(); void setAgreements(List<Agreement> agreements); void addAgreement(Agreement agreement); @Column(name = "start_date", nullable = true) String getStartDate(); void setStartDate(String startDate); @Column(name = "end_date", nullable = true) String getEndDate(); void setEndDate(String endDate); @ManyToOne(fetch=FetchType.EAGER) @JoinColumn(name="application_id") Application getApplication(); void setApplication(Application application); }
Deployment { public void addVM(VM vm) { if(vms == null) vms = new ArrayList<VM>(); vms.add(vm); }  @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "deployment_id", unique = true, nullable = false) int getId(); void setId(int id); @Column(name = "deploymentName", nullable = true, unique = true) String getDeploymentName(); void setDeploymentName(String deploymentName); @Column(name = "provider_id", nullable = true, unique = true) String getProviderId(); void setProviderId(String providerId); @Column(name = "status", nullable = false) String getStatus(); void setStatus(String status); @Column(name = "sla_uuid", nullable = true) String getSlaUUID(); void setSlaUUID(String slaUUID); @Transient String getHref(); void setHref(String href); @Column(name = "price", nullable = true) String getPrice(); void setPrice(String price); @Column(name = "price_schema", nullable = true) int getSchema(); void setSchema(int schema); @Transient List<Link> getLinks(); void setLinks(List<Link> links); void addLink(Link link); @Column(name = "ovf", length=900000) String getOvf(); void setOvf(String ovf); @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) @JoinColumn(name = "deployment_id", referencedColumnName="deployment_id", nullable = true) List<VM> getVms(); void setVms(List<VM> vms); void addVM(VM vm); @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) @JoinColumn(name = "deployment_id", referencedColumnName="deployment_id", nullable = true) List<Agreement> getAgreements(); void setAgreements(List<Agreement> agreements); void addAgreement(Agreement agreement); @Column(name = "start_date", nullable = true) String getStartDate(); void setStartDate(String startDate); @Column(name = "end_date", nullable = true) String getEndDate(); void setEndDate(String endDate); @ManyToOne(fetch=FetchType.EAGER) @JoinColumn(name="application_id") Application getApplication(); void setApplication(Application application);  }