Package org.wikier.trioo.jtrioo

Source Code of org.wikier.trioo.jtrioo.BlankNodeTests

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);
  }

}
TOP

Related Classes of org.wikier.trioo.jtrioo.BlankNodeTests

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.