Changeset 316 for trunk/org.modelica.mdt.test/src/org/modelica/mdt/test
- Timestamp:
- 02/14/06 15:29:13 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/org.modelica.mdt.test/src/org/modelica/mdt/test/TestNewPackageWizard.java
r291 r316 75 75 76 76 private Text packageName; 77 //private Text parentPackage;77 private Text parentPackage; 78 78 private Text packageDesc; 79 79 private Text sourceFolder; … … 131 131 packageName = 132 132 TextTester.getInstrumentedText(NewPackageWizard.PACKAGE_NAME_TAG); 133 //parentPackage =134 //TextTester.getInstrumentedText(NewTypePage.PARENT_PACKAGE_TAG);133 parentPackage = 134 TextTester.getInstrumentedText(NewTypePage.PARENT_PACKAGE_TAG); 135 135 packageDesc = 136 136 TextTester.getInstrumentedText(NewPackageWizard.PACKAGE_DESC_TAG); … … 195 195 // testEncapsulatedCreatePackageWithDesc() tests with creating a subpackage 196 196 // after the main package is created 197 // /* 198 // * test to create a nested package inside pkg1 199 // */ 200 // 201 // openWizardAndFetchWidgets(); 202 // 203 // String subName = "sub_pkg1"; 204 // 205 // /* 206 // * fill in the wizard fields 207 // */ 208 // ttester.actionEnterText(packageName, subName); 209 // ttester.actionEnterText(parentPackage, name); 210 // 211 // /* wait for the name change to propogate to enable the finish button */ 212 // while (!finish.getEnabled()) { Utility.sleep(this, 100); } 213 // Utility.sleep(this, 10000); // TODO remove me 214 // btester.actionClick(finish); 215 // 216 // /* check if the package folder was created */ 217 // folder = folder.getFolder(subName); 218 // assertTrue("no package folder was created", folder.exists()); 219 // 220 // /* 221 // * check that the generated package.mo exists and is sane 222 // */ 223 // packageMo = folder.getFile("package.mo"); 224 // assertTrue("package.mo was not created", packageMo.exists()); 225 // 226 // same = 227 // Utility.compareContent(packageMo, 228 // "within " + name + ";\n" + 229 // "\n" + 230 // "package " + subName + "\n" + 231 // "\n"+ 232 // "end " + name + ";"); 233 // assertTrue("unexpected conted created in the package.mo", same); 234 // 197 /* 198 * test to create a nested package inside pkg1 199 */ 200 201 openWizardAndFetchWidgets(); 202 203 String subName = "sub_pkg1"; 204 205 /* 206 * fill in the wizard fields 207 */ 208 ttester.actionEnterText(packageName, subName); 209 ttester.actionEnterText(parentPackage, name); 210 211 /* 212 * wait tops 5 seconds for the name change to propogate 213 * to enable the finish button 214 */ 215 long waitUntil = System.currentTimeMillis() + 5000; 216 while (!finish.getEnabled() && waitUntil > System.currentTimeMillis()) 217 { 218 Utility.sleep(this, 95); 219 } 220 btester.actionClick(finish); 221 222 /* check if the package folder was created */ 223 folder = folder.getFolder(subName); 224 assertTrue("no package folder was created", folder.exists()); 225 226 /* 227 * check that the generated package.mo exists and is sane 228 */ 229 packageMo = folder.getFile("package.mo"); 230 assertTrue("package.mo was not created", packageMo.exists()); 231 232 same = 233 Utility.compareContent(packageMo, 234 "within " + name + ";\n" + 235 "\n" + 236 "package " + subName + "\n" + 237 "\n"+ 238 "end " + subName + ";"); 239 assertTrue("unexpected conted created in the package.mo", same); 240 235 241 } 236 242 … … 272 278 "end " + name + ";"); 273 279 assertTrue("unexpected conted created in the package.mo", same); 280 281 /* 282 * test to create a nested package inside pkg2 283 */ 284 285 openWizardAndFetchWidgets(); 286 287 String subName = "sub_pkg2"; 288 description = "a jolly good subpackage"; 289 290 /* 291 * fill in the wizard fields 292 */ 293 ttester.actionEnterText(packageName, subName); 294 ttester.actionEnterText(parentPackage, name); 295 ttester.actionEnterText(packageDesc, description); 296 297 /* 298 * wait tops 5 seconds for the name change to propogate 299 * to enable the finish button 300 */ 301 long waitUntil = System.currentTimeMillis() + 5000; 302 while (!finish.getEnabled() && waitUntil > System.currentTimeMillis()) 303 { 304 Utility.sleep(this, 95); 305 } 306 btester.actionClick(finish); 307 308 /* check if the package folder was created */ 309 folder = folder.getFolder(subName); 310 assertTrue("no package folder was created", folder.exists()); 311 312 /* 313 * check that the generated package.mo exists and is sane 314 */ 315 packageMo = folder.getFile("package.mo"); 316 assertTrue("package.mo was not created", packageMo.exists()); 317 318 same = 319 Utility.compareContent(packageMo, 320 "within " + name + ";\n" + 321 "\n" + 322 "package " + subName + " \"" + description + "\"" + "\n" + 323 "\n"+ 324 "end " + subName + ";"); 325 assertTrue("unexpected conted created in the package.mo", same); 274 326 } 275 327 … … 310 362 assertTrue("unexpected conted created in the package.mo", same); 311 363 364 /* 365 * test to create a nested package inside pkg3 366 */ 367 368 openWizardAndFetchWidgets(); 369 370 String subName = "sub_pkg3"; 371 372 /* 373 * fill in the wizard fields 374 */ 375 ttester.actionEnterText(packageName, subName); 376 ttester.actionEnterText(parentPackage, name); 377 btester.actionClick(isEncapsulated); 378 379 /* 380 * wait tops 5 seconds for the name change to propogate 381 * to enable the finish button 382 */ 383 long waitUntil = System.currentTimeMillis() + 5000; 384 while (!finish.getEnabled() && waitUntil > System.currentTimeMillis()) 385 { 386 Utility.sleep(this, 95); 387 } 388 btester.actionClick(finish); 389 390 /* check if the package folder was created */ 391 folder = folder.getFolder(subName); 392 assertTrue("no package folder was created", folder.exists()); 393 394 /* 395 * check that the generated package.mo exists and is sane 396 */ 397 packageMo = folder.getFile("package.mo"); 398 assertTrue("package.mo was not created", packageMo.exists()); 399 400 same = 401 Utility.compareContent(packageMo, 402 "within " + name + ";\n" + 403 "\n" + 404 "encapsulated package " + subName + "\n" + 405 "\n"+ 406 "end " + subName + ";"); 407 assertTrue("unexpected conted created in the package.mo", same); 312 408 } 313 409 … … 351 447 assertTrue("unexpected conted created in the package.mo", same); 352 448 449 /* 450 * test to create a nested package inside pkg4 451 */ 452 453 openWizardAndFetchWidgets(); 454 455 String subName = "sub_pkg4"; 456 description = "deutsche, jaaa"; 457 458 /* 459 * fill in the wizard fields 460 */ 461 ttester.actionEnterText(packageName, subName); 462 ttester.actionEnterText(parentPackage, name); 463 ttester.actionEnterText(packageDesc, description); 464 btester.actionClick(isEncapsulated); 465 466 467 /* 468 * wait tops 5 seconds for the name change to propogate 469 * to enable the finish button 470 */ 471 long waitUntil = System.currentTimeMillis() + 5000; 472 while (!finish.getEnabled() && waitUntil > System.currentTimeMillis()) 473 { 474 Utility.sleep(this, 95); 475 } 476 btester.actionClick(finish); 477 478 /* check if the package folder was created */ 479 folder = folder.getFolder(subName); 480 assertTrue("no package folder was created", folder.exists()); 481 482 /* 483 * check that the generated package.mo exists and is sane 484 */ 485 packageMo = folder.getFile("package.mo"); 486 assertTrue("package.mo was not created", packageMo.exists()); 487 488 same = 489 Utility.compareContent(packageMo, 490 "within " + name + ";\n" + 491 "\n" + 492 "encapsulated package " + subName + " \"" + description + "\"" + "\n" + 493 "\n"+ 494 "end " + subName + ";"); 495 assertTrue("unexpected conted created in the package.mo", same); 496 353 497 } 354 498 }
Note: See TracChangeset
for help on using the changeset viewer.