@Test
public void testDelete() {
em.getTransaction().begin();
final String childId = "3";
Tag t3 = new Tag();
t3.setTagId("t3");
em.persist(t3);
ComponentSpec child = createComponentSpec(childId, "xyz", "deleted", "123", "xyz", Collections.<Tag>emptyList(), Collections.<String,String>emptyMap());
ComponentSpec parent1 = createComponentSpec("1", "xyz", "parent1", "123", "xyz", Collections.<Tag>emptyList(), Collections.<String,String>emptyMap());
ComponentSpec parent2 = createComponentSpec("2", "xyz", "parent2", "123", "xyz", Collections.<Tag>emptyList(), Collections.<String,String>emptyMap());
ComponentSpec parent3 = createComponentSpec("p2", "xyz", "parent2", "123", "xyz", Collections.<Tag>singletonList(t3), Collections.<String,String>emptyMap());