Skip to content

Commit 6badf19

Browse files
committed
system-test ordering changed to Order annotation from Method
1 parent d3c30dc commit 6badf19

File tree

1 file changed

+62
-30
lines changed
  • system-test/src/test/java/oracle/weblogic/deploy/integration

1 file changed

+62
-30
lines changed

system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java

Lines changed: 62 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.junit.jupiter.api.BeforeAll;
2929
import org.junit.jupiter.api.DisplayName;
3030
import org.junit.jupiter.api.MethodOrderer;
31+
import org.junit.jupiter.api.Order;
3132
import org.junit.jupiter.api.Tag;
3233
import org.junit.jupiter.api.Test;
3334
import org.junit.jupiter.api.TestInfo;
@@ -38,7 +39,7 @@
3839
import static org.junit.jupiter.api.Assumptions.assumeTrue;
3940

4041
@IntegrationTest
41-
@TestMethodOrder(MethodOrderer.MethodName.class)
42+
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
4243
public class ITWdt extends BaseTest {
4344
@TestingLogger
4445
private static final Logger logger = Logger.getLogger("integration.tests");
@@ -105,6 +106,7 @@ private static PrintWriter getTestMethodWriter(TestInfo testInfo) throws IOExcep
105106
* @throws Exception - if any error occurs
106107
*/
107108
@DisplayName("Test 1: createDomain bad arguments")
109+
@Order(1)
108110
@Tag("gate")
109111
@Test
110112
public void test1CreateDomainNoDomainHome(TestInfo testInfo) throws Exception {
@@ -121,6 +123,7 @@ public void test1CreateDomainNoDomainHome(TestInfo testInfo) throws Exception {
121123
* @throws Exception - if any error occurs
122124
*/
123125
@DisplayName("Test 2: createDomain bad arguments")
126+
@Order(2)
124127
@Tag("gate")
125128
@Test
126129
public void test2CreateDomainNoDomainHome(TestInfo testInfo) throws Exception {
@@ -138,6 +141,7 @@ public void test2CreateDomainNoDomainHome(TestInfo testInfo) throws Exception {
138141
* @throws Exception - if any error occurs
139142
*/
140143
@DisplayName("Test 3: createDomain bad arguments")
144+
@Order(3)
141145
@Tag("gate")
142146
@Test
143147
public void test3CreateDomainNoModelfile(TestInfo testInfo) throws Exception {
@@ -155,6 +159,7 @@ public void test3CreateDomainNoModelfile(TestInfo testInfo) throws Exception {
155159
* @throws Exception - if output file could not be created or written
156160
*/
157161
@DisplayName("Test 4: createDomain without archive file")
162+
@Order(4)
158163
@Tag("gate")
159164
@Test
160165
public void test4CreateDomainNoArchivefile(TestInfo testInfo) throws Exception {
@@ -173,6 +178,7 @@ public void test4CreateDomainNoArchivefile(TestInfo testInfo) throws Exception {
173178
* @throws Exception - if any error occurs
174179
*/
175180
@DisplayName("Test 5: createDomain with domain_parent")
181+
@Order(5)
176182
@Tag("gate")
177183
@Test
178184
public void test5CreateDomain(TestInfo testInfo) throws Exception {
@@ -193,6 +199,7 @@ public void test5CreateDomain(TestInfo testInfo) throws Exception {
193199
* @throws Exception - if any error occurs
194200
*/
195201
@DisplayName("Test 6: createDomain with domain_home")
202+
@Order(6)
196203
@Tag("gate")
197204
@Test
198205
public void test6CreateDomainDifferentDomainName(TestInfo testInfo) throws Exception {
@@ -212,6 +219,7 @@ public void test6CreateDomainDifferentDomainName(TestInfo testInfo) throws Excep
212219
* test createDomain.sh with WLS domain_type
213220
* @throws Exception -if any error occurs
214221
*/
222+
@Order(7)
215223
@Tag("gate")
216224
@Test
217225
public void test7CreateDomainWLSType(TestInfo testInfo) throws Exception {
@@ -231,6 +239,7 @@ public void test7CreateDomainWLSType(TestInfo testInfo) throws Exception {
231239
* @throws Exception - if any error occurs
232240
*/
233241
@DisplayName("Test 8: createDomain but needs variable file")
242+
@Order(8)
234243
@Tag("gate")
235244
@Test
236245
public void test8CreateDomainNoVariableFile(TestInfo testInfo) throws Exception {
@@ -250,6 +259,7 @@ public void test8CreateDomainNoVariableFile(TestInfo testInfo) throws Exception
250259
* @throws Exception - if any error occurs
251260
*/
252261
@DisplayName("Test 9: createDomain with variable file")
262+
@Order(9)
253263
@Tag("gate")
254264
@Test
255265
public void test9CreateDomainWithVariableFile(TestInfo testInfo) throws Exception {
@@ -269,9 +279,10 @@ public void test9CreateDomainWithVariableFile(TestInfo testInfo) throws Exceptio
269279
* @throws Exception - if any error occurs
270280
*/
271281
@DisplayName("Test 10: createDomain with WLS wlst_path")
282+
@Order(10)
272283
@Tag("gate")
273284
@Test
274-
public void testACreateDomainWithWlstPath(TestInfo testInfo) throws Exception {
285+
public void test10CreateDomainWithWlstPath(TestInfo testInfo) throws Exception {
275286
String cmd = createDomainScript + " -oracle_home " + mwhome_12213 + " -domain_home " +
276287
domainParentDir + FS + "domain2 -model_file " +
277288
getSampleModelFile("1") + " -archive_file " + getSampleArchiveFile() +
@@ -289,9 +300,10 @@ public void testACreateDomainWithWlstPath(TestInfo testInfo) throws Exception {
289300
* @throws Exception - if any error occurs
290301
*/
291302
@DisplayName("Test 11: createDomain with oracle_commmon wlst_path")
303+
@Order(11)
292304
@Tag("gate")
293305
@Test
294-
public void testBCreateDomainWithOracleCommonWlstPath(TestInfo testInfo) throws Exception {
306+
public void test11CreateDomainWithOracleCommonWlstPath(TestInfo testInfo) throws Exception {
295307
String cmd = createDomainScript + " -oracle_home " + mwhome_12213 + " -domain_home " +
296308
domainParentDir + FS + "domain2 -model_file " +
297309
getSampleModelFile("1") + " -archive_file " + getSampleArchiveFile() +
@@ -309,9 +321,10 @@ public void testBCreateDomainWithOracleCommonWlstPath(TestInfo testInfo) throws
309321
* @throws Exception - if any error occurs
310322
*/
311323
@DisplayName("Test 12: createDomain JRF domain without DB")
324+
@Order(12)
312325
@Tag("gate")
313326
@Test
314-
public void testCCreateJRFDomainNoRunRCU(TestInfo testInfo) throws Exception {
327+
public void test12CreateJRFDomainNoRunRCU(TestInfo testInfo) throws Exception {
315328
try (PrintWriter out = getTestMethodWriter(testInfo)) {
316329
Path source = Paths.get(getSampleModelFile("2"));
317330
Path modelOut = getTestOutputPath(testInfo).resolve(SAMPLE_MODEL_FILE_PREFIX + "2.yaml");
@@ -333,9 +346,10 @@ public void testCCreateJRFDomainNoRunRCU(TestInfo testInfo) throws Exception {
333346
* @throws Exception - if any error occurs
334347
*/
335348
@DisplayName("Test 13: createDomain JRF domain and run RCU")
349+
@Order(13)
336350
@Tag("gate")
337351
@Test
338-
public void testDCreateJRFDomainRunRCU(TestInfo testInfo) throws Exception {
352+
public void test13CreateJRFDomainRunRCU(TestInfo testInfo) throws Exception {
339353
waitForDatabase();
340354
try (PrintWriter out = getTestMethodWriter(testInfo)) {
341355
Path source = Paths.get(getSampleModelFile("2"));
@@ -361,9 +375,10 @@ public void testDCreateJRFDomainRunRCU(TestInfo testInfo) throws Exception {
361375
* @throws Exception - if any error occurs
362376
*/
363377
@DisplayName("Test 14: Update JRF domain that requires restart")
378+
@Order(14)
364379
@Tag("gate")
365380
@Test
366-
public void testDOnlineUpdate1(TestInfo testInfo) throws Exception {
381+
public void test14OnlineUpdate1(TestInfo testInfo) throws Exception {
367382
assumeTrue(rcuDomainCreated, "testDOnlineUpdate skipped because testDCreateJRFDomainRunRCU failed");
368383

369384
// Setup boot.properties
@@ -405,9 +420,10 @@ public void testDOnlineUpdate1(TestInfo testInfo) throws Exception {
405420
* @throws Exception - if any error occurs
406421
*/
407422
@DisplayName("Test 15: Update JRF domain that requires restart, but cancel changes")
423+
@Order(15)
408424
@Tag("gate")
409425
@Test
410-
public void testDOnlineUpdate2(TestInfo testInfo) throws Exception {
426+
public void test15OnlineUpdate2(TestInfo testInfo) throws Exception {
411427
assumeTrue(rcuDomainCreated, "testDOnlineUpdate2 skipped because testDCreateJRFDomainRunRCU failed");
412428

413429
String domainHome = domainParentDir + FS + "jrfDomain1";
@@ -445,9 +461,10 @@ public void testDOnlineUpdate2(TestInfo testInfo) throws Exception {
445461
* @throws Exception - if any error occurs
446462
*/
447463
@DisplayName("Test 16: create restricted JRF domain")
464+
@Order(16)
448465
@Tag("gate")
449466
@Test
450-
public void testECreateRestrictedJRFDomain(TestInfo testInfo) throws Exception {
467+
public void test16CreateRestrictedJRFDomain(TestInfo testInfo) throws Exception {
451468
String cmd = createDomainScript + " -oracle_home " + mwhome_12213 + " -domain_home " +
452469
domainParentDir + FS + "restrictedJRFD1 -model_file " +
453470
getSampleModelFile("-constant") + " -archive_file " + getSampleArchiveFile() +
@@ -465,9 +482,10 @@ public void testECreateRestrictedJRFDomain(TestInfo testInfo) throws Exception {
465482
* @throws Exception - if any error occurs
466483
*/
467484
@DisplayName("Test 17: Discover domain restrictedJRFD1")
485+
@Order(17)
468486
@Tag("gate")
469487
@Test
470-
public void testFDiscoverDomainWithRequiredArgument(TestInfo testInfo) throws Exception {
488+
public void test17DiscoverDomainWithRequiredArgument(TestInfo testInfo) throws Exception {
471489
try (PrintWriter out = getTestMethodWriter(testInfo)) {
472490
Path discoveredArchive = getTestOutputPath(testInfo).resolve("discoveredArchive.zip");
473491
String cmd = discoverDomainScript
@@ -507,9 +525,10 @@ private void verifyFDiscoverDomainWithRequiredArgument(String expectedModelFile)
507525
* @throws Exception - if any error occurs
508526
*/
509527
@DisplayName("Test 18: Discover domain restrictedJRFD1 using model_file arg")
528+
@Order(18)
510529
@Tag("gate")
511530
@Test
512-
public void testGDiscoverDomainWithModelFile(TestInfo testInfo) throws Exception {
531+
public void test18DiscoverDomainWithModelFile(TestInfo testInfo) throws Exception {
513532
Path discoveredArchive = getTestOutputPath(testInfo).resolve("discoveredArchive.zip");
514533
Path discoveredModelFile = getTestOutputPath(testInfo).resolve("discoveredRestrictedJRFD1.yaml");
515534
String cmd = discoverDomainScript + " -oracle_home " + mwhome_12213 + " -domain_home " +
@@ -530,9 +549,10 @@ public void testGDiscoverDomainWithModelFile(TestInfo testInfo) throws Exception
530549
* @throws Exception - if any error occurs
531550
*/
532551
@DisplayName("Test 19: Discover domain restrictedJRFD1 using variable file")
552+
@Order(19)
533553
@Tag("gate")
534554
@Test
535-
public void testGDiscoverDomainWithVariableFile(TestInfo testInfo) throws Exception {
555+
public void test19DiscoverDomainWithVariableFile(TestInfo testInfo) throws Exception {
536556
Path discoveredArchive = getTestOutputPath(testInfo).resolve("discoveredArchive.zip");
537557
Path discoveredModelFile = getTestOutputPath(testInfo).resolve("discoveredRestrictedJRFD1.yaml");
538558
Path discoveredVariableFile = getTestOutputPath(testInfo).resolve("discoveredRestrictedJRFD1.properties");
@@ -566,10 +586,13 @@ private void verifyGDiscoverDomainWithVariableFile(String expectedModelFile) thr
566586
* @throws Exception - if any error occurs
567587
*/
568588
@DisplayName("Test 20: Discover domain domain_type JRF")
589+
@Order(20)
569590
@Tag("gate")
570591
@Test
571-
public void testHDiscoverDomainJRFDomainType(TestInfo testInfo) throws Exception {
572-
try (PrintWriter out = getTestMethodWriter(testInfo)) {
592+
public void test20DiscoverDomainJRFDomainType(TestInfo testInfo) throws Exception {
593+
assumeTrue(rcuDomainCreated, "testHDiscoverDomainJRFDomainType skipped because testDCreateJRFDomainRunRCU failed");
594+
595+
try (PrintWriter out = getTestMethodWriter(testInfo)) {
573596
Path discoveredArchive = getTestOutputPath(testInfo).resolve("discoveredArchive.zip");
574597
Path discoveredModelFile = getTestOutputPath(testInfo).resolve("discoveredJRFD1.yaml");
575598
String cmd = discoverDomainScript
@@ -605,9 +628,10 @@ private void verifyHDiscoverDomainJRFDomainType(String expectedModelFile) {
605628
* @throws Exception - if any error occurs
606629
*/
607630
@DisplayName("Test 21: Update domain dynamic server count")
631+
@Order(21)
608632
@Tag("gate")
609633
@Test
610-
public void testIUpdateDomain(TestInfo testInfo) throws Exception {
634+
public void test21UpdateDomain(TestInfo testInfo) throws Exception {
611635
try (PrintWriter out = getTestMethodWriter(testInfo)) {
612636
Path source = Paths.get(getSampleVariableFile());
613637
Path variableFile = getTestOutputPath(testInfo).resolve(SAMPLE_VARIABLE_FILE);
@@ -640,9 +664,10 @@ public void testIUpdateDomain(TestInfo testInfo) throws Exception {
640664
* @throws Exception - if any error occurs
641665
*/
642666
@DisplayName("Test 22: Deploy App negative test")
667+
@Order(22)
643668
@Tag("gate")
644669
@Test
645-
public void testJDeployAppWithoutModelfile(TestInfo testInfo) throws Exception {
670+
public void test22DeployAppWithoutModelfile(TestInfo testInfo) throws Exception {
646671
try (PrintWriter out = getTestMethodWriter(testInfo)) {
647672
String cmd = deployAppScript
648673
+ " -oracle_home " + mwhome_12213
@@ -657,10 +682,11 @@ public void testJDeployAppWithoutModelfile(TestInfo testInfo) throws Exception {
657682
* Test deployApps.
658683
* @throws Exception - if any error occurs
659684
*/
660-
@DisplayName("Test 22: Deploy App")
685+
@DisplayName("Test 23: Deploy App")
686+
@Order(23)
661687
@Tag("gate")
662688
@Test
663-
public void testKDeployAppWithModelfile(TestInfo testInfo) throws Exception {
689+
public void test23DeployAppWithModelfile(TestInfo testInfo) throws Exception {
664690
try (PrintWriter out = getTestMethodWriter(testInfo)) {
665691
String cmd = deployAppScript
666692
+ " -oracle_home " + mwhome_12213
@@ -676,10 +702,11 @@ public void testKDeployAppWithModelfile(TestInfo testInfo) throws Exception {
676702
* test validateModel.sh with -oracle_home only
677703
* @throws Exception - if any error occurs
678704
*/
679-
@DisplayName("Test 23: Validate model negative (no model)")
705+
@DisplayName("Test 24: Validate model negative (no model)")
706+
@Order(24)
680707
@Tag("gate")
681708
@Test
682-
public void testLValidateModelWithOracleHomeOnly(TestInfo testInfo) throws Exception {
709+
public void test24ValidateModelWithOracleHomeOnly(TestInfo testInfo) throws Exception {
683710
try (PrintWriter out = getTestMethodWriter(testInfo)) {
684711
String cmd = validateModelScript + " -oracle_home " + mwhome_12213;
685712
CommandResult result = Runner.run(cmd, getTestMethodEnvironment(testInfo), out);
@@ -691,10 +718,11 @@ public void testLValidateModelWithOracleHomeOnly(TestInfo testInfo) throws Excep
691718
* test validateModel.sh with -oracle_home and -model_file
692719
* @throws Exception - if any error occurs
693720
*/
694-
@DisplayName("Test 24: Validate model negative (no archive)")
721+
@DisplayName("Test 25: Validate model negative (no archive)")
722+
@Order(25)
695723
@Tag("gate")
696724
@Test
697-
public void testMValidateModelWithOracleHomeModelFile(TestInfo testInfo) throws Exception {
725+
public void test25ValidateModelWithOracleHomeModelFile(TestInfo testInfo) throws Exception {
698726
try (PrintWriter out = getTestMethodWriter(testInfo)) {
699727
String cmd = validateModelScript + " -oracle_home " + mwhome_12213 + " -model_file " +
700728
getSampleModelFile("-constant");
@@ -707,10 +735,11 @@ public void testMValidateModelWithOracleHomeModelFile(TestInfo testInfo) throws
707735
* test validateModel.sh without -variable_file
708736
* @throws Exception - if any error occurs
709737
*/
710-
@DisplayName("Test 25: Validate model negative (no variable file)")
738+
@DisplayName("Test 26: Validate model negative (no variable file)")
739+
@Order(26)
711740
@Tag("gate")
712741
@Test
713-
public void testNValidateModelWithoutVariableFile(TestInfo testInfo) throws Exception {
742+
public void test26ValidateModelWithoutVariableFile(TestInfo testInfo) throws Exception {
714743
try (PrintWriter out = getTestMethodWriter(testInfo)) {
715744
String cmd = validateModelScript
716745
+ " -oracle_home " + mwhome_12213
@@ -724,10 +753,11 @@ public void testNValidateModelWithoutVariableFile(TestInfo testInfo) throws Exce
724753
* test compareModel.sh with only attribute difference. The files existences test whether it impacts WKO operation
725754
* @throws Exception - if any error occurs
726755
*/
727-
@DisplayName("Test 26: Compare model")
756+
@DisplayName("Test 27: Compare model")
757+
@Order(27)
728758
@Tag("gate")
729759
@Test
730-
public void testCompareModelRemoveAttribute(TestInfo testInfo) throws Exception {
760+
public void test27CompareModelRemoveAttribute(TestInfo testInfo) throws Exception {
731761
try (PrintWriter out = getTestMethodWriter(testInfo)) {
732762
Path outputDir = getTestOutputPath(testInfo).resolve("wdt_temp_output");
733763
Files.createDirectories(outputDir);
@@ -748,10 +778,11 @@ public void testCompareModelRemoveAttribute(TestInfo testInfo) throws Exception
748778
* test validateModel.sh with invalid model file
749779
* @throws Exception - if any error occurs
750780
*/
751-
@DisplayName("Test 27: Validate model negative (invalid model)")
781+
@DisplayName("Test 28: Validate model negative (invalid model)")
782+
@Order(28)
752783
@Tag("gate")
753784
@Test
754-
public void testOValidateModelWithInvalidModelfile(TestInfo testInfo) throws Exception {
785+
public void test28ValidateModelWithInvalidModelfile(TestInfo testInfo) throws Exception {
755786
try (PrintWriter out = getTestMethodWriter(testInfo)) {
756787
String cmd = validateModelScript
757788
+ " -oracle_home " + mwhome_12213
@@ -762,10 +793,11 @@ public void testOValidateModelWithInvalidModelfile(TestInfo testInfo) throws Exc
762793
}
763794
}
764795

765-
@DisplayName("Test 28: Encrypt model")
796+
@DisplayName("Test 29: Encrypt model")
797+
@Order(29)
766798
@Tag("gate")
767799
@Test
768-
public void testPEncryptModel(TestInfo testInfo) throws Exception {
800+
public void test29EncryptModel(TestInfo testInfo) throws Exception {
769801
try (PrintWriter out = getTestMethodWriter(testInfo)) {
770802
Path source = Paths.get(getSampleModelFile("-constant"));
771803
Path model = getTestOutputPath(testInfo).resolve(SAMPLE_MODEL_FILE_PREFIX + "-constant.yaml");
@@ -851,7 +883,7 @@ private void setUpBootProperties(String domainHome, String server, String userna
851883
throws Exception {
852884

853885
File adminSecurityDir = new File(domainHome + FS + "servers" + FS + server + FS + "security");
854-
adminSecurityDir.mkdirs();
886+
assertTrue(adminSecurityDir.mkdirs(), "mkdir for boot.properties failed");
855887
try (PrintWriter pw = new PrintWriter(adminSecurityDir + FS + "boot.properties")) {
856888
pw.println("username=" + username);
857889
pw.println("password=" + password);

0 commit comments

Comments
 (0)