Package com.hp.jena3.rules.grammar.tests

Examples of com.hp.jena3.rules.grammar.tests.TestJenaRulesRagbag


        assertEquals( new ArrayList<String>(), e.getArguments() );
        }
   
    @Test public void ensureToStringDisplaysComponents()
        {
        ScriptElement e = new ScriptElement( "command", "body" );
        assertEquals( "<command|body>", e.toString() );
        }
View Full Code Here


        assertEquals( "<command|body>", e.toString() );
        }
   
    @Test public void ensureToStringDisplaysArgumentComponents()
        {
        ScriptElement e = new ScriptElement( "command", listOfStrings( "grey 17" ), "body" );
        assertEquals( "<command grey 17|body>", e.toString() );
        }
View Full Code Here

        assertEquals( "<command grey 17|body>", e.toString() );
        }
   
    @Test public void ensureToStringEscapesNewlines()
        {
        ScriptElement e = new ScriptElement( "command", "bo\ndy\n" );
        assertEquals( "<command|bo\\ndy\\n>", e.toString() );
        }
View Full Code Here

        }
   
    @Test public void ensureScriptElementHashcodeDependsOnComponents()
        {
        String command = "advance", body = "clock";
        ScriptElement e = new ScriptElement( command, body );
        assertEquals( command.hashCode() ^ body.hashCode(), e.hashCode() );
        }
View Full Code Here

        assertEquals( command.hashCode() ^ body.hashCode(), e.hashCode() );
        }
   
    @Test public void ensureScriptElementEqualityWorks()
        {
        assertEquals( new ScriptElement( "A", "B" ), new ScriptElement( "A", "B" ) );
        assertEquals( new ScriptElement( "A", listOfStrings( "grey 17" ), "B" ), new ScriptElement( "A", listOfStrings( "grey 17" ), "B" ) );
        assertDiffer( new ScriptElement( "A", listOfStrings( "grey 17" ), "B" ), new ScriptElement( "A", listOfStrings( "gray 17" ), "B" ) );
        assertDiffer( new ScriptElement( "A", listOfStrings( "grey 17" ), "B" ), new ScriptElement( "A", "B" ) );
        assertDiffer( new ScriptElement( "A", listOfStrings( "grey 17" ), "B" ), new ScriptElement( "A", listOfStrings( "grey" ), "B" ) );
        assertDiffer( new ScriptElement( "A", "B" ), new ScriptElement( "A", "C" ) );
        assertDiffer( new ScriptElement( "A", "B" ), new ScriptElement( "D", "B" ) );
        assertDiffer( new ScriptElement( "A", "B" ), new ScriptElement( "C", "D" ) );
        }
View Full Code Here

public class TestScriptParser
    {
    @Test public void ensureParseEmptyStringToEmptyList()
        {
        assertTrue( new ScriptParser().parse( "" ).isEmpty() );
        }
View Full Code Here

        }
   
    @Test public void ensureParseSingleElementToSingletonList()
        {
        ScriptElement e = new ScriptElement( "spoo", "" );
        assertEquals( list( e ), new ScriptParser().parse( "!spoo" ) );
        }
View Full Code Here

        }
   
    @Test public void ensureParseSingleElementToSingletonList2()
        {
        ScriptElement e = new ScriptElement( "spoo", "flarn" );
        assertEquals( list( e ), new ScriptParser().parse( "!spoo\nflarn" ) );
        }
View Full Code Here

        }
  
    @Test public void ensureParseSingleElementToSingletonList3()
        {
        ScriptElement e = new ScriptElement( "spoo", "flarn\nmeatballs" );
        assertEquals( list( e ), new ScriptParser().parse( "!spoo\nflarn\nmeatballs" ) );
        }
View Full Code Here

   
    @Test public void ensureParsingOfMultipleSimpleElements()
        {
        ScriptElement r = new ScriptElement( "ruleset", "" );
        ScriptElement e = new ScriptElement( "expect", "" );
        assertEquals( list( r, e ), new ScriptParser().parse( "!ruleset\n!expect" ) );
        }
View Full Code Here

TOP

Related Classes of com.hp.jena3.rules.grammar.tests.TestJenaRulesRagbag

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.