1 20 21 package org.netbeans.test.editor.app.tests; 22 import java.io.PrintWriter ; 23 import org.openide.filesystems.*; 24 import org.netbeans.junit.NbTestCase; 25 import org.netbeans.junit.NbTestSuite; 26 import java.io.File ; 27 import org.netbeans.test.editor.LineDiff; 28 29 30 35 36 public class JavaDocPerformer extends NbTestCase { 37 public JavaDocPerformer(String name) { 38 super(name); 39 } 40 public void tearDown() throws Exception { 41 assertFile("Output does not match golden file.", getGoldenFile(), new File (getWorkDir(), this.getName() + ".ref"), new File (getWorkDir(), this.getName() + ".diff"), new LineDiff(false)); 42 } 43 44 51 52 public void testInside() throws Exception { 53 PrintWriter ref = null; 54 PrintWriter log = null; 55 String [] arguments = new String [] { 56 "/org/netbeans/test/editor/app/tests/javadoc.xml", 57 "Writting.Inside" 58 }; 59 try { 60 ref = new PrintWriter (getRef()); 61 log = new PrintWriter (getLog()); 62 new CallTestGeneric().runTest(arguments, log, ref); 63 } finally { 64 if (ref != null) ref.flush(); 65 if (log != null) log.flush(); 66 } 67 } 68 69 76 77 public void testStart() throws Exception { 78 PrintWriter ref = null; 79 PrintWriter log = null; 80 String [] arguments = new String [] { 81 "/org/netbeans/test/editor/app/tests/javadoc.xml", 82 "Writting.Start" 83 }; 84 try { 85 ref = new PrintWriter (getRef()); 86 log = new PrintWriter (getLog()); 87 new CallTestGeneric().runTest(arguments, log, ref); 88 } finally { 89 if (ref != null) ref.flush(); 90 if (log != null) log.flush(); 91 } 92 } 93 94 101 102 public void testEnd() throws Exception { 103 PrintWriter ref = null; 104 PrintWriter log = null; 105 String [] arguments = new String [] { 106 "/org/netbeans/test/editor/app/tests/javadoc.xml", 107 "Writting.End" 108 }; 109 try { 110 ref = new PrintWriter (getRef()); 111 log = new PrintWriter (getLog()); 112 new CallTestGeneric().runTest(arguments, log, ref); 113 } finally { 114 if (ref != null) ref.flush(); 115 if (log != null) log.flush(); 116 } 117 } 118 119 126 127 public void testInsideNoLeading() throws Exception { 128 PrintWriter ref = null; 129 PrintWriter log = null; 130 String [] arguments = new String [] { 131 "/org/netbeans/test/editor/app/tests/javadoc.xml", 132 "Writting.InsideNoLeading" 133 }; 134 try { 135 ref = new PrintWriter (getRef()); 136 log = new PrintWriter (getLog()); 137 new CallTestGeneric().runTest(arguments, log, ref); 138 } finally { 139 if (ref != null) ref.flush(); 140 if (log != null) log.flush(); 141 } 142 } 143 144 151 152 public void testStartNoLeading() throws Exception { 153 PrintWriter ref = null; 154 PrintWriter log = null; 155 String [] arguments = new String [] { 156 "/org/netbeans/test/editor/app/tests/javadoc.xml", 157 "Writting.StartNoLeading" 158 }; 159 try { 160 ref = new PrintWriter (getRef()); 161 log = new PrintWriter (getLog()); 162 new CallTestGeneric().runTest(arguments, log, ref); 163 } finally { 164 if (ref != null) ref.flush(); 165 if (log != null) log.flush(); 166 } 167 } 168 169 176 177 public void testEndNoLeading() throws Exception { 178 PrintWriter ref = null; 179 PrintWriter log = null; 180 String [] arguments = new String [] { 181 "/org/netbeans/test/editor/app/tests/javadoc.xml", 182 "Writting.EndNoLeading" 183 }; 184 try { 185 ref = new PrintWriter (getRef()); 186 log = new PrintWriter (getLog()); 187 new CallTestGeneric().runTest(arguments, log, ref); 188 } finally { 189 if (ref != null) ref.flush(); 190 if (log != null) log.flush(); 191 } 192 } 193 194 201 202 public void testReformattingLeadingStar() throws Exception { 203 PrintWriter ref = null; 204 PrintWriter log = null; 205 String [] arguments = new String [] { 206 "/org/netbeans/test/editor/app/tests/javadoc.xml", 207 "Reformatting.ReformattingLeadingStar" 208 }; 209 try { 210 ref = new PrintWriter (getRef()); 211 log = new PrintWriter (getLog()); 212 new CallTestGeneric().runTest(arguments, log, ref); 213 } finally { 214 if (ref != null) ref.flush(); 215 if (log != null) log.flush(); 216 } 217 } 218 219 226 227 public void testReformatingNoLeadingStar() throws Exception { 228 PrintWriter ref = null; 229 PrintWriter log = null; 230 String [] arguments = new String [] { 231 "/org/netbeans/test/editor/app/tests/javadoc.xml", 232 "Reformatting.ReformatingNoLeadingStar" 233 }; 234 try { 235 ref = new PrintWriter (getRef()); 236 log = new PrintWriter (getLog()); 237 new CallTestGeneric().runTest(arguments, log, ref); 238 } finally { 239 if (ref != null) ref.flush(); 240 if (log != null) log.flush(); 241 } 242 } 243 } 244 | Popular Tags |