Package org.wikier.trioo.jtrioo

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

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.SimplePerson;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.hp.hpl.jena.rdf.model.Model;

public class RelationTest {
 
  private static final String SERIALIZATION = "RDF/XML-ABBREV";
  private SimplePerson person;
 
  @Before
  public void before() {
    this.person = new SimplePerson();
    this.person.setName("Alice");
    SimplePerson rel = new SimplePerson();
    rel.setName("Bob");
    this.person.setRel(rel);
  }
 
  @After
  public void after() {
    this.person = null;
  }
 
  @Test
  public void testDescribe() {
    Model model = JTriooHelper.describe(this.person);
    long size = model.size();
    assertTrue(size > 0);
    assertEquals(3, size);
    model.write(System.out, SERIALIZATION);
  }
 
  @Test
  public void testDescribeTwice() {
    Model model = JTriooHelper.describe(this.person);
    long size = model.size();
    assertTrue(size > 0);
    assertEquals(3, size);
    model = JTriooHelper.describe(this.person, model);
    size = model.size();
    assertTrue(size > 0);
    assertEquals(3, size);
    model.write(System.out, SERIALIZATION);
  }

}
TOP

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

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.