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 CompletionPerformer extends NbTestCase { 37 public CompletionPerformer(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 testFooClass() throws Exception { 53 PrintWriter ref = null; 54 PrintWriter log = null; 55 String [] arguments = new String [] { 56 "/org/netbeans/test/editor/app/tests/completion.xml", 57 "BasicTests.FooClass" 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 testObjectMethods() throws Exception { 78 PrintWriter ref = null; 79 PrintWriter log = null; 80 String [] arguments = new String [] { 81 "/org/netbeans/test/editor/app/tests/completion.xml", 82 "BasicTests.ObjectMethods" 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 testRetypeClass() throws Exception { 103 PrintWriter ref = null; 104 PrintWriter log = null; 105 String [] arguments = new String [] { 106 "/org/netbeans/test/editor/app/tests/completion.xml", 107 "BasicTests.RetypeClass" 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 testStayInvoked() throws Exception { 128 PrintWriter ref = null; 129 PrintWriter log = null; 130 String [] arguments = new String [] { 131 "/org/netbeans/test/editor/app/tests/completion.xml", 132 "BasicTests.StayInvoked" 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 testCaseInsensitive() throws Exception { 153 PrintWriter ref = null; 154 PrintWriter log = null; 155 String [] arguments = new String [] { 156 "/org/netbeans/test/editor/app/tests/completion.xml", 157 "Settings.CaseInsensitive" 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 testInstantSubstitution() throws Exception { 178 PrintWriter ref = null; 179 PrintWriter log = null; 180 String [] arguments = new String [] { 181 "/org/netbeans/test/editor/app/tests/completion.xml", 182 "Settings.InstantSubstitution" 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 testCCAfterMethods() throws Exception { 203 PrintWriter ref = null; 204 PrintWriter log = null; 205 String [] arguments = new String [] { 206 "/org/netbeans/test/editor/app/tests/completion.xml", 207 "Issues.CCAfterMethods" 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 testPackageCC() throws Exception { 228 PrintWriter ref = null; 229 PrintWriter log = null; 230 String [] arguments = new String [] { 231 "/org/netbeans/test/editor/app/tests/completion.xml", 232 "Issues.PackageCC" 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 252 253 public void testBasicHTML() throws Exception { 254 PrintWriter ref = null; 255 PrintWriter log = null; 256 String [] arguments = new String [] { 257 "/org/netbeans/test/editor/app/tests/completion.xml", 258 "HTMLCompletion.BasicHTML" 259 }; 260 try { 261 ref = new PrintWriter (getRef()); 262 log = new PrintWriter (getLog()); 263 new CallTestGeneric().runTest(arguments, log, ref); 264 } finally { 265 if (ref != null) ref.flush(); 266 if (log != null) log.flush(); 267 } 268 } 269 } 270 | Popular Tags |