Skip to content

Commit 095ba85

Browse files
committed
1) Changed version of wiremock to 1.56 (latest build with Java7),
2) Added wireMockRule.resetScenarios(); wireMockRule.resetMappings(); in the after() method of test classes 3) Removed Unstable test from the excluded tests This refer to #RESTCOMM-1501
1 parent 7570978 commit 095ba85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+106
-27
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ node("cxs-ups-testsuites_large") {
6565
runTestsuite("org.restcomm.connect.commons.annotations.UnstableTests or org.restcomm.connect.commons.annotations.BrokenTests", "org.restcomm.connect.commons.annotations.ParallelClassTests", "16" , "parallel-testing")
6666
} else {
6767
//exclude alt and exp to make it lighter
68-
runTestsuite("org.restcomm.connect.commons.annotations.UnstableTests or org.restcomm.connect.commons.annotations.BrokenTests or org.restcomm.connect.commons.annotations.FeatureAltTests or org.restcomm.connect.commons.annotations.FeatureExpTests", "org.restcomm.connect.commons.annotations.ParallelClassTests", "16" , "parallel-testing")
68+
runTestsuite("org.restcomm.connect.commons.annotations.BrokenTests or org.restcomm.connect.commons.annotations.FeatureAltTests or org.restcomm.connect.commons.annotations.FeatureExpTests", "org.restcomm.connect.commons.annotations.ParallelClassTests", "16" , "parallel-testing")
6969
}
7070
}
7171

restcomm/restcomm.testsuite/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
<dependency>
290290
<groupId>com.github.tomakehurst</groupId>
291291
<artifactId>wiremock</artifactId>
292-
<version>1.57</version>
292+
<version>1.56</version>
293293
<!-- Include this if you have dependency conflicts for Guava, Jetty, Jackson
294294
or Apache HTTP Client -->
295295
<classifier>standalone</classifier>
@@ -505,7 +505,7 @@
505505
every forked JVM/test class-->
506506
<arquillian_http_port>${surefire.forkNumber}509</arquillian_http_port>
507507
<arquillian_sip_port>${surefire.forkNumber}508</arquillian_sip_port>
508-
</systemPropertyVariables>
508+
</systemPropertyVariables>
509509
</configuration>
510510
</plugin>
511511
</plugins>

restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/http/GeolocationEndpointTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ public class GeolocationEndpointTest {
9292
@After
9393
public void after() throws InterruptedException {
9494
wireMockRule.resetRequests();
95+
wireMockRule.resetScenarios();
96+
wireMockRule.resetMappings();
9597
Thread.sleep(1000);
9698
}
9799

restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/http/LiveCallModificationAnswerDelayTest.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ public void after() throws Exception {
130130
}
131131
Thread.sleep(1000);
132132
wireMockRule.resetRequests();
133+
wireMockRule.resetScenarios();
134+
wireMockRule.resetMappings();
133135
Thread.sleep(4000);
134136
}
135137

@@ -698,7 +700,7 @@ public void testTerminateDialForkCallWhileRinging_LCM_to_dial_branches() throws
698700
assertTrue(bobCall.waitOutgoingCallResponse(5 * 1000));
699701
assertEquals(Response.RINGING, bobCall.getLastReceivedResponse().getStatusCode());
700702
}
701-
703+
702704
String bobCallSid = bobCall.getLastReceivedResponse().getMessage().getHeader("X-RestComm-CallSid").toString().split(":")[1].trim();
703705

704706
assertTrue(georgeCall.waitForIncomingCall(30 * 1000));
@@ -739,12 +741,12 @@ public void testTerminateDialForkCallWhileRinging_LCM_to_dial_branches() throws
739741
JsonObject jsonObj = cdr.getAsJsonObject();
740742
logger.info("Status for call: "+aliceCallSid+" : "+jsonObj.get("status").getAsString());
741743
assertTrue(jsonObj.get("status").getAsString().equalsIgnoreCase("canceled"));
742-
744+
743745
cdr = RestcommCallsTool.getInstance().getCall(deploymentUrl.toString(), adminAccountSid, adminAuthToken, georgeCallSid);
744746
jsonObj = cdr.getAsJsonObject();
745747
logger.info("Status for call: "+georgeCallSid+" : "+jsonObj.get("status").getAsString());
746748
assertTrue(jsonObj.get("status").getAsString().equalsIgnoreCase("canceled"));
747-
749+
748750
cdr = RestcommCallsTool.getInstance().getCall(deploymentUrl.toString(), adminAccountSid, adminAuthToken, bobCallSid);
749751
jsonObj = cdr.getAsJsonObject();
750752
logger.info("Status for call: "+bobCallSid+" : "+jsonObj.get("status").getAsString());
@@ -793,7 +795,7 @@ public void testTerminateDialForkCallWhileRinging_LCM_to_initial_call() throws E
793795
assertTrue(bobCall.waitOutgoingCallResponse(5 * 1000));
794796
assertEquals(Response.RINGING, bobCall.getLastReceivedResponse().getStatusCode());
795797
}
796-
798+
797799
String bobCallSid = bobCall.getLastReceivedResponse().getMessage().getHeader("X-RestComm-CallSid").toString().split(":")[1].trim();
798800

799801
// assertTrue(bobCall.waitOutgoingCallResponse(5 * 1000));
@@ -837,12 +839,12 @@ public void testTerminateDialForkCallWhileRinging_LCM_to_initial_call() throws E
837839
JsonObject jsonObj = cdr.getAsJsonObject();
838840
logger.info("Status for call: "+aliceCallSid+" : "+jsonObj.get("status").getAsString());
839841
assertTrue(jsonObj.get("status").getAsString().equalsIgnoreCase("canceled"));
840-
842+
841843
cdr = RestcommCallsTool.getInstance().getCall(deploymentUrl.toString(), adminAccountSid, adminAuthToken, georgeCallSid);
842844
jsonObj = cdr.getAsJsonObject();
843845
logger.info("Status for call: "+georgeCallSid+" : "+jsonObj.get("status").getAsString());
844846
assertTrue(jsonObj.get("status").getAsString().equalsIgnoreCase("canceled"));
845-
847+
846848
cdr = RestcommCallsTool.getInstance().getCall(deploymentUrl.toString(), adminAccountSid, adminAuthToken, bobCallSid);
847849
jsonObj = cdr.getAsJsonObject();
848850
logger.info("Status for call: "+bobCallSid+" : "+jsonObj.get("status").getAsString());
@@ -899,7 +901,7 @@ public void testTerminateDialForkCallWhileRinging_LCM_to_move_initial_call_to_ha
899901
assertTrue(bobCall.waitOutgoingCallResponse(5 * 1000));
900902
assertEquals(Response.RINGING, bobCall.getLastReceivedResponse().getStatusCode());
901903
}
902-
904+
903905
String bobCallSid = bobCall.getLastReceivedResponse().getMessage().getHeader("X-RestComm-CallSid").toString().split(":")[1].trim();
904906

905907
// assertTrue(bobCall.waitOutgoingCallResponse(5 * 1000));
@@ -937,20 +939,20 @@ public void testTerminateDialForkCallWhileRinging_LCM_to_move_initial_call_to_ha
937939

938940
assertTrue(bobCall.waitOutgoingCallResponse(5 * 1000));
939941
assertEquals(Response.REQUEST_TERMINATED, bobCall.getLastReceivedResponse().getStatusCode());
940-
942+
941943
//Wait to cancel the other branches
942944
Thread.sleep(3000);
943945

944946
JsonObject cdr = RestcommCallsTool.getInstance().getCall(deploymentUrl.toString(), adminAccountSid, adminAuthToken, aliceCallSid);
945947
JsonObject jsonObj = cdr.getAsJsonObject();
946948
logger.info("Status for call: "+aliceCallSid+" : "+jsonObj.get("status").getAsString());
947949
assertTrue(jsonObj.get("status").getAsString().equalsIgnoreCase("canceled"));
948-
950+
949951
cdr = RestcommCallsTool.getInstance().getCall(deploymentUrl.toString(), adminAccountSid, adminAuthToken, georgeCallSid);
950952
jsonObj = cdr.getAsJsonObject();
951953
logger.info("Status for call: "+georgeCallSid+" : "+jsonObj.get("status").getAsString());
952954
assertTrue(jsonObj.get("status").getAsString().equalsIgnoreCase("canceled"));
953-
955+
954956
cdr = RestcommCallsTool.getInstance().getCall(deploymentUrl.toString(), adminAccountSid, adminAuthToken, bobCallSid);
955957
jsonObj = cdr.getAsJsonObject();
956958
logger.info("Status for call: "+bobCallSid+" : "+jsonObj.get("status").getAsString());

restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/http/LiveCallModificationMuteUnMuteTest.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ public void after() throws Exception {
119119
}
120120
Thread.sleep(1000);
121121
wireMockRule.resetRequests();
122+
wireMockRule.resetScenarios();
123+
wireMockRule.resetMappings();
122124
Thread.sleep(4000);
123125
}
124126

@@ -188,29 +190,29 @@ public void muteUnmuteInProgressConferenceParticipant() throws Exception {
188190
JsonArray callsArray = partObject.getAsJsonArray("calls");
189191
int size = callsArray.size();
190192
assertEquals(2, size);
191-
193+
192194
logger.info("callsArray: "+callsArray);
193-
195+
194196
//any call sid
195197
String firstCallSid = callsArray.get(0).getAsJsonObject().get("sid").getAsString();
196198

197-
//Going to mute :
199+
//Going to mute :
198200
JsonObject muteResponse = RestcommConferenceParticipantsTool.getInstance().modifyCall(deploymentUrl.toString(), adminAccountSid, conferenceSid, adminAuthToken, firstCallSid, true);
199-
assertNotNull(muteResponse);
201+
assertNotNull(muteResponse);
200202
JsonObject modifiedParticipant = RestcommConferenceParticipantsTool.getInstance().getParticipant(deploymentUrl.toString(), adminAccountSid, conferenceSid, adminAuthToken, firstCallSid);
201203
assertNotNull(modifiedParticipant);
202204
Boolean muted = modifiedParticipant.get("muted").getAsBoolean();
203205
assertTrue(muted);
204-
205-
//Going to unmute :
206+
207+
//Going to unmute :
206208
JsonObject unmuteResponse = RestcommConferenceParticipantsTool.getInstance().modifyCall(deploymentUrl.toString(), adminAccountSid, conferenceSid, adminAuthToken, firstCallSid, false);
207209
assertNotNull(muteResponse);
208210
modifiedParticipant = RestcommConferenceParticipantsTool.getInstance().getParticipant(deploymentUrl.toString(), adminAccountSid, conferenceSid, adminAuthToken, firstCallSid);
209211
assertNotNull(modifiedParticipant);
210212
muted = modifiedParticipant.get("muted").getAsBoolean();
211213
assertTrue(!muted);
212214
}
213-
215+
214216
@Deployment(name = "LiveCallModificationTest", managed = true, testable = false)
215217
public static WebArchive createWebArchiveNoGw() {
216218
logger.info("Packaging Test App");

restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/http/LiveCallModificationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ public void after() throws Exception {
135135
}
136136
Thread.sleep(1000);
137137
wireMockRule.resetRequests();
138+
wireMockRule.resetScenarios();
139+
wireMockRule.resetMappings();
138140
Thread.sleep(4000);
139141
}
140142

restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/telephony/CallLifecycleAnswerDelayTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ public void after() throws Exception {
212212
}
213213
Thread.sleep(1000);
214214
wireMockRule.resetRequests();
215+
wireMockRule.resetScenarios();
216+
wireMockRule.resetMappings();
215217
Thread.sleep(4000);
216218
}
217219

restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/telephony/CallLifecycleTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ public void after() throws Exception {
235235
}
236236
Thread.sleep(1000);
237237
wireMockRule.resetRequests();
238+
wireMockRule.resetScenarios();
239+
wireMockRule.resetMappings();
238240
Thread.sleep(4000);
239241
}
240242

restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/telephony/CallLifecycleTestLive.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ public void after() throws Exception {
136136
}
137137
Thread.sleep(2000);
138138
wireMockRule.resetRequests();
139+
wireMockRule.resetScenarios();
140+
wireMockRule.resetMappings();
139141
Thread.sleep(2000);
140142
}
141143

restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/telephony/CallRegexSingleTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ public void after() throws Exception {
225225
}
226226
Thread.sleep(1000);
227227
wireMockRule.resetRequests();
228+
wireMockRule.resetScenarios();
229+
wireMockRule.resetMappings();
228230
Thread.sleep(4000);
229231
}
230232

0 commit comments

Comments
 (0)