Examples of AssertEquals


Examples of dk.brics.string.stringoperations.AssertEquals

                if (lefttype.leastUpperBound(VariableType.NONE) != VariableType.NONE
                    && righttype.leastUpperBound(VariableType.NONE) != VariableType.NONE) {
                    Variable left = context.getExpressionVariable(v.getOp1());
                    Variable right = context.getExpressionVariable(v.getOp2());
                    if (equals == true) {
                        makeBinaryAssertion(left, right, new AssertEquals());
                        makeBinaryAssertion(right, left, new AssertEquals());
                        // assert aliases as well
                        if (lefttype.mightBeUsefulMutable() && righttype.mightBeUsefulMutable()) {
                          makeAliasAssertion(left, right, true);
                        }
                    }
View Full Code Here

Examples of dk.brics.string.stringoperations.AssertEquals

            }
            else if (m.getSignature().equals("<java.lang.String: boolean equals(java.lang.Object)>")) {
                Variable base = getBase(v);
                Variable arg = getArgument(v, 0);
                if (expected == true) {
                    makeBinaryAssertion(base, arg, new AssertEquals());
                    makeBinaryAssertion(arg, base, new AssertEquals());
                } else {
                    makeBinaryAssertion(base, arg, new AssertNotEquals());
                    makeBinaryAssertion(arg, base, new AssertNotEquals());
                }
            }
            else if (m.getSignature().equals("<java.lang.String: boolean startsWith(java.lang.String)>")) {
                if (expected == true) {
                    Variable base = getBase(v);
                    Variable arg = getArgument(v, 0);
                    makeBinaryAssertion(base, arg, new AssertStartsWith());
                    makeBinaryAssertion(arg, base, new AssertPrefixOf());
                } else {
                    // TODO negated startsWith assertions [note: it is sound to ignore this]
                }
            }
            else if (m.getSignature().equals("<java.lang.String: boolean endsWith(java.lang.String)>")) {
                if (expected == true) {
                    Variable base = getBase(v);
                    Variable arg = getArgument(v, 0);
                    makeBinaryAssertion(base, arg, new AssertEndsWith());
                    makeBinaryAssertion(arg, base, new AssertSuffixOf());
                } else {
                    // TODO negated endsWith assertions [note: it is sound to ignore this]
                }
            }
            else if (m.getSignature().equals("<java.lang.String: boolean isEmpty()>")) {
                Variable base = getBase(v);
                if (expected == true) {
                    makeUnaryAssertion(base, new AssertEmpty());
                } else {
                    makeUnaryAssertion(base, new AssertNotEmpty());
                }
            }
            else if (m.getSignature().equals("<java.lang.String: boolean contentEquals(java.lang.StringBuffer)>")
                    || m.getSignature().equals("<java.lang.String: boolean contentEquals(java.lang.CharSequence)>")) {
                Variable base = getBase(v);
                Variable arg = getArgument(v, 0);
                if (expected == true) {
                    makeBinaryAssertion(base, arg, new AssertEquals());
                    makeBinaryAssertion(arg, base, new AssertEquals());
                } else {
                    makeBinaryAssertion(base, arg, new AssertNotEquals());
                    makeBinaryAssertion(arg, base, new AssertNotEquals());
                }
            }
View Full Code Here

Examples of org.drools.command.assertion.AssertEquals

                                 cmds,
                                 4000 ) );

        cmds = new ArrayList<Command>();

        cmds.add( new KnowledgeContextResolveFromContextCommand( new AssertEquals( "Check List size",
                                                                                   2,
                                                                                   new GetGlobalCommand( "list" ),
                                                                                   "size()" ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new AssertEquals( "Check Person",
                                                                                   new Person( "darth",
                                                                                               97 ),
                                                                                   new GetGlobalCommand( "list" ),
                                                                                   "get( 0 )" ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new AssertEquals( "Check Person",
                                                                                   new Person( "yoda",
                                                                                               98 ),
                                                                                   new GetGlobalCommand( "list" ),
                                                                                   "get( 1 )" ),
                                                                 "kbuilder",
View Full Code Here

Examples of org.drools.command.assertion.AssertEquals

                                 cmds,
                                 4500 ) );

        cmds = new ArrayList<Command>();

        cmds.add( new KnowledgeContextResolveFromContextCommand( new AssertEquals( "Check List size",
                                                                                   5,
                                                                                   new GetGlobalCommand( "list" ),
                                                                                   "size()" ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new AssertEquals( "Check Person",
                                                                                   new Person( "bobba",
                                                                                               77 ),
                                                                                   new GetGlobalCommand( "list" ),
                                                                                   "get( 0 )" ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new AssertEquals( "Check Person",
                                                                                   new Person( "darth",
                                                                                               97 ),
                                                                                   new GetGlobalCommand( "list" ),
                                                                                   "get( 1 )" ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new AssertEquals( "Check Person",
                                                                                   new Person( "luke",
                                                                                               30 ),
                                                                                   new GetGlobalCommand( "list" ),
                                                                                   "get( 2 )" ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new AssertEquals( "Check Person",
                                                                                   new Person( "yoda",
                                                                                               98 ),
                                                                                   new GetGlobalCommand( "list" ),
                                                                                   "get( 3 )" ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new AssertEquals( "Check Person",
                                                                                   new Person( "ben",
                                                                                               150 ),
                                                                                   new GetGlobalCommand( "list" ),
                                                                                   "get( 4 )" ),
                                                                 "kbuilder",
View Full Code Here

Examples of org.drools.command.assertion.AssertEquals


        SimulationStepImpl step4 = new SimulationStepImpl(path, 5000);
        List<Command> cmds4 = new ArrayList<Command>();

        cmds4.add( new AssertEquals( "Check List size",
                                    2,
                                    new GetGlobalCommand( "list" ),
                                    "size()" ) );
       
        cmds4.add( new AssertEquals( "Check Person",
                                    new Person( "darth",
                                                97 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 0 )" ) );

        cmds4.add(new AssertEquals("Check Person",
                new Person("yoda",
                        98),
                new GetGlobalCommand("list"),
                "get( 1 )"));
View Full Code Here

Examples of org.drools.command.assertion.AssertEquals


        SimulationStepImpl step24 = new SimulationStepImpl(path2,
                5000);
        List<Command> cmds24 = new ArrayList<Command>();
        cmds24.add(new AssertEquals("Check List size",
                5,
                new GetGlobalCommand("list"),
                "size()"));

        cmds24.add(new AssertEquals("Check Person",
                new Person("bobba",
                        77),
                new GetGlobalCommand("list"),
                "get( 0 )" ) );

        cmds24.add(new AssertEquals("Check Person",
                new Person("darth",
                        97),
                new GetGlobalCommand("list"),
                "get( 1 )"));

        cmds24.add(new AssertEquals("Check Person",
                new Person("luke",
                        30),
                new GetGlobalCommand("list"),
                "get( 2 )"));

        cmds24.add(new AssertEquals("Check Person",
                new Person("yoda",
                        98),
                new GetGlobalCommand("list"),
                "get( 3 )"));

        cmds24.add(new AssertEquals("Check Person",
                new Person("ben",
                        150),
                new GetGlobalCommand("list"),
                "get( 4 )"));
        step24.getCommands().add(new TestGroupCommand("test2", cmds24));
View Full Code Here

Examples of org.drools.command.assertion.AssertEquals

                                 cmds,
                                 4000 ) );

        cmds = new ArrayList<Command>();

        cmds.add( new AssertEquals( "Check List size",
                                    2,
                                    new GetGlobalCommand( "list" ),
                                    "size()" ) );
       
        cmds.add( new AssertEquals( "Check Person",
                                    new Person( "darth",
                                                97 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 0 )" ) );

        cmds.add( new AssertEquals( "Check Person",
                                    new Person( "yoda",
                                                98 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 1 )" ) );
View Full Code Here

Examples of org.drools.command.assertion.AssertEquals

                                 cmds,
                                 4500 ) );

        cmds = new ArrayList<Command>();

        cmds.add( new AssertEquals( "Check List size",
                                    5,
                                    new GetGlobalCommand( "list" ),
                                    "size()" ) );

        cmds.add( new AssertEquals( "Check Person",
                                    new Person( "bobba",
                                                77 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 0 )" ) );

        cmds.add( new AssertEquals( "Check Person",
                                    new Person( "darth",
                                                97 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 1 )" ) );

        cmds.add( new AssertEquals( "Check Person",
                                    new Person( "luke",
                                                30 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 2 )" ) );

        cmds.add( new AssertEquals( "Check Person",
                                    new Person( "yoda",
                                                98 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 3 )" ) );

        cmds.add( new AssertEquals( "Check Person",
                                    new Person( "ben",
                                                150 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 4 )" ) );
View Full Code Here
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.