package org.wikier.trioo.jtrioo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.wikier.trioo.jtrioo.helpers.JTriooHelper;
import org.wikier.trioo.jtrioo.models.BlankNode;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.hp.hpl.jena.rdf.model.Model;
public class BlankNodeTests {
private static final String SERIALIZATION = "RDF/XML-ABBREV";
private BlankNode bnode;
@Before
public void before() {
this.bnode = new BlankNode();
this.bnode.setName("Alice");
}
@After
public void after() {
this.bnode = null;
}
@Test
public void testDescribe() {
Model model = JTriooHelper.describe(this.bnode);
long size = model.size();
assertTrue(size > 0);
assertEquals(2, size);
model.write(System.out, SERIALIZATION);
}
@Test
public void testDescribeTwice() {
Model model = JTriooHelper.describe(this.bnode);
long size = model.size();
assertTrue(size > 0);
assertEquals(2, size);
model = JTriooHelper.describe(this.bnode, model);
size = model.size();
assertTrue(size > 0);
assertEquals(4, size);
model.write(System.out, SERIALIZATION);
}
}