Coverage Report - com.jeantessier.dependency.TestVisitorDecorator
 
Classes in this File Line Coverage Branch Coverage Complexity
TestVisitorDecorator
100%
49/49
N/A
1
TestVisitorDecorator$1
100%
3/3
N/A
1
TestVisitorDecorator$10
100%
3/3
N/A
1
TestVisitorDecorator$11
100%
3/3
N/A
1
TestVisitorDecorator$12
100%
3/3
N/A
1
TestVisitorDecorator$2
100%
3/3
N/A
1
TestVisitorDecorator$3
100%
3/3
N/A
1
TestVisitorDecorator$4
100%
3/3
N/A
1
TestVisitorDecorator$5
100%
3/3
N/A
1
TestVisitorDecorator$6
100%
3/3
N/A
1
TestVisitorDecorator$7
100%
3/3
N/A
1
TestVisitorDecorator$8
100%
3/3
N/A
1
TestVisitorDecorator$9
100%
3/3
N/A
1
 
 1  
 /*
 2  
  *  Copyright (c) 2001-2009, Jean Tessier
 3  
  *  All rights reserved.
 4  
  *
 5  
  *  Redistribution and use in source and binary forms, with or without
 6  
  *  modification, are permitted provided that the following conditions
 7  
  *  are met:
 8  
  *
 9  
  *      * Redistributions of source code must retain the above copyright
 10  
  *        notice, this list of conditions and the following disclaimer.
 11  
  *
 12  
  *      * Redistributions in binary form must reproduce the above copyright
 13  
  *        notice, this list of conditions and the following disclaimer in the
 14  
  *        documentation and/or other materials provided with the distribution.
 15  
  *
 16  
  *      * Neither the name of Jean Tessier nor the names of his contributors
 17  
  *        may be used to endorse or promote products derived from this software
 18  
  *        without specific prior written permission.
 19  
  *
 20  
  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 21  
  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 22  
  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 23  
  *  A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
 24  
  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 25  
  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 26  
  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 27  
  *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 28  
  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 29  
  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 30  
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 31  
  */
 32  
 
 33  
 package com.jeantessier.dependency;
 34  
 
 35  
 import java.util.*;
 36  
 
 37  
 import org.jmock.*;
 38  
 import org.jmock.integration.junit4.*;
 39  
 import org.jmock.lib.legacy.*;
 40  
 import org.junit.*;
 41  
 import org.junit.runner.*;
 42  
 
 43  
 @RunWith(JMock.class)
 44  33
 public class TestVisitorDecorator {
 45  
     private Mockery context;
 46  
 
 47  
     private Visitor delegate;
 48  
 
 49  
     private PackageNode packageNode;
 50  
     private ClassNode classNode;
 51  
     private FeatureNode featureNode;
 52  
 
 53  
     private VisitorDecorator sut;
 54  
 
 55  
     @Before
 56  
     public void setUp() {
 57  12
         context = new Mockery();
 58  12
         context.setImposteriser(ClassImposteriser.INSTANCE);
 59  
 
 60  12
         delegate = context.mock(Visitor.class);
 61  
 
 62  12
         packageNode = context.mock(PackageNode.class);
 63  12
         classNode = context.mock(ClassNode.class);
 64  12
         featureNode = context.mock(FeatureNode.class);
 65  
 
 66  12
         sut = new VisitorDecorator();
 67  12
         sut.setDelegate(delegate);
 68  12
     }
 69  
 
 70  
     @Test
 71  
     public void testTraverseNodes() {
 72  1
         final Collection<? extends Node> nodes = new ArrayList<Node>();
 73  
 
 74  1
         context.checking(new Expectations() {{
 75  1
             one (delegate).traverseNodes(nodes);
 76  1
         }});
 77  
 
 78  1
         sut.traverseNodes(nodes);
 79  1
     }
 80  
 
 81  
     @Test
 82  
     public void testTraverseInbound() {
 83  1
         final Collection<? extends Node> nodes = new ArrayList<Node>();
 84  
 
 85  1
         context.checking(new Expectations() {{
 86  1
             one (delegate).traverseInbound(nodes);
 87  1
         }});
 88  
 
 89  1
         sut.traverseInbound(nodes);
 90  1
     }
 91  
 
 92  
     @Test
 93  
     public void testTraverseOutbound() {
 94  1
         final Collection<? extends Node> nodes = new ArrayList<Node>();
 95  
 
 96  1
         context.checking(new Expectations() {{
 97  1
             one (delegate).traverseOutbound(nodes);
 98  1
         }});
 99  
 
 100  1
         sut.traverseOutbound(nodes);
 101  1
     }
 102  
 
 103  
     @Test
 104  
     public void testVisitPackageNode() {
 105  1
         context.checking(new Expectations() {{
 106  1
             one (packageNode).accept(delegate);
 107  1
         }});
 108  
 
 109  1
         sut.visitPackageNode(packageNode);
 110  1
     }
 111  
 
 112  
     @Test
 113  
     public void testVisitInboundPackageNode() {
 114  1
         context.checking(new Expectations() {{
 115  1
             one (packageNode).acceptInbound(delegate);
 116  1
         }});
 117  
 
 118  1
         sut.visitInboundPackageNode(packageNode);
 119  1
     }
 120  
 
 121  
     @Test
 122  
     public void testVisitOutboundPackageNode() {
 123  1
         context.checking(new Expectations() {{
 124  1
             one (packageNode).acceptOutbound(delegate);
 125  1
         }});
 126  
 
 127  1
         sut.visitOutboundPackageNode(packageNode);
 128  1
     }
 129  
 
 130  
     @Test
 131  
     public void testVisitClassNode() {
 132  1
         context.checking(new Expectations() {{
 133  1
             one (classNode).accept(delegate);
 134  1
         }});
 135  
 
 136  1
         sut.visitClassNode(classNode);
 137  1
     }
 138  
 
 139  
     @Test
 140  
     public void testVisitInboundClassNode() {
 141  1
         context.checking(new Expectations() {{
 142  1
             one (classNode).acceptInbound(delegate);
 143  1
         }});
 144  
 
 145  1
         sut.visitInboundClassNode(classNode);
 146  1
     }
 147  
 
 148  
     @Test
 149  
     public void testVisitOutboundClassNode() {
 150  1
         context.checking(new Expectations() {{
 151  1
             one (classNode).acceptOutbound(delegate);
 152  1
         }});
 153  
 
 154  1
         sut.visitOutboundClassNode(classNode);
 155  1
     }
 156  
 
 157  
     @Test
 158  
     public void testVisitFeatureNode() {
 159  1
         context.checking(new Expectations() {{
 160  1
             one (featureNode).accept(delegate);
 161  1
         }});
 162  
 
 163  1
         sut.visitFeatureNode(featureNode);
 164  1
     }
 165  
 
 166  
     @Test
 167  
     public void testVisitInboundFeatureNode() {
 168  1
         context.checking(new Expectations() {{
 169  1
             one (featureNode).acceptInbound(delegate);
 170  1
         }});
 171  
 
 172  1
         sut.visitInboundFeatureNode(featureNode);
 173  1
     }
 174  
 
 175  
     @Test
 176  
     public void testVisitOutboundFeatureNode() {
 177  1
         context.checking(new Expectations() {{
 178  1
             one (featureNode).acceptOutbound(delegate);
 179  1
         }});
 180  
 
 181  1
         sut.visitOutboundFeatureNode(featureNode);
 182  1
     }
 183  
 }