Skip to content

Commit f29929c

Browse files
committed
added unstable beased on latest test results from CI
1 parent dc6f651 commit f29929c

21 files changed

Lines changed: 415 additions & 347 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.restcomm.connect.testsuite;
2+
3+
public interface BrokenTests {
4+
5+
}

restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/RvdProjectsMigratorWorkspaceMigratedTest.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,28 @@ public class RvdProjectsMigratorWorkspaceMigratedTest {
6868
private Deployer deployer;
6969
@ArquillianResource
7070
URL deploymentUrl;
71-
71+
7272
private static int mediaPort = NetworkPortAssigner.retrieveNextPortByFile();
73-
private static int smtpPort = NetworkPortAssigner.retrieveNextPortByFile();
73+
private static int smtpPort = NetworkPortAssigner.retrieveNextPortByFile();
7474

7575
private String adminUsername = "administrator@company.com";
7676
private String adminAccountSid = "ACae6e420f425248d6a26948c17a9e2acf";
7777
private String adminAuthToken = "77f8c12cc7b8f8423e5c38b035249166";
7878
private static GreenMail mailServer;
79-
79+
8080
private static int restcommPort = 5080;
8181
private static int restcommHTTPPort = 8080;
82-
private static String restcommContact = "127.0.0.1:" + restcommPort;
83-
82+
private static String restcommContact = "127.0.0.1:" + restcommPort;
83+
8484
public static void reconfigurePorts() throws Exception {
8585
if (System.getProperty("arquillian_sip_port") != null) {
8686
restcommPort = Integer.valueOf(System.getProperty("arquillian_sip_port"));
8787
restcommContact = "127.0.0.1:" + restcommPort;
8888
}
8989
if (System.getProperty("arquillian_http_port") != null) {
9090
restcommHTTPPort = Integer.valueOf(System.getProperty("arquillian_http_port"));
91-
}
92-
}
91+
}
92+
}
9393

9494
@AfterClass
9595
public static void stopMailServer() {
@@ -153,6 +153,7 @@ public void checkNotifications() {
153153
}
154154

155155
@Test
156+
@Category(UnstableTests.class)
156157
public void checkEmail() throws IOException, MessagingException, InterruptedException {
157158
mailServer.waitForIncomingEmail(60000, 1);
158159
MimeMessage[] messages = mailServer.getReceivedMessages();
@@ -175,7 +176,7 @@ public static WebArchive createWebArchiveRestcomm() throws Exception {
175176

176177
Map<String, String> replacements = new HashMap();
177178
replacements.put("3025", String.valueOf(smtpPort));
178-
//replace mediaport 2727
179+
//replace mediaport 2727
179180
replacements.put("2727", String.valueOf(mediaPort));
180181
replacements.put("8080", String.valueOf(restcommHTTPPort));
181182
replacements.put("5080", String.valueOf(restcommPort));
@@ -184,15 +185,15 @@ public static WebArchive createWebArchiveRestcomm() throws Exception {
184185
));
185186

186187
WebArchive archive = WebArchiveUtil.createWebArchiveNoGw("restcomm_workspaceMigration.xml",
187-
"restcomm.script_projectMigratorWorkspaceMigratedTest",
188+
"restcomm.script_projectMigratorWorkspaceMigratedTest",
188189
resources, replacements);
189-
190+
190191
String source = "src/test/resources/workspace-migration-scenarios/migrated";
191192
String target = "workspace-migration";
192193
File f = new File(source);
193-
addFiles(archive, f, source, target);
194+
addFiles(archive, f, source, target);
194195
return archive;
195-
}
196+
}
196197

197198
private static void addFiles(WebArchive war, File dir, String source, String target) throws Exception {
198199
if (!dir.isDirectory()) {
@@ -208,7 +209,7 @@ private static void addFiles(WebArchive war, File dir, String source, String tar
208209
}
209210
}
210211

211-
@BeforeClass
212+
@BeforeClass
212213
public static void startEmailServer() {
213214
ServerSetup setup = new ServerSetup(smtpPort, "127.0.0.1", "smtp");
214215
mailServer = new GreenMail(setup);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
5252
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
5353
import static com.github.tomakehurst.wiremock.client.WireMock.verify;
54+
import org.junit.experimental.categories.Category;
55+
import org.restcomm.connect.testsuite.UnstableTests;
5456

5557
/**
5658
* @author otsakir@gmail.com - Orestis Tsakiridis
@@ -96,6 +98,7 @@ public void removeAccountAndSendNotifications() throws InterruptedException {
9698

9799
// verify that DID provider (nexmo) was contacted to cancel the numbers when the account is removed
98100
@Test
101+
@Category(UnstableTests.class)
99102
public void removeAccountAndReleaseProvidedNumbers() {
100103
stubFor(post(urlMatching("/nexmo/number/cancel/.*/.*/US/12223334444"))
101104
.willReturn(aResponse()

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
import com.sun.jersey.api.client.UniformInterfaceException;
4040
import com.sun.jersey.api.client.WebResource;
4141
import com.sun.jersey.core.util.MultivaluedMapImpl;
42+
import org.junit.experimental.categories.Category;
43+
import org.restcomm.connect.testsuite.UnstableTests;
4244

4345
/**
4446
* @author <a href="mailto:gvagenas@gmail.com">gvagenas</a>
@@ -98,15 +100,15 @@ public class AccountsEndpointTest extends EndpointTest {
98100
private String nonSubAccountSid = "AC44444444444444444444444444444444";
99101

100102
private String commonAuthToken = "77f8c12cc7b8f8423e5c38b035249166";
101-
103+
102104
private String organizationSid1 = "ORafbe225ad37541eba518a74248f0ac4c";
103105
private String organizationSid2 = "ORafbe225ad37541eba518a74248f0ac4d";
104106
private String organizationSid3 = "ORafbe225ad37541eba518a74248f0ac4e";
105-
107+
106108
private String organization1DomainName = "127.0.0.1";
107109
private String organization2DomainName = "org1.restcomm.com";
108110
private String organization3DomainName = "org2.restcomm.com";
109-
111+
110112

111113
static SipStackTool tool1;
112114

@@ -181,6 +183,7 @@ public void testCreateAccount() {
181183
}
182184

183185
@Test
186+
@Category(UnstableTests.class)
184187
public void testCreateAccountWithJapaneseChars() {
185188
String friendlyName = "NTTアドバンステクノロジ";
186189
JsonObject createAccountResponse = RestcommAccountsTool.getInstance().createAccount(deploymentUrl.toString(),
@@ -589,7 +592,7 @@ public void createAccountInSpecificOrganizationPermissionTest() {
589592
ClientResponse clientResponse = RestcommAccountsTool.getInstance().createAccountResponse(deploymentUrl.toString(),
590593
childUsername, childAuthToken, createdUsernanme, createdPassword, null, organizationSid2);
591594
assertEquals(403, clientResponse.getStatus());
592-
595+
593596
}
594597

595598
@Test
@@ -603,7 +606,7 @@ public void createAccountInSpecificOrganizationRoleTest() {
603606
clientResponse = RestcommAccountsTool.getInstance().createAccountResponse(deploymentUrl.toString(),
604607
adminUsername, adminAuthToken, createdUsernanme3, createdPassword, null, organizationSid2);
605608
assertEquals(200, clientResponse.getStatus());
606-
609+
607610
}
608611

609612
@Test
@@ -621,6 +624,7 @@ public void createAccountInSpecificOrganizationInvalidRequestTest() {
621624
}
622625

623626
@Test
627+
@Category(UnstableTests.class)
624628
public void testGetAccountsOfASpecificOrganization() {
625629
//getAccounts without any parameters
626630
ClientResponse response = RestcommAccountsTool.getInstance().getAccountsResponse(deploymentUrl.toString(), adminUsername, adminAuthToken);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
import com.google.gson.JsonArray;
5151
import com.google.gson.JsonObject;
5252
import com.sun.jersey.core.util.MultivaluedMapImpl;
53+
import org.junit.experimental.categories.Category;
54+
import org.restcomm.connect.testsuite.UnstableTests;
5355

5456
/**
5557
* @author guilherme.jansen@telestax.com
@@ -75,6 +77,7 @@ public void after() throws InterruptedException {
7577
}
7678

7779
@Test
80+
@Category(UnstableTests.class)
7881
public void testCreateAndGetApplication() throws ParseException, IllegalArgumentException, ClientProtocolException,
7982
IOException {
8083
// Define application attributes

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
1919
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
2020
*/
21-
21+
2222
package org.restcomm.connect.testsuite.http;
2323

2424
import static org.junit.Assert.assertTrue;
@@ -38,15 +38,17 @@
3838
import org.jboss.shrinkwrap.api.spec.WebArchive;
3939
import org.jboss.shrinkwrap.resolver.api.maven.archive.ShrinkWrapMaven;
4040
import org.junit.Test;
41+
import org.junit.experimental.categories.Category;
4142
import org.junit.runner.RunWith;
4243

4344
import org.restcomm.connect.commons.Version;
45+
import org.restcomm.connect.testsuite.UnstableTests;
4446
import wiremock.org.apache.http.client.ClientProtocolException;
4547

4648
/**
4749
* The aim of this scenario is to ensure that an account can manage its own information and the information from its sub
4850
* accounts. Accounts and Applications endpoints are tested separately due its particularities.
49-
*
51+
*
5052
* @author guilherme.jansen@telestax.com
5153
*/
5254
@RunWith(Arquillian.class)
@@ -75,16 +77,16 @@ public class MultitenancyAllowAccessApiTest {
7577
private final static String jsonExtension = ".json";
7678

7779
private enum Endpoint {
78-
80+
7981
INCOMING_PHONE_NUMBERS("IncomingPhoneNumbers", true, false, true, true, new HashMap<String,String>(){{ put("PhoneNumber","1111"); put("AreaCode","100"); }}, "PNff22dc8d1cdf4d449d666ac09f0bb110", "PN9f9cf955aeb94ebb9d2e09cead5683a4"),
80-
CALLS("Calls", true, false, false, false, null, "CA9aa1b61e9b864477a820d5c1c9d9bb7d", "CAc6a057e16aa74cb0923c538725ffcf01"),
81-
SMS_MESSAGES("SMS/Messages", true, false, false, false, null, "SMa272937700b3461bb5d68a3569c61bf1", "SMa272937700b3461bb5d68a3569c61bf2"),
82+
CALLS("Calls", true, false, false, false, null, "CA9aa1b61e9b864477a820d5c1c9d9bb7d", "CAc6a057e16aa74cb0923c538725ffcf01"),
83+
SMS_MESSAGES("SMS/Messages", true, false, false, false, null, "SMa272937700b3461bb5d68a3569c61bf1", "SMa272937700b3461bb5d68a3569c61bf2"),
8284
CLIENTS("Clients", true, true, true, true, new HashMap<String,String>(){{ put("Login","test"); put("Password","Restcomm12"); }}, "CLe95ba029114147c9a9aa42becd0518c0", "CL9bfcb54ead2b44e6bae03f337967a249"),
8385
OUTGOING_CALLER_IDS("OutgoingCallerIds", true, true, false, true, new HashMap<String,String>(){{ put("PhoneNumber","1111"); }}, "PNfa413fdbf3944932b37bef4bd661c7f7", "PN5a33fa8232d84578af023b1e81e30f67"),
8486
RECORDINGS("Recordings", true, false, false, false, null, "REacaffdf107da4dc3926e37bddfff44ed", "REacaffdf107da4dc3926e37bddfff44ee"),
8587
TRANSCRIPTIONS("Transcriptions", true, false, false, true, null, "TRacaffdf107da4dc3926e37bddfff44ee", "TRacaffdf107da4dc3926e37bddfff44ed"),
8688
NOTIFICATIONS("Notifications", true, false, false, false, null, "NO8927433ce9514b70ac0a76cd36601b9e", "NO8927433ce9514b70ac0a76cd36601b9d");
87-
89+
8890
String name;
8991
boolean get;
9092
boolean postList;
@@ -93,7 +95,7 @@ private enum Endpoint {
9395
HashMap<String, String> postParams;
9496
String elementSameAccount;
9597
String elementSubaccount;
96-
98+
9799
Endpoint(String name, boolean get, boolean postList, boolean postElement, boolean delete, HashMap<String,String> postParams, String elementSameAccount, String elementSubaccount){
98100
this.name = name;
99101
this.get = get;
@@ -104,7 +106,7 @@ private enum Endpoint {
104106
this.elementSameAccount = elementSameAccount;
105107
this.elementSubaccount = elementSubaccount;
106108
}
107-
109+
108110
}
109111

110112
@Test
@@ -163,6 +165,7 @@ public void postListSubaccount() throws ClientProtocolException, IOException {
163165
}
164166

165167
@Test
168+
@Category(UnstableTests.class)
166169
public void getElementSameAccount() throws ClientProtocolException, IOException {
167170
String baseUrl = deploymentUrl.toString() + apiPath + primaryAccountSid + "/";
168171
for (Endpoint endpoint : Endpoint.values()) {
@@ -176,6 +179,7 @@ public void getElementSameAccount() throws ClientProtocolException, IOException
176179
}
177180

178181
@Test
182+
@Category(UnstableTests.class)
179183
public void getElementSubaccount() throws ClientProtocolException, IOException {
180184
String baseUrl = deploymentUrl.toString() + apiPath + subaccountaAccountSid + "/";
181185
for (Endpoint endpoint : Endpoint.values()) {
@@ -252,7 +256,7 @@ public void accountsApi() throws ClientProtocolException, IOException {
252256
assertTrue(statusCode == httpOk);
253257
statusCode = RestcommMultitenancyTool.getInstance().post(baseUrl + jsonExtension, primaryUsername, accountsPassword, new HashMap<String,String>(){{ put("EmailAddress","test@test.com"); put("Password","RestComm12");}});
254258
Assert.assertEquals(httpOk, statusCode);
255-
259+
256260
// Sub account
257261
baseUrl = deploymentUrl.toString() + apiPath.substring(0, apiPath.length()-1);
258262
statusCode = RestcommMultitenancyTool.getInstance().get(baseUrl + jsonExtension + "/" + subaccountbAccountSid, primaryUsername, accountsPassword);

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
import com.sun.jersey.api.client.UniformInterfaceException;
2626
import com.google.gson.JsonElement;
27-
import com.google.gson.JsonArray;
2827
import com.google.gson.JsonObject;
2928

3029
import org.apache.log4j.Logger;
@@ -38,9 +37,10 @@
3837
import org.junit.Test;
3938
import org.junit.runner.RunWith;
4039
import org.restcomm.connect.commons.Version;
41-
import org.restcomm.connect.testsuite.http.RestcommUsageRecordsTool;
4240

4341
import java.net.URL;
42+
import org.junit.experimental.categories.Category;
43+
import org.restcomm.connect.testsuite.UnstableTests;
4444

4545
/**
4646
* @author <a href="mailto:abdulazizali@acm.org">abdulazizali77</a>
@@ -82,6 +82,7 @@ public void getUsageRecordsListCategorySms() {
8282
}
8383

8484
@Test
85+
@Category(UnstableTests.class)
8586
public void getUsageRecordsDaily() {
8687
JsonElement response = RestcommUsageRecordsTool.getInstance().getUsageRecordsDaily(deploymentUrl.toString(),
8788
adminAccountSid, adminAuthToken, "", true);
@@ -120,6 +121,7 @@ public void getUsageRecordsDaily() {
120121
}
121122

122123
@Test
124+
@Category(UnstableTests.class)
123125
public void getUsageRecordsMonthly() {
124126
JsonElement response = RestcommUsageRecordsTool.getInstance().getUsageRecordsMonthly(deploymentUrl.toString(),
125127
adminAccountSid, adminAuthToken, "", true);
@@ -155,6 +157,7 @@ public void getUsageRecordsMonthly() {
155157
}
156158

157159
@Test
160+
@Category(UnstableTests.class)
158161
public void getUsageRecordsYearly() {
159162
JsonElement response = RestcommUsageRecordsTool.getInstance().getUsageRecordsYearly(deploymentUrl.toString(),
160163
adminAccountSid, adminAuthToken, "", true);
@@ -185,11 +188,12 @@ public void getUsageRecordsYearly() {
185188
assertTrue(usage_unit.equals("minutes"));
186189
assertTrue(price_unit.equals("USD"));
187190
assertTrue(uri.equals("/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Usage/Records/Yearly.json?Category=Calls&EndDate=2016-01-01&StartDate=2016-12-31"));
188-
191+
189192
//TODO: test other categories
190193
}
191194

192195
@Test
196+
@Category(UnstableTests.class)
193197
public void getUsageRecordsAlltime() {
194198
JsonElement response = RestcommUsageRecordsTool.getInstance().getUsageRecordsAllTime(deploymentUrl.toString(),
195199
adminAccountSid, adminAuthToken, "", true);

0 commit comments

Comments
 (0)