Following test fails
package edu.uiuc.ncsa.cet.bean.tupelo;
import java.util.Set;
import org.junit.Test;
import org.tupeloproject.kernel.impl.MemoryContext;
import org.tupeloproject.rdf.Resource;
public class TagEventBeanUtilTest {
TagEventBeanUtil getTebu()
{
return new TagEventBeanUtil((new MemoryContext()).getBeanSession());
}
@Test
public void testAddDelete() throws Exception
{
TagEventBeanUtil tebu = getTebu();
Resource subject = Resource.uriRef();
tebu.addTags(subject, null, "foo,bar");
tebu.getBeanSession().save();
Set<String> tags = tebu.getTags(subject);
assert tags.contains("foo");
assert tags.contains("bar");
assert tags.size()==2;
// now delete
tebu.removeTags(subject, null, "foo");
tebu.getBeanSession().save();
tags = tebu.getTags(subject);
assert tags.contains("bar");
assert tags.size()==1;
tebu.removeTags(subject, null, "bar");
tebu.getBeanSession().save();
assert tags.size()==0;
}
}