4
4
5
5
package oracle .kubernetes .operator ;
6
6
7
+ import java .util .HashMap ;
7
8
import java .util .Map ;
8
9
import oracle .kubernetes .operator .utils .Domain ;
9
10
import oracle .kubernetes .operator .utils .Operator ;
15
16
import org .junit .FixMethodOrder ;
16
17
import org .junit .Test ;
17
18
import org .junit .runners .MethodSorters ;
19
+
18
20
/**
19
- * Simple JUnit test file used for testing Operator.
20
- *
21
- * <p>This test is used for testing pods being restarted by some properties change.
21
+ * This class contains Coherence relates integraiton tests.
22
22
*/
23
23
@ FixMethodOrder (MethodSorters .NAME_ASCENDING )
24
24
public class ITCoherenceTests extends BaseTest {
25
25
26
26
private static Domain domain = null ;
27
- private static Operator operator1 ;
28
-
29
- private static final String testAppName = "coherence-proxy-client" ;
27
+ private static Operator operator1 = null ;
30
28
31
29
private static final String PROXY_CLIENT_SCRIPT = "buildRunProxyClient.sh" ;
32
30
private static final String PROXY_CLIENT_APP_NAME = "coherence-proxy-client" ;
@@ -37,8 +35,7 @@ public class ITCoherenceTests extends BaseTest {
37
35
/**
38
36
* This method gets called only once before any of the test methods are executed. It does the
39
37
* initialization of the integration test properties defined in OperatorIT.properties and setting
40
- * the resultRoot, pvRoot and projectRoot attributes. Create Operator1 and domainOnPVUsingWLST
41
- * with admin server and 1 managed server if they are not running
38
+ * the resultRoot, pvRoot and projectRoot attributes. Also, create the operator.
42
39
*
43
40
* @throws Exception
44
41
*/
@@ -47,22 +44,20 @@ public static void staticPrepare() throws Exception {
47
44
// initialize test properties and create the directories
48
45
if (!QUICKTEST ) {
49
46
initialize (APP_PROPS_FILE );
50
-
51
- if (operator1 == null ) {
52
- operator1 = TestUtils .createOperator (OPERATOR1_YAML );
53
- }
47
+ operator1 = TestUtils .createOperator (OPERATOR1_YAML );
54
48
}
55
49
}
56
50
57
51
/**
58
- * Releases k8s cluster lease, archives result, pv directories
52
+ * Releases k8s cluster lease, archives result, pv directories and destroy the operator
59
53
*
60
54
* @throws Exception
61
55
*/
62
56
@ AfterClass
63
57
public static void staticUnPrepare () throws Exception {
64
58
if (!QUICKTEST ) {
65
59
tearDown (new Object () {}.getClass ().getEnclosingClass ().getSimpleName ());
60
+ operator1 .destroy ();
66
61
}
67
62
}
68
63
@@ -88,11 +83,10 @@ public void testRollingRestart() throws Exception {
88
83
}
89
84
90
85
/**
91
- * Copy the shell script file and all App files over to the admin pod the run the script to build
92
- * the proxy client and run the proxy test.
86
+ * Copy the shell script file and all coherence app files over to the admin pod.
87
+ * Then run the script to build the proxy client and run the proxy test.
93
88
*
94
89
* @param cacheOp - cache operation
95
- * @throws Exception exception
96
90
*/
97
91
private static void copyAndExecuteProxyClientInPod (String cacheOp ) {
98
92
try {
@@ -159,21 +153,25 @@ private void restartDomainByChangingEnvProperty() throws Exception {
159
153
"\" -Dweblogic.StdoutDebugEnabled=false\" " , "\" -Dweblogic.StdoutDebugEnabled=true\" " );
160
154
}
161
155
162
- private static void destroyDomain () throws Exception {
163
- if ( domain != null ) {
164
- domain . destroy ();
165
- }
166
- }
167
-
156
+ /**
157
+ * Create the domain
158
+ *
159
+ * @return
160
+ * @throws Exception
161
+ */
168
162
private Domain createDomain () throws Exception {
169
163
170
- // System.getenv().put("CUSTOM_WDT_ARCHIVE", "/Users/pmackin/archive-proxy.zip");
164
+ // TODO - Don't hardcode the archive location
165
+ Map <String , String > envMap = new HashMap ();
166
+ envMap .put ("CUSTOM_WDT_ARCHIVE" , "/Users/pmackin/archive-proxy.zip" );
171
167
172
168
// create domain
173
169
Domain domain = null ;
174
170
Map <String , Object > domainMap = TestUtils .loadYaml (DOMAININIMAGE_WDT_YAML );
175
171
domainMap .put ("namespace" , "test1" );
176
172
domainMap .put ("domainUID" , "coh" );
173
+ domainMap .put ("additionalEnvMap" , envMap );
174
+
177
175
domainMap .put (
178
176
"customWdtTemplate" ,
179
177
BaseTest .getProjectRoot ()
@@ -182,4 +180,16 @@ private Domain createDomain() throws Exception {
182
180
domain .verifyDomainCreated ();
183
181
return domain ;
184
182
}
183
+
184
+ /**
185
+ * Destroy the domain
186
+ *
187
+ * @throws Exception
188
+ */
189
+ private static void destroyDomain () throws Exception {
190
+ if (domain != null ) {
191
+ domain .destroy ();
192
+ }
193
+ }
194
+
185
195
}
0 commit comments