use of org.ovirt.engine.api.model.Tag in project ovirt-engine by oVirt.
the class V3SpecialObjectsOutAdapter method adapt.
@Override
public V3SpecialObjects adapt(SpecialObjects from) {
V3SpecialObjects to = new V3SpecialObjects();
Template blankTemplate = from.getBlankTemplate();
if (blankTemplate != null) {
V3Link blankTemplateLink = new V3Link();
blankTemplateLink.setRel("templates/blank");
blankTemplateLink.setHref(blankTemplate.getHref());
to.getLinks().add(blankTemplateLink);
}
Tag rootTag = from.getRootTag();
if (rootTag != null) {
V3Link rootTagLink = new V3Link();
rootTagLink.setRel("tags/root");
rootTagLink.setHref(rootTag.getHref());
to.getLinks().add(rootTagLink);
}
return to;
}
use of org.ovirt.engine.api.model.Tag 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.Tag in project ovirt-engine by oVirt.
the class LinkHelperTest method testUserTagLinks.
@Test
public void testUserTagLinks() throws Exception {
Tag tag = new Tag();
tag.setId(TAG_ID);
tag.setUser(new User());
tag.getUser().setId(USER_ID);
LinkHelper.addLinks(tag);
assertEquals(USER_TAG_HREF, tag.getHref());
}
use of org.ovirt.engine.api.model.Tag in project ovirt-engine by oVirt.
the class LinkHelperTest method testTagLinks.
@Test
public void testTagLinks() throws Exception {
Tag tag = new Tag();
tag.setId(TAG_ID);
LinkHelper.addLinks(tag);
assertEquals(TAG_HREF, tag.getHref());
}
use of org.ovirt.engine.api.model.Tag in project ovirt-engine by oVirt.
the class LinkHelperTest method testHostTagLinks.
@Test
public void testHostTagLinks() throws Exception {
Tag tag = new Tag();
tag.setId(TAG_ID);
tag.setHost(new Host());
tag.getHost().setId(HOST_ID);
LinkHelper.addLinks(tag);
assertEquals(HOST_TAG_HREF, tag.getHref());
}
Aggregations