11
11
import oracle .kubernetes .operator .utils .TestUtils ;
12
12
import org .junit .AfterClass ;
13
13
import org .junit .Assert ;
14
- import org .junit .Assume ;
15
14
import org .junit .BeforeClass ;
16
15
import org .junit .FixMethodOrder ;
17
16
import org .junit .Test ;
@@ -28,6 +27,7 @@ public class ITCoherenceTests extends BaseTest {
28
27
29
28
private static final String PROXY_CLIENT_SCRIPT = "buildRunProxyClient.sh" ;
30
29
private static final String PROXY_CLIENT_APP_NAME = "coherence-proxy-client" ;
30
+ private static final String PROXY_SERVER_APP_NAME = "coherence-proxy-server" ;
31
31
private static final String OP_CACHE_LOAD = "load" ;
32
32
private static final String OP_CACHE_VALIDATE = "validate" ;
33
33
private static final String PROXY_PORT = "9000" ;
@@ -70,11 +70,13 @@ public void testRollingRestart() throws Exception {
70
70
Assert .assertNotNull (domain );
71
71
72
72
try {
73
+ // Build and run the proxy client on the admin VM to load the cache
73
74
copyAndExecuteProxyClientInPod (OP_CACHE_LOAD );
74
75
75
76
// Do the rolling restart
76
- restartDomainByChangingEnvProperty ();
77
+ // restartDomainByChangingEnvProperty();
77
78
79
+ // Build and run the proxy client on the admin VM to validate the cache
78
80
copyAndExecuteProxyClientInPod (OP_CACHE_VALIDATE );
79
81
} finally {
80
82
destroyDomain ();
@@ -83,7 +85,8 @@ public void testRollingRestart() throws Exception {
83
85
}
84
86
85
87
/**
86
- * Copy the shell script file and all coherence app files over to the admin pod.
88
+ * Since the coherence.jar is not open source, we need to build the proxy client on the admin VM, which has the
89
+ * coherence.jar. Copy the shell script file and all coherence app files over to the admin pod.
87
90
* Then run the script to build the proxy client and run the proxy test.
88
91
*
89
92
* @param cacheOp - cache operation
@@ -133,26 +136,6 @@ private static void copyAndExecuteProxyClientInPod(String cacheOp) {
133
136
}
134
137
}
135
138
136
- /**
137
- * Modify the domain scope env property on the domain resource using kubectl apply -f domain.yaml
138
- * Verify that all the server pods in the domain got re-started. The property tested is: env:
139
- * "-Dweblogic.StdoutDebugEnabled=false"--> "-Dweblogic.StdoutDebugEnabled=true"
140
- *
141
- * @throws Exception
142
- */
143
- private void restartDomainByChangingEnvProperty () throws Exception {
144
-
145
- // The default cmd loop sleep is too long and we could miss states like terminating. Change
146
- // the
147
- // sleep and iterations
148
- //
149
- setWaitTimePod (2 );
150
- setMaxIterationsPod (125 );
151
-
152
- domain .verifyDomainServerPodRestart (
153
- "\" -Dweblogic.StdoutDebugEnabled=false\" " , "\" -Dweblogic.StdoutDebugEnabled=true\" " );
154
- }
155
-
156
139
/**
157
140
* Create the domain
158
141
*
@@ -161,9 +144,8 @@ private void restartDomainByChangingEnvProperty() throws Exception {
161
144
*/
162
145
private Domain createDomain () throws Exception {
163
146
164
- // TODO - Don't hardcode the archive location
165
147
Map <String , String > envMap = new HashMap ();
166
- envMap .put ("CUSTOM_WDT_ARCHIVE" , "/Users/pmackin/archive-proxy.zip" );
148
+ envMap .put ("CUSTOM_WDT_ARCHIVE" , buildProxyServerWdtZip () );
167
149
168
150
// create domain
169
151
Domain domain = null ;
@@ -192,4 +174,41 @@ private static void destroyDomain() throws Exception {
192
174
}
193
175
}
194
176
177
+ /**
178
+ * Modify the domain scope env property on the domain resource using kubectl apply -f domain.yaml
179
+ * Verify that all the server pods in the domain got re-started. The property tested is: env:
180
+ * "-Dweblogic.StdoutDebugEnabled=false"--> "-Dweblogic.StdoutDebugEnabled=true"
181
+ *
182
+ * @throws Exception
183
+ */
184
+ private void restartDomainByChangingEnvProperty () throws Exception {
185
+
186
+ // The default cmd loop sleep is too long and we could miss states like terminating. Change
187
+ // the
188
+ // sleep and iterations
189
+ //
190
+ setWaitTimePod (2 );
191
+ setMaxIterationsPod (125 );
192
+
193
+ domain .verifyDomainServerPodRestart (
194
+ "\" -Dweblogic.StdoutDebugEnabled=false\" " , "\" -Dweblogic.StdoutDebugEnabled=true\" " );
195
+ }
196
+
197
+ /**
198
+ * Build the WDT zip that contains the Coherence proxy server
199
+ *
200
+ * @return the WDT zip path
201
+ */
202
+ private static String buildProxyServerWdtZip () {
203
+
204
+ // Build the proxy server gar file
205
+ String garPath = getResultDir () + "/coh-proxy-server.gar" ;
206
+ String cohAppLocationOnHost = BaseTest .getAppLocationOnHost () + "/" + PROXY_SERVER_APP_NAME ;
207
+ TestUtils .buildJarArchive (garPath , cohAppLocationOnHost );
208
+
209
+ // Build the WDT zip
210
+ String wdtArchivePath = getResultDir () + "/coh-wdt-archive.zip" ;
211
+ TestUtils .buildWdtZip (wdtArchivePath , new String [] {garPath }, getResultDir ());
212
+ return wdtArchivePath ;
213
+ }
195
214
}
0 commit comments