Source Code Cross Referenced for TestHTMLPrinter.java in  » Code-Analyzer » DependencyFinder » com » jeantessier » dependency » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » DependencyFinder » com.jeantessier.dependency 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         *  Copyright (c) 2001-2007, Jean Tessier
0003:         *  All rights reserved.
0004:         *  
0005:         *  Redistribution and use in source and binary forms, with or without
0006:         *  modification, are permitted provided that the following conditions
0007:         *  are met:
0008:         *  
0009:         *      * Redistributions of source code must retain the above copyright
0010:         *        notice, this list of conditions and the following disclaimer.
0011:         *  
0012:         *      * Redistributions in binary form must reproduce the above copyright
0013:         *        notice, this list of conditions and the following disclaimer in the
0014:         *        documentation and/or other materials provided with the distribution.
0015:         *  
0016:         *      * Neither the name of Jean Tessier nor the names of his contributors
0017:         *        may be used to endorse or promote products derived from this software
0018:         *        without specific prior written permission.
0019:         *  
0020:         *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0021:         *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0022:         *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0023:         *  A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
0024:         *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
0025:         *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
0026:         *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
0027:         *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
0028:         *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0029:         *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0030:         *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0031:         */
0032:
0033:        package com.jeantessier.dependency;
0034:
0035:        import java.io.*;
0036:        import java.text.*;
0037:
0038:        import junit.framework.*;
0039:
0040:        public class TestHTMLPrinter extends TestHTMLPrinterBase {
0041:            private HTMLPrinter visitor;
0042:
0043:            protected void setUp() throws Exception {
0044:                super .setUp();
0045:
0046:                visitor = new HTMLPrinter(new PrintWriter(out), FORMAT);
0047:            }
0048:
0049:            public void testShowInboundsPackageTrueWithInferred()
0050:                    throws IOException {
0051:                factory.createPackage("outbound").addDependency(
0052:                        factory.createPackage("inbound"));
0053:                factory.createPackage("empty");
0054:
0055:                visitor.setShowInbounds(true);
0056:                visitor.setShowOutbounds(false);
0057:
0058:                visitor.traverseNodes(factory.getPackages().values());
0059:
0060:                int lineNumber = 0;
0061:                BufferedReader in = new BufferedReader(new StringReader(out
0062:                        .toString()));
0063:
0064:                assertEquals("line " + ++lineNumber,
0065:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0066:                                + PREFIX + "empty" + SUFFIX
0067:                                + "\" id=\"empty\">empty</a> *</span>", in
0068:                                .readLine());
0069:                assertEquals("line " + ++lineNumber,
0070:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0071:                                + PREFIX + "inbound" + SUFFIX
0072:                                + "\" id=\"inbound\">inbound</a> *</span>", in
0073:                                .readLine());
0074:                assertEquals(
0075:                        "line " + ++lineNumber,
0076:                        "    <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
0077:                                + PREFIX
0078:                                + "outbound"
0079:                                + SUFFIX
0080:                                + "\" id=\"inbound_from_outbound\">outbound</a> *</span>",
0081:                        in.readLine());
0082:                assertEquals("line " + ++lineNumber,
0083:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0084:                                + PREFIX + "outbound" + SUFFIX
0085:                                + "\" id=\"outbound\">outbound</a> *</span>",
0086:                        in.readLine());
0087:
0088:                assertEquals("End of file", null, in.readLine());
0089:            }
0090:
0091:            public void testShowInboundsPackageTrueWithConfirmed()
0092:                    throws IOException {
0093:                factory.createPackage("outbound", true).addDependency(
0094:                        factory.createPackage("inbound", true));
0095:                factory.createPackage("empty", true);
0096:
0097:                visitor.setShowInbounds(true);
0098:                visitor.setShowOutbounds(false);
0099:
0100:                visitor.traverseNodes(factory.getPackages().values());
0101:
0102:                int lineNumber = 0;
0103:                BufferedReader in = new BufferedReader(new StringReader(out
0104:                        .toString()));
0105:
0106:                assertEquals("line " + ++lineNumber,
0107:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
0108:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
0109:                                .readLine());
0110:                assertEquals("line " + ++lineNumber,
0111:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
0112:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
0113:                                .readLine());
0114:                assertEquals("line " + ++lineNumber, "    &lt;-- <a href=\""
0115:                        + PREFIX + "outbound" + SUFFIX
0116:                        + "\" id=\"inbound_from_outbound\">outbound</a>", in
0117:                        .readLine());
0118:                assertEquals("line " + ++lineNumber,
0119:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
0120:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
0121:                        in.readLine());
0122:
0123:                assertEquals("End of file", null, in.readLine());
0124:            }
0125:
0126:            public void testShowInboundsPackageFalseWithInferred()
0127:                    throws IOException {
0128:                factory.createPackage("outbound").addDependency(
0129:                        factory.createPackage("inbound"));
0130:                factory.createPackage("empty");
0131:
0132:                visitor.setShowInbounds(false);
0133:                visitor.setShowOutbounds(false);
0134:
0135:                visitor.traverseNodes(factory.getPackages().values());
0136:
0137:                int lineNumber = 0;
0138:                BufferedReader in = new BufferedReader(new StringReader(out
0139:                        .toString()));
0140:
0141:                assertEquals("line " + ++lineNumber,
0142:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0143:                                + PREFIX + "empty" + SUFFIX
0144:                                + "\" id=\"empty\">empty</a> *</span>", in
0145:                                .readLine());
0146:                assertEquals("line " + ++lineNumber,
0147:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0148:                                + PREFIX + "inbound" + SUFFIX
0149:                                + "\" id=\"inbound\">inbound</a> *</span>", in
0150:                                .readLine());
0151:                assertEquals("line " + ++lineNumber,
0152:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0153:                                + PREFIX + "outbound" + SUFFIX
0154:                                + "\" id=\"outbound\">outbound</a> *</span>",
0155:                        in.readLine());
0156:
0157:                assertEquals("End of file", null, in.readLine());
0158:            }
0159:
0160:            public void testShowInboundsPackageFalseWithConfirmed()
0161:                    throws IOException {
0162:                factory.createPackage("outbound", true).addDependency(
0163:                        factory.createPackage("inbound", true));
0164:                factory.createPackage("empty", true);
0165:
0166:                visitor.setShowInbounds(false);
0167:                visitor.setShowOutbounds(false);
0168:
0169:                visitor.traverseNodes(factory.getPackages().values());
0170:
0171:                int lineNumber = 0;
0172:                BufferedReader in = new BufferedReader(new StringReader(out
0173:                        .toString()));
0174:
0175:                assertEquals("line " + ++lineNumber,
0176:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
0177:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
0178:                                .readLine());
0179:                assertEquals("line " + ++lineNumber,
0180:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
0181:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
0182:                                .readLine());
0183:                assertEquals("line " + ++lineNumber,
0184:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
0185:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
0186:                        in.readLine());
0187:
0188:                assertEquals("End of file", null, in.readLine());
0189:            }
0190:
0191:            public void testShowInboundsClassTrueWithInferred()
0192:                    throws IOException {
0193:                factory.createClass("outbound.Outbound").addDependency(
0194:                        factory.createClass("inbound.Inbound"));
0195:                factory.createClass("empty.Empty");
0196:
0197:                visitor.setShowInbounds(true);
0198:                visitor.setShowOutbounds(false);
0199:
0200:                visitor.traverseNodes(factory.getPackages().values());
0201:
0202:                int lineNumber = 0;
0203:                BufferedReader in = new BufferedReader(new StringReader(out
0204:                        .toString()));
0205:
0206:                assertEquals("line " + ++lineNumber,
0207:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0208:                                + PREFIX + "empty" + SUFFIX
0209:                                + "\" id=\"empty\">empty</a> *</span>", in
0210:                                .readLine());
0211:                assertEquals("line " + ++lineNumber,
0212:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0213:                                + PREFIX + "empty.Empty" + SUFFIX
0214:                                + "\" id=\"empty.Empty\">Empty</a> *</span>",
0215:                        in.readLine());
0216:                assertEquals("line " + ++lineNumber,
0217:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0218:                                + PREFIX + "inbound" + SUFFIX
0219:                                + "\" id=\"inbound\">inbound</a> *</span>", in
0220:                                .readLine());
0221:                assertEquals(
0222:                        "line " + ++lineNumber,
0223:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0224:                                + PREFIX
0225:                                + "inbound.Inbound"
0226:                                + SUFFIX
0227:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
0228:                        in.readLine());
0229:                assertEquals(
0230:                        "line " + ++lineNumber,
0231:                        "        <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
0232:                                + PREFIX
0233:                                + "outbound.Outbound"
0234:                                + SUFFIX
0235:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a> *</span>",
0236:                        in.readLine());
0237:                assertEquals("line " + ++lineNumber,
0238:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0239:                                + PREFIX + "outbound" + SUFFIX
0240:                                + "\" id=\"outbound\">outbound</a> *</span>",
0241:                        in.readLine());
0242:                assertEquals(
0243:                        "line " + ++lineNumber,
0244:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0245:                                + PREFIX
0246:                                + "outbound.Outbound"
0247:                                + SUFFIX
0248:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
0249:                        in.readLine());
0250:
0251:                assertEquals("End of file", null, in.readLine());
0252:            }
0253:
0254:            public void testShowInboundsClassTrueWithConfirmed()
0255:                    throws IOException {
0256:                factory.createClass("outbound.Outbound", true).addDependency(
0257:                        factory.createClass("inbound.Inbound", true));
0258:                factory.createClass("empty.Empty", true);
0259:
0260:                visitor.setShowInbounds(true);
0261:                visitor.setShowOutbounds(false);
0262:
0263:                visitor.traverseNodes(factory.getPackages().values());
0264:
0265:                int lineNumber = 0;
0266:                BufferedReader in = new BufferedReader(new StringReader(out
0267:                        .toString()));
0268:
0269:                assertEquals("line " + ++lineNumber,
0270:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
0271:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
0272:                                .readLine());
0273:                assertEquals("line " + ++lineNumber,
0274:                        "    <a class=\"scope\" href=\"" + PREFIX
0275:                                + "empty.Empty" + SUFFIX
0276:                                + "\" id=\"empty.Empty\">Empty</a>", in
0277:                                .readLine());
0278:                assertEquals("line " + ++lineNumber,
0279:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
0280:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
0281:                                .readLine());
0282:                assertEquals("line " + ++lineNumber,
0283:                        "    <a class=\"scope\" href=\"" + PREFIX
0284:                                + "inbound.Inbound" + SUFFIX
0285:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
0286:                                .readLine());
0287:                assertEquals(
0288:                        "line " + ++lineNumber,
0289:                        "        &lt;-- <a href=\""
0290:                                + PREFIX
0291:                                + "outbound.Outbound"
0292:                                + SUFFIX
0293:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a>",
0294:                        in.readLine());
0295:                assertEquals("line " + ++lineNumber,
0296:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
0297:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
0298:                        in.readLine());
0299:                assertEquals("line " + ++lineNumber,
0300:                        "    <a class=\"scope\" href=\"" + PREFIX
0301:                                + "outbound.Outbound" + SUFFIX
0302:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
0303:                        in.readLine());
0304:
0305:                assertEquals("End of file", null, in.readLine());
0306:            }
0307:
0308:            public void testShowInboundsClassFalseWithInferred()
0309:                    throws IOException {
0310:                factory.createClass("outbound.Outbound").addDependency(
0311:                        factory.createClass("inbound.Inbound"));
0312:                factory.createClass("empty.Empty");
0313:
0314:                visitor.setShowInbounds(false);
0315:                visitor.setShowOutbounds(false);
0316:
0317:                visitor.traverseNodes(factory.getPackages().values());
0318:
0319:                int lineNumber = 0;
0320:                BufferedReader in = new BufferedReader(new StringReader(out
0321:                        .toString()));
0322:
0323:                assertEquals("line " + ++lineNumber,
0324:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0325:                                + PREFIX + "empty" + SUFFIX
0326:                                + "\" id=\"empty\">empty</a> *</span>", in
0327:                                .readLine());
0328:                assertEquals("line " + ++lineNumber,
0329:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0330:                                + PREFIX + "empty.Empty" + SUFFIX
0331:                                + "\" id=\"empty.Empty\">Empty</a> *</span>",
0332:                        in.readLine());
0333:                assertEquals("line " + ++lineNumber,
0334:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0335:                                + PREFIX + "inbound" + SUFFIX
0336:                                + "\" id=\"inbound\">inbound</a> *</span>", in
0337:                                .readLine());
0338:                assertEquals(
0339:                        "line " + ++lineNumber,
0340:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0341:                                + PREFIX
0342:                                + "inbound.Inbound"
0343:                                + SUFFIX
0344:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
0345:                        in.readLine());
0346:                assertEquals("line " + ++lineNumber,
0347:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0348:                                + PREFIX + "outbound" + SUFFIX
0349:                                + "\" id=\"outbound\">outbound</a> *</span>",
0350:                        in.readLine());
0351:                assertEquals(
0352:                        "line " + ++lineNumber,
0353:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0354:                                + PREFIX
0355:                                + "outbound.Outbound"
0356:                                + SUFFIX
0357:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
0358:                        in.readLine());
0359:
0360:                assertEquals("End of file", null, in.readLine());
0361:            }
0362:
0363:            public void testShowInboundsClassFalseWithConfirmed()
0364:                    throws IOException {
0365:                factory.createClass("outbound.Outbound", true).addDependency(
0366:                        factory.createClass("inbound.Inbound", true));
0367:                factory.createClass("empty.Empty", true);
0368:
0369:                visitor.setShowInbounds(false);
0370:                visitor.setShowOutbounds(false);
0371:
0372:                visitor.traverseNodes(factory.getPackages().values());
0373:
0374:                int lineNumber = 0;
0375:                BufferedReader in = new BufferedReader(new StringReader(out
0376:                        .toString()));
0377:
0378:                assertEquals("line " + ++lineNumber,
0379:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
0380:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
0381:                                .readLine());
0382:                assertEquals("line " + ++lineNumber,
0383:                        "    <a class=\"scope\" href=\"" + PREFIX
0384:                                + "empty.Empty" + SUFFIX
0385:                                + "\" id=\"empty.Empty\">Empty</a>", in
0386:                                .readLine());
0387:                assertEquals("line " + ++lineNumber,
0388:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
0389:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
0390:                                .readLine());
0391:                assertEquals("line " + ++lineNumber,
0392:                        "    <a class=\"scope\" href=\"" + PREFIX
0393:                                + "inbound.Inbound" + SUFFIX
0394:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
0395:                                .readLine());
0396:                assertEquals("line " + ++lineNumber,
0397:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
0398:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
0399:                        in.readLine());
0400:                assertEquals("line " + ++lineNumber,
0401:                        "    <a class=\"scope\" href=\"" + PREFIX
0402:                                + "outbound.Outbound" + SUFFIX
0403:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
0404:                        in.readLine());
0405:
0406:                assertEquals("End of file", null, in.readLine());
0407:            }
0408:
0409:            public void testShowInboundsInnerClass() throws IOException {
0410:                factory.createClass("outbound.Outbound$Outbound", true)
0411:                        .addDependency(
0412:                                factory.createClass("inbound.Inbound$Inbound",
0413:                                        true));
0414:                factory.createClass("empty.Empty$Empty", true);
0415:
0416:                visitor.setShowInbounds(true);
0417:                visitor.setShowOutbounds(false);
0418:
0419:                visitor.traverseNodes(factory.getPackages().values());
0420:
0421:                int lineNumber = 0;
0422:                BufferedReader in = new BufferedReader(new StringReader(out
0423:                        .toString()));
0424:
0425:                assertEquals("line " + ++lineNumber,
0426:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
0427:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
0428:                                .readLine());
0429:                assertEquals(
0430:                        "line " + ++lineNumber,
0431:                        "    <a class=\"scope\" href=\"" + PREFIX
0432:                                + "empty.Empty\\$Empty" + SUFFIX
0433:                                + "\" id=\"empty.Empty$Empty\">Empty$Empty</a>",
0434:                        in.readLine());
0435:                assertEquals("line " + ++lineNumber,
0436:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
0437:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
0438:                                .readLine());
0439:                assertEquals(
0440:                        "line " + ++lineNumber,
0441:                        "    <a class=\"scope\" href=\""
0442:                                + PREFIX
0443:                                + "inbound.Inbound\\$Inbound"
0444:                                + SUFFIX
0445:                                + "\" id=\"inbound.Inbound$Inbound\">Inbound$Inbound</a>",
0446:                        in.readLine());
0447:                assertEquals(
0448:                        "line " + ++lineNumber,
0449:                        "        &lt;-- <a href=\""
0450:                                + PREFIX
0451:                                + "outbound.Outbound\\$Outbound"
0452:                                + SUFFIX
0453:                                + "\" id=\"inbound.Inbound$Inbound_from_outbound.Outbound$Outbound\">outbound.Outbound$Outbound</a>",
0454:                        in.readLine());
0455:                assertEquals("line " + ++lineNumber,
0456:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
0457:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
0458:                        in.readLine());
0459:                assertEquals(
0460:                        "line " + ++lineNumber,
0461:                        "    <a class=\"scope\" href=\""
0462:                                + PREFIX
0463:                                + "outbound.Outbound\\$Outbound"
0464:                                + SUFFIX
0465:                                + "\" id=\"outbound.Outbound$Outbound\">Outbound$Outbound</a>",
0466:                        in.readLine());
0467:
0468:                assertEquals("End of file", null, in.readLine());
0469:            }
0470:
0471:            public void testShowInboundsFeatureTrueWithInferred()
0472:                    throws IOException {
0473:                factory
0474:                        .createFeature("outbound.Outbound.outbound()")
0475:                        .addDependency(
0476:                                factory
0477:                                        .createFeature("inbound.Inbound.inbound()"));
0478:                factory.createFeature("empty.Empty.empty()");
0479:
0480:                visitor.setShowInbounds(true);
0481:                visitor.setShowOutbounds(false);
0482:
0483:                visitor.traverseNodes(factory.getPackages().values());
0484:
0485:                int lineNumber = 0;
0486:                BufferedReader in = new BufferedReader(new StringReader(out
0487:                        .toString()));
0488:
0489:                assertEquals("line " + ++lineNumber,
0490:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0491:                                + PREFIX + "empty" + SUFFIX
0492:                                + "\" id=\"empty\">empty</a> *</span>", in
0493:                                .readLine());
0494:                assertEquals("line " + ++lineNumber,
0495:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0496:                                + PREFIX + "empty.Empty" + SUFFIX
0497:                                + "\" id=\"empty.Empty\">Empty</a> *</span>",
0498:                        in.readLine());
0499:                assertEquals(
0500:                        "line " + ++lineNumber,
0501:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0502:                                + PREFIX
0503:                                + "empty.Empty.empty\\(\\)"
0504:                                + SUFFIX
0505:                                + "\" id=\"empty.Empty.empty()\">empty()</a> *</span>",
0506:                        in.readLine());
0507:                assertEquals("line " + ++lineNumber,
0508:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0509:                                + PREFIX + "inbound" + SUFFIX
0510:                                + "\" id=\"inbound\">inbound</a> *</span>", in
0511:                                .readLine());
0512:                assertEquals(
0513:                        "line " + ++lineNumber,
0514:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0515:                                + PREFIX
0516:                                + "inbound.Inbound"
0517:                                + SUFFIX
0518:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
0519:                        in.readLine());
0520:                assertEquals(
0521:                        "line " + ++lineNumber,
0522:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0523:                                + PREFIX
0524:                                + "inbound.Inbound.inbound\\(\\)"
0525:                                + SUFFIX
0526:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a> *</span>",
0527:                        in.readLine());
0528:                assertEquals(
0529:                        "line " + ++lineNumber,
0530:                        "            <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
0531:                                + PREFIX
0532:                                + "outbound.Outbound.outbound\\(\\)"
0533:                                + SUFFIX
0534:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a> *</span>",
0535:                        in.readLine());
0536:                assertEquals("line " + ++lineNumber,
0537:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0538:                                + PREFIX + "outbound" + SUFFIX
0539:                                + "\" id=\"outbound\">outbound</a> *</span>",
0540:                        in.readLine());
0541:                assertEquals(
0542:                        "line " + ++lineNumber,
0543:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0544:                                + PREFIX
0545:                                + "outbound.Outbound"
0546:                                + SUFFIX
0547:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
0548:                        in.readLine());
0549:                assertEquals(
0550:                        "line " + ++lineNumber,
0551:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0552:                                + PREFIX
0553:                                + "outbound.Outbound.outbound\\(\\)"
0554:                                + SUFFIX
0555:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a> *</span>",
0556:                        in.readLine());
0557:
0558:                assertEquals("End of file", null, in.readLine());
0559:            }
0560:
0561:            public void testShowInboundsFeatureTrueWithConfirmed()
0562:                    throws IOException {
0563:                factory.createFeature("outbound.Outbound.outbound()", true)
0564:                        .addDependency(
0565:                                factory.createFeature(
0566:                                        "inbound.Inbound.inbound()", true));
0567:                factory.createFeature("empty.Empty.empty()", true);
0568:
0569:                visitor.setShowInbounds(true);
0570:                visitor.setShowOutbounds(false);
0571:
0572:                visitor.traverseNodes(factory.getPackages().values());
0573:
0574:                int lineNumber = 0;
0575:                BufferedReader in = new BufferedReader(new StringReader(out
0576:                        .toString()));
0577:
0578:                assertEquals("line " + ++lineNumber,
0579:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
0580:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
0581:                                .readLine());
0582:                assertEquals("line " + ++lineNumber,
0583:                        "    <a class=\"scope\" href=\"" + PREFIX
0584:                                + "empty.Empty" + SUFFIX
0585:                                + "\" id=\"empty.Empty\">Empty</a>", in
0586:                                .readLine());
0587:                assertEquals("line " + ++lineNumber,
0588:                        "        <a class=\"scope\" href=\"" + PREFIX
0589:                                + "empty.Empty.empty\\(\\)" + SUFFIX
0590:                                + "\" id=\"empty.Empty.empty()\">empty()</a>",
0591:                        in.readLine());
0592:                assertEquals("line " + ++lineNumber,
0593:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
0594:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
0595:                                .readLine());
0596:                assertEquals("line " + ++lineNumber,
0597:                        "    <a class=\"scope\" href=\"" + PREFIX
0598:                                + "inbound.Inbound" + SUFFIX
0599:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
0600:                                .readLine());
0601:                assertEquals(
0602:                        "line " + ++lineNumber,
0603:                        "        <a class=\"scope\" href=\""
0604:                                + PREFIX
0605:                                + "inbound.Inbound.inbound\\(\\)"
0606:                                + SUFFIX
0607:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
0608:                        in.readLine());
0609:                assertEquals(
0610:                        "line " + ++lineNumber,
0611:                        "            &lt;-- <a href=\""
0612:                                + PREFIX
0613:                                + "outbound.Outbound.outbound\\(\\)"
0614:                                + SUFFIX
0615:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a>",
0616:                        in.readLine());
0617:                assertEquals("line " + ++lineNumber,
0618:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
0619:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
0620:                        in.readLine());
0621:                assertEquals("line " + ++lineNumber,
0622:                        "    <a class=\"scope\" href=\"" + PREFIX
0623:                                + "outbound.Outbound" + SUFFIX
0624:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
0625:                        in.readLine());
0626:                assertEquals(
0627:                        "line " + ++lineNumber,
0628:                        "        <a class=\"scope\" href=\""
0629:                                + PREFIX
0630:                                + "outbound.Outbound.outbound\\(\\)"
0631:                                + SUFFIX
0632:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
0633:                        in.readLine());
0634:
0635:                assertEquals("End of file", null, in.readLine());
0636:            }
0637:
0638:            public void testShowInboundsFeatureFalseWithInferred()
0639:                    throws IOException {
0640:                factory
0641:                        .createFeature("outbound.Outbound.outbound()")
0642:                        .addDependency(
0643:                                factory
0644:                                        .createFeature("inbound.Inbound.inbound()"));
0645:                factory.createFeature("empty.Empty.empty()");
0646:
0647:                visitor.setShowInbounds(false);
0648:                visitor.setShowOutbounds(false);
0649:
0650:                visitor.traverseNodes(factory.getPackages().values());
0651:
0652:                int lineNumber = 0;
0653:                BufferedReader in = new BufferedReader(new StringReader(out
0654:                        .toString()));
0655:
0656:                assertEquals("line " + ++lineNumber,
0657:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0658:                                + PREFIX + "empty" + SUFFIX
0659:                                + "\" id=\"empty\">empty</a> *</span>", in
0660:                                .readLine());
0661:                assertEquals("line " + ++lineNumber,
0662:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0663:                                + PREFIX + "empty.Empty" + SUFFIX
0664:                                + "\" id=\"empty.Empty\">Empty</a> *</span>",
0665:                        in.readLine());
0666:                assertEquals(
0667:                        "line " + ++lineNumber,
0668:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0669:                                + PREFIX
0670:                                + "empty.Empty.empty\\(\\)"
0671:                                + SUFFIX
0672:                                + "\" id=\"empty.Empty.empty()\">empty()</a> *</span>",
0673:                        in.readLine());
0674:                assertEquals("line " + ++lineNumber,
0675:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0676:                                + PREFIX + "inbound" + SUFFIX
0677:                                + "\" id=\"inbound\">inbound</a> *</span>", in
0678:                                .readLine());
0679:                assertEquals(
0680:                        "line " + ++lineNumber,
0681:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0682:                                + PREFIX
0683:                                + "inbound.Inbound"
0684:                                + SUFFIX
0685:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
0686:                        in.readLine());
0687:                assertEquals(
0688:                        "line " + ++lineNumber,
0689:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0690:                                + PREFIX
0691:                                + "inbound.Inbound.inbound\\(\\)"
0692:                                + SUFFIX
0693:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a> *</span>",
0694:                        in.readLine());
0695:                assertEquals("line " + ++lineNumber,
0696:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0697:                                + PREFIX + "outbound" + SUFFIX
0698:                                + "\" id=\"outbound\">outbound</a> *</span>",
0699:                        in.readLine());
0700:                assertEquals(
0701:                        "line " + ++lineNumber,
0702:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0703:                                + PREFIX
0704:                                + "outbound.Outbound"
0705:                                + SUFFIX
0706:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
0707:                        in.readLine());
0708:                assertEquals(
0709:                        "line " + ++lineNumber,
0710:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
0711:                                + PREFIX
0712:                                + "outbound.Outbound.outbound\\(\\)"
0713:                                + SUFFIX
0714:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a> *</span>",
0715:                        in.readLine());
0716:
0717:                assertEquals("End of file", null, in.readLine());
0718:            }
0719:
0720:            public void testShowInboundsFeatureFalseWithConfirmed()
0721:                    throws IOException {
0722:                factory.createFeature("outbound.Outbound.outbound()", true)
0723:                        .addDependency(
0724:                                factory.createFeature(
0725:                                        "inbound.Inbound.inbound()", true));
0726:                factory.createFeature("empty.Empty.empty()", true);
0727:
0728:                visitor.setShowInbounds(false);
0729:                visitor.setShowOutbounds(false);
0730:
0731:                visitor.traverseNodes(factory.getPackages().values());
0732:
0733:                int lineNumber = 0;
0734:                BufferedReader in = new BufferedReader(new StringReader(out
0735:                        .toString()));
0736:
0737:                assertEquals("line " + ++lineNumber,
0738:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
0739:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
0740:                                .readLine());
0741:                assertEquals("line " + ++lineNumber,
0742:                        "    <a class=\"scope\" href=\"" + PREFIX
0743:                                + "empty.Empty" + SUFFIX
0744:                                + "\" id=\"empty.Empty\">Empty</a>", in
0745:                                .readLine());
0746:                assertEquals("line " + ++lineNumber,
0747:                        "        <a class=\"scope\" href=\"" + PREFIX
0748:                                + "empty.Empty.empty\\(\\)" + SUFFIX
0749:                                + "\" id=\"empty.Empty.empty()\">empty()</a>",
0750:                        in.readLine());
0751:                assertEquals("line " + ++lineNumber,
0752:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
0753:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
0754:                                .readLine());
0755:                assertEquals("line " + ++lineNumber,
0756:                        "    <a class=\"scope\" href=\"" + PREFIX
0757:                                + "inbound.Inbound" + SUFFIX
0758:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
0759:                                .readLine());
0760:                assertEquals(
0761:                        "line " + ++lineNumber,
0762:                        "        <a class=\"scope\" href=\""
0763:                                + PREFIX
0764:                                + "inbound.Inbound.inbound\\(\\)"
0765:                                + SUFFIX
0766:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
0767:                        in.readLine());
0768:                assertEquals("line " + ++lineNumber,
0769:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
0770:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
0771:                        in.readLine());
0772:                assertEquals("line " + ++lineNumber,
0773:                        "    <a class=\"scope\" href=\"" + PREFIX
0774:                                + "outbound.Outbound" + SUFFIX
0775:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
0776:                        in.readLine());
0777:                assertEquals(
0778:                        "line " + ++lineNumber,
0779:                        "        <a class=\"scope\" href=\""
0780:                                + PREFIX
0781:                                + "outbound.Outbound.outbound\\(\\)"
0782:                                + SUFFIX
0783:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
0784:                        in.readLine());
0785:
0786:                assertEquals("End of file", null, in.readLine());
0787:            }
0788:
0789:            public void testShowInboundsInnerClassFeature() throws IOException {
0790:                factory.createFeature("outbound.Outbound$Outbound.outbound()",
0791:                        true).addDependency(
0792:                        factory.createFeature(
0793:                                "inbound.Inbound$Inbound.inbound()", true));
0794:                factory.createFeature("empty.Empty$Empty.empty()", true);
0795:
0796:                visitor.setShowInbounds(true);
0797:                visitor.setShowOutbounds(false);
0798:
0799:                visitor.traverseNodes(factory.getPackages().values());
0800:
0801:                int lineNumber = 0;
0802:                BufferedReader in = new BufferedReader(new StringReader(out
0803:                        .toString()));
0804:
0805:                assertEquals("line " + ++lineNumber,
0806:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
0807:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
0808:                                .readLine());
0809:                assertEquals(
0810:                        "line " + ++lineNumber,
0811:                        "    <a class=\"scope\" href=\"" + PREFIX
0812:                                + "empty.Empty\\$Empty" + SUFFIX
0813:                                + "\" id=\"empty.Empty$Empty\">Empty$Empty</a>",
0814:                        in.readLine());
0815:                assertEquals(
0816:                        "line " + ++lineNumber,
0817:                        "        <a class=\"scope\" href=\""
0818:                                + PREFIX
0819:                                + "empty.Empty\\$Empty.empty\\(\\)"
0820:                                + SUFFIX
0821:                                + "\" id=\"empty.Empty$Empty.empty()\">empty()</a>",
0822:                        in.readLine());
0823:                assertEquals("line " + ++lineNumber,
0824:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
0825:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
0826:                                .readLine());
0827:                assertEquals(
0828:                        "line " + ++lineNumber,
0829:                        "    <a class=\"scope\" href=\""
0830:                                + PREFIX
0831:                                + "inbound.Inbound\\$Inbound"
0832:                                + SUFFIX
0833:                                + "\" id=\"inbound.Inbound$Inbound\">Inbound$Inbound</a>",
0834:                        in.readLine());
0835:                assertEquals(
0836:                        "line " + ++lineNumber,
0837:                        "        <a class=\"scope\" href=\""
0838:                                + PREFIX
0839:                                + "inbound.Inbound\\$Inbound.inbound\\(\\)"
0840:                                + SUFFIX
0841:                                + "\" id=\"inbound.Inbound$Inbound.inbound()\">inbound()</a>",
0842:                        in.readLine());
0843:                assertEquals(
0844:                        "line " + ++lineNumber,
0845:                        "            &lt;-- <a href=\""
0846:                                + PREFIX
0847:                                + "outbound.Outbound\\$Outbound.outbound\\(\\)"
0848:                                + SUFFIX
0849:                                + "\" id=\"inbound.Inbound$Inbound.inbound()_from_outbound.Outbound$Outbound.outbound()\">outbound.Outbound$Outbound.outbound()</a>",
0850:                        in.readLine());
0851:                assertEquals("line " + ++lineNumber,
0852:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
0853:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
0854:                        in.readLine());
0855:                assertEquals(
0856:                        "line " + ++lineNumber,
0857:                        "    <a class=\"scope\" href=\""
0858:                                + PREFIX
0859:                                + "outbound.Outbound\\$Outbound"
0860:                                + SUFFIX
0861:                                + "\" id=\"outbound.Outbound$Outbound\">Outbound$Outbound</a>",
0862:                        in.readLine());
0863:                assertEquals(
0864:                        "line " + ++lineNumber,
0865:                        "        <a class=\"scope\" href=\""
0866:                                + PREFIX
0867:                                + "outbound.Outbound\\$Outbound.outbound\\(\\)"
0868:                                + SUFFIX
0869:                                + "\" id=\"outbound.Outbound$Outbound.outbound()\">outbound()</a>",
0870:                        in.readLine());
0871:
0872:                assertEquals("End of file", null, in.readLine());
0873:            }
0874:
0875:            public void testShowOutboundsPackageTrueWithInferred()
0876:                    throws IOException {
0877:                factory.createPackage("outbound").addDependency(
0878:                        factory.createPackage("inbound"));
0879:                factory.createPackage("empty");
0880:
0881:                visitor.setShowInbounds(false);
0882:                visitor.setShowOutbounds(true);
0883:
0884:                visitor.traverseNodes(factory.getPackages().values());
0885:
0886:                int lineNumber = 0;
0887:                BufferedReader in = new BufferedReader(new StringReader(out
0888:                        .toString()));
0889:
0890:                assertEquals("line " + ++lineNumber,
0891:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0892:                                + PREFIX + "empty" + SUFFIX
0893:                                + "\" id=\"empty\">empty</a> *</span>", in
0894:                                .readLine());
0895:                assertEquals("line " + ++lineNumber,
0896:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0897:                                + PREFIX + "inbound" + SUFFIX
0898:                                + "\" id=\"inbound\">inbound</a> *</span>", in
0899:                                .readLine());
0900:                assertEquals("line " + ++lineNumber,
0901:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0902:                                + PREFIX + "outbound" + SUFFIX
0903:                                + "\" id=\"outbound\">outbound</a> *</span>",
0904:                        in.readLine());
0905:                assertEquals(
0906:                        "line " + ++lineNumber,
0907:                        "    <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
0908:                                + PREFIX
0909:                                + "inbound"
0910:                                + SUFFIX
0911:                                + "\" id=\"outbound_to_inbound\">inbound</a> *</span>",
0912:                        in.readLine());
0913:
0914:                assertEquals("End of file", null, in.readLine());
0915:            }
0916:
0917:            public void testShowOutboundsPackageTrueWithConfirmed()
0918:                    throws IOException {
0919:                factory.createPackage("outbound", true).addDependency(
0920:                        factory.createPackage("inbound", true));
0921:                factory.createPackage("empty", true);
0922:
0923:                visitor.setShowInbounds(false);
0924:                visitor.setShowOutbounds(true);
0925:
0926:                visitor.traverseNodes(factory.getPackages().values());
0927:
0928:                int lineNumber = 0;
0929:                BufferedReader in = new BufferedReader(new StringReader(out
0930:                        .toString()));
0931:
0932:                assertEquals("line " + ++lineNumber,
0933:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
0934:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
0935:                                .readLine());
0936:                assertEquals("line " + ++lineNumber,
0937:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
0938:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
0939:                                .readLine());
0940:                assertEquals("line " + ++lineNumber,
0941:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
0942:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
0943:                        in.readLine());
0944:                assertEquals("line " + ++lineNumber, "    --&gt; <a href=\""
0945:                        + PREFIX + "inbound" + SUFFIX
0946:                        + "\" id=\"outbound_to_inbound\">inbound</a>", in
0947:                        .readLine());
0948:
0949:                assertEquals("End of file", null, in.readLine());
0950:            }
0951:
0952:            public void testShowOutboundsPackageFalseWithInferred()
0953:                    throws IOException {
0954:                factory.createPackage("outbound").addDependency(
0955:                        factory.createPackage("inbound"));
0956:                factory.createPackage("empty");
0957:
0958:                visitor.setShowInbounds(false);
0959:                visitor.setShowOutbounds(false);
0960:
0961:                visitor.traverseNodes(factory.getPackages().values());
0962:
0963:                int lineNumber = 0;
0964:                BufferedReader in = new BufferedReader(new StringReader(out
0965:                        .toString()));
0966:
0967:                assertEquals("line " + ++lineNumber,
0968:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0969:                                + PREFIX + "empty" + SUFFIX
0970:                                + "\" id=\"empty\">empty</a> *</span>", in
0971:                                .readLine());
0972:                assertEquals("line " + ++lineNumber,
0973:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0974:                                + PREFIX + "inbound" + SUFFIX
0975:                                + "\" id=\"inbound\">inbound</a> *</span>", in
0976:                                .readLine());
0977:                assertEquals("line " + ++lineNumber,
0978:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
0979:                                + PREFIX + "outbound" + SUFFIX
0980:                                + "\" id=\"outbound\">outbound</a> *</span>",
0981:                        in.readLine());
0982:
0983:                assertEquals("End of file", null, in.readLine());
0984:            }
0985:
0986:            public void testShowOutboundsPackageFalseWithConfirmed()
0987:                    throws IOException {
0988:                factory.createPackage("outbound", true).addDependency(
0989:                        factory.createPackage("inbound", true));
0990:                factory.createPackage("empty", true);
0991:
0992:                visitor.setShowInbounds(false);
0993:                visitor.setShowOutbounds(false);
0994:
0995:                visitor.traverseNodes(factory.getPackages().values());
0996:
0997:                int lineNumber = 0;
0998:                BufferedReader in = new BufferedReader(new StringReader(out
0999:                        .toString()));
1000:
1001:                assertEquals("line " + ++lineNumber,
1002:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
1003:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
1004:                                .readLine());
1005:                assertEquals("line " + ++lineNumber,
1006:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
1007:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
1008:                                .readLine());
1009:                assertEquals("line " + ++lineNumber,
1010:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
1011:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
1012:                        in.readLine());
1013:
1014:                assertEquals("End of file", null, in.readLine());
1015:            }
1016:
1017:            public void testShowOutboundsClassTrueWithInferred()
1018:                    throws IOException {
1019:                factory.createClass("outbound.Outbound").addDependency(
1020:                        factory.createClass("inbound.Inbound"));
1021:                factory.createClass("empty.Empty");
1022:
1023:                visitor.setShowInbounds(false);
1024:                visitor.setShowOutbounds(true);
1025:
1026:                visitor.traverseNodes(factory.getPackages().values());
1027:
1028:                int lineNumber = 0;
1029:                BufferedReader in = new BufferedReader(new StringReader(out
1030:                        .toString()));
1031:
1032:                assertEquals("line " + ++lineNumber,
1033:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1034:                                + PREFIX + "empty" + SUFFIX
1035:                                + "\" id=\"empty\">empty</a> *</span>", in
1036:                                .readLine());
1037:                assertEquals("line " + ++lineNumber,
1038:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1039:                                + PREFIX + "empty.Empty" + SUFFIX
1040:                                + "\" id=\"empty.Empty\">Empty</a> *</span>",
1041:                        in.readLine());
1042:                assertEquals("line " + ++lineNumber,
1043:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1044:                                + PREFIX + "inbound" + SUFFIX
1045:                                + "\" id=\"inbound\">inbound</a> *</span>", in
1046:                                .readLine());
1047:                assertEquals(
1048:                        "line " + ++lineNumber,
1049:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1050:                                + PREFIX
1051:                                + "inbound.Inbound"
1052:                                + SUFFIX
1053:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
1054:                        in.readLine());
1055:                assertEquals("line " + ++lineNumber,
1056:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1057:                                + PREFIX + "outbound" + SUFFIX
1058:                                + "\" id=\"outbound\">outbound</a> *</span>",
1059:                        in.readLine());
1060:                assertEquals(
1061:                        "line " + ++lineNumber,
1062:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1063:                                + PREFIX
1064:                                + "outbound.Outbound"
1065:                                + SUFFIX
1066:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
1067:                        in.readLine());
1068:                assertEquals(
1069:                        "line " + ++lineNumber,
1070:                        "        <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
1071:                                + PREFIX
1072:                                + "inbound.Inbound"
1073:                                + SUFFIX
1074:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a> *</span>",
1075:                        in.readLine());
1076:
1077:                assertEquals("End of file", null, in.readLine());
1078:            }
1079:
1080:            public void testShowOutboundsClassTrueWithConfirmed()
1081:                    throws IOException {
1082:                factory.createClass("outbound.Outbound", true).addDependency(
1083:                        factory.createClass("inbound.Inbound", true));
1084:                factory.createClass("empty.Empty", true);
1085:
1086:                visitor.setShowInbounds(false);
1087:                visitor.setShowOutbounds(true);
1088:
1089:                visitor.traverseNodes(factory.getPackages().values());
1090:
1091:                int lineNumber = 0;
1092:                BufferedReader in = new BufferedReader(new StringReader(out
1093:                        .toString()));
1094:
1095:                assertEquals("line " + ++lineNumber,
1096:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
1097:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
1098:                                .readLine());
1099:                assertEquals("line " + ++lineNumber,
1100:                        "    <a class=\"scope\" href=\"" + PREFIX
1101:                                + "empty.Empty" + SUFFIX
1102:                                + "\" id=\"empty.Empty\">Empty</a>", in
1103:                                .readLine());
1104:                assertEquals("line " + ++lineNumber,
1105:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
1106:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
1107:                                .readLine());
1108:                assertEquals("line " + ++lineNumber,
1109:                        "    <a class=\"scope\" href=\"" + PREFIX
1110:                                + "inbound.Inbound" + SUFFIX
1111:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
1112:                                .readLine());
1113:                assertEquals("line " + ++lineNumber,
1114:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
1115:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
1116:                        in.readLine());
1117:                assertEquals("line " + ++lineNumber,
1118:                        "    <a class=\"scope\" href=\"" + PREFIX
1119:                                + "outbound.Outbound" + SUFFIX
1120:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
1121:                        in.readLine());
1122:                assertEquals(
1123:                        "line " + ++lineNumber,
1124:                        "        --&gt; <a href=\""
1125:                                + PREFIX
1126:                                + "inbound.Inbound"
1127:                                + SUFFIX
1128:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a>",
1129:                        in.readLine());
1130:
1131:                assertEquals("End of file", null, in.readLine());
1132:            }
1133:
1134:            public void testShowOutboundsClassFalseWithInferred()
1135:                    throws IOException {
1136:                factory.createClass("outbound.Outbound").addDependency(
1137:                        factory.createClass("inbound.Inbound"));
1138:                factory.createClass("empty.Empty");
1139:
1140:                visitor.setShowInbounds(false);
1141:                visitor.setShowOutbounds(false);
1142:
1143:                visitor.traverseNodes(factory.getPackages().values());
1144:
1145:                int lineNumber = 0;
1146:                BufferedReader in = new BufferedReader(new StringReader(out
1147:                        .toString()));
1148:
1149:                assertEquals("line " + ++lineNumber,
1150:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1151:                                + PREFIX + "empty" + SUFFIX
1152:                                + "\" id=\"empty\">empty</a> *</span>", in
1153:                                .readLine());
1154:                assertEquals("line " + ++lineNumber,
1155:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1156:                                + PREFIX + "empty.Empty" + SUFFIX
1157:                                + "\" id=\"empty.Empty\">Empty</a> *</span>",
1158:                        in.readLine());
1159:                assertEquals("line " + ++lineNumber,
1160:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1161:                                + PREFIX + "inbound" + SUFFIX
1162:                                + "\" id=\"inbound\">inbound</a> *</span>", in
1163:                                .readLine());
1164:                assertEquals(
1165:                        "line " + ++lineNumber,
1166:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1167:                                + PREFIX
1168:                                + "inbound.Inbound"
1169:                                + SUFFIX
1170:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
1171:                        in.readLine());
1172:                assertEquals("line " + ++lineNumber,
1173:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1174:                                + PREFIX + "outbound" + SUFFIX
1175:                                + "\" id=\"outbound\">outbound</a> *</span>",
1176:                        in.readLine());
1177:                assertEquals(
1178:                        "line " + ++lineNumber,
1179:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1180:                                + PREFIX
1181:                                + "outbound.Outbound"
1182:                                + SUFFIX
1183:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
1184:                        in.readLine());
1185:
1186:                assertEquals("End of file", null, in.readLine());
1187:            }
1188:
1189:            public void testShowOutboundsClassFalseWithConfirmed()
1190:                    throws IOException {
1191:                factory.createClass("outbound.Outbound", true).addDependency(
1192:                        factory.createClass("inbound.Inbound", true));
1193:                factory.createClass("empty.Empty", true);
1194:
1195:                visitor.setShowInbounds(false);
1196:                visitor.setShowOutbounds(false);
1197:
1198:                visitor.traverseNodes(factory.getPackages().values());
1199:
1200:                int lineNumber = 0;
1201:                BufferedReader in = new BufferedReader(new StringReader(out
1202:                        .toString()));
1203:
1204:                assertEquals("line " + ++lineNumber,
1205:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
1206:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
1207:                                .readLine());
1208:                assertEquals("line " + ++lineNumber,
1209:                        "    <a class=\"scope\" href=\"" + PREFIX
1210:                                + "empty.Empty" + SUFFIX
1211:                                + "\" id=\"empty.Empty\">Empty</a>", in
1212:                                .readLine());
1213:                assertEquals("line " + ++lineNumber,
1214:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
1215:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
1216:                                .readLine());
1217:                assertEquals("line " + ++lineNumber,
1218:                        "    <a class=\"scope\" href=\"" + PREFIX
1219:                                + "inbound.Inbound" + SUFFIX
1220:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
1221:                                .readLine());
1222:                assertEquals("line " + ++lineNumber,
1223:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
1224:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
1225:                        in.readLine());
1226:                assertEquals("line " + ++lineNumber,
1227:                        "    <a class=\"scope\" href=\"" + PREFIX
1228:                                + "outbound.Outbound" + SUFFIX
1229:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
1230:                        in.readLine());
1231:
1232:                assertEquals("End of file", null, in.readLine());
1233:            }
1234:
1235:            public void testShowOutboundsInnerClass() throws IOException {
1236:                factory.createClass("outbound.Outbound$Outbound", true)
1237:                        .addDependency(
1238:                                factory.createClass("inbound.Inbound$Inbound",
1239:                                        true));
1240:                factory.createClass("empty.Empty$Empty", true);
1241:
1242:                visitor.setShowInbounds(false);
1243:                visitor.setShowOutbounds(true);
1244:
1245:                visitor.traverseNodes(factory.getPackages().values());
1246:
1247:                int lineNumber = 0;
1248:                BufferedReader in = new BufferedReader(new StringReader(out
1249:                        .toString()));
1250:
1251:                assertEquals("line " + ++lineNumber,
1252:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
1253:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
1254:                                .readLine());
1255:                assertEquals(
1256:                        "line " + ++lineNumber,
1257:                        "    <a class=\"scope\" href=\"" + PREFIX
1258:                                + "empty.Empty\\$Empty" + SUFFIX
1259:                                + "\" id=\"empty.Empty$Empty\">Empty$Empty</a>",
1260:                        in.readLine());
1261:                assertEquals("line " + ++lineNumber,
1262:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
1263:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
1264:                                .readLine());
1265:                assertEquals(
1266:                        "line " + ++lineNumber,
1267:                        "    <a class=\"scope\" href=\""
1268:                                + PREFIX
1269:                                + "inbound.Inbound\\$Inbound"
1270:                                + SUFFIX
1271:                                + "\" id=\"inbound.Inbound$Inbound\">Inbound$Inbound</a>",
1272:                        in.readLine());
1273:                assertEquals("line " + ++lineNumber,
1274:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
1275:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
1276:                        in.readLine());
1277:                assertEquals(
1278:                        "line " + ++lineNumber,
1279:                        "    <a class=\"scope\" href=\""
1280:                                + PREFIX
1281:                                + "outbound.Outbound\\$Outbound"
1282:                                + SUFFIX
1283:                                + "\" id=\"outbound.Outbound$Outbound\">Outbound$Outbound</a>",
1284:                        in.readLine());
1285:                assertEquals(
1286:                        "line " + ++lineNumber,
1287:                        "        --&gt; <a href=\""
1288:                                + PREFIX
1289:                                + "inbound.Inbound\\$Inbound"
1290:                                + SUFFIX
1291:                                + "\" id=\"outbound.Outbound$Outbound_to_inbound.Inbound$Inbound\">inbound.Inbound$Inbound</a>",
1292:                        in.readLine());
1293:
1294:                assertEquals("End of file", null, in.readLine());
1295:            }
1296:
1297:            public void testShowOutboundsFeatureTrueWithInferred()
1298:                    throws IOException {
1299:                factory
1300:                        .createFeature("outbound.Outbound.outbound()")
1301:                        .addDependency(
1302:                                factory
1303:                                        .createFeature("inbound.Inbound.inbound()"));
1304:                factory.createFeature("empty.Empty.empty()");
1305:
1306:                visitor.setShowInbounds(false);
1307:                visitor.setShowOutbounds(true);
1308:
1309:                visitor.traverseNodes(factory.getPackages().values());
1310:
1311:                int lineNumber = 0;
1312:                BufferedReader in = new BufferedReader(new StringReader(out
1313:                        .toString()));
1314:
1315:                assertEquals("line " + ++lineNumber,
1316:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1317:                                + PREFIX + "empty" + SUFFIX
1318:                                + "\" id=\"empty\">empty</a> *</span>", in
1319:                                .readLine());
1320:                assertEquals("line " + ++lineNumber,
1321:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1322:                                + PREFIX + "empty.Empty" + SUFFIX
1323:                                + "\" id=\"empty.Empty\">Empty</a> *</span>",
1324:                        in.readLine());
1325:                assertEquals(
1326:                        "line " + ++lineNumber,
1327:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1328:                                + PREFIX
1329:                                + "empty.Empty.empty\\(\\)"
1330:                                + SUFFIX
1331:                                + "\" id=\"empty.Empty.empty()\">empty()</a> *</span>",
1332:                        in.readLine());
1333:                assertEquals("line " + ++lineNumber,
1334:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1335:                                + PREFIX + "inbound" + SUFFIX
1336:                                + "\" id=\"inbound\">inbound</a> *</span>", in
1337:                                .readLine());
1338:                assertEquals(
1339:                        "line " + ++lineNumber,
1340:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1341:                                + PREFIX
1342:                                + "inbound.Inbound"
1343:                                + SUFFIX
1344:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
1345:                        in.readLine());
1346:                assertEquals(
1347:                        "line " + ++lineNumber,
1348:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1349:                                + PREFIX
1350:                                + "inbound.Inbound.inbound\\(\\)"
1351:                                + SUFFIX
1352:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a> *</span>",
1353:                        in.readLine());
1354:                assertEquals("line " + ++lineNumber,
1355:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1356:                                + PREFIX + "outbound" + SUFFIX
1357:                                + "\" id=\"outbound\">outbound</a> *</span>",
1358:                        in.readLine());
1359:                assertEquals(
1360:                        "line " + ++lineNumber,
1361:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1362:                                + PREFIX
1363:                                + "outbound.Outbound"
1364:                                + SUFFIX
1365:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
1366:                        in.readLine());
1367:                assertEquals(
1368:                        "line " + ++lineNumber,
1369:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1370:                                + PREFIX
1371:                                + "outbound.Outbound.outbound\\(\\)"
1372:                                + SUFFIX
1373:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a> *</span>",
1374:                        in.readLine());
1375:                assertEquals(
1376:                        "line " + ++lineNumber,
1377:                        "            <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
1378:                                + PREFIX
1379:                                + "inbound.Inbound.inbound\\(\\)"
1380:                                + SUFFIX
1381:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a> *</span>",
1382:                        in.readLine());
1383:
1384:                assertEquals("End of file", null, in.readLine());
1385:            }
1386:
1387:            public void testShowOutboundsFeatureTrueWithConfirmed()
1388:                    throws IOException {
1389:                factory.createFeature("outbound.Outbound.outbound()", true)
1390:                        .addDependency(
1391:                                factory.createFeature(
1392:                                        "inbound.Inbound.inbound()", true));
1393:                factory.createFeature("empty.Empty.empty()", true);
1394:
1395:                visitor.setShowInbounds(false);
1396:                visitor.setShowOutbounds(true);
1397:
1398:                visitor.traverseNodes(factory.getPackages().values());
1399:
1400:                int lineNumber = 0;
1401:                BufferedReader in = new BufferedReader(new StringReader(out
1402:                        .toString()));
1403:
1404:                assertEquals("line " + ++lineNumber,
1405:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
1406:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
1407:                                .readLine());
1408:                assertEquals("line " + ++lineNumber,
1409:                        "    <a class=\"scope\" href=\"" + PREFIX
1410:                                + "empty.Empty" + SUFFIX
1411:                                + "\" id=\"empty.Empty\">Empty</a>", in
1412:                                .readLine());
1413:                assertEquals("line " + ++lineNumber,
1414:                        "        <a class=\"scope\" href=\"" + PREFIX
1415:                                + "empty.Empty.empty\\(\\)" + SUFFIX
1416:                                + "\" id=\"empty.Empty.empty()\">empty()</a>",
1417:                        in.readLine());
1418:                assertEquals("line " + ++lineNumber,
1419:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
1420:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
1421:                                .readLine());
1422:                assertEquals("line " + ++lineNumber,
1423:                        "    <a class=\"scope\" href=\"" + PREFIX
1424:                                + "inbound.Inbound" + SUFFIX
1425:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
1426:                                .readLine());
1427:                assertEquals(
1428:                        "line " + ++lineNumber,
1429:                        "        <a class=\"scope\" href=\""
1430:                                + PREFIX
1431:                                + "inbound.Inbound.inbound\\(\\)"
1432:                                + SUFFIX
1433:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
1434:                        in.readLine());
1435:                assertEquals("line " + ++lineNumber,
1436:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
1437:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
1438:                        in.readLine());
1439:                assertEquals("line " + ++lineNumber,
1440:                        "    <a class=\"scope\" href=\"" + PREFIX
1441:                                + "outbound.Outbound" + SUFFIX
1442:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
1443:                        in.readLine());
1444:                assertEquals(
1445:                        "line " + ++lineNumber,
1446:                        "        <a class=\"scope\" href=\""
1447:                                + PREFIX
1448:                                + "outbound.Outbound.outbound\\(\\)"
1449:                                + SUFFIX
1450:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
1451:                        in.readLine());
1452:                assertEquals(
1453:                        "line " + ++lineNumber,
1454:                        "            --&gt; <a href=\""
1455:                                + PREFIX
1456:                                + "inbound.Inbound.inbound\\(\\)"
1457:                                + SUFFIX
1458:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a>",
1459:                        in.readLine());
1460:
1461:                assertEquals("End of file", null, in.readLine());
1462:            }
1463:
1464:            public void testShowOutboundsFeatureFalseWithInferred()
1465:                    throws IOException {
1466:                factory
1467:                        .createFeature("outbound.Outbound.outbound()")
1468:                        .addDependency(
1469:                                factory
1470:                                        .createFeature("inbound.Inbound.inbound()"));
1471:                factory.createFeature("empty.Empty.empty()");
1472:
1473:                visitor.setShowInbounds(false);
1474:                visitor.setShowOutbounds(false);
1475:
1476:                visitor.traverseNodes(factory.getPackages().values());
1477:
1478:                int lineNumber = 0;
1479:                BufferedReader in = new BufferedReader(new StringReader(out
1480:                        .toString()));
1481:
1482:                assertEquals("line " + ++lineNumber,
1483:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1484:                                + PREFIX + "empty" + SUFFIX
1485:                                + "\" id=\"empty\">empty</a> *</span>", in
1486:                                .readLine());
1487:                assertEquals("line " + ++lineNumber,
1488:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1489:                                + PREFIX + "empty.Empty" + SUFFIX
1490:                                + "\" id=\"empty.Empty\">Empty</a> *</span>",
1491:                        in.readLine());
1492:                assertEquals(
1493:                        "line " + ++lineNumber,
1494:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1495:                                + PREFIX
1496:                                + "empty.Empty.empty\\(\\)"
1497:                                + SUFFIX
1498:                                + "\" id=\"empty.Empty.empty()\">empty()</a> *</span>",
1499:                        in.readLine());
1500:                assertEquals("line " + ++lineNumber,
1501:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1502:                                + PREFIX + "inbound" + SUFFIX
1503:                                + "\" id=\"inbound\">inbound</a> *</span>", in
1504:                                .readLine());
1505:                assertEquals(
1506:                        "line " + ++lineNumber,
1507:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1508:                                + PREFIX
1509:                                + "inbound.Inbound"
1510:                                + SUFFIX
1511:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
1512:                        in.readLine());
1513:                assertEquals(
1514:                        "line " + ++lineNumber,
1515:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1516:                                + PREFIX
1517:                                + "inbound.Inbound.inbound\\(\\)"
1518:                                + SUFFIX
1519:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a> *</span>",
1520:                        in.readLine());
1521:                assertEquals("line " + ++lineNumber,
1522:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1523:                                + PREFIX + "outbound" + SUFFIX
1524:                                + "\" id=\"outbound\">outbound</a> *</span>",
1525:                        in.readLine());
1526:                assertEquals(
1527:                        "line " + ++lineNumber,
1528:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1529:                                + PREFIX
1530:                                + "outbound.Outbound"
1531:                                + SUFFIX
1532:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
1533:                        in.readLine());
1534:                assertEquals(
1535:                        "line " + ++lineNumber,
1536:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1537:                                + PREFIX
1538:                                + "outbound.Outbound.outbound\\(\\)"
1539:                                + SUFFIX
1540:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a> *</span>",
1541:                        in.readLine());
1542:
1543:                assertEquals("End of file", null, in.readLine());
1544:            }
1545:
1546:            public void testShowOutboundsFeatureFalseWithConfirmed()
1547:                    throws IOException {
1548:                factory.createFeature("outbound.Outbound.outbound()", true)
1549:                        .addDependency(
1550:                                factory.createFeature(
1551:                                        "inbound.Inbound.inbound()", true));
1552:                factory.createFeature("empty.Empty.empty()", true);
1553:
1554:                visitor.setShowInbounds(false);
1555:                visitor.setShowOutbounds(false);
1556:
1557:                visitor.traverseNodes(factory.getPackages().values());
1558:
1559:                int lineNumber = 0;
1560:                BufferedReader in = new BufferedReader(new StringReader(out
1561:                        .toString()));
1562:
1563:                assertEquals("line " + ++lineNumber,
1564:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
1565:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
1566:                                .readLine());
1567:                assertEquals("line " + ++lineNumber,
1568:                        "    <a class=\"scope\" href=\"" + PREFIX
1569:                                + "empty.Empty" + SUFFIX
1570:                                + "\" id=\"empty.Empty\">Empty</a>", in
1571:                                .readLine());
1572:                assertEquals("line " + ++lineNumber,
1573:                        "        <a class=\"scope\" href=\"" + PREFIX
1574:                                + "empty.Empty.empty\\(\\)" + SUFFIX
1575:                                + "\" id=\"empty.Empty.empty()\">empty()</a>",
1576:                        in.readLine());
1577:                assertEquals("line " + ++lineNumber,
1578:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
1579:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
1580:                                .readLine());
1581:                assertEquals("line " + ++lineNumber,
1582:                        "    <a class=\"scope\" href=\"" + PREFIX
1583:                                + "inbound.Inbound" + SUFFIX
1584:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
1585:                                .readLine());
1586:                assertEquals(
1587:                        "line " + ++lineNumber,
1588:                        "        <a class=\"scope\" href=\""
1589:                                + PREFIX
1590:                                + "inbound.Inbound.inbound\\(\\)"
1591:                                + SUFFIX
1592:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
1593:                        in.readLine());
1594:                assertEquals("line " + ++lineNumber,
1595:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
1596:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
1597:                        in.readLine());
1598:                assertEquals("line " + ++lineNumber,
1599:                        "    <a class=\"scope\" href=\"" + PREFIX
1600:                                + "outbound.Outbound" + SUFFIX
1601:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
1602:                        in.readLine());
1603:                assertEquals(
1604:                        "line " + ++lineNumber,
1605:                        "        <a class=\"scope\" href=\""
1606:                                + PREFIX
1607:                                + "outbound.Outbound.outbound\\(\\)"
1608:                                + SUFFIX
1609:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
1610:                        in.readLine());
1611:
1612:                assertEquals("End of file", null, in.readLine());
1613:            }
1614:
1615:            public void testShowOutboundsInnerClassFeature() throws IOException {
1616:                factory.createFeature("outbound.Outbound$Outbound.outbound()",
1617:                        true).addDependency(
1618:                        factory.createFeature(
1619:                                "inbound.Inbound$Inbound.inbound()", true));
1620:                factory.createFeature("empty.Empty$Empty.empty()", true);
1621:
1622:                visitor.setShowInbounds(false);
1623:                visitor.setShowOutbounds(true);
1624:
1625:                visitor.traverseNodes(factory.getPackages().values());
1626:
1627:                int lineNumber = 0;
1628:                BufferedReader in = new BufferedReader(new StringReader(out
1629:                        .toString()));
1630:
1631:                assertEquals("line " + ++lineNumber,
1632:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
1633:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
1634:                                .readLine());
1635:                assertEquals(
1636:                        "line " + ++lineNumber,
1637:                        "    <a class=\"scope\" href=\"" + PREFIX
1638:                                + "empty.Empty\\$Empty" + SUFFIX
1639:                                + "\" id=\"empty.Empty$Empty\">Empty$Empty</a>",
1640:                        in.readLine());
1641:                assertEquals(
1642:                        "line " + ++lineNumber,
1643:                        "        <a class=\"scope\" href=\""
1644:                                + PREFIX
1645:                                + "empty.Empty\\$Empty.empty\\(\\)"
1646:                                + SUFFIX
1647:                                + "\" id=\"empty.Empty$Empty.empty()\">empty()</a>",
1648:                        in.readLine());
1649:                assertEquals("line " + ++lineNumber,
1650:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
1651:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
1652:                                .readLine());
1653:                assertEquals(
1654:                        "line " + ++lineNumber,
1655:                        "    <a class=\"scope\" href=\""
1656:                                + PREFIX
1657:                                + "inbound.Inbound\\$Inbound"
1658:                                + SUFFIX
1659:                                + "\" id=\"inbound.Inbound$Inbound\">Inbound$Inbound</a>",
1660:                        in.readLine());
1661:                assertEquals(
1662:                        "line " + ++lineNumber,
1663:                        "        <a class=\"scope\" href=\""
1664:                                + PREFIX
1665:                                + "inbound.Inbound\\$Inbound.inbound\\(\\)"
1666:                                + SUFFIX
1667:                                + "\" id=\"inbound.Inbound$Inbound.inbound()\">inbound()</a>",
1668:                        in.readLine());
1669:                assertEquals("line " + ++lineNumber,
1670:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
1671:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
1672:                        in.readLine());
1673:                assertEquals(
1674:                        "line " + ++lineNumber,
1675:                        "    <a class=\"scope\" href=\""
1676:                                + PREFIX
1677:                                + "outbound.Outbound\\$Outbound"
1678:                                + SUFFIX
1679:                                + "\" id=\"outbound.Outbound$Outbound\">Outbound$Outbound</a>",
1680:                        in.readLine());
1681:                assertEquals(
1682:                        "line " + ++lineNumber,
1683:                        "        <a class=\"scope\" href=\""
1684:                                + PREFIX
1685:                                + "outbound.Outbound\\$Outbound.outbound\\(\\)"
1686:                                + SUFFIX
1687:                                + "\" id=\"outbound.Outbound$Outbound.outbound()\">outbound()</a>",
1688:                        in.readLine());
1689:                assertEquals(
1690:                        "line " + ++lineNumber,
1691:                        "            --&gt; <a href=\""
1692:                                + PREFIX
1693:                                + "inbound.Inbound\\$Inbound.inbound\\(\\)"
1694:                                + SUFFIX
1695:                                + "\" id=\"outbound.Outbound$Outbound.outbound()_to_inbound.Inbound$Inbound.inbound()\">inbound.Inbound$Inbound.inbound()</a>",
1696:                        in.readLine());
1697:
1698:                assertEquals("End of file", null, in.readLine());
1699:            }
1700:
1701:            public void testShowEmptyPackageTrueWithInferred()
1702:                    throws IOException {
1703:                factory.createPackage("outbound").addDependency(
1704:                        factory.createPackage("inbound"));
1705:                factory.createClass("outbound.Outbound").addDependency(
1706:                        factory.createClass("inbound.Inbound"));
1707:                factory
1708:                        .createFeature("outbound.Outbound.outbound()")
1709:                        .addDependency(
1710:                                factory
1711:                                        .createFeature("inbound.Inbound.inbound()"));
1712:                factory.createPackage("empty");
1713:
1714:                visitor.setShowEmptyNodes(true);
1715:
1716:                visitor.traverseNodes(factory.getPackages().values());
1717:
1718:                int lineNumber = 0;
1719:                BufferedReader in = new BufferedReader(new StringReader(out
1720:                        .toString()));
1721:
1722:                assertEquals("line " + ++lineNumber,
1723:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1724:                                + PREFIX + "empty" + SUFFIX
1725:                                + "\" id=\"empty\">empty</a> *</span>", in
1726:                                .readLine());
1727:                assertEquals("line " + ++lineNumber,
1728:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1729:                                + PREFIX + "inbound" + SUFFIX
1730:                                + "\" id=\"inbound\">inbound</a> *</span>", in
1731:                                .readLine());
1732:                assertEquals(
1733:                        "line " + ++lineNumber,
1734:                        "    <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
1735:                                + PREFIX
1736:                                + "outbound"
1737:                                + SUFFIX
1738:                                + "\" id=\"inbound_from_outbound\">outbound</a> *</span>",
1739:                        in.readLine());
1740:                assertEquals(
1741:                        "line " + ++lineNumber,
1742:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1743:                                + PREFIX
1744:                                + "inbound.Inbound"
1745:                                + SUFFIX
1746:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
1747:                        in.readLine());
1748:                assertEquals(
1749:                        "line " + ++lineNumber,
1750:                        "        <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
1751:                                + PREFIX
1752:                                + "outbound.Outbound"
1753:                                + SUFFIX
1754:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a> *</span>",
1755:                        in.readLine());
1756:                assertEquals(
1757:                        "line " + ++lineNumber,
1758:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1759:                                + PREFIX
1760:                                + "inbound.Inbound.inbound\\(\\)"
1761:                                + SUFFIX
1762:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a> *</span>",
1763:                        in.readLine());
1764:                assertEquals(
1765:                        "line " + ++lineNumber,
1766:                        "            <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
1767:                                + PREFIX
1768:                                + "outbound.Outbound.outbound\\(\\)"
1769:                                + SUFFIX
1770:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a> *</span>",
1771:                        in.readLine());
1772:                assertEquals("line " + ++lineNumber,
1773:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
1774:                                + PREFIX + "outbound" + SUFFIX
1775:                                + "\" id=\"outbound\">outbound</a> *</span>",
1776:                        in.readLine());
1777:                assertEquals(
1778:                        "line " + ++lineNumber,
1779:                        "    <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
1780:                                + PREFIX
1781:                                + "inbound"
1782:                                + SUFFIX
1783:                                + "\" id=\"outbound_to_inbound\">inbound</a> *</span>",
1784:                        in.readLine());
1785:                assertEquals(
1786:                        "line " + ++lineNumber,
1787:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1788:                                + PREFIX
1789:                                + "outbound.Outbound"
1790:                                + SUFFIX
1791:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
1792:                        in.readLine());
1793:                assertEquals(
1794:                        "line " + ++lineNumber,
1795:                        "        <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
1796:                                + PREFIX
1797:                                + "inbound.Inbound"
1798:                                + SUFFIX
1799:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a> *</span>",
1800:                        in.readLine());
1801:                assertEquals(
1802:                        "line " + ++lineNumber,
1803:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
1804:                                + PREFIX
1805:                                + "outbound.Outbound.outbound\\(\\)"
1806:                                + SUFFIX
1807:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a> *</span>",
1808:                        in.readLine());
1809:                assertEquals(
1810:                        "line " + ++lineNumber,
1811:                        "            <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
1812:                                + PREFIX
1813:                                + "inbound.Inbound.inbound\\(\\)"
1814:                                + SUFFIX
1815:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a> *</span>",
1816:                        in.readLine());
1817:
1818:                assertEquals("End of file", null, in.readLine());
1819:            }
1820:
1821:            public void testSetFlagInferredToFalse() throws IOException {
1822:                factory.createPackage("outbound").addDependency(
1823:                        factory.createPackage("inbound"));
1824:                factory.createClass("outbound.Outbound").addDependency(
1825:                        factory.createClass("inbound.Inbound"));
1826:                factory
1827:                        .createFeature("outbound.Outbound.outbound()")
1828:                        .addDependency(
1829:                                factory
1830:                                        .createFeature("inbound.Inbound.inbound()"));
1831:                factory.createPackage("empty");
1832:
1833:                visitor.setShowInferred(false);
1834:
1835:                visitor.traverseNodes(factory.getPackages().values());
1836:
1837:                int lineNumber = 0;
1838:                BufferedReader in = new BufferedReader(new StringReader(out
1839:                        .toString()));
1840:
1841:                assertEquals("line " + ++lineNumber,
1842:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
1843:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
1844:                                .readLine());
1845:                assertEquals("line " + ++lineNumber,
1846:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
1847:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
1848:                                .readLine());
1849:                assertEquals("line " + ++lineNumber, "    &lt;-- <a href=\""
1850:                        + PREFIX + "outbound" + SUFFIX
1851:                        + "\" id=\"inbound_from_outbound\">outbound</a>", in
1852:                        .readLine());
1853:                assertEquals("line " + ++lineNumber,
1854:                        "    <a class=\"scope\" href=\"" + PREFIX
1855:                                + "inbound.Inbound" + SUFFIX
1856:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
1857:                                .readLine());
1858:                assertEquals(
1859:                        "line " + ++lineNumber,
1860:                        "        &lt;-- <a href=\""
1861:                                + PREFIX
1862:                                + "outbound.Outbound"
1863:                                + SUFFIX
1864:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a>",
1865:                        in.readLine());
1866:                assertEquals(
1867:                        "line " + ++lineNumber,
1868:                        "        <a class=\"scope\" href=\""
1869:                                + PREFIX
1870:                                + "inbound.Inbound.inbound\\(\\)"
1871:                                + SUFFIX
1872:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
1873:                        in.readLine());
1874:                assertEquals(
1875:                        "line " + ++lineNumber,
1876:                        "            &lt;-- <a href=\""
1877:                                + PREFIX
1878:                                + "outbound.Outbound.outbound\\(\\)"
1879:                                + SUFFIX
1880:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a>",
1881:                        in.readLine());
1882:                assertEquals("line " + ++lineNumber,
1883:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
1884:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
1885:                        in.readLine());
1886:                assertEquals("line " + ++lineNumber, "    --&gt; <a href=\""
1887:                        + PREFIX + "inbound" + SUFFIX
1888:                        + "\" id=\"outbound_to_inbound\">inbound</a>", in
1889:                        .readLine());
1890:                assertEquals("line " + ++lineNumber,
1891:                        "    <a class=\"scope\" href=\"" + PREFIX
1892:                                + "outbound.Outbound" + SUFFIX
1893:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
1894:                        in.readLine());
1895:                assertEquals(
1896:                        "line " + ++lineNumber,
1897:                        "        --&gt; <a href=\""
1898:                                + PREFIX
1899:                                + "inbound.Inbound"
1900:                                + SUFFIX
1901:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a>",
1902:                        in.readLine());
1903:                assertEquals(
1904:                        "line " + ++lineNumber,
1905:                        "        <a class=\"scope\" href=\""
1906:                                + PREFIX
1907:                                + "outbound.Outbound.outbound\\(\\)"
1908:                                + SUFFIX
1909:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
1910:                        in.readLine());
1911:                assertEquals(
1912:                        "line " + ++lineNumber,
1913:                        "            --&gt; <a href=\""
1914:                                + PREFIX
1915:                                + "inbound.Inbound.inbound\\(\\)"
1916:                                + SUFFIX
1917:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a>",
1918:                        in.readLine());
1919:
1920:                assertEquals("End of file", null, in.readLine());
1921:            }
1922:
1923:            public void testShowEmptyPackageTrueWithConfirmed()
1924:                    throws IOException {
1925:                factory.createPackage("outbound", true).addDependency(
1926:                        factory.createPackage("inbound", true));
1927:                factory.createClass("outbound.Outbound", true).addDependency(
1928:                        factory.createClass("inbound.Inbound", true));
1929:                factory.createFeature("outbound.Outbound.outbound()", true)
1930:                        .addDependency(
1931:                                factory.createFeature(
1932:                                        "inbound.Inbound.inbound()", true));
1933:                factory.createPackage("empty", true);
1934:
1935:                visitor.setShowEmptyNodes(true);
1936:
1937:                visitor.traverseNodes(factory.getPackages().values());
1938:
1939:                int lineNumber = 0;
1940:                BufferedReader in = new BufferedReader(new StringReader(out
1941:                        .toString()));
1942:
1943:                assertEquals("line " + ++lineNumber,
1944:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
1945:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
1946:                                .readLine());
1947:                assertEquals("line " + ++lineNumber,
1948:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
1949:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
1950:                                .readLine());
1951:                assertEquals("line " + ++lineNumber, "    &lt;-- <a href=\""
1952:                        + PREFIX + "outbound" + SUFFIX
1953:                        + "\" id=\"inbound_from_outbound\">outbound</a>", in
1954:                        .readLine());
1955:                assertEquals("line " + ++lineNumber,
1956:                        "    <a class=\"scope\" href=\"" + PREFIX
1957:                                + "inbound.Inbound" + SUFFIX
1958:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
1959:                                .readLine());
1960:                assertEquals(
1961:                        "line " + ++lineNumber,
1962:                        "        &lt;-- <a href=\""
1963:                                + PREFIX
1964:                                + "outbound.Outbound"
1965:                                + SUFFIX
1966:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a>",
1967:                        in.readLine());
1968:                assertEquals(
1969:                        "line " + ++lineNumber,
1970:                        "        <a class=\"scope\" href=\""
1971:                                + PREFIX
1972:                                + "inbound.Inbound.inbound\\(\\)"
1973:                                + SUFFIX
1974:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
1975:                        in.readLine());
1976:                assertEquals(
1977:                        "line " + ++lineNumber,
1978:                        "            &lt;-- <a href=\""
1979:                                + PREFIX
1980:                                + "outbound.Outbound.outbound\\(\\)"
1981:                                + SUFFIX
1982:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a>",
1983:                        in.readLine());
1984:                assertEquals("line " + ++lineNumber,
1985:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
1986:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
1987:                        in.readLine());
1988:                assertEquals("line " + ++lineNumber, "    --&gt; <a href=\""
1989:                        + PREFIX + "inbound" + SUFFIX
1990:                        + "\" id=\"outbound_to_inbound\">inbound</a>", in
1991:                        .readLine());
1992:                assertEquals("line " + ++lineNumber,
1993:                        "    <a class=\"scope\" href=\"" + PREFIX
1994:                                + "outbound.Outbound" + SUFFIX
1995:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
1996:                        in.readLine());
1997:                assertEquals(
1998:                        "line " + ++lineNumber,
1999:                        "        --&gt; <a href=\""
2000:                                + PREFIX
2001:                                + "inbound.Inbound"
2002:                                + SUFFIX
2003:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a>",
2004:                        in.readLine());
2005:                assertEquals(
2006:                        "line " + ++lineNumber,
2007:                        "        <a class=\"scope\" href=\""
2008:                                + PREFIX
2009:                                + "outbound.Outbound.outbound\\(\\)"
2010:                                + SUFFIX
2011:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
2012:                        in.readLine());
2013:                assertEquals(
2014:                        "line " + ++lineNumber,
2015:                        "            --&gt; <a href=\""
2016:                                + PREFIX
2017:                                + "inbound.Inbound.inbound\\(\\)"
2018:                                + SUFFIX
2019:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a>",
2020:                        in.readLine());
2021:
2022:                assertEquals("End of file", null, in.readLine());
2023:            }
2024:
2025:            public void testShowEmptyPackageFalseWithInferred()
2026:                    throws IOException {
2027:                factory.createPackage("outbound").addDependency(
2028:                        factory.createPackage("inbound"));
2029:                factory.createClass("outbound.Outbound").addDependency(
2030:                        factory.createClass("inbound.Inbound"));
2031:                factory
2032:                        .createFeature("outbound.Outbound.outbound()")
2033:                        .addDependency(
2034:                                factory
2035:                                        .createFeature("inbound.Inbound.inbound()"));
2036:                factory.createPackage("empty");
2037:
2038:                visitor.setShowEmptyNodes(false);
2039:
2040:                visitor.traverseNodes(factory.getPackages().values());
2041:
2042:                int lineNumber = 0;
2043:                BufferedReader in = new BufferedReader(new StringReader(out
2044:                        .toString()));
2045:
2046:                assertEquals("line " + ++lineNumber,
2047:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2048:                                + PREFIX + "inbound" + SUFFIX
2049:                                + "\" id=\"inbound\">inbound</a> *</span>", in
2050:                                .readLine());
2051:                assertEquals(
2052:                        "line " + ++lineNumber,
2053:                        "    <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
2054:                                + PREFIX
2055:                                + "outbound"
2056:                                + SUFFIX
2057:                                + "\" id=\"inbound_from_outbound\">outbound</a> *</span>",
2058:                        in.readLine());
2059:                assertEquals(
2060:                        "line " + ++lineNumber,
2061:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2062:                                + PREFIX
2063:                                + "inbound.Inbound"
2064:                                + SUFFIX
2065:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
2066:                        in.readLine());
2067:                assertEquals(
2068:                        "line " + ++lineNumber,
2069:                        "        <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
2070:                                + PREFIX
2071:                                + "outbound.Outbound"
2072:                                + SUFFIX
2073:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a> *</span>",
2074:                        in.readLine());
2075:                assertEquals(
2076:                        "line " + ++lineNumber,
2077:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2078:                                + PREFIX
2079:                                + "inbound.Inbound.inbound\\(\\)"
2080:                                + SUFFIX
2081:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a> *</span>",
2082:                        in.readLine());
2083:                assertEquals(
2084:                        "line " + ++lineNumber,
2085:                        "            <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
2086:                                + PREFIX
2087:                                + "outbound.Outbound.outbound\\(\\)"
2088:                                + SUFFIX
2089:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a> *</span>",
2090:                        in.readLine());
2091:                assertEquals("line " + ++lineNumber,
2092:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2093:                                + PREFIX + "outbound" + SUFFIX
2094:                                + "\" id=\"outbound\">outbound</a> *</span>",
2095:                        in.readLine());
2096:                assertEquals(
2097:                        "line " + ++lineNumber,
2098:                        "    <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
2099:                                + PREFIX
2100:                                + "inbound"
2101:                                + SUFFIX
2102:                                + "\" id=\"outbound_to_inbound\">inbound</a> *</span>",
2103:                        in.readLine());
2104:                assertEquals(
2105:                        "line " + ++lineNumber,
2106:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2107:                                + PREFIX
2108:                                + "outbound.Outbound"
2109:                                + SUFFIX
2110:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
2111:                        in.readLine());
2112:                assertEquals(
2113:                        "line " + ++lineNumber,
2114:                        "        <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
2115:                                + PREFIX
2116:                                + "inbound.Inbound"
2117:                                + SUFFIX
2118:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a> *</span>",
2119:                        in.readLine());
2120:                assertEquals(
2121:                        "line " + ++lineNumber,
2122:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2123:                                + PREFIX
2124:                                + "outbound.Outbound.outbound\\(\\)"
2125:                                + SUFFIX
2126:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a> *</span>",
2127:                        in.readLine());
2128:                assertEquals(
2129:                        "line " + ++lineNumber,
2130:                        "            <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
2131:                                + PREFIX
2132:                                + "inbound.Inbound.inbound\\(\\)"
2133:                                + SUFFIX
2134:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a> *</span>",
2135:                        in.readLine());
2136:
2137:                assertEquals("End of file", null, in.readLine());
2138:            }
2139:
2140:            public void testShowEmptyPackageFalseWithConfirmed()
2141:                    throws IOException {
2142:                factory.createPackage("outbound", true).addDependency(
2143:                        factory.createPackage("inbound", true));
2144:                factory.createClass("outbound.Outbound", true).addDependency(
2145:                        factory.createClass("inbound.Inbound", true));
2146:                factory.createFeature("outbound.Outbound.outbound()", true)
2147:                        .addDependency(
2148:                                factory.createFeature(
2149:                                        "inbound.Inbound.inbound()", true));
2150:                factory.createPackage("empty", true);
2151:
2152:                visitor.setShowEmptyNodes(false);
2153:
2154:                visitor.traverseNodes(factory.getPackages().values());
2155:
2156:                int lineNumber = 0;
2157:                BufferedReader in = new BufferedReader(new StringReader(out
2158:                        .toString()));
2159:
2160:                assertEquals("line " + ++lineNumber,
2161:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
2162:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
2163:                                .readLine());
2164:                assertEquals("line " + ++lineNumber, "    &lt;-- <a href=\""
2165:                        + PREFIX + "outbound" + SUFFIX
2166:                        + "\" id=\"inbound_from_outbound\">outbound</a>", in
2167:                        .readLine());
2168:                assertEquals("line " + ++lineNumber,
2169:                        "    <a class=\"scope\" href=\"" + PREFIX
2170:                                + "inbound.Inbound" + SUFFIX
2171:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
2172:                                .readLine());
2173:                assertEquals(
2174:                        "line " + ++lineNumber,
2175:                        "        &lt;-- <a href=\""
2176:                                + PREFIX
2177:                                + "outbound.Outbound"
2178:                                + SUFFIX
2179:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a>",
2180:                        in.readLine());
2181:                assertEquals(
2182:                        "line " + ++lineNumber,
2183:                        "        <a class=\"scope\" href=\""
2184:                                + PREFIX
2185:                                + "inbound.Inbound.inbound\\(\\)"
2186:                                + SUFFIX
2187:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
2188:                        in.readLine());
2189:                assertEquals(
2190:                        "line " + ++lineNumber,
2191:                        "            &lt;-- <a href=\""
2192:                                + PREFIX
2193:                                + "outbound.Outbound.outbound\\(\\)"
2194:                                + SUFFIX
2195:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a>",
2196:                        in.readLine());
2197:                assertEquals("line " + ++lineNumber,
2198:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
2199:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
2200:                        in.readLine());
2201:                assertEquals("line " + ++lineNumber, "    --&gt; <a href=\""
2202:                        + PREFIX + "inbound" + SUFFIX
2203:                        + "\" id=\"outbound_to_inbound\">inbound</a>", in
2204:                        .readLine());
2205:                assertEquals("line " + ++lineNumber,
2206:                        "    <a class=\"scope\" href=\"" + PREFIX
2207:                                + "outbound.Outbound" + SUFFIX
2208:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
2209:                        in.readLine());
2210:                assertEquals(
2211:                        "line " + ++lineNumber,
2212:                        "        --&gt; <a href=\""
2213:                                + PREFIX
2214:                                + "inbound.Inbound"
2215:                                + SUFFIX
2216:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a>",
2217:                        in.readLine());
2218:                assertEquals(
2219:                        "line " + ++lineNumber,
2220:                        "        <a class=\"scope\" href=\""
2221:                                + PREFIX
2222:                                + "outbound.Outbound.outbound\\(\\)"
2223:                                + SUFFIX
2224:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
2225:                        in.readLine());
2226:                assertEquals(
2227:                        "line " + ++lineNumber,
2228:                        "            --&gt; <a href=\""
2229:                                + PREFIX
2230:                                + "inbound.Inbound.inbound\\(\\)"
2231:                                + SUFFIX
2232:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a>",
2233:                        in.readLine());
2234:
2235:                assertEquals("End of file", null, in.readLine());
2236:            }
2237:
2238:            public void testShowEmptyClassTrueWithInferred() throws IOException {
2239:                factory.createClass("outbound.Outbound").addDependency(
2240:                        factory.createClass("inbound.Inbound"));
2241:                factory
2242:                        .createFeature("outbound.Outbound.outbound()")
2243:                        .addDependency(
2244:                                factory
2245:                                        .createFeature("inbound.Inbound.inbound()"));
2246:                factory.createClass("empty.Empty");
2247:
2248:                visitor.setShowEmptyNodes(true);
2249:
2250:                visitor.traverseNodes(factory.getPackages().values());
2251:
2252:                int lineNumber = 0;
2253:                BufferedReader in = new BufferedReader(new StringReader(out
2254:                        .toString()));
2255:
2256:                assertEquals("line " + ++lineNumber,
2257:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2258:                                + PREFIX + "empty" + SUFFIX
2259:                                + "\" id=\"empty\">empty</a> *</span>", in
2260:                                .readLine());
2261:                assertEquals("line " + ++lineNumber,
2262:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2263:                                + PREFIX + "empty.Empty" + SUFFIX
2264:                                + "\" id=\"empty.Empty\">Empty</a> *</span>",
2265:                        in.readLine());
2266:                assertEquals("line " + ++lineNumber,
2267:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2268:                                + PREFIX + "inbound" + SUFFIX
2269:                                + "\" id=\"inbound\">inbound</a> *</span>", in
2270:                                .readLine());
2271:                assertEquals(
2272:                        "line " + ++lineNumber,
2273:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2274:                                + PREFIX
2275:                                + "inbound.Inbound"
2276:                                + SUFFIX
2277:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
2278:                        in.readLine());
2279:                assertEquals(
2280:                        "line " + ++lineNumber,
2281:                        "        <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
2282:                                + PREFIX
2283:                                + "outbound.Outbound"
2284:                                + SUFFIX
2285:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a> *</span>",
2286:                        in.readLine());
2287:                assertEquals(
2288:                        "line " + ++lineNumber,
2289:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2290:                                + PREFIX
2291:                                + "inbound.Inbound.inbound\\(\\)"
2292:                                + SUFFIX
2293:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a> *</span>",
2294:                        in.readLine());
2295:                assertEquals(
2296:                        "line " + ++lineNumber,
2297:                        "            <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
2298:                                + PREFIX
2299:                                + "outbound.Outbound.outbound\\(\\)"
2300:                                + SUFFIX
2301:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a> *</span>",
2302:                        in.readLine());
2303:                assertEquals("line " + ++lineNumber,
2304:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2305:                                + PREFIX + "outbound" + SUFFIX
2306:                                + "\" id=\"outbound\">outbound</a> *</span>",
2307:                        in.readLine());
2308:                assertEquals(
2309:                        "line " + ++lineNumber,
2310:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2311:                                + PREFIX
2312:                                + "outbound.Outbound"
2313:                                + SUFFIX
2314:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
2315:                        in.readLine());
2316:                assertEquals(
2317:                        "line " + ++lineNumber,
2318:                        "        <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
2319:                                + PREFIX
2320:                                + "inbound.Inbound"
2321:                                + SUFFIX
2322:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a> *</span>",
2323:                        in.readLine());
2324:                assertEquals(
2325:                        "line " + ++lineNumber,
2326:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2327:                                + PREFIX
2328:                                + "outbound.Outbound.outbound\\(\\)"
2329:                                + SUFFIX
2330:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a> *</span>",
2331:                        in.readLine());
2332:                assertEquals(
2333:                        "line " + ++lineNumber,
2334:                        "            <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
2335:                                + PREFIX
2336:                                + "inbound.Inbound.inbound\\(\\)"
2337:                                + SUFFIX
2338:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a> *</span>",
2339:                        in.readLine());
2340:
2341:                assertEquals("End of file", null, in.readLine());
2342:            }
2343:
2344:            public void testShowEmptyClassTrueWithConfirmed()
2345:                    throws IOException {
2346:                factory.createClass("outbound.Outbound", true).addDependency(
2347:                        factory.createClass("inbound.Inbound", true));
2348:                factory.createFeature("outbound.Outbound.outbound()", true)
2349:                        .addDependency(
2350:                                factory.createFeature(
2351:                                        "inbound.Inbound.inbound()", true));
2352:                factory.createClass("empty.Empty", true);
2353:
2354:                visitor.setShowEmptyNodes(true);
2355:
2356:                visitor.traverseNodes(factory.getPackages().values());
2357:
2358:                int lineNumber = 0;
2359:                BufferedReader in = new BufferedReader(new StringReader(out
2360:                        .toString()));
2361:
2362:                assertEquals("line " + ++lineNumber,
2363:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
2364:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
2365:                                .readLine());
2366:                assertEquals("line " + ++lineNumber,
2367:                        "    <a class=\"scope\" href=\"" + PREFIX
2368:                                + "empty.Empty" + SUFFIX
2369:                                + "\" id=\"empty.Empty\">Empty</a>", in
2370:                                .readLine());
2371:                assertEquals("line " + ++lineNumber,
2372:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
2373:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
2374:                                .readLine());
2375:                assertEquals("line " + ++lineNumber,
2376:                        "    <a class=\"scope\" href=\"" + PREFIX
2377:                                + "inbound.Inbound" + SUFFIX
2378:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
2379:                                .readLine());
2380:                assertEquals(
2381:                        "line " + ++lineNumber,
2382:                        "        &lt;-- <a href=\""
2383:                                + PREFIX
2384:                                + "outbound.Outbound"
2385:                                + SUFFIX
2386:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a>",
2387:                        in.readLine());
2388:                assertEquals(
2389:                        "line " + ++lineNumber,
2390:                        "        <a class=\"scope\" href=\""
2391:                                + PREFIX
2392:                                + "inbound.Inbound.inbound\\(\\)"
2393:                                + SUFFIX
2394:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
2395:                        in.readLine());
2396:                assertEquals(
2397:                        "line " + ++lineNumber,
2398:                        "            &lt;-- <a href=\""
2399:                                + PREFIX
2400:                                + "outbound.Outbound.outbound\\(\\)"
2401:                                + SUFFIX
2402:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a>",
2403:                        in.readLine());
2404:                assertEquals("line " + ++lineNumber,
2405:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
2406:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
2407:                        in.readLine());
2408:                assertEquals("line " + ++lineNumber,
2409:                        "    <a class=\"scope\" href=\"" + PREFIX
2410:                                + "outbound.Outbound" + SUFFIX
2411:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
2412:                        in.readLine());
2413:                assertEquals(
2414:                        "line " + ++lineNumber,
2415:                        "        --&gt; <a href=\""
2416:                                + PREFIX
2417:                                + "inbound.Inbound"
2418:                                + SUFFIX
2419:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a>",
2420:                        in.readLine());
2421:                assertEquals(
2422:                        "line " + ++lineNumber,
2423:                        "        <a class=\"scope\" href=\""
2424:                                + PREFIX
2425:                                + "outbound.Outbound.outbound\\(\\)"
2426:                                + SUFFIX
2427:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
2428:                        in.readLine());
2429:                assertEquals(
2430:                        "line " + ++lineNumber,
2431:                        "            --&gt; <a href=\""
2432:                                + PREFIX
2433:                                + "inbound.Inbound.inbound\\(\\)"
2434:                                + SUFFIX
2435:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a>",
2436:                        in.readLine());
2437:
2438:                assertEquals("End of file", null, in.readLine());
2439:            }
2440:
2441:            public void testShowEmptyClassFalseWithInferred()
2442:                    throws IOException {
2443:                factory.createClass("outbound.Outbound").addDependency(
2444:                        factory.createClass("inbound.Inbound"));
2445:                factory
2446:                        .createFeature("outbound.Outbound.outbound()")
2447:                        .addDependency(
2448:                                factory
2449:                                        .createFeature("inbound.Inbound.inbound()"));
2450:                factory.createClass("empty.Empty");
2451:
2452:                visitor.setShowEmptyNodes(false);
2453:
2454:                visitor.traverseNodes(factory.getPackages().values());
2455:
2456:                int lineNumber = 0;
2457:                BufferedReader in = new BufferedReader(new StringReader(out
2458:                        .toString()));
2459:
2460:                assertEquals("line " + ++lineNumber,
2461:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2462:                                + PREFIX + "inbound" + SUFFIX
2463:                                + "\" id=\"inbound\">inbound</a> *</span>", in
2464:                                .readLine());
2465:                assertEquals(
2466:                        "line " + ++lineNumber,
2467:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2468:                                + PREFIX
2469:                                + "inbound.Inbound"
2470:                                + SUFFIX
2471:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
2472:                        in.readLine());
2473:                assertEquals(
2474:                        "line " + ++lineNumber,
2475:                        "        <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
2476:                                + PREFIX
2477:                                + "outbound.Outbound"
2478:                                + SUFFIX
2479:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a> *</span>",
2480:                        in.readLine());
2481:                assertEquals(
2482:                        "line " + ++lineNumber,
2483:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2484:                                + PREFIX
2485:                                + "inbound.Inbound.inbound\\(\\)"
2486:                                + SUFFIX
2487:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a> *</span>",
2488:                        in.readLine());
2489:                assertEquals(
2490:                        "line " + ++lineNumber,
2491:                        "            <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
2492:                                + PREFIX
2493:                                + "outbound.Outbound.outbound\\(\\)"
2494:                                + SUFFIX
2495:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a> *</span>",
2496:                        in.readLine());
2497:                assertEquals("line " + ++lineNumber,
2498:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2499:                                + PREFIX + "outbound" + SUFFIX
2500:                                + "\" id=\"outbound\">outbound</a> *</span>",
2501:                        in.readLine());
2502:                assertEquals(
2503:                        "line " + ++lineNumber,
2504:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2505:                                + PREFIX
2506:                                + "outbound.Outbound"
2507:                                + SUFFIX
2508:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
2509:                        in.readLine());
2510:                assertEquals(
2511:                        "line " + ++lineNumber,
2512:                        "        <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
2513:                                + PREFIX
2514:                                + "inbound.Inbound"
2515:                                + SUFFIX
2516:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a> *</span>",
2517:                        in.readLine());
2518:                assertEquals(
2519:                        "line " + ++lineNumber,
2520:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2521:                                + PREFIX
2522:                                + "outbound.Outbound.outbound\\(\\)"
2523:                                + SUFFIX
2524:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a> *</span>",
2525:                        in.readLine());
2526:                assertEquals(
2527:                        "line " + ++lineNumber,
2528:                        "            <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
2529:                                + PREFIX
2530:                                + "inbound.Inbound.inbound\\(\\)"
2531:                                + SUFFIX
2532:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a> *</span>",
2533:                        in.readLine());
2534:
2535:                assertEquals("End of file", null, in.readLine());
2536:            }
2537:
2538:            public void testShowEmptyClassFalseWithConfirmed()
2539:                    throws IOException {
2540:                factory.createClass("outbound.Outbound", true).addDependency(
2541:                        factory.createClass("inbound.Inbound", true));
2542:                factory.createFeature("outbound.Outbound.outbound()", true)
2543:                        .addDependency(
2544:                                factory.createFeature(
2545:                                        "inbound.Inbound.inbound()", true));
2546:                factory.createClass("empty.Empty", true);
2547:
2548:                visitor.setShowEmptyNodes(false);
2549:
2550:                visitor.traverseNodes(factory.getPackages().values());
2551:
2552:                int lineNumber = 0;
2553:                BufferedReader in = new BufferedReader(new StringReader(out
2554:                        .toString()));
2555:
2556:                assertEquals("line " + ++lineNumber,
2557:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
2558:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
2559:                                .readLine());
2560:                assertEquals("line " + ++lineNumber,
2561:                        "    <a class=\"scope\" href=\"" + PREFIX
2562:                                + "inbound.Inbound" + SUFFIX
2563:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
2564:                                .readLine());
2565:                assertEquals(
2566:                        "line " + ++lineNumber,
2567:                        "        &lt;-- <a href=\""
2568:                                + PREFIX
2569:                                + "outbound.Outbound"
2570:                                + SUFFIX
2571:                                + "\" id=\"inbound.Inbound_from_outbound.Outbound\">outbound.Outbound</a>",
2572:                        in.readLine());
2573:                assertEquals(
2574:                        "line " + ++lineNumber,
2575:                        "        <a class=\"scope\" href=\""
2576:                                + PREFIX
2577:                                + "inbound.Inbound.inbound\\(\\)"
2578:                                + SUFFIX
2579:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
2580:                        in.readLine());
2581:                assertEquals(
2582:                        "line " + ++lineNumber,
2583:                        "            &lt;-- <a href=\""
2584:                                + PREFIX
2585:                                + "outbound.Outbound.outbound\\(\\)"
2586:                                + SUFFIX
2587:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a>",
2588:                        in.readLine());
2589:                assertEquals("line " + ++lineNumber,
2590:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
2591:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
2592:                        in.readLine());
2593:                assertEquals("line " + ++lineNumber,
2594:                        "    <a class=\"scope\" href=\"" + PREFIX
2595:                                + "outbound.Outbound" + SUFFIX
2596:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
2597:                        in.readLine());
2598:                assertEquals(
2599:                        "line " + ++lineNumber,
2600:                        "        --&gt; <a href=\""
2601:                                + PREFIX
2602:                                + "inbound.Inbound"
2603:                                + SUFFIX
2604:                                + "\" id=\"outbound.Outbound_to_inbound.Inbound\">inbound.Inbound</a>",
2605:                        in.readLine());
2606:                assertEquals(
2607:                        "line " + ++lineNumber,
2608:                        "        <a class=\"scope\" href=\""
2609:                                + PREFIX
2610:                                + "outbound.Outbound.outbound\\(\\)"
2611:                                + SUFFIX
2612:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
2613:                        in.readLine());
2614:                assertEquals(
2615:                        "line " + ++lineNumber,
2616:                        "            --&gt; <a href=\""
2617:                                + PREFIX
2618:                                + "inbound.Inbound.inbound\\(\\)"
2619:                                + SUFFIX
2620:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a>",
2621:                        in.readLine());
2622:
2623:                assertEquals("End of file", null, in.readLine());
2624:            }
2625:
2626:            public void testShowEmptyFeatureTrueWithInferred()
2627:                    throws IOException {
2628:                factory
2629:                        .createFeature("outbound.Outbound.outbound()")
2630:                        .addDependency(
2631:                                factory
2632:                                        .createFeature("inbound.Inbound.inbound()"));
2633:                factory.createFeature("empty.Empty.empty()");
2634:
2635:                visitor.setShowEmptyNodes(true);
2636:
2637:                visitor.traverseNodes(factory.getPackages().values());
2638:
2639:                int lineNumber = 0;
2640:                BufferedReader in = new BufferedReader(new StringReader(out
2641:                        .toString()));
2642:
2643:                assertEquals("line " + ++lineNumber,
2644:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2645:                                + PREFIX + "empty" + SUFFIX
2646:                                + "\" id=\"empty\">empty</a> *</span>", in
2647:                                .readLine());
2648:                assertEquals("line " + ++lineNumber,
2649:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2650:                                + PREFIX + "empty.Empty" + SUFFIX
2651:                                + "\" id=\"empty.Empty\">Empty</a> *</span>",
2652:                        in.readLine());
2653:                assertEquals(
2654:                        "line " + ++lineNumber,
2655:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2656:                                + PREFIX
2657:                                + "empty.Empty.empty\\(\\)"
2658:                                + SUFFIX
2659:                                + "\" id=\"empty.Empty.empty()\">empty()</a> *</span>",
2660:                        in.readLine());
2661:                assertEquals("line " + ++lineNumber,
2662:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2663:                                + PREFIX + "inbound" + SUFFIX
2664:                                + "\" id=\"inbound\">inbound</a> *</span>", in
2665:                                .readLine());
2666:                assertEquals(
2667:                        "line " + ++lineNumber,
2668:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2669:                                + PREFIX
2670:                                + "inbound.Inbound"
2671:                                + SUFFIX
2672:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
2673:                        in.readLine());
2674:                assertEquals(
2675:                        "line " + ++lineNumber,
2676:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2677:                                + PREFIX
2678:                                + "inbound.Inbound.inbound\\(\\)"
2679:                                + SUFFIX
2680:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a> *</span>",
2681:                        in.readLine());
2682:                assertEquals(
2683:                        "line " + ++lineNumber,
2684:                        "            <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
2685:                                + PREFIX
2686:                                + "outbound.Outbound.outbound\\(\\)"
2687:                                + SUFFIX
2688:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a> *</span>",
2689:                        in.readLine());
2690:                assertEquals("line " + ++lineNumber,
2691:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2692:                                + PREFIX + "outbound" + SUFFIX
2693:                                + "\" id=\"outbound\">outbound</a> *</span>",
2694:                        in.readLine());
2695:                assertEquals(
2696:                        "line " + ++lineNumber,
2697:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2698:                                + PREFIX
2699:                                + "outbound.Outbound"
2700:                                + SUFFIX
2701:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
2702:                        in.readLine());
2703:                assertEquals(
2704:                        "line " + ++lineNumber,
2705:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2706:                                + PREFIX
2707:                                + "outbound.Outbound.outbound\\(\\)"
2708:                                + SUFFIX
2709:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a> *</span>",
2710:                        in.readLine());
2711:                assertEquals(
2712:                        "line " + ++lineNumber,
2713:                        "            <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
2714:                                + PREFIX
2715:                                + "inbound.Inbound.inbound\\(\\)"
2716:                                + SUFFIX
2717:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a> *</span>",
2718:                        in.readLine());
2719:
2720:                assertEquals("End of file", null, in.readLine());
2721:            }
2722:
2723:            public void testShowEmptyFeatureTrueWithConfirmed()
2724:                    throws IOException {
2725:                factory.createFeature("outbound.Outbound.outbound()", true)
2726:                        .addDependency(
2727:                                factory.createFeature(
2728:                                        "inbound.Inbound.inbound()", true));
2729:                factory.createFeature("empty.Empty.empty()", true);
2730:
2731:                visitor.setShowEmptyNodes(true);
2732:
2733:                visitor.traverseNodes(factory.getPackages().values());
2734:
2735:                int lineNumber = 0;
2736:                BufferedReader in = new BufferedReader(new StringReader(out
2737:                        .toString()));
2738:
2739:                assertEquals("line " + ++lineNumber,
2740:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
2741:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
2742:                                .readLine());
2743:                assertEquals("line " + ++lineNumber,
2744:                        "    <a class=\"scope\" href=\"" + PREFIX
2745:                                + "empty.Empty" + SUFFIX
2746:                                + "\" id=\"empty.Empty\">Empty</a>", in
2747:                                .readLine());
2748:                assertEquals("line " + ++lineNumber,
2749:                        "        <a class=\"scope\" href=\"" + PREFIX
2750:                                + "empty.Empty.empty\\(\\)" + SUFFIX
2751:                                + "\" id=\"empty.Empty.empty()\">empty()</a>",
2752:                        in.readLine());
2753:                assertEquals("line " + ++lineNumber,
2754:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
2755:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
2756:                                .readLine());
2757:                assertEquals("line " + ++lineNumber,
2758:                        "    <a class=\"scope\" href=\"" + PREFIX
2759:                                + "inbound.Inbound" + SUFFIX
2760:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
2761:                                .readLine());
2762:                assertEquals(
2763:                        "line " + ++lineNumber,
2764:                        "        <a class=\"scope\" href=\""
2765:                                + PREFIX
2766:                                + "inbound.Inbound.inbound\\(\\)"
2767:                                + SUFFIX
2768:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
2769:                        in.readLine());
2770:                assertEquals(
2771:                        "line " + ++lineNumber,
2772:                        "            &lt;-- <a href=\""
2773:                                + PREFIX
2774:                                + "outbound.Outbound.outbound\\(\\)"
2775:                                + SUFFIX
2776:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a>",
2777:                        in.readLine());
2778:                assertEquals("line " + ++lineNumber,
2779:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
2780:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
2781:                        in.readLine());
2782:                assertEquals("line " + ++lineNumber,
2783:                        "    <a class=\"scope\" href=\"" + PREFIX
2784:                                + "outbound.Outbound" + SUFFIX
2785:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
2786:                        in.readLine());
2787:                assertEquals(
2788:                        "line " + ++lineNumber,
2789:                        "        <a class=\"scope\" href=\""
2790:                                + PREFIX
2791:                                + "outbound.Outbound.outbound\\(\\)"
2792:                                + SUFFIX
2793:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
2794:                        in.readLine());
2795:                assertEquals(
2796:                        "line " + ++lineNumber,
2797:                        "            --&gt; <a href=\""
2798:                                + PREFIX
2799:                                + "inbound.Inbound.inbound\\(\\)"
2800:                                + SUFFIX
2801:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a>",
2802:                        in.readLine());
2803:
2804:                assertEquals("End of file", null, in.readLine());
2805:            }
2806:
2807:            public void testShowEmptyFeatureFalseWithInferred()
2808:                    throws IOException {
2809:                factory
2810:                        .createFeature("outbound.Outbound.outbound()")
2811:                        .addDependency(
2812:                                factory
2813:                                        .createFeature("inbound.Inbound.inbound()"));
2814:                factory.createFeature("empty.Empty.empty()");
2815:
2816:                visitor.setShowEmptyNodes(false);
2817:
2818:                visitor.traverseNodes(factory.getPackages().values());
2819:
2820:                int lineNumber = 0;
2821:                BufferedReader in = new BufferedReader(new StringReader(out
2822:                        .toString()));
2823:
2824:                assertEquals("line " + ++lineNumber,
2825:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2826:                                + PREFIX + "inbound" + SUFFIX
2827:                                + "\" id=\"inbound\">inbound</a> *</span>", in
2828:                                .readLine());
2829:                assertEquals(
2830:                        "line " + ++lineNumber,
2831:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2832:                                + PREFIX
2833:                                + "inbound.Inbound"
2834:                                + SUFFIX
2835:                                + "\" id=\"inbound.Inbound\">Inbound</a> *</span>",
2836:                        in.readLine());
2837:                assertEquals(
2838:                        "line " + ++lineNumber,
2839:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2840:                                + PREFIX
2841:                                + "inbound.Inbound.inbound\\(\\)"
2842:                                + SUFFIX
2843:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a> *</span>",
2844:                        in.readLine());
2845:                assertEquals(
2846:                        "line " + ++lineNumber,
2847:                        "            <span class=\"inferred\">&lt;-- <a class=\"inferred\" href=\""
2848:                                + PREFIX
2849:                                + "outbound.Outbound.outbound\\(\\)"
2850:                                + SUFFIX
2851:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a> *</span>",
2852:                        in.readLine());
2853:                assertEquals("line " + ++lineNumber,
2854:                        "<span class=\"inferred\"><a class=\"scope inferred\" href=\""
2855:                                + PREFIX + "outbound" + SUFFIX
2856:                                + "\" id=\"outbound\">outbound</a> *</span>",
2857:                        in.readLine());
2858:                assertEquals(
2859:                        "line " + ++lineNumber,
2860:                        "    <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2861:                                + PREFIX
2862:                                + "outbound.Outbound"
2863:                                + SUFFIX
2864:                                + "\" id=\"outbound.Outbound\">Outbound</a> *</span>",
2865:                        in.readLine());
2866:                assertEquals(
2867:                        "line " + ++lineNumber,
2868:                        "        <span class=\"inferred\"><a class=\"scope inferred\" href=\""
2869:                                + PREFIX
2870:                                + "outbound.Outbound.outbound\\(\\)"
2871:                                + SUFFIX
2872:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a> *</span>",
2873:                        in.readLine());
2874:                assertEquals(
2875:                        "line " + ++lineNumber,
2876:                        "            <span class=\"inferred\">--&gt; <a class=\"inferred\" href=\""
2877:                                + PREFIX
2878:                                + "inbound.Inbound.inbound\\(\\)"
2879:                                + SUFFIX
2880:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a> *</span>",
2881:                        in.readLine());
2882:
2883:                assertEquals("End of file", null, in.readLine());
2884:            }
2885:
2886:            public void testShowEmptyFeatureFalseWithConfirmed()
2887:                    throws IOException {
2888:                factory.createFeature("outbound.Outbound.outbound()", true)
2889:                        .addDependency(
2890:                                factory.createFeature(
2891:                                        "inbound.Inbound.inbound()", true));
2892:                factory.createFeature("empty.Empty.empty()", true);
2893:
2894:                visitor.setShowEmptyNodes(false);
2895:
2896:                visitor.traverseNodes(factory.getPackages().values());
2897:
2898:                int lineNumber = 0;
2899:                BufferedReader in = new BufferedReader(new StringReader(out
2900:                        .toString()));
2901:
2902:                assertEquals("line " + ++lineNumber,
2903:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
2904:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
2905:                                .readLine());
2906:                assertEquals("line " + ++lineNumber,
2907:                        "    <a class=\"scope\" href=\"" + PREFIX
2908:                                + "inbound.Inbound" + SUFFIX
2909:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
2910:                                .readLine());
2911:                assertEquals(
2912:                        "line " + ++lineNumber,
2913:                        "        <a class=\"scope\" href=\""
2914:                                + PREFIX
2915:                                + "inbound.Inbound.inbound\\(\\)"
2916:                                + SUFFIX
2917:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
2918:                        in.readLine());
2919:                assertEquals(
2920:                        "line " + ++lineNumber,
2921:                        "            &lt;-- <a href=\""
2922:                                + PREFIX
2923:                                + "outbound.Outbound.outbound\\(\\)"
2924:                                + SUFFIX
2925:                                + "\" id=\"inbound.Inbound.inbound()_from_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a>",
2926:                        in.readLine());
2927:                assertEquals("line " + ++lineNumber,
2928:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
2929:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
2930:                        in.readLine());
2931:                assertEquals("line " + ++lineNumber,
2932:                        "    <a class=\"scope\" href=\"" + PREFIX
2933:                                + "outbound.Outbound" + SUFFIX
2934:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
2935:                        in.readLine());
2936:                assertEquals(
2937:                        "line " + ++lineNumber,
2938:                        "        <a class=\"scope\" href=\""
2939:                                + PREFIX
2940:                                + "outbound.Outbound.outbound\\(\\)"
2941:                                + SUFFIX
2942:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
2943:                        in.readLine());
2944:                assertEquals(
2945:                        "line " + ++lineNumber,
2946:                        "            --&gt; <a href=\""
2947:                                + PREFIX
2948:                                + "inbound.Inbound.inbound\\(\\)"
2949:                                + SUFFIX
2950:                                + "\" id=\"outbound.Outbound.outbound()_to_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a>",
2951:                        in.readLine());
2952:
2953:                assertEquals("End of file", null, in.readLine());
2954:            }
2955:
2956:            public void testShowInnerClass() throws IOException {
2957:                factory.createPackage("outbound", true).addDependency(
2958:                        factory.createPackage("inbound", true));
2959:                factory.createClass("outbound.Outbound$Outbound", true)
2960:                        .addDependency(
2961:                                factory.createClass("inbound.Inbound$Inbound",
2962:                                        true));
2963:                factory.createFeature("outbound.Outbound$Outbound.outbound()",
2964:                        true).addDependency(
2965:                        factory.createFeature(
2966:                                "inbound.Inbound$Inbound.inbound()", true));
2967:                factory.createFeature("empty.Empty$Empty.empty()", true);
2968:
2969:                visitor.traverseNodes(factory.getPackages().values());
2970:
2971:                int lineNumber = 0;
2972:                BufferedReader in = new BufferedReader(new StringReader(out
2973:                        .toString()));
2974:
2975:                assertEquals("line " + ++lineNumber,
2976:                        "<a class=\"scope\" href=\"" + PREFIX + "empty"
2977:                                + SUFFIX + "\" id=\"empty\">empty</a>", in
2978:                                .readLine());
2979:                assertEquals(
2980:                        "line " + ++lineNumber,
2981:                        "    <a class=\"scope\" href=\"" + PREFIX
2982:                                + "empty.Empty\\$Empty" + SUFFIX
2983:                                + "\" id=\"empty.Empty$Empty\">Empty$Empty</a>",
2984:                        in.readLine());
2985:                assertEquals(
2986:                        "line " + ++lineNumber,
2987:                        "        <a class=\"scope\" href=\""
2988:                                + PREFIX
2989:                                + "empty.Empty\\$Empty.empty\\(\\)"
2990:                                + SUFFIX
2991:                                + "\" id=\"empty.Empty$Empty.empty()\">empty()</a>",
2992:                        in.readLine());
2993:                assertEquals("line " + ++lineNumber,
2994:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
2995:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
2996:                                .readLine());
2997:                assertEquals("line " + ++lineNumber, "    &lt;-- <a href=\""
2998:                        + PREFIX + "outbound" + SUFFIX
2999:                        + "\" id=\"inbound_from_outbound\">outbound</a>", in
3000:                        .readLine());
3001:                assertEquals(
3002:                        "line " + ++lineNumber,
3003:                        "    <a class=\"scope\" href=\""
3004:                                + PREFIX
3005:                                + "inbound.Inbound\\$Inbound"
3006:                                + SUFFIX
3007:                                + "\" id=\"inbound.Inbound$Inbound\">Inbound$Inbound</a>",
3008:                        in.readLine());
3009:                assertEquals(
3010:                        "line " + ++lineNumber,
3011:                        "        &lt;-- <a href=\""
3012:                                + PREFIX
3013:                                + "outbound.Outbound\\$Outbound"
3014:                                + SUFFIX
3015:                                + "\" id=\"inbound.Inbound$Inbound_from_outbound.Outbound$Outbound\">outbound.Outbound$Outbound</a>",
3016:                        in.readLine());
3017:                assertEquals(
3018:                        "line " + ++lineNumber,
3019:                        "        <a class=\"scope\" href=\""
3020:                                + PREFIX
3021:                                + "inbound.Inbound\\$Inbound.inbound\\(\\)"
3022:                                + SUFFIX
3023:                                + "\" id=\"inbound.Inbound$Inbound.inbound()\">inbound()</a>",
3024:                        in.readLine());
3025:                assertEquals(
3026:                        "line " + ++lineNumber,
3027:                        "            &lt;-- <a href=\""
3028:                                + PREFIX
3029:                                + "outbound.Outbound\\$Outbound.outbound\\(\\)"
3030:                                + SUFFIX
3031:                                + "\" id=\"inbound.Inbound$Inbound.inbound()_from_outbound.Outbound$Outbound.outbound()\">outbound.Outbound$Outbound.outbound()</a>",
3032:                        in.readLine());
3033:                assertEquals("line " + ++lineNumber,
3034:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
3035:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
3036:                        in.readLine());
3037:                assertEquals("line " + ++lineNumber, "    --&gt; <a href=\""
3038:                        + PREFIX + "inbound" + SUFFIX
3039:                        + "\" id=\"outbound_to_inbound\">inbound</a>", in
3040:                        .readLine());
3041:                assertEquals(
3042:                        "line " + ++lineNumber,
3043:                        "    <a class=\"scope\" href=\""
3044:                                + PREFIX
3045:                                + "outbound.Outbound\\$Outbound"
3046:                                + SUFFIX
3047:                                + "\" id=\"outbound.Outbound$Outbound\">Outbound$Outbound</a>",
3048:                        in.readLine());
3049:                assertEquals(
3050:                        "line " + ++lineNumber,
3051:                        "        --&gt; <a href=\""
3052:                                + PREFIX
3053:                                + "inbound.Inbound\\$Inbound"
3054:                                + SUFFIX
3055:                                + "\" id=\"outbound.Outbound$Outbound_to_inbound.Inbound$Inbound\">inbound.Inbound$Inbound</a>",
3056:                        in.readLine());
3057:                assertEquals(
3058:                        "line " + ++lineNumber,
3059:                        "        <a class=\"scope\" href=\""
3060:                                + PREFIX
3061:                                + "outbound.Outbound\\$Outbound.outbound\\(\\)"
3062:                                + SUFFIX
3063:                                + "\" id=\"outbound.Outbound$Outbound.outbound()\">outbound()</a>",
3064:                        in.readLine());
3065:                assertEquals(
3066:                        "line " + ++lineNumber,
3067:                        "            --&gt; <a href=\""
3068:                                + PREFIX
3069:                                + "inbound.Inbound\\$Inbound.inbound\\(\\)"
3070:                                + SUFFIX
3071:                                + "\" id=\"outbound.Outbound$Outbound.outbound()_to_inbound.Inbound$Inbound.inbound()\">inbound.Inbound$Inbound.inbound()</a>",
3072:                        in.readLine());
3073:
3074:                assertEquals("End of file", null, in.readLine());
3075:            }
3076:
3077:            public void testShowBidirectionalDependencies() throws IOException {
3078:                factory.createPackage("outbound", true).addDependency(
3079:                        factory.createPackage("inbound", true));
3080:                factory.createClass("outbound.Outbound", true).addDependency(
3081:                        factory.createClass("inbound.Inbound", true));
3082:                factory.createFeature("outbound.Outbound.outbound()", true)
3083:                        .addDependency(
3084:                                factory.createFeature(
3085:                                        "inbound.Inbound.inbound()", true));
3086:                factory.createPackage("inbound", true).addDependency(
3087:                        factory.createPackage("outbound", true));
3088:                factory.createClass("inbound.Inbound", true).addDependency(
3089:                        factory.createClass("outbound.Outbound", true));
3090:                factory.createFeature("inbound.Inbound.inbound()", true)
3091:                        .addDependency(
3092:                                factory.createFeature(
3093:                                        "outbound.Outbound.outbound()", true));
3094:
3095:                visitor.traverseNodes(factory.getPackages().values());
3096:
3097:                int lineNumber = 0;
3098:                BufferedReader in = new BufferedReader(new StringReader(out
3099:                        .toString()));
3100:
3101:                assertEquals("line " + ++lineNumber,
3102:                        "<a class=\"scope\" href=\"" + PREFIX + "inbound"
3103:                                + SUFFIX + "\" id=\"inbound\">inbound</a>", in
3104:                                .readLine());
3105:                assertEquals(
3106:                        "line " + ++lineNumber,
3107:                        "    &lt;-&gt; <a href=\""
3108:                                + PREFIX
3109:                                + "outbound"
3110:                                + SUFFIX
3111:                                + "\" id=\"inbound_bidirectional_outbound\">outbound</a>",
3112:                        in.readLine());
3113:                assertEquals("line " + ++lineNumber,
3114:                        "    <a class=\"scope\" href=\"" + PREFIX
3115:                                + "inbound.Inbound" + SUFFIX
3116:                                + "\" id=\"inbound.Inbound\">Inbound</a>", in
3117:                                .readLine());
3118:                assertEquals(
3119:                        "line " + ++lineNumber,
3120:                        "        &lt;-&gt; <a href=\""
3121:                                + PREFIX
3122:                                + "outbound.Outbound"
3123:                                + SUFFIX
3124:                                + "\" id=\"inbound.Inbound_bidirectional_outbound.Outbound\">outbound.Outbound</a>",
3125:                        in.readLine());
3126:                assertEquals(
3127:                        "line " + ++lineNumber,
3128:                        "        <a class=\"scope\" href=\""
3129:                                + PREFIX
3130:                                + "inbound.Inbound.inbound\\(\\)"
3131:                                + SUFFIX
3132:                                + "\" id=\"inbound.Inbound.inbound()\">inbound()</a>",
3133:                        in.readLine());
3134:                assertEquals(
3135:                        "line " + ++lineNumber,
3136:                        "            &lt;-&gt; <a href=\""
3137:                                + PREFIX
3138:                                + "outbound.Outbound.outbound\\(\\)"
3139:                                + SUFFIX
3140:                                + "\" id=\"inbound.Inbound.inbound()_bidirectional_outbound.Outbound.outbound()\">outbound.Outbound.outbound()</a>",
3141:                        in.readLine());
3142:                assertEquals("line " + ++lineNumber,
3143:                        "<a class=\"scope\" href=\"" + PREFIX + "outbound"
3144:                                + SUFFIX + "\" id=\"outbound\">outbound</a>",
3145:                        in.readLine());
3146:                assertEquals(
3147:                        "line " + ++lineNumber,
3148:                        "    &lt;-&gt; <a href=\""
3149:                                + PREFIX
3150:                                + "inbound"
3151:                                + SUFFIX
3152:                                + "\" id=\"outbound_bidirectional_inbound\">inbound</a>",
3153:                        in.readLine());
3154:                assertEquals("line " + ++lineNumber,
3155:                        "    <a class=\"scope\" href=\"" + PREFIX
3156:                                + "outbound.Outbound" + SUFFIX
3157:                                + "\" id=\"outbound.Outbound\">Outbound</a>",
3158:                        in.readLine());
3159:                assertEquals(
3160:                        "line " + ++lineNumber,
3161:                        "        &lt;-&gt; <a href=\""
3162:                                + PREFIX
3163:                                + "inbound.Inbound"
3164:                                + SUFFIX
3165:                                + "\" id=\"outbound.Outbound_bidirectional_inbound.Inbound\">inbound.Inbound</a>",
3166:                        in.readLine());
3167:                assertEquals(
3168:                        "line " + ++lineNumber,
3169:                        "        <a class=\"scope\" href=\""
3170:                                + PREFIX
3171:                                + "outbound.Outbound.outbound\\(\\)"
3172:                                + SUFFIX
3173:                                + "\" id=\"outbound.Outbound.outbound()\">outbound()</a>",
3174:                        in.readLine());
3175:                assertEquals(
3176:                        "line " + ++lineNumber,
3177:                        "            &lt;-&gt; <a href=\""
3178:                                + PREFIX
3179:                                + "inbound.Inbound.inbound\\(\\)"
3180:                                + SUFFIX
3181:                                + "\" id=\"outbound.Outbound.outbound()_bidirectional_inbound.Inbound.inbound()\">inbound.Inbound.inbound()</a>",
3182:                        in.readLine());
3183:
3184:                assertEquals("End of file", null, in.readLine());
3185:            }
3186:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.