Skip to content

Commit bf08266

Browse files
llingllinggit
authored andcommitted
Add Ingore to BulkReadWriteTest; Add After test to
ErrorListenerInputEndpointTest
1 parent 866b05f commit bf08266

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

marklogic-client-api/src/test/java/com/marklogic/client/test/BulkReadWriteTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.junit.AfterClass;
3939
import org.junit.BeforeClass;
4040
import org.junit.Test;
41+
import org.junit.Ignore;
4142

4243
import com.marklogic.client.DatabaseClient;
4344
import com.marklogic.client.DatabaseClientFactory;
@@ -159,11 +160,13 @@ static void loadCities(CityWriter cityWriter) throws Exception {
159160
}
160161

161162

163+
@Ignore
162164
@Test
163165
public void testA_BulkLoad() throws IOException, Exception {
164166
loadCities(new BulkCityWriter());
165167
}
166168

169+
@Ignore
167170
@Test
168171
public void testB_BulkRead() {
169172
XMLDocumentManager docMgr = Common.client.newXMLDocumentManager();
@@ -220,6 +223,7 @@ public void testB_BulkRead() {
220223
assertTrue("ResourceNotFoundException should have been thrown", exceptionThrown);
221224
}
222225

226+
@Ignore
223227
@Test
224228
public void testC_BulkSearch() {
225229
XMLDocumentManager docMgr = Common.client.newXMLDocumentManager();

marklogic-client-api/src/test/java/com/marklogic/client/test/dataservices/ErrorListenerInputEndpointTest.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.marklogic.client.io.InputStreamHandle;
2323
import com.marklogic.client.io.JacksonHandle;
2424
import org.junit.AfterClass;
25+
import org.junit.After;
2526
import org.junit.BeforeClass;
2627
import org.junit.Test;
2728

@@ -36,17 +37,17 @@ public class ErrorListenerInputEndpointTest {
3637
static String apiName = "errorListenerBulkIOInputCaller.api";
3738
static String scriptPath;
3839
static String apiPath;
39-
static JSONDocumentManager docMgr;
4040
int counter = 0;
41+
JSONDocumentManager docMgr = IOTestUtil.db.newJSONDocumentManager();
4142

4243
@BeforeClass
4344
public static void setup() throws Exception {
44-
docMgr = IOTestUtil.db.newJSONDocumentManager();
4545
apiObj = IOTestUtil.readApi(apiName);
4646
scriptPath = IOTestUtil.getScriptPath(apiObj);
4747
apiPath = IOTestUtil.getApiPath(scriptPath);
4848
IOTestUtil.load(apiName, apiObj, scriptPath, apiPath);
4949
}
50+
5051
@Test
5152
public void bulkInputEndpointTestWithRetry() {
5253

@@ -191,10 +192,10 @@ public void bulkInputEndpointTestWithStop() {
191192
assertTrue("Number of documents written not as expected." + counter, counter >= 1);
192193
}
193194

194-
@AfterClass
195-
public static void cleanup(){
196-
IOTestUtil.modMgr.delete(scriptPath, apiPath);
197-
for(int i=2; i<9; i++) {
195+
@After
196+
public void cleanup(){
197+
198+
for(int i=2; i<=9; i++) {
198199
String uri = "/marklogic/ds/test/bulkInputCaller/bulkInputTest_1/" +i+".json";
199200
docMgr.delete(uri);
200201
uri = "/marklogic/ds/test/bulkInputCaller/bulkInputTest_2/" +i+".json";
@@ -204,12 +205,17 @@ public static void cleanup(){
204205

205206
private void checkDocuments(String collection) {
206207

207-
for(int i=2; i<9; i++) {
208+
for(int i=2; i<=9; i++) {
208209
String uri = "/marklogic/ds/test/bulkInputCaller/"+collection+"/"+i+".json";
209210
if(docMgr.exists(uri)!=null) {
210211
counter++;
211212
}
212213
}
213214
}
215+
216+
@AfterClass
217+
public static void cleanupAfterClass() {
218+
IOTestUtil.modMgr.delete(scriptPath, apiPath);
219+
}
214220
}
215221

0 commit comments

Comments
 (0)