Skip to content

Commit 4789f27

Browse files
victiniJaven
authored andcommitted
add logic tests
1 parent 9366c96 commit 4789f27

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

test/cn/jpush/api/device/DeviceNormalRemoteTest.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ public void testGetDeviceTagAlias_1() throws Exception {
4949
assertFalse("tag not contains", result.tags.contains("tag_3"));
5050
assertFalse("tag not contains", result.tags.contains("tag_4"));
5151
}
52+
@Test
53+
@TestOrder(order = 111)
54+
public void testGetAliasDeviceList_1() throws APIConnectionException, APIRequestException {
55+
AliasDeviceListResult result = jpushClient.getAliasDeviceList(ALIAS1, null);
56+
assertTrue(result.registration_ids.contains(REGISTRATION_ID1));
57+
}
5258

5359
@Test
5460
@TestOrder(order = 120)
@@ -90,6 +96,13 @@ public void testIsDeviceInTag() throws APIConnectionException, APIRequestExcepti
9096
result = jpushClient.isDeviceInTag("tag_3", REGISTRATION_ID2);
9197
assertFalse("", result.result);
9298
}
99+
100+
@Test
101+
@TestOrder(order = 211)
102+
public void testAddRemoveDevicesFromTagResult() throws APIConnectionException, APIRequestException {
103+
TagListResult result = jpushClient.getTagList();
104+
assertTrue("", result.tags.contains("tag_3"));
105+
}
93106

94107
@Test
95108
@TestOrder(order = 220)
@@ -105,6 +118,13 @@ public void testDeleteTag() throws APIConnectionException, APIRequestException {
105118
assertTrue(result.isResultOK());
106119
}
107120

121+
@Test
122+
@TestOrder(order = 251)
123+
public void testDeleteResult() throws APIConnectionException, APIRequestException {
124+
TagListResult result = jpushClient.getTagList();
125+
assertFalse("", result.tags.contains("tag3"));
126+
}
127+
108128
@Test
109129
@TestOrder(order = 260)
110130
public void testDeleteTag_2() throws APIConnectionException, APIRequestException {
@@ -132,7 +152,7 @@ public void testGetAliasDeviceList() throws APIConnectionException, APIRequestEx
132152
@TestOrder(order = 310)
133153
public void testGetAliasDeviceList_2() throws APIConnectionException, APIRequestException {
134154
AliasDeviceListResult result = jpushClient.getAliasDeviceList(ALIAS1, null);
135-
assertTrue(result.isResultOK());
155+
assertTrue(result.registration_ids.size() == 0);
136156
}
137157

138158
@Test
@@ -142,6 +162,7 @@ public void testDeleteAlias() throws APIConnectionException, APIRequestException
142162
assertTrue(result.isResultOK());
143163
}
144164

165+
145166
@Test
146167
@TestOrder(order = 330)
147168
public void testDeleteAlias_2() throws APIConnectionException, APIRequestException {

0 commit comments

Comments
 (0)