Package org.mindswap.pellet.output

Examples of org.mindswap.pellet.output.ATermRenderer


  }

  @Test
  public void testSome() {
    StringWriter s = new StringWriter();
    ATermRenderer r = new ATermManchesterSyntaxRenderer();
    r.setWriter( new PrintWriter( s ) );

    ATermAppl C = term( "C" );
    ATermAppl p = term( "p" );

    r.visit( some( p, C ) );

    String expected = "(p some C)";
    String actual = s.toString();

    assertEquals( expected, actual );
View Full Code Here


  }

  @Test
  public void test1() {
    StringWriter s = new StringWriter();
    ATermRenderer r = new ATermManchesterSyntaxRenderer();
    r.setWriter( new PrintWriter( s ) );

    ATermAppl C = term( "C" );
    ATermAppl D = term( "D" );
    ATermAppl p = term( "p" );

    r.visit( and( C, some( p, D ) ));

    String expected = "(C and (p some D))";
    String actual = s.toString();

    assertEquals( expected, actual );
View Full Code Here

  }
 
  @Test
  public void testAll() {
    StringWriter s = new StringWriter();
    ATermRenderer r = new ATermManchesterSyntaxRenderer();
    r.setWriter( new PrintWriter( s ) );

    ATermAppl C = term( "C" );
    ATermAppl p = term( "p" );

    r.visit( all( p, C ) );

    String expected = "(p only C)";
    String actual = s.toString();

    assertEquals( expected, actual );
View Full Code Here

  }

  @Test
  public void testAnd() {
    StringWriter s = new StringWriter();
    ATermRenderer r = new ATermManchesterSyntaxRenderer();
    r.setWriter( new PrintWriter( s ) );

    ATermAppl C = term( "C" );
    ATermAppl D = term( "D" );
    ATermAppl E = term( "E" );

    r.visit( and( C, D, E ) );

    String expected = "(C and D and E)";
    String actual = s.toString();

    assertEquals( expected, actual );
View Full Code Here

  }

  @Test
  public void testHasValue() {
    StringWriter s = new StringWriter();
    ATermRenderer r = new ATermManchesterSyntaxRenderer();
    r.setWriter( new PrintWriter( s ) );

    ATermAppl l = literal( "foobar" );
    ATermAppl p = term( "p" );

    r.visit( hasValue( p, l ) );

    String expected = "(p value \"foobar\")";
    String actual = s.toString();

    assertEquals( expected, actual );
View Full Code Here

  }

  @Test
  public void testInverse() {
    StringWriter s = new StringWriter();
    ATermRenderer r = new ATermManchesterSyntaxRenderer();
    r.setWriter( new PrintWriter( s ) );

    ATermAppl p = term( "p" );

    r.visit( inv( p ) );

    String expected = "inverse p";
    String actual = s.toString();

    assertEquals( expected, actual );
View Full Code Here

  }

  @Test
  public void testMax() {
    StringWriter s = new StringWriter();
    ATermRenderer r = new ATermManchesterSyntaxRenderer();
    r.setWriter( new PrintWriter( s ) );

    ATermAppl C = term( "C" );
    ATermAppl p = term( "p" );

    r.visit( max( p, 3, C ) );

    String expected = "(p max 3 C)";
    String actual = s.toString();

    assertEquals( expected, actual );
View Full Code Here

  }

  @Test
  public void testMin() {
    StringWriter s = new StringWriter();
    ATermRenderer r = new ATermManchesterSyntaxRenderer();
    r.setWriter( new PrintWriter( s ) );

    ATermAppl C = term( "C" );
    ATermAppl p = term( "p" );

    r.visit( min( p, 3, C ) );

    String expected = "(p min 3 C)";
    String actual = s.toString();

    assertEquals( expected, actual );
View Full Code Here

  }

  @Test
  public void testNot() {
    StringWriter s = new StringWriter();
    ATermRenderer r = new ATermManchesterSyntaxRenderer();
    r.setWriter( new PrintWriter( s ) );

    ATermAppl C = term( "C" );

    r.visit( not( C ) );

    String expected = "not C";
    String actual = s.toString();

    assertEquals( expected, actual );
View Full Code Here

  }

  @Test
  public void testOneOf() {
    StringWriter s = new StringWriter();
    ATermRenderer r = new ATermManchesterSyntaxRenderer();
    r.setWriter( new PrintWriter( s ) );

    ATermAppl C = term( "C" );
    ATermAppl D = term( "D" );
    ATermAppl E = term( "E" );

    r.visit( oneOf( C, D, E ) );

    // oneOf inserts new list elements on top of the list
    String expected = "{E D C}";
    String actual = s.toString();
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.output.ATermRenderer

Copyright © 2018 www.massapicom. 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.