@@ -28,6 +28,8 @@ public class ITOperator extends BaseTest {
28
28
// property file used to customize operator properties for operator inputs yaml
29
29
private static String op1YamlFile = "operator1.yaml" ;
30
30
private static String op2YamlFile = "operator2.yaml" ;
31
+ private static final String opForDelYamlFile1 = "operator_del1.yaml" ;
32
+ private static final String opForDelYamlFile2 = "operator_del2.yaml" ;
31
33
32
34
// property file used to customize domain properties for domain inputs yaml
33
35
private static String domain1YamlFile = "domain1.yaml" ;
@@ -38,6 +40,9 @@ public class ITOperator extends BaseTest {
38
40
private static String domain6YamlFile = "domain6.yaml" ;
39
41
private static String domain7YamlFile = "domain7.yaml" ;
40
42
private static String domain8YamlFile = "domain8.yaml" ;
43
+ private static final String domain1ForDelValueYamlFile = "domain_del_1.yaml" ;
44
+ private static final String domain2ForDelValueYamlFile = "domain_del_2.yaml" ;
45
+ private static final String domain3ForDelValueYamlFile = "domain_del_3.yaml" ;
41
46
private static String domain9YamlFile = "domain9.yaml" ;
42
47
private static String domain10YamlFile = "domain10.yaml" ;
43
48
@@ -46,6 +51,9 @@ public class ITOperator extends BaseTest {
46
51
47
52
private static Operator operator1 , operator2 ;
48
53
54
+ private static Operator operatorForDel1 ;
55
+ private static Operator operatorForDel2 ;
56
+
49
57
/**
50
58
* This method gets called only once before any of the test methods are executed. It does the
51
59
* initialization of the integration test properties defined in OperatorIT.properties and setting
@@ -274,6 +282,50 @@ public void testBCreateDomainWithDefaultValuesInSampleInputs() throws Exception
274
282
logger .info ("SUCCESS - testBCreateDomainWithDefaultValuesInSampleInputs" );
275
283
}
276
284
285
+ @ Test
286
+ public void testDeleteOneDomain () throws Exception {
287
+ Assume .assumeFalse (
288
+ System .getenv ("QUICKTEST" ) != null && System .getenv ("QUICKTEST" ).equalsIgnoreCase ("true" ));
289
+ logTestBegin ("Deleting one domain." );
290
+
291
+ if (operatorForDel1 == null ) {
292
+ logger .info ("About to create operator" );
293
+ operatorForDel1 = TestUtils .createOperator (opForDelYamlFile1 );
294
+ }
295
+ final Domain domain = TestUtils .createDomain (domain1ForDelValueYamlFile );
296
+ TestUtils .verifyBeforeDeletion (domain );
297
+
298
+ logger .info ("About to delete domain: " + domain .getDomainUid ());
299
+ TestUtils .deleteWeblogicDomainResources (domain .getDomainUid ());
300
+
301
+ TestUtils .verifyAfterDeletion (domain );
302
+ }
303
+
304
+ @ Test
305
+ public void testDeleteTwoDomains () throws Exception {
306
+ Assume .assumeFalse (
307
+ System .getenv ("QUICKTEST" ) != null && System .getenv ("QUICKTEST" ).equalsIgnoreCase ("true" ));
308
+ logTestBegin ("Deleting two domains." );
309
+
310
+ if (operatorForDel2 == null ) {
311
+ logger .info ("About to create operator" );
312
+ operatorForDel2 = TestUtils .createOperator (opForDelYamlFile2 );
313
+ }
314
+ final Domain domainDel1 = TestUtils .createDomain (domain2ForDelValueYamlFile );
315
+ final Domain domainDel2 = TestUtils .createDomain (domain3ForDelValueYamlFile );
316
+
317
+ TestUtils .verifyBeforeDeletion (domainDel1 );
318
+ TestUtils .verifyBeforeDeletion (domainDel2 );
319
+
320
+ final String domainUidsToBeDeleted =
321
+ domainDel1 .getDomainUid () + "," + domainDel2 .getDomainUid ();
322
+ logger .info ("About to delete domains: " + domainUidsToBeDeleted );
323
+ TestUtils .deleteWeblogicDomainResources (domainUidsToBeDeleted );
324
+
325
+ TestUtils .verifyAfterDeletion (domainDel1 );
326
+ TestUtils .verifyAfterDeletion (domainDel2 );
327
+ }
328
+
277
329
private void testCreateOperatorManagingDefaultAndTest1NS () throws Exception {
278
330
logger .info ("Creating Operator & waiting for the script to complete execution" );
279
331
// create operator1
0 commit comments