/*
(c) Copyright 2008, 2009 Hewlett-Packard Development Company, LP
All rights reserved.
$Id$
*/
package com.hp.jena.rules.ast.tests;
import static org.junit.Assert.*;
import java.util.*;
import org.junit.Test;
import com.hp.jena.rules.ast.*;
import com.hp.jena.rules.ast.tests.TestElement.VisitElement;
public class TestTriples
{
@Test public void ensureTriplesExposeTerms()
{
List<Term> terms = new ArrayList<Term>();
Triples t = new Triples( terms );
assertSame( terms, t.getTripleTerms() );
}
static class VisitTriples extends TestElement.VisitElement
{
@Override public void visitTriples( Triples triples )
{ seen.set( triples ); }
}
@Test public void ensureTriplesVisitInvokesVisitTriples()
{
List<Term> terms = new ArrayList<Term>();
Triples t = new Triples( terms );
VisitElement v = new VisitTriples();
t.visit( v );
assertSame( t, v.seen.get() );
}
}