@@ -27,23 +27,24 @@ public void setUp() throws Exception {
2727 this .deviceManager = new DeviceManager (auth );
2828 }
2929
30- // @Test
31- // @Tag("IntegrationTest")
32- // public void testCreateDevice() {
33- // Device device = Device.builder().username("admin").password("QQQNNN111").build();
34- // try {
35- // res = deviceManager.createDevice(namespaceId, device);
36- // assertNotNull(res);
37- // System.out.println(res.bodyString());
38- // } catch (QiniuException e) {
39- //// assertEquals(401, res.statusCode);
40- // e.printStackTrace();
41- // } finally {
42- // if (res != null) {
43- // res.close();
44- // }
45- // }
46- // }
30+ /* @Test
31+ @Tag("IntegrationTest")
32+ public void testCreateDevice() {
33+ Device device = Device.builder().username("admin").password("QQQNNN111").build();
34+ try {
35+ res = deviceManager.createDevice(namespaceId, device);
36+ assertNotNull(res);
37+ System.out.println(res.bodyString());
38+ } catch (QiniuException e) {
39+ // assertEquals(401, res.statusCode);
40+ e.printStackTrace();
41+ } finally {
42+ if (res != null) {
43+ res.close();
44+ }
45+ }
46+ }
47+ */
4748
4849 @ Test
4950 @ Tag ("IntegrationTest" )
@@ -86,7 +87,7 @@ public void testListDevice() {
8687 int offset = 0 ;
8788 int line = 3 ;
8889 int qtype = 0 ;
89- String prefix = "310 " ;
90+ String prefix = "中文 " ;
9091 String state = "notReg" ;
9192 try {
9293 res = deviceManager .listDevice (namespaceId , offset , line , prefix , state , qtype );
@@ -119,7 +120,7 @@ public void testListDevice() {
119120// }
120121// }
121122
122- @ Test
123+ /* @Test
123124 @Tag("IntegrationTest")
124125 public void testStartDevice() {
125126 try {
@@ -135,22 +136,22 @@ public void testStartDevice() {
135136 }
136137 }
137138
138- // @Test
139- // @Tag("IntegrationTest")
140- // public void testStopDevice() {
141- // try {
142- // res = deviceManager.stopDevice(namespaceId, gbId, channels);
143- // res2 = deviceManager.startDevice(namespaceId, gbId, channels);
144- // assertNotNull(res);
145- // System.out.println(res.bodyString());
146- // } catch (QiniuException e) {
147- // e.printStackTrace();
148- // } finally {
149- // if (res != null) {
150- // res.close();
151- // }
152- // }
153- // }
139+ @Test
140+ @Tag("IntegrationTest")
141+ public void testStopDevice() {
142+ try {
143+ res = deviceManager.stopDevice(namespaceId, gbId, channels);
144+ res2 = deviceManager.startDevice(namespaceId, gbId, channels);
145+ assertNotNull(res);
146+ System.out.println(res.bodyString());
147+ } catch (QiniuException e) {
148+ e.printStackTrace();
149+ } finally {
150+ if (res != null) {
151+ res.close();
152+ }
153+ }
154+ }
154155
155156 @Test
156157 @Tag("IntegrationTest")
@@ -168,21 +169,21 @@ public void testFetchCatalog() {
168169 }
169170 }
170171
171- // @Test
172- // @Tag("IntegrationTest")
173- // public void testQueryChannel() {
174- // try {
175- // res = deviceManager.queryChannel(namespaceId, gbId, channels[0]);//TODO
176- // assertNotNull(res);
177- // System.out.println(res.bodyString());
178- // } catch (QiniuException e) {
179- // e.printStackTrace();
180- // } finally {
181- // if (res != null) {
182- // res.close();
183- // }
184- // }
185- // }
172+ @Test
173+ @Tag("IntegrationTest")
174+ public void testQueryChannel() {
175+ try {
176+ res = deviceManager.queryChannel(namespaceId, gbId, channels[0]);//TODO
177+ assertNotNull(res);
178+ System.out.println(res.bodyString());
179+ } catch (QiniuException e) {
180+ e.printStackTrace();
181+ } finally {
182+ if (res != null) {
183+ res.close();
184+ }
185+ }
186+ }
186187
187188 @Test
188189 @Tag("IntegrationTest")
@@ -200,4 +201,5 @@ public void testQueryGBRecordHistories() {
200201 }
201202 }
202203 }
204+ */
203205}
0 commit comments