use of org.ovirt.engine.api.model.Template in project ovirt-engine by oVirt.
the class LinkHelperTest method testTemplateTagLinks.
@Test
public void testTemplateTagLinks() throws Exception {
Tag tag = new Tag();
tag.setId(TAG_ID);
tag.setTemplate(new Template());
tag.getTemplate().setId(TEMPLATE_ID);
LinkHelper.addLinks(tag);
assertEquals(TEMPLATE_TAG_HREF, tag.getHref());
}
use of org.ovirt.engine.api.model.Template in project ovirt-engine by oVirt.
the class LinkHelperTest method doTestVmLinks.
private void doTestVmLinks(boolean suggestParent) throws Exception {
Vm vm = new Vm();
vm.setId(VM_ID);
vm.setCluster(new Cluster());
vm.getCluster().setId(CLUSTER_ID);
vm.setTemplate(new Template());
vm.getTemplate().setId(TEMPLATE_ID);
vm.setVmPool(new VmPool());
vm.getVmPool().setId(VM_POOL_ID);
if (suggestParent) {
LinkHelper.addLinks(vm, Vm.class);
} else {
LinkHelper.addLinks(vm);
}
assertEquals(VM_HREF, vm.getHref());
assertEquals(CLUSTER_HREF, vm.getCluster().getHref());
assertEquals(TEMPLATE_HREF, vm.getTemplate().getHref());
assertEquals(VM_POOL_HREF, vm.getVmPool().getHref());
}
use of org.ovirt.engine.api.model.Template in project ovirt-engine by oVirt.
the class BackendTemplateDiskResource method addParents.
@Override
public Disk addParents(Disk entity) {
entity.setTemplate(new Template());
entity.getTemplate().setId(templateId.toString());
return entity;
}
use of org.ovirt.engine.api.model.Template in project ovirt-engine by oVirt.
the class BackendTemplateDisksResource method addParents.
@Override
public Disk addParents(Disk disk) {
disk.setTemplate(new Template());
disk.getTemplate().setId(templateId.toString());
return disk;
}
use of org.ovirt.engine.api.model.Template in project ovirt-engine by oVirt.
the class BackendTemplateGraphicsConsolesResource method addParents.
@Override
protected GraphicsConsole addParents(GraphicsConsole model) {
model.setTemplate(new Template());
model.getTemplate().setId(guid.toString());
return model;
}
Aggregations