Clover Coverage Report - Kuali Student 1.3.0-SNAPSHOT (Aggregated)
Coverage timestamp: Thu Apr 28 2011 05:03:32 EDT
21   44   1   21
0   34   0.05   1
1     1  
1    
 
  BooleanNodeTest       Line # 10 21 0% 1 22 0% 0.0
 
No Tests
 
1    package org.kuali.student.common.messagebuilder.booleanmessage.ast;
2   
3    import org.antlr.runtime.Token;
4    import org.antlr.runtime.tree.CommonTreeAdaptor;
5    import org.junit.Assert;
6    import org.junit.Test;
7    import org.kuali.student.common.messagebuilder.booleanmessage.ast.BooleanNode;
8    import org.kuali.student.common.messagebuilder.booleanmessage.ast.parsers.BooleanFunctionParser;
9   
 
10    public class BooleanNodeTest {
11   
12    private final static CommonTreeAdaptor adapter = new CommonTreeAdaptor();
13   
 
14  0 toggle @Test
15    public void testBooleanNode() throws Exception {
16  0 Token and = adapter.createToken(BooleanFunctionParser.AND, "*");
17  0 Token a = adapter.createToken(BooleanFunctionParser.ALPHA, "A");
18  0 Token b = adapter.createToken(BooleanFunctionParser.ALPHA, "B");
19   
20    // root node
21  0 BooleanNode andNode = new BooleanNode(and);
22   
23  0 BooleanNode aNode = new BooleanNode(a);
24  0 aNode.setParent(andNode);
25  0 aNode.setValue(Boolean.TRUE);
26  0 aNode.setLanguage("en");
27  0 aNode.setNodeMessage("MATH101");
28   
29  0 BooleanNode bNode = new BooleanNode(b);
30  0 bNode.setParent(andNode);
31  0 bNode.setValue(Boolean.FALSE);
32  0 bNode.setNodeMessage("MATH201");
33   
34  0 andNode.addChild(aNode); // left node
35  0 andNode.addChild(bNode); // right node
36   
37  0 Assert.assertEquals("en", aNode.getLanguage());
38  0 Assert.assertEquals("MATH101", aNode.getNodeMessage());
39  0 Assert.assertEquals(Boolean.TRUE, aNode.getValue());
40  0 Assert.assertSame(andNode, aNode.getParent());
41  0 Assert.assertSame(aNode, andNode.getLeftNode());
42  0 Assert.assertSame(bNode, andNode.getRightNode());
43    }
44    }