EMMA Coverage Report (generated Mon Nov 29 14:43:38 PST 2010)
[all classes][com.jeantessier.dependencyfinder.web]

COVERAGE SUMMARY FOR SOURCE FILE [TestClosureBase.java]

nameclass, %method, %block, %line, %
TestClosureBase.java100% (1/1)100% (3/3)100% (703/703)100% (66/66)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TestClosureBase100% (1/1)100% (3/3)100% (703/703)100% (66/66)
TestClosureBase (): void 100% (1/1)100% (3/3)100% (1/1)
testDirectQuery (): void 100% (1/1)100% (386/386)100% (35/35)
testFollowDownstreamLink (): void 100% (1/1)100% (314/314)100% (30/30)

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 
33package com.jeantessier.dependencyfinder.web;
34 
35import com.meterware.httpunit.*;
36 
37public abstract class TestClosureBase extends TestBase {
38    public void testDirectQuery() throws Exception {
39        request.setParameter("start-includes", "/" + barPackageName + "/");
40        request.setParameter("scope", "package");
41        request.setParameter("filter", "package");
42        request.setParameter("maximum-inbound-depth", "");
43        request.setParameter("maximum-outbound-depth", "");
44        request.setParameter("submit", "Run Query");
45 
46        context.service();
47        WebResponse response = client.getResponse(request);
48 
49        assertNotNull("Missing link to " + fooPackageName, response.getLinkWith(fooPackageName));
50        assertNull("Unwanted link to " + fooClassName, response.getLinkWith(fooClassName));
51        assertNull("Unwanted link to " + fooFeatureName, response.getLinkWith(fooFeatureName));
52        assertNotNull("Missing link to " + barPackageName, response.getLinkWith(barPackageName));
53        assertNull("Unwanted link to " + barClassName, response.getLinkWith(barClassName));
54        assertNull("Unwanted link to " + barFeatureName, response.getLinkWith(barFeatureName));
55        assertNotNull("Missing link to " + bazPackageName, response.getLinkWith(bazPackageName));
56        assertNull("Unwanted link to " + bazClassName, response.getLinkWith(bazClassName));
57        assertNull("Unwanted link to " + bazFeatureName, response.getLinkWith(bazFeatureName));
58        assertNull("Unwanted link to " + leftPackageName, response.getLinkWith(leftPackageName));
59        assertNull("Unwanted link to " + leftClassName, response.getLinkWith(leftClassName));
60        assertNull("Unwanted link to " + leftFeatureName, response.getLinkWith(leftFeatureName));
61        assertNull("Unwanted link to " + rightPackageName, response.getLinkWith(rightPackageName));
62        assertNull("Unwanted link to " + rightClassName, response.getLinkWith(rightClassName));
63        assertNull("Unwanted link to " + rightFeatureName, response.getLinkWith(rightFeatureName));
64 
65        assertNotNull("Missing link foo", response.getLinkWithID(fooPackageName));
66        assertNotNull("Missing link foo --> bar", response.getLinkWithID(fooPackageName + "_to_" + barPackageName));
67        assertNotNull("Missing link bar", response.getLinkWithID(barPackageName));
68        assertNotNull("Missing link bar <-- foo", response.getLinkWithID(barPackageName + "_from_" + fooPackageName));
69        assertNotNull("Missing link bar --> baz", response.getLinkWithID(barPackageName + "_to_" + bazPackageName));
70        assertNotNull("Missing link baz", response.getLinkWithID(bazPackageName));
71        assertNotNull("Missing link baz <-- bar", response.getLinkWithID(bazPackageName + "_from_" + barPackageName));
72        assertNull("Unwanted link left", response.getLinkWithID(leftPackageName));
73        assertNull("Unwanted link left <-> right", response.getLinkWithID(leftPackageName + "_bidirectional_" + rightPackageName));
74        assertNull("Unwanted link right", response.getLinkWithID(rightPackageName));
75        assertNull("Unwanted link right <-> left", response.getLinkWithID(rightPackageName + "_bidirectional_" + leftPackageName));
76    }
77 
78    public void testFollowDownstreamLink() throws Exception {
79        request.setParameter("start-includes", "/" + fooPackageName + "/");
80        request.setParameter("scope", "package");
81        request.setParameter("filter", "package");
82        request.setParameter("maximum-inbound-depth", "0");
83        request.setParameter("maximum-outbound-depth", "1");
84        request.setParameter("submit", "Run Query");
85 
86        context.service();
87        WebResponse response = client.getResponse(request);
88 
89        assertNotNull("Missing link to " + fooPackageName, response.getLinkWith(fooPackageName));
90        assertNotNull("Missing link to " + barPackageName, response.getLinkWith(barPackageName));
91        assertNull("Unwanted link to " + bazPackageName, response.getLinkWith(bazPackageName));
92 
93        assertNotNull("Missing link foo", response.getLinkWithID(fooPackageName));
94        assertNotNull("Missing link foo --> bar", response.getLinkWithID(fooPackageName + "_to_" + barPackageName));
95        assertNotNull("Missing link bar", response.getLinkWithID(barPackageName));
96        assertNotNull("Missing link bar <-- foo", response.getLinkWithID(barPackageName + "_from_" + fooPackageName));
97        assertNull("Unwanted link bar --> baz", response.getLinkWithID(barPackageName + "_to_" + bazPackageName));
98        assertNull("Unwanted link baz", response.getLinkWithID(bazPackageName));
99        assertNull("Unwanted link baz <-- bar", response.getLinkWithID(bazPackageName + "_from_" + barPackageName));
100 
101        response = response.getLinkWithID(fooPackageName + "_to_" + barPackageName).click();
102 
103        assertNull("Unwanted link to " + fooPackageName, response.getLinkWith(fooPackageName));
104        assertNotNull("Missing link to " + barPackageName, response.getLinkWith(barPackageName));
105        assertNotNull("Missing link to " + bazPackageName, response.getLinkWith(bazPackageName));
106 
107        assertNull("Unwanted link foo", response.getLinkWithID(fooPackageName));
108        assertNull("Unwanted link foo --> bar", response.getLinkWithID(fooPackageName + "_to_" + barPackageName));
109        assertNotNull("Missing link bar", response.getLinkWithID(barPackageName));
110        assertNull("Unwanted link bar <-- foo", response.getLinkWithID(barPackageName + "_from_" + fooPackageName));
111        assertNotNull("Missing link bar --> baz", response.getLinkWithID(barPackageName + "_to_" + bazPackageName));
112        assertNotNull("Missing link baz", response.getLinkWithID(bazPackageName));
113        assertNotNull("Missing link baz <-- bar", response.getLinkWithID(bazPackageName + "_from_" + barPackageName));
114    }
115}

[all classes][com.jeantessier.dependencyfinder.web]
EMMA 2.0.5312 (C) Vladimir Roubtsov