Source Code Cross Referenced for TestPrettyPrinter.java in  » UML » jrefactory » org » acm » seguin » pretty » 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 » UML » jrefactory » org.acm.seguin.pretty 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         *  Author:  Chris Seguin
0003:         *
0004:         *  This software has been developed under the copyleft
0005:         *  rules of the GNU General Public License.  Please
0006:         *  consult the GNU General Public License for more
0007:         *  details about use and distribution of this software.
0008:         */
0009:        package org.acm.seguin.pretty;
0010:
0011:        import org.acm.seguin.tools.builder.PrettyPrinter;
0012:        import java.io.File;
0013:        import org.acm.seguin.io.FileCopy;
0014:        import org.acm.seguin.junit.DirSourceTestCase;
0015:        import org.acm.seguin.junit.FileCompare;
0016:        import org.acm.seguin.pretty.sort.MultipleOrdering;
0017:        import org.acm.seguin.tools.RefactoryInstaller;
0018:        import junit.framework.*;
0019:
0020:        /**
0021:         *  Unit tests for the pretty printer
0022:         *
0023:         *@author     Chris Seguin
0024:         *@author     Mike Atkinson
0025:         *@created    February 22, 2002
0026:         */
0027:        public class TestPrettyPrinter extends DirSourceTestCase {
0028:            private File checkDir;
0029:            private File cleanDir;
0030:            private File destDir;
0031:
0032:            /**
0033:             *  Constructor for the TestPrettyPrinter object
0034:             *
0035:             *@param  name  Description of Parameter
0036:             */
0037:            public TestPrettyPrinter(String name) {
0038:                super (name);
0039:            }
0040:
0041:            /**
0042:             *  A unit test for JUnit
0043:             */
0044:            public void test01() {
0045:                File dest = new File(destDir, "TestCStyleComments.java");
0046:                (new FileCopy(
0047:                        new File(cleanDir, "test_TestCStyleComments.java"),
0048:                        dest, false)).run();
0049:
0050:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0051:                tppf.setAsk(false);
0052:                tppf.isApplicable(dest);
0053:                tppf.setCStyle(PrintData.CSC_LEAVE_UNTOUCHED);
0054:                tppf.apply(dest);
0055:
0056:                FileCompare.assertEquals("TestCStyleComments.java in error",
0057:                        new File(checkDir, "TestComments7.java"), dest);
0058:            }
0059:
0060:            /**
0061:             *  A unit test for JUnit
0062:             */
0063:            public void test02() {
0064:                File dest = new File(destDir, "TestCStyleComments.java");
0065:                (new FileCopy(
0066:                        new File(cleanDir, "test_TestCStyleComments.java"),
0067:                        dest, false)).run();
0068:
0069:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0070:                tppf.setAsk(false);
0071:                tppf.isApplicable(dest);
0072:                tppf.setCStyle(PrintData.CSC_ALIGN_STAR);
0073:                tppf.setCStyleIndent(2);
0074:                tppf.apply(dest);
0075:
0076:                FileCompare.assertEquals("TestCStyleComments.java in error",
0077:                        new File(checkDir, "TestComments8.java"), dest);
0078:            }
0079:
0080:            /**
0081:             *  A unit test for JUnit
0082:             */
0083:            public void test03() {
0084:                File dest = new File(destDir, "TestCStyleComments.java");
0085:                (new FileCopy(
0086:                        new File(cleanDir, "test_TestCStyleComments.java"),
0087:                        dest, false)).run();
0088:
0089:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0090:                tppf.setAsk(false);
0091:                tppf.isApplicable(dest);
0092:                tppf.setCStyle(PrintData.CSC_ALIGN_BLANK);
0093:                tppf.setCStyleIndent(2);
0094:                tppf.apply(dest);
0095:
0096:                FileCompare.assertEquals("TestCStyleComments.java in error",
0097:                        new File(checkDir, "TestComments9.java"), dest);
0098:            }
0099:
0100:            /**
0101:             *  A unit test for JUnit
0102:             */
0103:            public void test04() {
0104:                File dest = new File(destDir, "TestCStyleComments.java");
0105:                (new FileCopy(
0106:                        new File(cleanDir, "test_TestCStyleComments.java"),
0107:                        dest, false)).run();
0108:
0109:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0110:                tppf.setAsk(false);
0111:                tppf.isApplicable(dest);
0112:                tppf.setCStyle(PrintData.CSC_ALIGN_STAR);
0113:                tppf.setCStyleIndent(4);
0114:                tppf.apply(dest);
0115:
0116:                FileCompare.assertEquals("TestCStyleComments.java in error",
0117:                        new File(checkDir, "TestComments10.java"), dest);
0118:            }
0119:
0120:            /**
0121:             *  A unit test for JUnit
0122:             */
0123:            public void test05() {
0124:                File dest = new File(destDir, "TestCStyleComments.java");
0125:                (new FileCopy(
0126:                        new File(cleanDir, "test_TestCStyleComments.java"),
0127:                        dest, false)).run();
0128:
0129:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0130:                tppf.setAsk(false);
0131:                tppf.isApplicable(dest);
0132:                tppf.setCStyle(PrintData.CSC_MAINTAIN_STAR);
0133:                tppf.apply(dest);
0134:
0135:                FileCompare.assertEquals("TestCStyleComments.java in error",
0136:                        new File(checkDir, "TestComments11.java"), dest);
0137:            }
0138:
0139:            /**
0140:             *  A unit test for JUnit
0141:             */
0142:            public void test06() {
0143:                File dest = new File(destDir, "VariousTest.java");
0144:                (new FileCopy(new File(cleanDir, "test_VariousTest.java"),
0145:                        dest, false)).run();
0146:
0147:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0148:                tppf.setAsk(false);
0149:                tppf.isApplicable(dest);
0150:                tppf.setForceBlock(false);
0151:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_C);
0152:                tppf.apply(dest);
0153:
0154:                FileCompare.assertEquals("VariousTest.java in error", new File(
0155:                        checkDir, "VariousTest1.java"), dest);
0156:            }
0157:
0158:            /**
0159:             *  A unit test for JUnit
0160:             */
0161:            public void test07() {
0162:                File dest = new File(destDir, "VariousTest.java");
0163:                (new FileCopy(new File(cleanDir, "test_VariousTest.java"),
0164:                        dest, false)).run();
0165:
0166:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0167:                tppf.setAsk(false);
0168:                tppf.isApplicable(dest);
0169:                tppf.setForceBlock(false);
0170:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
0171:                tppf.apply(dest);
0172:
0173:                FileCompare.assertEquals("VariousTest.java in error", new File(
0174:                        checkDir, "VariousTest2.java"), dest);
0175:            }
0176:
0177:            /**
0178:             *  A unit test for JUnit
0179:             */
0180:            public void test08() {
0181:                File dest = new File(destDir, "FinalUsage.java");
0182:                (new FileCopy(new File(cleanDir, "FinalUsage.java"), dest,
0183:                        false)).run();
0184:
0185:                String arg = dest.getPath();
0186:                PrettyPrinter.prettyPrinter(arg, false);
0187:
0188:                FileCompare.assertEquals("FinalUsage.java in error", new File(
0189:                        checkDir, "FinalUsage.java"), dest);
0190:            }
0191:
0192:            /**
0193:             *  A unit test for JUnit
0194:             */
0195:            public void test09() {
0196:                File dest = new File(destDir, "TestCastPrettyPrinter.java");
0197:                (new FileCopy(new File(cleanDir, "TestCastPrettyPrinter.java"),
0198:                        dest, false)).run();
0199:
0200:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0201:                tppf.setAsk(false);
0202:                tppf.isApplicable(dest);
0203:                tppf.setCastSpace(true);
0204:                tppf.setExpressionSpace(true);
0205:                tppf.apply(dest);
0206:
0207:                FileCompare
0208:                        .assertEquals("TestCastPrettyPrinter.java in error",
0209:                                new File(checkDir,
0210:                                        "TestCastPrettyPrinter1.java"), dest);
0211:            }
0212:
0213:            /**
0214:             *  A unit test for JUnit
0215:             */
0216:            public void test10() {
0217:                File dest = new File(destDir, "TestCastPrettyPrinter.java");
0218:                (new FileCopy(new File(cleanDir, "TestCastPrettyPrinter.java"),
0219:                        dest, false)).run();
0220:
0221:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0222:                tppf.setAsk(false);
0223:                tppf.isApplicable(dest);
0224:                tppf.setCastSpace(false);
0225:                tppf.setExpressionSpace(true);
0226:                tppf.apply(dest);
0227:
0228:                FileCompare
0229:                        .assertEquals("TestCastPrettyPrinter.java in error",
0230:                                new File(checkDir,
0231:                                        "TestCastPrettyPrinter2.java"), dest);
0232:            }
0233:
0234:            /**
0235:             *  A unit test for JUnit
0236:             */
0237:            public void test11() {
0238:                File dest = new File(destDir,
0239:                        "JavadocForInnerAndAnnonymous.java");
0240:                (new FileCopy(new File(cleanDir,
0241:                        "JavadocForInnerAndAnnonymous.java"), dest, false))
0242:                        .run();
0243:
0244:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0245:                tppf.setAsk(false);
0246:                tppf.isApplicable(dest);
0247:                tppf.setDocumentNestedClasses(true);
0248:                tppf.apply(dest);
0249:
0250:                FileCompare
0251:                        .assertEquals(
0252:                                "JavadocForInnerAndAnnonymous.java in error",
0253:                                new File(checkDir,
0254:                                        "JavadocForInnerAndAnnonymous1.java"),
0255:                                dest);
0256:            }
0257:
0258:            /**
0259:             *  A unit test for JUnit
0260:             */
0261:            public void test12() {
0262:                File dest = new File(destDir,
0263:                        "JavadocForInnerAndAnnonymous.java");
0264:                (new FileCopy(new File(cleanDir,
0265:                        "JavadocForInnerAndAnnonymous.java"), dest, false))
0266:                        .run();
0267:
0268:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0269:                tppf.setAsk(false);
0270:                tppf.isApplicable(dest);
0271:                tppf.setDocumentNestedClasses(false);
0272:                tppf.apply(dest);
0273:
0274:                FileCompare
0275:                        .assertEquals(
0276:                                "JavadocForInnerAndAnnonymous.java in error",
0277:                                new File(checkDir,
0278:                                        "JavadocForInnerAndAnnonymous2.java"),
0279:                                dest);
0280:            }
0281:
0282:            /**
0283:             *  A unit test for JUnit
0284:             */
0285:            public void test13() {
0286:                String[] orderStrings = {
0287:                        "Type(Field,Constructor,Method,NestedClass,NestedInterface,Initializer)",
0288:                        "Class(Instance,Static)", "Protection(public)",
0289:                        "Method(setter,getter,other)" };
0290:
0291:                File dest = new File(destDir, "SortTestData.java");
0292:                (new FileCopy(new File(cleanDir, "SortTestData.java"), dest,
0293:                        false)).run();
0294:
0295:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0296:                tppf.setAsk(false);
0297:                tppf.isApplicable(dest);
0298:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0299:                tppf.apply(dest);
0300:
0301:                FileCompare.assertEquals("SortTestData.java in error",
0302:                        new File(checkDir, "SortTestData00000.java"), dest);
0303:            }
0304:
0305:            /**
0306:             *  A unit test for JUnit
0307:             */
0308:            public void test14() {
0309:                String[] orderStrings = {
0310:                        "Type(Field,Constructor,Method,NestedClass,NestedInterface,Initializer)",
0311:                        "Class(Instance,Static)", "Protection(public)",
0312:                        "Method(getter,setter,other)" };
0313:
0314:                File dest = new File(destDir, "SortTestData.java");
0315:                (new FileCopy(new File(cleanDir, "SortTestData.java"), dest,
0316:                        false)).run();
0317:
0318:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0319:                tppf.setAsk(false);
0320:                tppf.isApplicable(dest);
0321:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0322:                tppf.apply(dest);
0323:
0324:                FileCompare.assertEquals("SortTestData.java in error",
0325:                        new File(checkDir, "SortTestData00010.java"), dest);
0326:            }
0327:
0328:            /**
0329:             *  A unit test for JUnit
0330:             */
0331:            public void test15() {
0332:                String[] orderStrings = {
0333:                        "Type(Field,Constructor,Method,NestedClass,NestedInterface,Initializer)",
0334:                        "Class(Instance,Static)", "Protection(public)",
0335:                        "Method(getter,other,setter)" };
0336:
0337:                File dest = new File(destDir, "SortTestData.java");
0338:                (new FileCopy(new File(cleanDir, "SortTestData.java"), dest,
0339:                        false)).run();
0340:
0341:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0342:                tppf.setAsk(false);
0343:                tppf.isApplicable(dest);
0344:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0345:                tppf.apply(dest);
0346:
0347:                FileCompare.assertEquals("SortTestData.java in error",
0348:                        new File(checkDir, "SortTestData00020.java"), dest);
0349:            }
0350:
0351:            /**
0352:             *  A unit test for JUnit
0353:             */
0354:            public void test16() {
0355:                String[] orderStrings = {
0356:                        "Type(Field,Constructor,Method,NestedClass,NestedInterface,Initializer)",
0357:                        "Class(Instance,Static)", "Protection(public)",
0358:                        "Method(other,getter,setter)" };
0359:
0360:                File dest = new File(destDir, "SortTestData.java");
0361:                (new FileCopy(new File(cleanDir, "SortTestData.java"), dest,
0362:                        false)).run();
0363:
0364:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0365:                tppf.setAsk(false);
0366:                tppf.isApplicable(dest);
0367:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0368:                tppf.apply(dest);
0369:
0370:                FileCompare.assertEquals("SortTestData.java in error",
0371:                        new File(checkDir, "SortTestData00030.java"), dest);
0372:            }
0373:
0374:            /**
0375:             *  A unit test for JUnit
0376:             */
0377:            public void test17() {
0378:                String[] orderStrings = {
0379:                        "Type(Field,Constructor,Method,NestedClass,NestedInterface,Initializer)",
0380:                        "Class(Instance,Static)", "Protection(public)",
0381:                        "Method(other,setter,getter)" };
0382:
0383:                File dest = new File(destDir, "SortTestData.java");
0384:                (new FileCopy(new File(cleanDir, "SortTestData.java"), dest,
0385:                        false)).run();
0386:
0387:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0388:                tppf.setAsk(false);
0389:                tppf.isApplicable(dest);
0390:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0391:                tppf.apply(dest);
0392:
0393:                FileCompare.assertEquals("SortTestData.java in error",
0394:                        new File(checkDir, "SortTestData00040.java"), dest);
0395:            }
0396:
0397:            /**
0398:             *  A unit test for JUnit
0399:             */
0400:            public void test18() {
0401:                String[] orderStrings = {
0402:                        "Type(Field,Constructor,Method,NestedClass,NestedInterface,Initializer)",
0403:                        "Class(Instance,Static)", "Protection(public)",
0404:                        "Method(setter,other,getter)" };
0405:
0406:                File dest = new File(destDir, "SortTestData.java");
0407:                (new FileCopy(new File(cleanDir, "SortTestData.java"), dest,
0408:                        false)).run();
0409:
0410:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0411:                tppf.setAsk(false);
0412:                tppf.isApplicable(dest);
0413:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0414:                tppf.apply(dest);
0415:
0416:                FileCompare.assertEquals("SortTestData.java in error",
0417:                        new File(checkDir, "SortTestData00050.java"), dest);
0418:            }
0419:
0420:            /**
0421:             *  A unit test for JUnit
0422:             */
0423:            public void test19() {
0424:                String[] orderStrings = {
0425:                        "Type(Field,Main,Constructor,Method,NestedClass,NestedInterface,Initializer)",
0426:                        "Class(Instance,Static)", "Protection(public)",
0427:                        "Method(setter,getter,other)" };
0428:
0429:                File dest = new File(destDir, "SortTestData.java");
0430:                (new FileCopy(new File(cleanDir, "SortTestData.java"), dest,
0431:                        false)).run();
0432:
0433:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0434:                tppf.setAsk(false);
0435:                tppf.isApplicable(dest);
0436:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0437:                tppf.apply(dest);
0438:
0439:                FileCompare.assertEquals("SortTestData.java in error",
0440:                        new File(checkDir, "SortTestData00001.java"), dest);
0441:            }
0442:
0443:            /**
0444:             *  A unit test for JUnit
0445:             */
0446:            public void test20() {
0447:                File dest = new File(destDir, "VariableIndent.java");
0448:                (new FileCopy(new File(cleanDir, "VariableIndent.java"), dest,
0449:                        false)).run();
0450:
0451:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0452:                tppf.setAsk(false);
0453:                tppf.isApplicable(dest);
0454:                tppf.setDynamicFieldSpacing(PrintData.DFS_ALWAYS);
0455:                tppf.apply(dest);
0456:
0457:                FileCompare.assertEquals("VariableIndent.java in error",
0458:                        new File(checkDir, "VariableIndent.java"), dest);
0459:            }
0460:
0461:            /**
0462:             *  A unit test for JUnit
0463:             */
0464:            public void test21() {
0465:                File dest = new File(destDir, "VariableFormatTwo.java");
0466:                (new FileCopy(new File(cleanDir, "VariableFormatTwo.java"),
0467:                        dest, false)).run();
0468:
0469:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0470:                tppf.setAsk(false);
0471:                tppf.isApplicable(dest);
0472:                tppf.setDynamicFieldSpacing(PrintData.DFS_ALWAYS);
0473:                tppf.apply(dest);
0474:
0475:                FileCompare.assertEquals("VariableFormatTwo.java in error",
0476:                        new File(checkDir, "VariableFormatTwo.java"), dest);
0477:            }
0478:
0479:            /**
0480:             *  A unit test for JUnit
0481:             */
0482:            public void test22() {
0483:                String[] orderStrings = {
0484:                        "FieldInitializers()",
0485:                        "Type(Constructor,Method,NestedClass,NestedInterface,Field,Initializer)",
0486:                        "Class(Instance,Static)", "Protection(public)",
0487:                        "Method(setter,getter,other)" };
0488:
0489:                File dest = new File(destDir, "FieldInitOrderTest.java");
0490:                (new FileCopy(new File(cleanDir, "FieldInitOrderTest.java"),
0491:                        dest, false)).run();
0492:
0493:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0494:                tppf.setAsk(false);
0495:                tppf.isApplicable(dest);
0496:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0497:                tppf.apply(dest);
0498:
0499:                FileCompare.assertEquals("FieldInitOrderTest.java in error",
0500:                        new File(checkDir, "FieldInitOrderTest.java"), dest);
0501:            }
0502:
0503:            /**
0504:             *  A unit test for JUnit
0505:             */
0506:            public void test23() {
0507:                File dest = new File(destDir, "BlockStyleTest.java");
0508:                (new FileCopy(new File(cleanDir, "BlockStyleTest.java"), dest,
0509:                        false)).run();
0510:
0511:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0512:                tppf.setAsk(false);
0513:                tppf.isApplicable(dest);
0514:                tppf.setCodeBlockStyle(PrintData.BLOCK_STYLE_C);
0515:                tppf.setMethodBlockStyle(PrintData.BLOCK_STYLE_C);
0516:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_C);
0517:                tppf.apply(dest);
0518:
0519:                FileCompare.assertEquals("BlockStyleTest.java in error",
0520:                        new File(checkDir, "BlockStyleTest1.java"), dest);
0521:            }
0522:
0523:            /**
0524:             *  A unit test for JUnit
0525:             */
0526:            public void test24() {
0527:                File dest = new File(destDir, "BlockStyleTest.java");
0528:                (new FileCopy(new File(cleanDir, "BlockStyleTest.java"), dest,
0529:                        false)).run();
0530:
0531:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0532:                tppf.setAsk(false);
0533:                tppf.isApplicable(dest);
0534:                tppf.setCodeBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
0535:                tppf.setMethodBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
0536:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
0537:                tppf.apply(dest);
0538:
0539:                FileCompare.assertEquals("BlockStyleTest.java in error",
0540:                        new File(checkDir, "BlockStyleTest2.java"), dest);
0541:            }
0542:
0543:            /**
0544:             *  A unit test for JUnit
0545:             */
0546:            public void test25() {
0547:                File dest = new File(destDir, "BlockStyleTest.java");
0548:                (new FileCopy(new File(cleanDir, "BlockStyleTest.java"), dest,
0549:                        false)).run();
0550:
0551:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0552:                tppf.setAsk(false);
0553:                tppf.isApplicable(dest);
0554:                tppf.setCodeBlockStyle(PrintData.BLOCK_STYLE_EMACS);
0555:                tppf.setMethodBlockStyle(PrintData.BLOCK_STYLE_EMACS);
0556:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_EMACS);
0557:                tppf.apply(dest);
0558:
0559:                FileCompare.assertEquals("BlockStyleTest.java in error",
0560:                        new File(checkDir, "BlockStyleTest3.java"), dest);
0561:            }
0562:
0563:            /**
0564:             *  A unit test for JUnit
0565:             */
0566:            public void test26() {
0567:                File dest = new File(destDir, "BlockStyleTest.java");
0568:                (new FileCopy(new File(cleanDir, "BlockStyleTest.java"), dest,
0569:                        false)).run();
0570:
0571:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0572:                tppf.setAsk(false);
0573:                tppf.isApplicable(dest);
0574:                tppf.setCodeBlockStyle(PrintData.BLOCK_STYLE_EMACS);
0575:                tppf.setMethodBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
0576:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
0577:                tppf.apply(dest);
0578:
0579:                FileCompare.assertEquals("BlockStyleTest.java in error",
0580:                        new File(checkDir, "BlockStyleTest4.java"), dest);
0581:            }
0582:
0583:            /**
0584:             *  A unit test for JUnit
0585:             */
0586:            public void test27() {
0587:                File dest = new File(destDir, "JavadocStyleTest.java");
0588:                (new FileCopy(new File(cleanDir, "JavadocStyleTest.java"),
0589:                        dest, false)).run();
0590:
0591:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0592:                tppf.setAsk(false);
0593:                tppf.isApplicable(dest);
0594:                tppf.setSingleLineJavadocs(true);
0595:                tppf.apply(dest);
0596:
0597:                FileCompare.assertEquals("JavadocStyleTest.java in error",
0598:                        new File(checkDir, "JavadocStyleTest.java"), dest);
0599:            }
0600:
0601:            /**
0602:             *  A unit test for JUnit
0603:             */
0604:            public void test28() {
0605:                File dest = new File(destDir, "VariableIndent.java");
0606:                (new FileCopy(new File(cleanDir, "pretty_VariableIndent.java"),
0607:                        dest, false)).run();
0608:
0609:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0610:                tppf.setAsk(false);
0611:                tppf.isApplicable(dest);
0612:                tppf.setVariablesAlignWithBlock(true);
0613:                tppf.setCodeBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
0614:                tppf.setMethodBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
0615:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
0616:                tppf.apply(dest);
0617:
0618:                FileCompare.assertEquals("VariableIndent.java in error",
0619:                        new File(checkDir, "VariableIndent2.java"), dest);
0620:            }
0621:
0622:            /**
0623:             *  A unit test for JUnit
0624:             */
0625:            public void test29() {
0626:                File dest = new File(destDir, "VariousTest.java");
0627:                (new FileCopy(new File(cleanDir, "test_VariousTest.java"),
0628:                        dest, false)).run();
0629:
0630:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0631:                tppf.setAsk(false);
0632:                tppf.isApplicable(dest);
0633:                tppf.setForceBlock(false);
0634:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_C);
0635:                tppf.setElseOnNewLine(false);
0636:                tppf.apply(dest);
0637:
0638:                FileCompare.assertEquals("VariousTest.java in error", new File(
0639:                        checkDir, "VariousTest3.java"), dest);
0640:            }
0641:
0642:            /**
0643:             *  Unit test for pretty printer
0644:             */
0645:            public void test30() {
0646:                File dest = new File(destDir, "VariousTest.java");
0647:                (new FileCopy(new File(cleanDir, "test_VariousTest.java"),
0648:                        dest, false)).run();
0649:
0650:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0651:                tppf.setAsk(false);
0652:                tppf.isApplicable(dest);
0653:                tppf.setForceBlock(true);
0654:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_C);
0655:                tppf.setElseOnNewLine(false);
0656:                tppf.apply(dest);
0657:
0658:                FileCompare.assertEquals("VariousTest.java in error", new File(
0659:                        checkDir, "VariousTest4.java"), dest);
0660:            }
0661:
0662:            /**
0663:             *  A unit test for JUnit
0664:             */
0665:            public void test31() {
0666:                File dest = new File(destDir, "SwitchClass.java");
0667:                (new FileCopy(new File(cleanDir, "SwitchClass.java"), dest,
0668:                        false)).run();
0669:
0670:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0671:                tppf.setAsk(false);
0672:                tppf.isApplicable(dest);
0673:                tppf.setCaseIndent(0);
0674:                tppf.apply(dest);
0675:
0676:                FileCompare.assertEquals("SwitchClass.java in error", new File(
0677:                        checkDir, "SwitchClass1.java"), dest);
0678:            }
0679:
0680:            /**
0681:             *  A unit test for JUnit
0682:             */
0683:            public void test32() {
0684:                File dest = new File(destDir, "SwitchClass.java");
0685:                (new FileCopy(new File(cleanDir, "SwitchClass.java"), dest,
0686:                        false)).run();
0687:
0688:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0689:                tppf.setAsk(false);
0690:                tppf.isApplicable(dest);
0691:                tppf.setCaseIndent(2);
0692:                tppf.apply(dest);
0693:
0694:                FileCompare.assertEquals("SwitchClass.java in error", new File(
0695:                        checkDir, "SwitchClass2.java"), dest);
0696:            }
0697:
0698:            /**
0699:             *  A unit test for JUnit
0700:             */
0701:            public void test33() {
0702:                String[] orderStrings = { "Alphabetical()" };
0703:
0704:                File dest = new File(destDir, "SortTestData.java");
0705:                (new FileCopy(new File(cleanDir, "SortTestData.java"), dest,
0706:                        false)).run();
0707:
0708:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0709:                tppf.setAsk(false);
0710:                tppf.isApplicable(dest);
0711:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0712:                tppf.apply(dest);
0713:
0714:                FileCompare.assertEquals("SortTestData.java in error",
0715:                        new File(checkDir, "SortTestData_a.java"), dest);
0716:            }
0717:
0718:            /**
0719:             *  A unit test for JUnit
0720:             */
0721:            public void test34() {
0722:                String[] orderStrings = { "Final(top)" };
0723:
0724:                File dest = new File(destDir, "SortTestData.java");
0725:                (new FileCopy(new File(cleanDir, "SortTestData.java"), dest,
0726:                        false)).run();
0727:
0728:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0729:                tppf.setAsk(false);
0730:                tppf.isApplicable(dest);
0731:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0732:                tppf.apply(dest);
0733:
0734:                FileCompare.assertEquals("SortTestData.java in error",
0735:                        new File(checkDir, "SortTestData_ft.java"), dest);
0736:            }
0737:
0738:            /**
0739:             *  A unit test for JUnit
0740:             */
0741:            public void test35() {
0742:                String[] orderStrings = { "Final(bottom)" };
0743:
0744:                File dest = new File(destDir, "SortTestData.java");
0745:                (new FileCopy(new File(cleanDir, "SortTestData.java"), dest,
0746:                        false)).run();
0747:
0748:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0749:                tppf.setAsk(false);
0750:                tppf.isApplicable(dest);
0751:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
0752:                tppf.apply(dest);
0753:
0754:                FileCompare.assertEquals("SortTestData.java in error",
0755:                        new File(checkDir, "SortTestData_fb.java"), dest);
0756:            }
0757:
0758:            /**
0759:             *  A unit test for JUnit
0760:             */
0761:            public void test36() {
0762:                String[] orderStrings = {};
0763:
0764:                File dest = new File(destDir, "SortImportData.java");
0765:                (new FileCopy(new File(cleanDir, "SortImportData.java"), dest,
0766:                        false)).run();
0767:
0768:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0769:                tppf.setAsk(false);
0770:                tppf.isApplicable(dest);
0771:                tppf.setImportSortImportant(orderStrings);
0772:                tppf.setImportSortNeighbourhood(0);
0773:                tppf.setSortTop(true);
0774:                tppf.setEmptyBlockOnSingleLine(true);
0775:                tppf.apply(dest);
0776:
0777:                FileCompare.assertEquals("SortImportData.java in error",
0778:                        new File(checkDir, "SortImportData01.java"), dest);
0779:            }
0780:
0781:            /**
0782:             *  A unit test for JUnit
0783:             */
0784:            public void test37() {
0785:                String[] orderStrings = { "java", "javax" };
0786:
0787:                File dest = new File(destDir, "SortImportData.java");
0788:                (new FileCopy(new File(cleanDir, "SortImportData.java"), dest,
0789:                        false)).run();
0790:
0791:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0792:                tppf.setAsk(false);
0793:                tppf.isApplicable(dest);
0794:                tppf.setImportSortImportant(orderStrings);
0795:                tppf.setImportSortNeighbourhood(0);
0796:                tppf.setSortTop(true);
0797:                tppf.apply(dest);
0798:
0799:                FileCompare.assertEquals("SortImportData.java in error",
0800:                        new File(checkDir, "SortImportData02.java"), dest);
0801:            }
0802:
0803:            /**
0804:             *  A unit test for JUnit
0805:             */
0806:            public void test38() {
0807:                String[] orderStrings = { "java", "javax", "org.w3c.dom" };
0808:
0809:                File dest = new File(destDir, "SortImportData.java");
0810:                (new FileCopy(new File(cleanDir, "SortImportData.java"), dest,
0811:                        false)).run();
0812:
0813:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0814:                tppf.setAsk(false);
0815:                tppf.isApplicable(dest);
0816:                tppf.setImportSortImportant(orderStrings);
0817:                tppf.setImportSortNeighbourhood(0);
0818:                tppf.setSortTop(true);
0819:                tppf.apply(dest);
0820:
0821:                FileCompare.assertEquals("SortImportData.java in error",
0822:                        new File(checkDir, "SortImportData03.java"), dest);
0823:            }
0824:
0825:            /**
0826:             *  A unit test for JUnit
0827:             */
0828:            public void test39() {
0829:                String[] orderStrings = { "java", "javax", "org.w3c.dom" };
0830:
0831:                File dest = new File(destDir, "SortImportData.java");
0832:                (new FileCopy(new File(cleanDir, "SortImportData.java"), dest,
0833:                        false)).run();
0834:
0835:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0836:                tppf.setAsk(false);
0837:                tppf.isApplicable(dest);
0838:                tppf.setImportSortImportant(orderStrings);
0839:                tppf.setImportSortNeighbourhood(1);
0840:                tppf.setSortTop(true);
0841:                tppf.apply(dest);
0842:
0843:                FileCompare.assertEquals("SortImportData.java in error",
0844:                        new File(checkDir, "SortImportData04.java"), dest);
0845:            }
0846:
0847:            /**
0848:             *  A unit test for JUnit
0849:             */
0850:            public void test40() {
0851:                String[] orderStrings = { "java", "javax", "org.w3c.dom" };
0852:
0853:                File dest = new File(destDir, "SortImportData.java");
0854:                (new FileCopy(new File(cleanDir, "SortImportData.java"), dest,
0855:                        false)).run();
0856:
0857:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0858:                tppf.setAsk(false);
0859:                tppf.isApplicable(dest);
0860:                tppf.setImportSortImportant(orderStrings);
0861:                tppf.setImportSortNeighbourhood(2);
0862:                tppf.setSortTop(true);
0863:                tppf.apply(dest);
0864:
0865:                FileCompare.assertEquals("SortImportData.java in error",
0866:                        new File(checkDir, "SortImportData05.java"), dest);
0867:            }
0868:
0869:            /**
0870:             *  A unit test for JUnit
0871:             */
0872:            public void test41() {
0873:                String[] orderStrings = { "java", "javax", "org.w3c.dom" };
0874:
0875:                File dest = new File(destDir, "SortImportData.java");
0876:                (new FileCopy(new File(cleanDir, "SortImportData.java"), dest,
0877:                        false)).run();
0878:
0879:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0880:                tppf.setAsk(false);
0881:                tppf.isApplicable(dest);
0882:                tppf.setImportSortImportant(orderStrings);
0883:                tppf.setImportSortNeighbourhood(3);
0884:                tppf.setSortTop(true);
0885:                tppf.apply(dest);
0886:
0887:                FileCompare.assertEquals("SortImportData.java in error",
0888:                        new File(checkDir, "SortImportData06.java"), dest);
0889:            }
0890:
0891:            /**
0892:             *  A unit test for JUnit
0893:             */
0894:            public void test42() {
0895:                String[] orderStrings = {};
0896:
0897:                File dest = new File(destDir, "SortImportData.java");
0898:                (new FileCopy(new File(cleanDir, "SortImportData.java"), dest,
0899:                        false)).run();
0900:
0901:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0902:                tppf.setAsk(false);
0903:                tppf.isApplicable(dest);
0904:                tppf.setImportSortImportant(orderStrings);
0905:                tppf.setImportSortNeighbourhood(3);
0906:                tppf.setSortTop(true);
0907:                tppf.apply(dest);
0908:
0909:                FileCompare.assertEquals("SortImportData.java in error",
0910:                        new File(checkDir, "SortImportData07.java"), dest);
0911:            }
0912:
0913:            /**
0914:             *  A unit test for JUnit
0915:             */
0916:            public void test43() {
0917:                File dest = new File(destDir, "ParserTest.java");
0918:                (new FileCopy(new File(cleanDir, "ParserTest.java"), dest,
0919:                        false)).run();
0920:
0921:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0922:                tppf.setAsk(false);
0923:                tppf.isApplicable(dest);
0924:                tppf.apply(dest);
0925:
0926:                FileCompare.assertEquals("ParserTest.java in error", new File(
0927:                        checkDir, "ParserTest.java"), dest);
0928:            }
0929:
0930:            /**
0931:             *  A unit test for JUnit
0932:             */
0933:            public void test44() {
0934:                File dest = new File(destDir, "AddExtraSpaces.java");
0935:                (new FileCopy(new File(cleanDir, "AddExtraSpaces.java"), dest,
0936:                        false)).run();
0937:
0938:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0939:                tppf.setAsk(false);
0940:                tppf.isApplicable(dest);
0941:                tppf.setInsertSpaceLocalVariables(true);
0942:                tppf.setLinesAfterPackage(2);
0943:                tppf.setMaintainNewlinesAroundImports(false);
0944:                tppf.setSortTop(true);
0945:                tppf.setLinesBeforeClass(2);
0946:                tppf.apply(dest);
0947:
0948:                FileCompare.assertEquals("AddExtraSpaces.java in error",
0949:                        new File(checkDir, "AddExtraSpaces.java"), dest);
0950:            }
0951:
0952:            /**
0953:             *  A unit test for JUnit
0954:             */
0955:            public void test45() {
0956:                File dest = new File(destDir, "AddExtraSpaces.java");
0957:                (new FileCopy(new File(cleanDir, "AddExtraSpaces.java"), dest,
0958:                        false)).run();
0959:
0960:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0961:                tppf.setAsk(false);
0962:                tppf.isApplicable(dest);
0963:                tppf.setRemoveExcessBlocks(true);
0964:                tppf.setForceBlock(false);
0965:                tppf.setSortTop(true);
0966:                tppf.apply(dest);
0967:
0968:                FileCompare.assertEquals("AddExtraSpaces.java in error",
0969:                        new File(checkDir, "AddExtraSpaces2.java"), dest);
0970:            }
0971:
0972:            /**
0973:             *  A unit test for JUnit
0974:             */
0975:            public void test46() {
0976:                File dest = new File(destDir, "C.java");
0977:                (new FileCopy(new File(cleanDir, "C.java"), dest, false)).run();
0978:
0979:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0980:                tppf.setAsk(false);
0981:                tppf.isApplicable(dest);
0982:                tppf.apply(dest);
0983:
0984:                FileCompare.assertEquals("C.java in error", new File(checkDir,
0985:                        "C.java"), dest);
0986:            }
0987:
0988:            /**
0989:             *  A unit test for JUnit
0990:             */
0991:            public void test47() {
0992:                File dest = new File(destDir, "TestArrayInitializerIndent.java");
0993:                (new FileCopy(new File(cleanDir,
0994:                        "TestArrayInitializerIndent.java"), dest, false)).run();
0995:
0996:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
0997:                tppf.setAsk(false);
0998:                tppf.isApplicable(dest);
0999:                tppf.setEmptyBlockOnSingleLine(true);
1000:                tppf.setIndentInInitializer(true);
1001:                tppf.setBangSpace(true);
1002:                tppf.apply(dest);
1003:
1004:                FileCompare.assertEquals(
1005:                        "TestArrayInitializerIndent.java in error", new File(
1006:                                checkDir, "TestArrayInitializerIndent.java"),
1007:                        dest);
1008:            }
1009:
1010:            /**
1011:             *  A unit test for JUnit
1012:             */
1013:            public void test48() {
1014:                File dest = new File(destDir, "D.java");
1015:                (new FileCopy(new File(cleanDir, "D.java"), dest, false)).run();
1016:
1017:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1018:                tppf.setAsk(false);
1019:                tppf.setExceptionTag("exception");
1020:                tppf.isApplicable(dest);
1021:                tppf.apply(dest);
1022:
1023:                FileCompare.assertEquals("D.java in error", new File(checkDir,
1024:                        "D1.java"), dest);
1025:            }
1026:
1027:            /**
1028:             *  A unit test for JUnit
1029:             */
1030:            public void test49() {
1031:                File dest = new File(destDir, "D.java");
1032:                (new FileCopy(new File(cleanDir, "D.java"), dest, false)).run();
1033:
1034:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1035:                tppf.setAsk(false);
1036:                tppf.setExceptionTag("throws");
1037:                tppf.isApplicable(dest);
1038:                tppf.apply(dest);
1039:
1040:                FileCompare.assertEquals("D.java in error", new File(checkDir,
1041:                        "D2.java"), dest);
1042:            }
1043:
1044:            /**
1045:             *  A unit test for JUnit
1046:             */
1047:            public void test50() {
1048:                File dest = new File(destDir, "D.java");
1049:                (new FileCopy(new File(cleanDir, "D.java"), dest, false)).run();
1050:
1051:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1052:                tppf.setAsk(false);
1053:                tppf.setExceptionTag("throw");
1054:                tppf.isApplicable(dest);
1055:                tppf.apply(dest);
1056:
1057:                FileCompare.assertEquals("D.java in error", new File(checkDir,
1058:                        "D3.java"), dest);
1059:            }
1060:
1061:            /**
1062:             *  A unit test for JUnit
1063:             */
1064:            public void test51() {
1065:                File dest = new File(destDir, "E.java");
1066:                (new FileCopy(new File(cleanDir, "E.java"), dest, false)).run();
1067:
1068:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1069:                tppf.setModifierOrder(PrintData.ALPHABETICAL_ORDER);
1070:                tppf.setAsk(false);
1071:                tppf.isApplicable(dest);
1072:                tppf.apply(dest);
1073:
1074:                FileCompare.assertEquals("E.java in error", new File(checkDir,
1075:                        "E1.java"), dest);
1076:            }
1077:
1078:            /**
1079:             *  A unit test for JUnit
1080:             */
1081:            public void test52() {
1082:                File dest = new File(destDir, "category.java");
1083:                (new FileCopy(new File(cleanDir, "category.java"), dest, false))
1084:                        .run();
1085:
1086:                String arg = dest.getPath();
1087:                PrettyPrinter.prettyPrinter(arg, false);
1088:
1089:                FileCompare.assertEquals("category.java in error", new File(
1090:                        checkDir, "category.java"), dest);
1091:            }
1092:
1093:            /**
1094:             *  A unit test for JUnit
1095:             */
1096:            public void test53() {
1097:                File dest = new File(destDir, "Item.java");
1098:                (new FileCopy(new File(cleanDir, "Item.java"), dest, false))
1099:                        .run();
1100:
1101:                String arg = dest.getPath();
1102:                PrettyPrinter.prettyPrinter(arg, false);
1103:
1104:                FileCompare.assertEquals("Item.java in error", new File(
1105:                        checkDir, "Item.java"), dest);
1106:            }
1107:
1108:            /**
1109:             *  A unit test for JUnit
1110:             */
1111:            public void test54() {
1112:                File dest = new File(destDir, "LineNumberingTest.java");
1113:                (new FileCopy(new File(cleanDir, "LineNumberingTest.java"),
1114:                        dest, false)).run();
1115:
1116:                String arg = dest.getPath();
1117:                PrettyPrinter.prettyPrinter(arg, false);
1118:
1119:                FileCompare.assertEquals("LineNumberingTest.java in error",
1120:                        new File(checkDir, "LineNumberingTest.java"), dest);
1121:            }
1122:
1123:            /**
1124:             *  A unit test for JUnit
1125:             */
1126:            public void test55() {
1127:                File dest = new File(destDir, "TestPackage.java");
1128:                (new FileCopy(new File(cleanDir, "TestPackage.java"), dest,
1129:                        false)).run();
1130:
1131:                String arg = dest.getPath();
1132:                PrettyPrinter.prettyPrinter(arg, false);
1133:
1134:                FileCompare.assertEquals("TestPackage.java in error", new File(
1135:                        checkDir, "TestPackage.java"), dest);
1136:            }
1137:
1138:            /**
1139:             *  A unit test for JUnit
1140:             */
1141:            public void test56() {
1142:                File dest = new File(destDir, "Correct.java");
1143:                (new FileCopy(new File(cleanDir, "Correct.java"), dest, false))
1144:                        .run();
1145:
1146:                String arg = dest.getPath();
1147:                PrettyPrinter.prettyPrinter(arg, false);
1148:
1149:                FileCompare.assertEquals("Correct.java in error", new File(
1150:                        checkDir, "Correct.java"), dest);
1151:            }
1152:
1153:            /**
1154:             *  A unit test for JUnit
1155:             */
1156:            public void test57() {
1157:                File dest = new File(destDir, "VenkatsError.java");
1158:                (new FileCopy(new File(cleanDir, "VenkatsError.java"), dest,
1159:                        false)).run();
1160:
1161:                String arg = dest.getPath();
1162:                PrettyPrinter.prettyPrinter(arg, false);
1163:
1164:                FileCompare.assertEquals("VenkatsError.java in error",
1165:                        new File(checkDir, "VenkatsError.java"), dest);
1166:            }
1167:
1168:            /**
1169:             *  A unit test for JUnit
1170:             */
1171:            public void test58() {
1172:                File dest = new File(destDir, "LoadingProblem.java");
1173:                (new FileCopy(new File(cleanDir, "LoadingProblem.java"), dest,
1174:                        false)).run();
1175:
1176:                String arg = dest.getPath();
1177:                PrettyPrinter.prettyPrinter(arg, false);
1178:
1179:                FileCompare.assertEquals("LoadingProblem.java in error",
1180:                        new File(checkDir, "LoadingProblem.java"), dest);
1181:            }
1182:
1183:            /**
1184:             *  A unit test for JUnit
1185:             */
1186:            public void test59() {
1187:                File dest = new File(destDir, "TestStrictFP.java");
1188:                (new FileCopy(new File(cleanDir, "TestStrictFP.java"), dest,
1189:                        false)).run();
1190:
1191:                String arg = dest.getPath();
1192:                PrettyPrinter.prettyPrinter(arg, false);
1193:
1194:                FileCompare.assertEquals("TestStrictFP.java in error",
1195:                        new File(checkDir, "TestStrictFP.java"), dest);
1196:            }
1197:
1198:            /**
1199:             *  A unit test for JUnit
1200:             */
1201:            public void test60() {
1202:                File dest = new File(destDir, "AnonymousClassFormatting.java");
1203:                (new FileCopy(new File(cleanDir,
1204:                        "AnonymousClassFormatting.java"), dest, false)).run();
1205:
1206:                String arg = dest.getPath();
1207:                PrettyPrinter.prettyPrinter(arg, false);
1208:
1209:                FileCompare.assertEquals(
1210:                        "AnonymousClassFormatting.java in error", new File(
1211:                                checkDir, "AnonymousClassFormatting.java"),
1212:                        dest);
1213:            }
1214:
1215:            /**
1216:             *  A unit test for JUnit
1217:             */
1218:            public void test61() {
1219:                File dest = new File(destDir, "DirkTest.java");
1220:                (new FileCopy(new File(cleanDir, "DirkTest.java"), dest, false))
1221:                        .run();
1222:
1223:                String arg = dest.getPath();
1224:                PrettyPrinter.prettyPrinter(arg, false);
1225:
1226:                FileCompare.assertEquals("DirkTest.java in error", new File(
1227:                        checkDir, "DirkTest.java"), dest);
1228:            }
1229:
1230:            /**
1231:             *  A unit test for JUnit
1232:             */
1233:            public void test62() {
1234:                File dest = new File(destDir, "InitAnonClass.java");
1235:                (new FileCopy(new File(cleanDir, "InitAnonClass.java"), dest,
1236:                        false)).run();
1237:
1238:                String arg = dest.getPath();
1239:                PrettyPrinter.prettyPrinter(arg, false);
1240:
1241:                FileCompare.assertEquals("InitAnonClass.java in error",
1242:                        new File(checkDir, "InitAnonClass.java"), dest);
1243:            }
1244:
1245:            /**
1246:             *  A unit test for JUnit
1247:             */
1248:            public void test63() {
1249:                File dest = new File(destDir, "SwitchClass.java");
1250:                (new FileCopy(new File(cleanDir, "SwitchClass.java"), dest,
1251:                        false)).run();
1252:
1253:                String arg = dest.getPath();
1254:                PrettyPrinter.prettyPrinter(arg, false);
1255:
1256:                FileCompare.assertEquals("SwitchClass.java in error", new File(
1257:                        checkDir, "SwitchClass.java"), dest);
1258:            }
1259:
1260:            /**
1261:             *  A unit test for JUnit
1262:             */
1263:            public void test64() {
1264:                File dest = new File(destDir, "SingleLineComments.java");
1265:                (new FileCopy(new File(cleanDir, "SingleLineComments.java"),
1266:                        dest, false)).run();
1267:
1268:                String arg = dest.getPath();
1269:                PrettyPrinter.prettyPrinter(arg, false);
1270:
1271:                FileCompare.assertEquals("SingleLineComments.java in error",
1272:                        new File(checkDir, "SingleLineComments.java"), dest);
1273:            }
1274:
1275:            /**
1276:             *  A unit test for JUnit
1277:             */
1278:            public void test65() {
1279:                File dest = new File(destDir, "DoWhileTest.java");
1280:                (new FileCopy(new File(cleanDir, "DoWhileTest.java"), dest,
1281:                        false)).run();
1282:
1283:                String arg = dest.getPath();
1284:                PrettyPrinter.prettyPrinter(arg, false);
1285:
1286:                FileCompare.assertEquals("DoWhileTest.java in error", new File(
1287:                        checkDir, "DoWhileTest.java"), dest);
1288:            }
1289:
1290:            /**
1291:             *  A unit test for JUnit
1292:             */
1293:            public void test66() {
1294:                File dest = new File(destDir, "TestComments.java");
1295:                (new FileCopy(new File(cleanDir, "TestComments.java"), dest,
1296:                        false)).run();
1297:
1298:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1299:                tppf.setAsk(false);
1300:                tppf.isApplicable(dest);
1301:                tppf.setReformatComments(false);
1302:                tppf.setSingleLineCommentOwnline(true);
1303:                tppf.apply(dest);
1304:
1305:                FileCompare.assertEquals("TestComments.java in error",
1306:                        new File(checkDir, "TestComments1.java"), dest);
1307:            }
1308:
1309:            /**
1310:             *  A unit test for JUnit
1311:             */
1312:            public void test67() {
1313:                File dest = new File(destDir, "TestComments2.java");
1314:                (new FileCopy(new File(cleanDir, "TestComments2.java"), dest,
1315:                        false)).run();
1316:
1317:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1318:                tppf.setAsk(false);
1319:                tppf.isApplicable(dest);
1320:                tppf.setReformatComments(false);
1321:                tppf.setCStyle(PrintData.CSC_LEAVE_UNTOUCHED);
1322:                tppf.setSingleLineCommentOwnline(true);
1323:                tppf.apply(dest);
1324:
1325:                FileCompare.assertEquals("TestComments2.java in error",
1326:                        new File(checkDir, "TestComments2.java"), dest);
1327:            }
1328:
1329:            /**
1330:             *  A unit test for JUnit
1331:             */
1332:            public void test68() {
1333:                File dest = new File(destDir, "TestComments3.java");
1334:                (new FileCopy(new File(cleanDir, "TestComments3.java"), dest,
1335:                        false)).run();
1336:
1337:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1338:                tppf.setAsk(false);
1339:                tppf.isApplicable(dest);
1340:                tppf.setReformatComments(false);
1341:                tppf.setKeepAll(true);
1342:                tppf.setSingleLineCommentOwnline(true);
1343:                tppf.apply(dest);
1344:
1345:                FileCompare.assertEquals("TestComments3.java in error",
1346:                        new File(checkDir, "TestComments3.java"), dest);
1347:            }
1348:
1349:            /**
1350:             *  A unit test for JUnit
1351:             */
1352:            public void test69() {
1353:                File dest = new File(destDir, "TestComments3.java");
1354:                (new FileCopy(new File(cleanDir, "TestComments3.java"), dest,
1355:                        false)).run();
1356:
1357:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1358:                tppf.setAsk(false);
1359:                tppf.isApplicable(dest);
1360:                tppf.setReformatComments(true);
1361:                tppf.setKeepAll(false);
1362:                tppf.setSingleLineCommentOwnline(false);
1363:                tppf.apply(dest);
1364:
1365:                FileCompare.assertEquals("TestComments4.java in error",
1366:                        new File(checkDir, "TestComments4.java"), dest);
1367:            }
1368:
1369:            /**
1370:             *  A unit test for JUnit
1371:             */
1372:            public void test70() {
1373:                File dest = new File(destDir, "TestComments3.java");
1374:                (new FileCopy(new File(cleanDir, "TestComments3.java"), dest,
1375:                        false)).run();
1376:
1377:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1378:                tppf.setAsk(false);
1379:                tppf.isApplicable(dest);
1380:                tppf.setReformatComments(true);
1381:                tppf.setKeepAll(false);
1382:                tppf.setSingleLineCommentOwnline(false);
1383:                tppf.setSingleLineCommentOwnlineCode(false);
1384:                tppf.setSingleLineCommentSharedIncremental(false);
1385:                tppf.setAbsoluteSpace(50);
1386:                tppf.apply(dest);
1387:
1388:                FileCompare.assertEquals("TestComments5.java in error",
1389:                        new File(checkDir, "TestComments5.java"), dest);
1390:            }
1391:
1392:            /**
1393:             *  A unit test for JUnit
1394:             */
1395:            public void test71() {
1396:                File dest = new File(destDir, "TestComments3.java");
1397:                (new FileCopy(new File(cleanDir, "TestComments3.java"), dest,
1398:                        false)).run();
1399:
1400:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1401:                tppf.setAsk(false);
1402:                tppf.isApplicable(dest);
1403:                tppf.setReformatComments(true);
1404:                tppf.setKeepAll(false);
1405:                tppf.setSingleLineCommentOwnline(false);
1406:                tppf.setSingleLineCommentOwnlineCode(false);
1407:                tppf.setSingleLineCommentSharedIncremental(true);
1408:                tppf.setAbsoluteSpace(50);
1409:                tppf.apply(dest);
1410:
1411:                FileCompare.assertEquals("TestComments6.java in error",
1412:                        new File(checkDir, "TestComments6.java"), dest);
1413:            }
1414:
1415:            /**
1416:             *  A unit test for JUnit
1417:             */
1418:            public void test72() {
1419:                File dest = new File(destDir, "TestCStyleComments.java");
1420:                (new FileCopy(new File(cleanDir, "TestCStyleComments.java"),
1421:                        dest, false)).run();
1422:
1423:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1424:                tppf.setAsk(false);
1425:                tppf.isApplicable(dest);
1426:                tppf.setReformatComments(false);
1427:                tppf.setCStyle(PrintData.CSC_LEAVE_UNTOUCHED);
1428:                tppf.setKeepAll(false);
1429:                tppf.setSingleLineCommentOwnline(false);
1430:                tppf.setSingleLineCommentOwnlineCode(false);
1431:                tppf.setSingleLineCommentSharedIncremental(true);
1432:                tppf.setAbsoluteSpace(50);
1433:                tppf.apply(dest);
1434:
1435:                FileCompare.assertEquals("TestCStyleComments.java in error",
1436:                        new File(checkDir, "TestCStyleComments.java"), dest);
1437:            }
1438:
1439:            /**
1440:             *  A unit test for JUnit
1441:             */
1442:            public void test73() {
1443:                File dest = new File(destDir, "TestEscapedCharacters.java");
1444:                (new FileCopy(new File(cleanDir, "TestEscapedCharacters.java"),
1445:                        dest, false)).run();
1446:
1447:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1448:                tppf.setAsk(false);
1449:                tppf.isApplicable(dest);
1450:                tppf.setReformatComments(false);
1451:                tppf.setKeepAll(false);
1452:                tppf.setSingleLineCommentOwnline(false);
1453:                tppf.setSingleLineCommentOwnlineCode(false);
1454:                tppf.setSingleLineCommentSharedIncremental(true);
1455:                tppf.setAbsoluteSpace(50);
1456:                tppf.apply(dest);
1457:
1458:                FileCompare.assertEquals("TestEscapedCharacters.java in error",
1459:                        new File(checkDir, "TestEscapedCharacters.java"), dest);
1460:            }
1461:
1462:            /**
1463:             *  A unit test for JUnit
1464:             */
1465:            public void test74() {
1466:                File dest = new File(destDir, "VariableFormattingTester.java");
1467:                (new FileCopy(new File(cleanDir,
1468:                        "VariableFormattingTester.java"), dest, false)).run();
1469:
1470:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1471:                tppf.setAsk(false);
1472:                tppf.isApplicable(dest);
1473:                tppf.setDynamicFieldSpacing(PrintData.DFS_ALWAYS);
1474:                tppf.apply(dest);
1475:
1476:                FileCompare.assertEquals(
1477:                        "VariableFormattingTester.java in error", new File(
1478:                                checkDir, "VariableFormattingTester1.java"),
1479:                        dest);
1480:            }
1481:
1482:            /**
1483:             *  A unit test for JUnit
1484:             */
1485:            public void test75() {
1486:                File dest = new File(destDir, "VariableFormattingTester.java");
1487:                (new FileCopy(new File(cleanDir,
1488:                        "VariableFormattingTester.java"), dest, false)).run();
1489:
1490:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1491:                tppf.setAsk(false);
1492:                tppf.isApplicable(dest);
1493:                tppf.setDynamicFieldSpacing(PrintData.DFS_NOT_WITH_JAVADOC);
1494:                tppf.apply(dest);
1495:
1496:                FileCompare.assertEquals(
1497:                        "VariableFormattingTester.java in error", new File(
1498:                                checkDir, "VariableFormattingTester2.java"),
1499:                        dest);
1500:            }
1501:
1502:            /**
1503:             *  A unit test for JUnit
1504:             */
1505:            public void test76() {
1506:                File dest = new File(destDir, "VariableFormattingTester.java");
1507:                (new FileCopy(new File(cleanDir,
1508:                        "VariableFormattingTester.java"), dest, false)).run();
1509:
1510:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1511:                tppf.setAsk(false);
1512:                tppf.isApplicable(dest);
1513:                tppf.setDynamicFieldSpacing(PrintData.DFS_NEVER);
1514:                tppf.apply(dest);
1515:
1516:                FileCompare.assertEquals(
1517:                        "VariableFormattingTester.java in error", new File(
1518:                                checkDir, "VariableFormattingTester3.java"),
1519:                        dest);
1520:            }
1521:
1522:            /**
1523:             *  A unit test for JUnit
1524:             */
1525:            public void test77() {
1526:                File dest = new File(destDir, "VariableFormattingTester.java");
1527:                (new FileCopy(new File(cleanDir,
1528:                        "VariableFormattingTester.java"), dest, false)).run();
1529:
1530:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1531:                tppf.setAsk(false);
1532:                tppf.isApplicable(dest);
1533:                tppf.setDynamicFieldSpacing(PrintData.DFS_ALIGN_EQUALS);
1534:                tppf.apply(dest);
1535:
1536:                FileCompare.assertEquals(
1537:                        "VariableFormattingTester.java in error", new File(
1538:                                checkDir, "VariableFormattingTester4.java"),
1539:                        dest);
1540:            }
1541:
1542:            /**
1543:             *  A unit test for JUnit
1544:             */
1545:            public void test78() {
1546:                File dest = new File(destDir, "E.java");
1547:                (new FileCopy(new File(cleanDir, "E.java"), dest, false)).run();
1548:
1549:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1550:                tppf.setKeepErroneousJavadocTags(true);
1551:                tppf.setSpaceInsideCast(true);
1552:                tppf.setSpaceAfterMethod(true);
1553:                tppf.setSpaceAroundOperators(false);
1554:                tppf.setModifierOrder(PrintData.STANDARD_ORDER);
1555:                tppf.setAsk(false);
1556:                tppf.isApplicable(dest);
1557:                tppf.apply(dest);
1558:
1559:                FileCompare.assertEquals("E.java in error", new File(checkDir,
1560:                        "E2.java"), dest);
1561:            }
1562:
1563:            /**
1564:             *  A unit test for JUnit
1565:             */
1566:            public void test79() {
1567:                File dest = new File(destDir, "F.java");
1568:                (new FileCopy(new File(cleanDir, "F.java"), dest, false)).run();
1569:
1570:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1571:                tppf.setLineBeforeClassBody(true);
1572:                tppf.setLineBeforeExtends(true);
1573:                tppf.setLineBeforeImplements(true);
1574:                tppf.setLineBeforeMultistatementMethodBody(true);
1575:                tppf.setExtendsIndentation(5);
1576:                tppf.setImplementsIndentation(6);
1577:                tppf.setAsk(false);
1578:                tppf.isApplicable(dest);
1579:                tppf.apply(dest);
1580:
1581:                FileCompare.assertEquals("F.java in error", new File(checkDir,
1582:                        "F1.java"), dest);
1583:            }
1584:
1585:            /**
1586:             *  A unit test for JUnit
1587:             */
1588:            public void test80() {
1589:                File dest = new File(destDir, "F.java");
1590:                (new FileCopy(new File(cleanDir, "F.java"), dest, false)).run();
1591:
1592:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1593:                tppf.setAsk(false);
1594:                tppf.isApplicable(dest);
1595:                tppf.apply(dest);
1596:
1597:                FileCompare.assertEquals("F.java in error", new File(checkDir,
1598:                        "F2.java"), dest);
1599:            }
1600:
1601:            /**
1602:             *  A unit test for JUnit
1603:             */
1604:            public void test81() {
1605:                File dest = new File(destDir, "TestArrayInitializerIndent.java");
1606:                (new FileCopy(new File(cleanDir,
1607:                        "TestArrayInitializerIndent.java"), dest, false)).run();
1608:
1609:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1610:                tppf.setAsk(false);
1611:                tppf.isApplicable(dest);
1612:                tppf.setEmptyBlockOnSingleLine(true);
1613:                tppf.setIndentInInitializer(true);
1614:                tppf.setArrayInitializerIndented(false);
1615:                tppf.setAlignStarsWithSlash(true);
1616:                tppf.setBangSpace(true);
1617:                tppf.apply(dest);
1618:
1619:                FileCompare.assertEquals(
1620:                        "TestArrayInitializerIndent.java in error", new File(
1621:                                checkDir, "TestArrayInitializerIndent2.java"),
1622:                        dest);
1623:            }
1624:
1625:            /**
1626:             *  A unit test for JUnit
1627:             *@since JRefactory 2.7.01
1628:             */
1629:            public void test82() {
1630:                File dest = new File(destDir, "JEditBug_692442_spaces.java");
1631:                (new FileCopy(new File(cleanDir, "JEditBug_692442.java"), dest,
1632:                        false)).run();
1633:
1634:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1635:                tppf.setAsk(false);
1636:                tppf.isApplicable(dest);
1637:                tppf.setInsertSpaceLocalVariables(true);
1638:                tppf.setLinesAfterPackage(2);
1639:                tppf.setMaintainNewlinesAroundImports(false);
1640:                tppf.setSortTop(true);
1641:                tppf.setLinesBeforeClass(2);
1642:                tppf.setSpaceAfterKeyword(true);
1643:                tppf.apply(dest);
1644:
1645:                FileCompare.assertEquals(
1646:                        "JEditBug_692442_spaces.java in error", new File(
1647:                                checkDir, "JEditBug_692442_spaces.java"), dest);
1648:
1649:                dest = new File(destDir, "JEditBug_692442_nospaces.java");
1650:                (new FileCopy(new File(cleanDir, "JEditBug_692442.java"), dest,
1651:                        false)).run();
1652:
1653:                tppf = new TestPrettyPrintFile();
1654:                tppf.setAsk(false);
1655:                tppf.isApplicable(dest);
1656:                tppf.setInsertSpaceLocalVariables(true);
1657:                tppf.setLinesAfterPackage(2);
1658:                tppf.setMaintainNewlinesAroundImports(false);
1659:                tppf.setSortTop(true);
1660:                tppf.setLinesBeforeClass(2);
1661:                tppf.setSpaceAfterKeyword(false);
1662:                tppf.apply(dest);
1663:
1664:                FileCompare.assertEquals(
1665:                        "JEditBug_692442_nospaces.java in error", new File(
1666:                                checkDir, "JEditBug_692442_nospaces.java"),
1667:                        dest);
1668:            }
1669:
1670:            /**
1671:             *  A unit test for JUnit
1672:             *@since JRefactory 2.7.01
1673:             */
1674:            public void test83() {
1675:                File dest = new File(destDir, "JEditBug_728002.java");
1676:                (new FileCopy(new File(cleanDir, "JEditBug_728002.java"), dest,
1677:                        false)).run();
1678:
1679:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1680:                tppf.setAsk(false);
1681:                tppf.isApplicable(dest);
1682:                tppf.setInsertSpaceLocalVariables(true);
1683:                tppf.setLinesAfterPackage(2);
1684:                tppf.setMaintainNewlinesAroundImports(false);
1685:                tppf.setSortTop(true);
1686:                tppf.setLinesBeforeClass(2);
1687:                tppf.setSpaceAfterKeyword(true);
1688:                tppf.apply(dest);
1689:
1690:                FileCompare.assertEquals("JEditBug_728002.java in error",
1691:                        new File(checkDir, "JEditBug_728002.java"), dest);
1692:            }
1693:
1694:            /**
1695:             *  This test gives a parse error, as it should. It used to cause an
1696:             *  infinite loop rather than an error, which was fixed by adding a
1697:             *  LOOKAHEAD(2) to the ArgumentList() definition in java1_5.jjt
1698:             *  JavaCC definition.
1699:             *@since JRefactory 2.7.01
1700:             */
1701:            /* 
1702:             public void test84()
1703:             {
1704:             File dest = new File(destDir, "JEditBug_549394.java");
1705:             (new FileCopy(
1706:             new File(cleanDir, "JEditBug_549394.java"),
1707:             dest, false)).run();
1708:
1709:             TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1710:             tppf.setAsk(false);
1711:             tppf.isApplicable(dest);
1712:             tppf.setInsertSpaceLocalVariables(true);
1713:             tppf.setLinesAfterPackage(2);
1714:             tppf.setMaintainNewlinesAroundImports(false);
1715:             tppf.setSortTop(true);
1716:             tppf.setLinesBeforeClass(2);
1717:             tppf.setSpaceAfterKeyword(true);
1718:             tppf.apply(dest);
1719:
1720:             FileCompare.assertEquals("JEditBug_549394.java in error",
1721:             new File(checkDir, "JEditBug_549394.java"),
1722:             dest);
1723:             }
1724:             */
1725:
1726:            /**
1727:             *  A unit test for JUnit
1728:             *@since JRefactory 2.7.01
1729:             */
1730:            public void test85() {
1731:                File dest = new File(destDir, "JEditBug_551481.java");
1732:                (new FileCopy(new File(cleanDir, "JEditBug_551481.java"), dest,
1733:                        false)).run();
1734:
1735:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1736:                tppf.setAsk(false);
1737:                tppf.isApplicable(dest);
1738:                tppf.setInsertSpaceLocalVariables(true);
1739:                tppf.setLinesAfterPackage(2);
1740:                tppf.setMaintainNewlinesAroundImports(false);
1741:                tppf.setSortTop(true);
1742:                tppf.setLinesBeforeClass(2);
1743:                tppf.setSpaceAfterKeyword(true);
1744:                tppf.apply(dest);
1745:
1746:                FileCompare.assertEquals("JEditBug_551481.java in error",
1747:                        new File(checkDir, "JEditBug_551481.java"), dest);
1748:            }
1749:
1750:            /**
1751:             *  A unit test for JUnit
1752:             *@since JRefactory 2.7.01
1753:             */
1754:            public void test86() {
1755:                File dest = new File(destDir, "JEditBug_570143.java");
1756:                (new FileCopy(new File(cleanDir, "JEditBug_570143.java"), dest,
1757:                        false)).run();
1758:
1759:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1760:                tppf.setAsk(false);
1761:                tppf.isApplicable(dest);
1762:                tppf.setInsertSpaceLocalVariables(true);
1763:                tppf.setLinesAfterPackage(2);
1764:                tppf.setMaintainNewlinesAroundImports(false);
1765:                tppf.setSortTop(true);
1766:                tppf.setLinesBeforeClass(2);
1767:                tppf.setSpaceAfterKeyword(true);
1768:                tppf.apply(dest);
1769:
1770:                FileCompare.assertEquals("JEditBug_570143.java in error",
1771:                        new File(checkDir, "JEditBug_570143.java"), dest);
1772:            }
1773:
1774:            /**
1775:             *  A unit test for JUnit
1776:             *@since JRefactory 2.7.01
1777:             */
1778:            public void test87() {
1779:                File dest = new File(destDir, "Labels.java");
1780:                (new FileCopy(new File(cleanDir, "Labels.java"), dest, false))
1781:                        .run();
1782:
1783:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1784:                tppf.setAsk(false);
1785:                tppf.isApplicable(dest);
1786:                tppf.setInsertSpaceLocalVariables(true);
1787:                tppf.setLinesAfterPackage(2);
1788:                tppf.setMaintainNewlinesAroundImports(false);
1789:                tppf.setSortTop(true);
1790:                tppf.setLinesBeforeClass(2);
1791:                tppf.setSpaceAfterKeyword(true);
1792:                tppf.apply(dest);
1793:
1794:                FileCompare.assertEquals("Labels.java in error", new File(
1795:                        checkDir, "Labels.java"), dest);
1796:            }
1797:
1798:            /**
1799:             *  A unit test for JUnit
1800:             *@since JRefactory 2.7.01
1801:             */
1802:            public void test88() {
1803:                String[] orderStrings = {
1804:                        "Type(Field,Constructor,Method,NestedClass,NestedInterface,Initializer)",
1805:                        "Class(Instance,Static)", "Protection(private,public)",
1806:                        "Method(other,setter,getter)" };
1807:
1808:                File dest = new File(destDir, "Bug_703771.java");
1809:                (new FileCopy(new File(cleanDir, "Bug_703771.java"), dest,
1810:                        false)).run();
1811:
1812:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1813:                tppf.setAsk(false);
1814:                tppf.isApplicable(dest);
1815:                tppf.setMultipleOrdering(new MultipleOrdering(orderStrings));
1816:                tppf.apply(dest);
1817:
1818:                FileCompare.assertEquals("Bug_703771.java in error", new File(
1819:                        checkDir, "Bug_703771.java"), dest);
1820:            }
1821:
1822:            /**
1823:             *  A unit test for JUnit
1824:             *@since JRefactory 2.7.01
1825:             */
1826:            public void test89() {
1827:
1828:                File dest = new File(destDir, "Bug_693745.java");
1829:                (new FileCopy(new File(cleanDir, "Bug_693745.java"), dest,
1830:                        false)).run();
1831:
1832:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1833:                tppf.setAsk(false);
1834:                tppf.isApplicable(dest);
1835:                tppf.setIndentInInitializer(false);
1836:                tppf.setBangSpace(true);
1837:                tppf.setIndentBracesInitializer(false); // testing these settings
1838:                tppf.setArrayInitializerIndented(false); // testing these settings
1839:                tppf.apply(dest);
1840:
1841:                FileCompare.assertEquals("Bug_693745.java in error", new File(
1842:                        checkDir, "Bug_693745.java"), dest);
1843:            }
1844:
1845:            /**
1846:             *  A unit test for JUnit
1847:             *@since JRefactory 2.7.01
1848:             */
1849:            public void test90() {
1850:                String[] orderStrings = { "java", "javax", "org.w3c",
1851:                        "org.apache", "com.sun" };
1852:
1853:                File dest = new File(destDir, "Bug_693738.java");
1854:                (new FileCopy(new File(cleanDir, "Bug_693738.java"), dest,
1855:                        false)).run();
1856:
1857:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1858:                tppf.setAsk(false);
1859:                tppf.isApplicable(dest);
1860:                tppf.setImportSortImportant(orderStrings);
1861:                tppf.setImportSortNeighbourhood(1);
1862:                tppf.setSortTop(true);
1863:                tppf.setEmptyBlockOnSingleLine(true);
1864:                tppf.apply(dest);
1865:
1866:                FileCompare.assertEquals("Bug_693738.java in error", new File(
1867:                        checkDir, "Bug_693738.java"), dest);
1868:            }
1869:
1870:            /**
1871:             *  A unit test for JUnit
1872:             *@since JRefactory 2.7.01
1873:             */
1874:            public void test91() {
1875:
1876:                File dest = new File(destDir, "Bug_679496.java");
1877:                (new FileCopy(new File(cleanDir, "Bug_679496.java"), dest,
1878:                        false)).run();
1879:
1880:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1881:                tppf.setAsk(false);
1882:                tppf.isApplicable(dest);
1883:                tppf.apply(dest);
1884:
1885:                FileCompare.assertEquals("Bug_679496.java in error", new File(
1886:                        checkDir, "Bug_679496.java"), dest);
1887:            }
1888:
1889:            /**
1890:             *  A unit test for JUnit
1891:             *@since JRefactory 2.7.01
1892:             */
1893:            public void test92() {
1894:
1895:                File dest = new File(destDir, "Bug_605626.java");
1896:                (new FileCopy(new File(cleanDir, "Bug_605626.java"), dest,
1897:                        false)).run();
1898:
1899:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1900:                tppf.setAsk(false);
1901:                tppf.isApplicable(dest);
1902:                tppf.setRemoveExcessBlocks(true);
1903:                tppf.apply(dest);
1904:
1905:                FileCompare.assertEquals("Bug_605626.java in error", new File(
1906:                        checkDir, "Bug_605626.java"), dest);
1907:            }
1908:
1909:            /**
1910:             *  A unit test for JUnit
1911:             *@since JRefactory 2.7.01
1912:             */
1913:            public void test93() {
1914:
1915:                File dest = new File(destDir, "Bug_641473.java");
1916:                (new FileCopy(new File(cleanDir, "Bug_641473.java"), dest,
1917:                        false)).run();
1918:
1919:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1920:                tppf.setAsk(false);
1921:                tppf.isApplicable(dest);
1922:                tppf.apply(dest);
1923:
1924:                FileCompare.assertEquals("Bug_641473.java in error", new File(
1925:                        checkDir, "Bug_641473.java"), dest);
1926:            }
1927:
1928:            /**
1929:             *  A unit test for JUnit
1930:             *@since JRefactory 2.7.01
1931:             */
1932:            public void test94() {
1933:
1934:                File dest = new File(destDir, "Bug_616419.java");
1935:                (new FileCopy(new File(cleanDir, "Bug_616419.java"), dest,
1936:                        false)).run();
1937:
1938:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1939:                tppf.setAsk(false);
1940:                tppf.isApplicable(dest);
1941:                tppf.setJavadocWordWrapMinimum(30);
1942:                tppf.setJavadocWordWrapMaximum(50);
1943:                tppf.apply(dest);
1944:
1945:                FileCompare.assertEquals("Bug_616419.java in error", new File(
1946:                        checkDir, "Bug_616419.java"), dest);
1947:            }
1948:
1949:            /**
1950:             *  Unit test for pretty printer
1951:             *@since JRefactory 2.7.01
1952:             */
1953:            public void test95() {
1954:                File dest = new File(destDir, "Bug_583264_c.java");
1955:                (new FileCopy(new File(cleanDir, "Bug_583264.java"), dest,
1956:                        false)).run();
1957:
1958:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
1959:                tppf.setAsk(false);
1960:                tppf.isApplicable(dest);
1961:                tppf.setForceBlock(true);
1962:                tppf.setCodeBlockStyle(PrintData.BLOCK_STYLE_C);
1963:                tppf.setMethodBlockStyle(PrintData.BLOCK_STYLE_C);
1964:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_C);
1965:                tppf.setElseOnNewLine(false);
1966:                tppf.apply(dest);
1967:
1968:                FileCompare.assertEquals("Bug_583264.java in error", new File(
1969:                        checkDir, "Bug_583264_c.java"), dest);
1970:
1971:                dest = new File(destDir, "Bug_583264_emacs.java");
1972:                (new FileCopy(new File(cleanDir, "Bug_583264.java"), dest,
1973:                        false)).run();
1974:
1975:                tppf = new TestPrettyPrintFile();
1976:                tppf.setAsk(false);
1977:                tppf.isApplicable(dest);
1978:                tppf.setForceBlock(true);
1979:                tppf.setCodeBlockStyle(PrintData.BLOCK_STYLE_EMACS);
1980:                tppf.setMethodBlockStyle(PrintData.BLOCK_STYLE_EMACS);
1981:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_EMACS);
1982:                tppf.setElseOnNewLine(false);
1983:                tppf.apply(dest);
1984:
1985:                FileCompare.assertEquals("Bug_583264.java in error", new File(
1986:                        checkDir, "Bug_583264_emacs.java"), dest);
1987:
1988:                dest = new File(destDir, "Bug_583264_pascal.java");
1989:                (new FileCopy(new File(cleanDir, "Bug_583264.java"), dest,
1990:                        false)).run();
1991:
1992:                tppf = new TestPrettyPrintFile();
1993:                tppf.setAsk(false);
1994:                tppf.isApplicable(dest);
1995:                tppf.setForceBlock(true);
1996:                tppf.setCodeBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
1997:                tppf.setMethodBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
1998:                tppf.setClassBlockStyle(PrintData.BLOCK_STYLE_PASCAL);
1999:                tppf.setElseOnNewLine(false);
2000:                tppf.apply(dest);
2001:
2002:                FileCompare.assertEquals("Bug_583264.java in error", new File(
2003:                        checkDir, "Bug_583264_pascal.java"), dest);
2004:
2005:            }
2006:
2007:            /**
2008:             *  A unit test for JUnit
2009:             *@since JRefactory 2.7.01
2010:             */
2011:            public void test96() {
2012:
2013:                File dest = new File(destDir, "Bug_574070.java");
2014:                (new FileCopy(new File(cleanDir, "Bug_574070.java"), dest,
2015:                        false)).run();
2016:
2017:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2018:                tppf.setAsk(false);
2019:                tppf.isApplicable(dest);
2020:                tppf.setSingleLineCommentOwnline(false);
2021:                tppf.apply(dest);
2022:
2023:                FileCompare.assertEquals("Bug_574070.java in error", new File(
2024:                        checkDir, "Bug_574070.java"), dest);
2025:            }
2026:
2027:            /**
2028:             *  A unit test for JUnit
2029:             *@since JRefactory 2.7.02
2030:             */
2031:            public void test97() {
2032:
2033:                File dest = new File(destDir, "Bug_758816.java");
2034:                (new FileCopy(new File(cleanDir, "Bug_758816.java"), dest,
2035:                        false)).run();
2036:
2037:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2038:                tppf.setAsk(false);
2039:                tppf.isApplicable(dest);
2040:                tppf.setSingleLineCommentOwnline(false);
2041:                tppf.apply(dest);
2042:
2043:                FileCompare.assertEquals("Bug_758816.java in error", new File(
2044:                        checkDir, "Bug_758816.java"), dest);
2045:            }
2046:
2047:            /**
2048:             *  A unit test for JUnit
2049:             *@since JRefactory 2.7.02
2050:             */
2051:            public void test98() {
2052:
2053:                File dest = new File(destDir, "RFE_651809.java");
2054:                (new FileCopy(new File(cleanDir, "RFE_651809.java"), dest,
2055:                        false)).run();
2056:
2057:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2058:                tppf.setAsk(false);
2059:                tppf.isApplicable(dest);
2060:                tppf.setSingleLineCommentOwnline(false);
2061:                tppf.apply(dest);
2062:
2063:                FileCompare.assertEquals("RFE_651809.java in error", new File(
2064:                        checkDir, "RFE_651809.java"), dest);
2065:            }
2066:
2067:            /**
2068:             *  A unit test for JUnit
2069:             *@since JRefactory 2.7.03
2070:             */
2071:            public void test99() {
2072:                File dest = new File(destDir, "Bug_761890.java");
2073:                (new FileCopy(new File(cleanDir, "Bug_761890.java"), dest,
2074:                        false)).run();
2075:
2076:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2077:                tppf.setAsk(false);
2078:                tppf.isApplicable(dest);
2079:                tppf.setSingleLineCommentOwnline(false);
2080:                tppf.setCStyleOwnline(true);
2081:                tppf.apply(dest);
2082:
2083:                FileCompare.assertEquals("Bug_761890.java in error", new File(
2084:                        checkDir, "Bug_761890_after.java"), dest);
2085:
2086:                dest = new File(destDir, "Bug_761890.java");
2087:                (new FileCopy(new File(cleanDir, "Bug_761890.java"), dest,
2088:                        false)).run();
2089:
2090:                tppf = new TestPrettyPrintFile();
2091:                tppf.setAsk(false);
2092:                tppf.isApplicable(dest);
2093:                tppf.setSingleLineCommentOwnline(false);
2094:                tppf.setCStyleOwnline(false);
2095:                tppf.apply(dest);
2096:
2097:                FileCompare.assertEquals("Bug_761890.java in error", new File(
2098:                        checkDir, "Bug_761890_online.java"), dest);
2099:                dest = new File(destDir, "Bug_761890.java");
2100:                (new FileCopy(new File(cleanDir, "Bug_761890.java"), dest,
2101:                        false)).run();
2102:
2103:                tppf = new TestPrettyPrintFile();
2104:                tppf.setAsk(false);
2105:                tppf.isApplicable(dest);
2106:                tppf.setSingleLineCommentOwnline(true);
2107:                tppf.setCStyleOwnline(false);
2108:                tppf.apply(dest);
2109:
2110:                FileCompare.assertEquals("Bug_761890.java in error", new File(
2111:                        checkDir, "Bug_761890_after2.java"), dest);
2112:            }
2113:
2114:            /**
2115:             *  A unit test for JUnit
2116:             *@since JRefactory 2.7.04
2117:             */
2118:            public void test100() {
2119:                File dest = new File(destDir, "Bug_500410.java");
2120:                (new FileCopy(new File(cleanDir, "Bug_500410.java"), dest,
2121:                        false)).run();
2122:
2123:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2124:                tppf.setAsk(false);
2125:                tppf.isApplicable(dest);
2126:                tppf.setSingleLineCommentOwnline(false);
2127:                tppf.apply(dest);
2128:
2129:                FileCompare.assertEquals("Bug_500410.java in error", new File(
2130:                        checkDir, "Bug_500410.java"), dest);
2131:            }
2132:
2133:            /**
2134:             *  A unit test for JUnit
2135:             *@since JRefactory 2.7.04
2136:             */
2137:            public void test101() {
2138:                File dest = new File(destDir, "Bug_539934.java");
2139:                (new FileCopy(new File(cleanDir, "Bug_539934.java"), dest,
2140:                        false)).run();
2141:
2142:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2143:                tppf.setAsk(false);
2144:                tppf.isApplicable(dest);
2145:                tppf.setSingleLineCommentOwnline(false);
2146:                tppf.setLineUpParams(true);
2147:                tppf.apply(dest);
2148:
2149:                FileCompare.assertEquals("Bug_539934.java in error", new File(
2150:                        checkDir, "Bug_539934.java"), dest);
2151:            }
2152:
2153:            /**
2154:             *  A unit test for JUnit
2155:             *@since JRefactory 2.7.04
2156:             */
2157:            public void test102() {
2158:                File dest = new File(destDir, "Bug_554735.java");
2159:                (new FileCopy(new File(cleanDir, "Bug_554735.java"), dest,
2160:                        false)).run();
2161:
2162:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2163:                tppf.setAsk(false);
2164:                tppf.isApplicable(dest);
2165:                tppf.setSingleLineCommentOwnline(false);
2166:                tppf.apply(dest);
2167:
2168:                FileCompare.assertEquals("Bug_554735.java in error", new File(
2169:                        checkDir, "Bug_554735.java"), dest);
2170:            }
2171:
2172:            /**
2173:             *  A unit test for JUnit
2174:             *@since JRefactory 2.7.04
2175:             */
2176:            public void test103() {
2177:                File dest = new File(destDir, "Bug_465568.java");
2178:                (new FileCopy(new File(cleanDir, "Bug_465568.java"), dest,
2179:                        false)).run();
2180:
2181:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2182:                tppf.setAsk(false);
2183:                tppf.isApplicable(dest);
2184:                tppf.setSingleLineCommentOwnline(false);
2185:                tppf.apply(dest);
2186:
2187:                FileCompare.assertEquals("Bug_465568.java in error", new File(
2188:                        checkDir, "Bug_465568.java"), dest);
2189:            }
2190:
2191:            /**
2192:             *  A unit test for JUnit
2193:             *@since JRefactory 2.7.04
2194:             */
2195:            public void test104() {
2196:                File dest = new File(destDir, "RFE_446066.java");
2197:                (new FileCopy(new File(cleanDir, "RFE_446066.java"), dest,
2198:                        false)).run();
2199:
2200:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2201:                tppf.setAsk(false);
2202:                tppf.isApplicable(dest);
2203:                tppf.setSingleLineCommentOwnline(false);
2204:                tppf.apply(dest);
2205:
2206:                FileCompare.assertEquals("RFE_446066.java in error", new File(
2207:                        checkDir, "RFE_446066.java"), dest);
2208:            }
2209:
2210:            /**
2211:             *  A unit test for JUnit
2212:             *@since JRefactory 2.7.04
2213:             */
2214:            public void test105() {
2215:                File dest = new File(destDir, "RFE_465239.java");
2216:                (new FileCopy(new File(cleanDir, "RFE_465239.java"), dest,
2217:                        false)).run();
2218:
2219:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2220:                tppf.setAsk(false);
2221:                tppf.isApplicable(dest);
2222:                tppf.setSingleLineCommentOwnline(false);
2223:                tppf.apply(dest);
2224:
2225:                FileCompare.assertEquals("RFE_465239.java in error", new File(
2226:                        checkDir, "RFE_465239.java"), dest);
2227:            }
2228:
2229:            /**
2230:             *  A unit test for JUnit
2231:             *@since JRefactory 2.7.04
2232:             */
2233:            public void test106() {
2234:                File dest = new File(destDir, "RFE_465236.java");
2235:                (new FileCopy(new File(cleanDir, "RFE_465236.java"), dest,
2236:                        false)).run();
2237:
2238:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2239:                tppf.setAsk(false);
2240:                tppf.isApplicable(dest);
2241:                tppf.setLineUpParams(true);
2242:                tppf.setSingleLineCommentOwnline(false);
2243:                tppf.apply(dest);
2244:
2245:                FileCompare.assertEquals("RFE_465236.java in error", new File(
2246:                        checkDir, "RFE_465236.java"), dest);
2247:            }
2248:
2249:            /**
2250:             *  A unit test for JUnit
2251:             *@since JRefactory 2.7.05
2252:             */
2253:            public void test107() {
2254:                File dest = new File(destDir, "JEditBug_746217.java");
2255:                (new FileCopy(new File(cleanDir, "JEditBug_746217.java"), dest,
2256:                        false)).run();
2257:
2258:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2259:                tppf.setAsk(false);
2260:                tppf.isApplicable(dest);
2261:                tppf.setSingleLineCommentOwnline(false);
2262:                tppf.apply(dest);
2263:
2264:                FileCompare.assertEquals("JEditBug_746217.java in error",
2265:                        new File(checkDir, "JEditBug_746217.java"), dest);
2266:            }
2267:
2268:            /**
2269:             *  A unit test for JUnit.
2270:             *  This tests the various assert statements formats, a regression
2271:             *  was introduced that the current JUnit tests were not picking up,
2272:             *  c.f. RFE 755940 - jdk 1.4 assert syntax
2273:             *@since JRefactory 2.7.06
2274:             */
2275:            public void test108() {
2276:                File dest = new File(destDir, "AssertTest.java");
2277:                (new FileCopy(new File(cleanDir, "AssertTest.java"), dest,
2278:                        false)).run();
2279:
2280:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2281:                tppf.setAsk(false);
2282:                tppf.isApplicable(dest);
2283:                tppf.setSingleLineCommentOwnline(false);
2284:                tppf.apply(dest);
2285:
2286:                FileCompare.assertEquals("AssertTest.java in error", new File(
2287:                        checkDir, "AssertTest.java"), dest);
2288:            }
2289:
2290:            /**
2291:             *  A unit test for JUnit.
2292:             *  This is for a bug reported by Frederic Vernier
2293:             *@since JRefactory 2.8.05
2294:             */
2295:            public void test109() {
2296:                File dest = new File(destDir, "Bug_810715.java");
2297:                (new FileCopy(new File(cleanDir, "Bug_810715.java"), dest,
2298:                        false)).run();
2299:
2300:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2301:                tppf.setAsk(false);
2302:                tppf.isApplicable(dest);
2303:                tppf.setRemoveExcessBlocks(true);
2304:                tppf.apply(dest);
2305:
2306:                FileCompare.assertEquals("Bug_810715.java in error", new File(
2307:                        checkDir, "Bug_810715.java"), dest);
2308:            }
2309:
2310:            /**
2311:             *  A unit test for JUnit.
2312:             *@since JRefactory 2.8.07
2313:             */
2314:            public void test110() {
2315:                File dest = new File(destDir, "Bug_813428.java");
2316:                (new FileCopy(new File(cleanDir, "Bug_813428.java"), dest,
2317:                        false)).run();
2318:
2319:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2320:                tppf.setAsk(false);
2321:                tppf.isApplicable(dest);
2322:                tppf.setRemoveExcessBlocks(true);
2323:                tppf.apply(dest);
2324:
2325:                FileCompare.assertEquals("Bug_813428.java in error", new File(
2326:                        checkDir, "Bug_813428.java"), dest);
2327:            }
2328:
2329:            /**
2330:             *  A unit test for JUnit.
2331:             *@since JRefactory 2.9.0
2332:             */
2333:            public void test111() {
2334:                File dest = new File(destDir, "Bug_825576.java");
2335:                (new FileCopy(new File(cleanDir, "Bug_825576.java"), dest,
2336:                        false)).run();
2337:
2338:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2339:                tppf.setAsk(false);
2340:                tppf.isApplicable(dest);
2341:                tppf.setSingleLineCommentOwnline(false);
2342:                tppf.apply(dest);
2343:
2344:                FileCompare.assertEquals("Bug_825576.java in error", new File(
2345:                        checkDir, "Bug_825576.java"), dest);
2346:
2347:                dest = new File(destDir, "Bug_825576a.java");
2348:                (new FileCopy(new File(cleanDir, "Bug_825576a.java"), dest,
2349:                        false)).run();
2350:
2351:                tppf = new TestPrettyPrintFile();
2352:                tppf.setAsk(false);
2353:                tppf.isApplicable(dest);
2354:                tppf.setSingleLineCommentOwnline(false);
2355:                tppf.setLineUpParams(true);
2356:                tppf.apply(dest);
2357:
2358:                FileCompare.assertEquals("Bug_825576a.java in error", new File(
2359:                        checkDir, "Bug_825576a.java"), dest);
2360:            }
2361:
2362:            /**
2363:             *  A unit test for JUnit.
2364:             *@since JRefactory 2.9.1
2365:             */
2366:            public void test112() {
2367:                File dest = new File(destDir, "CopyConstructor.java");
2368:                (new FileCopy(new File(cleanDir, "CopyConstructor.java"), dest,
2369:                        false)).run();
2370:
2371:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2372:                tppf.setAsk(false);
2373:                tppf.isApplicable(dest);
2374:                tppf.apply(dest);
2375:
2376:                FileCompare.assertEquals("CopyConstructor.java in error",
2377:                        new File(checkDir, "CopyConstructor.java"), dest);
2378:            }
2379:
2380:            /**
2381:             *  A unit test for JUnit.
2382:             *  This is for a bug reported by Frederic Vernier
2383:             *@since JRefactory 2.9.1
2384:             */
2385:            public void test113() {
2386:                File dest = new File(destDir, "Movie.java");
2387:                (new FileCopy(new File(cleanDir, "Movie.java"), dest, false))
2388:                        .run();
2389:
2390:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2391:                tppf.setAsk(false);
2392:                tppf.isApplicable(dest);
2393:                tppf.setSingleLineCommentOwnline(false);
2394:                tppf.apply(dest);
2395:
2396:                FileCompare.assertEquals("Movie.java in error", new File(
2397:                        checkDir, "Movie.java"), dest);
2398:            }
2399:
2400:            /**
2401:             *  A unit test for JUnit.
2402:             *@since JRefactory 2.9.2
2403:             */
2404:            public void test114() {
2405:                File dest = new File(destDir, "RFE_446056extends.java");
2406:                (new FileCopy(new File(cleanDir, "RFE_446056extends.java"),
2407:                        dest, false)).run();
2408:
2409:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2410:                tppf.setAsk(false);
2411:                tppf.isApplicable(dest);
2412:                tppf.setSortExtendsStatement(true);
2413:                tppf.apply(dest);
2414:
2415:                FileCompare.assertEquals("RFE_446056extends.java in error",
2416:                        new File(checkDir, "RFE_446056extends.java"), dest);
2417:            }
2418:
2419:            /**
2420:             *  A unit test for JUnit.
2421:             *@since JRefactory 2.9.2
2422:             */
2423:            public void test115() {
2424:                File dest = new File(destDir, "RFE_446056implements.java");
2425:                (new FileCopy(new File(cleanDir, "RFE_446056implements.java"),
2426:                        dest, false)).run();
2427:
2428:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2429:                tppf.setAsk(false);
2430:                tppf.isApplicable(dest);
2431:                tppf.setSortImplementsStatement(true);
2432:                tppf.apply(dest);
2433:
2434:                FileCompare.assertEquals("RFE_446056implements.java in error",
2435:                        new File(checkDir, "RFE_446056implements.java"), dest);
2436:            }
2437:
2438:            /**
2439:             *  A unit test for JUnit.
2440:             *@since JRefactory 2.9.2
2441:             */
2442:            public void test116() {
2443:                File dest = new File(destDir, "RFE_446058throws.java");
2444:                (new FileCopy(new File(cleanDir, "RFE_446058throws.java"),
2445:                        dest, false)).run();
2446:
2447:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2448:                tppf.setAsk(false);
2449:                tppf.isApplicable(dest);
2450:                tppf.setSortThrowsStatement(true);
2451:                tppf.apply(dest);
2452:
2453:                FileCompare.assertEquals("RFE_446058throws.java in error",
2454:                        new File(checkDir, "RFE_446058throws.java"), dest);
2455:            }
2456:
2457:            /**
2458:             *  A unit test for JUnit.
2459:             *@since JRefactory 2.9.2
2460:             */
2461:            public void test117() {
2462:                File dest = new File(destDir, "JEditBug_833328.java");
2463:                (new FileCopy(new File(cleanDir, "JEditBug_833328.java"), dest,
2464:                        false)).run();
2465:
2466:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2467:                tppf.setAsk(false);
2468:                tppf.isApplicable(dest);
2469:                //tppf.setSortTop(true);
2470:                tppf.setSingleLineCommentOwnline(false);
2471:                tppf.apply(dest);
2472:
2473:                FileCompare.assertEquals("JEditBug_833328.java in error",
2474:                        new File(checkDir, "JEditBug_833328.java"), dest);
2475:            }
2476:
2477:            /**
2478:             *  A unit test for JUnit.
2479:             *@since JRefactory 2.9.2
2480:             */
2481:            public void test118() {
2482:                File dest = new File(destDir, "JEditBug_833328.java");
2483:                (new FileCopy(new File(cleanDir, "JEditBug_833328.java"), dest,
2484:                        false)).run();
2485:
2486:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2487:                tppf.setAsk(false);
2488:                tppf.isApplicable(dest);
2489:                tppf.setSortTop(false);
2490:                tppf.setSingleLineCommentOwnline(false);
2491:                tppf.apply(dest);
2492:
2493:                FileCompare.assertEquals(
2494:                        "JEditBug_833328_noSort.java in error", new File(
2495:                                checkDir, "JEditBug_833328_noSort.java"), dest);
2496:            }
2497:
2498:            /**
2499:             *  A unit test for JUnit.
2500:             *@since JRefactory 2.9.4
2501:             */
2502:            public void test119() {
2503:                File dest = new File(destDir, "Bug_517495.java");
2504:                (new FileCopy(new File(cleanDir, "Bug_517495.java"), dest,
2505:                        false)).run();
2506:
2507:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2508:                tppf.setAsk(false);
2509:                tppf.isApplicable(dest);
2510:                tppf.setSortTop(false);
2511:                tppf.setSingleLineCommentOwnline(false);
2512:                tppf.apply(dest);
2513:
2514:                FileCompare.assertEquals("Bug_517495.java in error", new File(
2515:                        checkDir, "Bug_517495.java"), dest);
2516:            }
2517:
2518:            /**
2519:             *  A unit test for JUnit.
2520:             *@since JRefactory 2.9.5
2521:             */
2522:            public void test120() {
2523:                File dest = new File(destDir, "Bug_516386.java");
2524:                (new FileCopy(new File(cleanDir, "Bug_516386.java"), dest,
2525:                        false)).run();
2526:
2527:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2528:                tppf.setAsk(false);
2529:                tppf.isApplicable(dest);
2530:                tppf.setSortTop(false);
2531:                tppf.setSingleLineCommentOwnline(false);
2532:                tppf.apply(dest);
2533:
2534:                FileCompare.assertEquals("Bug_516386.java in error", new File(
2535:                        checkDir, "Bug_516386.java"), dest);
2536:            }
2537:
2538:            /**
2539:             *  A unit test for JUnit.
2540:             *@since JRefactory 2.9.15
2541:             */
2542:            public void test121() {
2543:                File dest = new File(destDir, "Bug_929006.java");
2544:                (new FileCopy(new File(cleanDir, "Bug_929006.java"), dest,
2545:                        false)).run();
2546:
2547:                TestPrettyPrintFile tppf = new TestPrettyPrintFile();
2548:                tppf.setAsk(false);
2549:                tppf.isApplicable(dest);
2550:                tppf.setParamDescr("");
2551:                tppf.apply(dest);
2552:
2553:                FileCompare.assertEquals("Bug_929006.java in error", new File(
2554:                        checkDir, "Bug_929006.java"), dest);
2555:
2556:                dest = new File(destDir, "Bug_929006a.java");
2557:                (new FileCopy(new File(cleanDir, "Bug_929006a.java"), dest,
2558:                        false)).run();
2559:
2560:                tppf = new TestPrettyPrintFile();
2561:                tppf.setAsk(false);
2562:                tppf.isApplicable(dest);
2563:                tppf.setParamDescr("New description");
2564:                tppf.apply(dest);
2565:
2566:                FileCompare.assertEquals("Bug_929006a.java in error", new File(
2567:                        checkDir, "Bug_929006a.java"), dest);
2568:            }
2569:
2570:            /**
2571:             *  The JUnit setup method
2572:             */
2573:            protected void setUp() {
2574:                cleanDir = new File("test/clean/pretty");
2575:                //try {
2576:                //    System.out.println("file="+cleanDir.getCanonicalFile());
2577:                //} catch (java.io.IOException e) {
2578:                //    e.printStackTrace();
2579:                //}
2580:                destDir = new File("test/temp");
2581:                checkDir = new File("test/check/pretty");
2582:                (new RefactoryInstaller(false)).run();
2583:            }
2584:
2585:            public static TestSuite suite() {
2586:                TestSuite result = new TestSuite();
2587:                /*        
2588:                 result.addTest(new TestPrettyPrinter("test68"));
2589:                 //result.addTest(new TestPrettyPrinter("test88"));
2590:                 //result.addTest(new TestPrettyPrinter("test89"));
2591:                 //result.addTest(new TestPrettyPrinter("test90"));
2592:                 //result.addTest(new TestPrettyPrinter("test91"));
2593:                 //result.addTest(new TestPrettyPrinter("test92"));
2594:                 //result.addTest(new TestPrettyPrinter("test93"));
2595:                 //result.addTest(new TestPrettyPrinter("test94"));
2596:                 //result.addTest(new TestPrettyPrinter("test95"));
2597:                 //result.addTest(new TestPrettyPrinter("test96"));
2598:                 //result.addTest(new TestPrettyPrinter("test97"));
2599:                 //result.addTest(new TestPrettyPrinter("test98"));
2600:                 //result.addTest(new TestPrettyPrinter("test99"));
2601:                 result.addTest(new TestPrettyPrinter("test100"));
2602:                 result.addTest(new TestPrettyPrinter("test101"));
2603:                 result.addTest(new TestPrettyPrinter("test102"));
2604:                 result.addTest(new TestPrettyPrinter("test103"));
2605:                 result.addTest(new TestPrettyPrinter("test104"));
2606:                 result.addTest(new TestPrettyPrinter("test105"));
2607:                 result.addTest(new TestPrettyPrinter("test106"));
2608:                 result.addTest(new TestPrettyPrinter("test107"));
2609:                 result.addTest(new TestPrettyPrinter("test108"));
2610:                 result.addTest(new TestPrettyPrinter("test109"));
2611:                 result.addTest(new TestPrettyPrinter("test110"));
2612:                 result.addTest(new TestPrettyPrinter("test111"));
2613:                 result.addTest(new TestPrettyPrinter("test112"));
2614:                 result.addTest(new TestPrettyPrinter("test113"));
2615:                 result.addTest(new TestPrettyPrinter("test114"));
2616:                 result.addTest(new TestPrettyPrinter("test115"));
2617:                 result.addTest(new TestPrettyPrinter("test116"));
2618:                 //result.addTest(new TestPrettyPrinter("test117"));
2619:                 //result.addTest(new TestPrettyPrinter("test118"));
2620:                 result.addTest(new TestPrettyPrinter("test119"));
2621:                 result.addTest(new TestPrettyPrinter("test120"));
2622:                 */
2623:                result.addTest(new TestPrettyPrinter("test121"));
2624:                return result;
2625:            }
2626:
2627:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.