Skip to content

Commit 379f294

Browse files
MarkLogic BuilderMarkLogic Builder
authored andcommitted
issue 43
1 parent 7c2b058 commit 379f294

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

test-complete/src/test/java/com/marklogic/javaclient/TestBulkWriteWithTransactions.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ public class TestBulkWriteWithTransactions extends BasicJavaClientREST {
3939
@BeforeClass
4040
public static void setUpBeforeClass() throws Exception {
4141
System.out.println("In Setup");
42-
// setupJavaRESTServer(dbName, fNames[0], restServerName,restPort);
43-
// createRESTUser("app-user", "password","rest-writer","rest-reader" );
44-
// createRESTUserWithPermissions("usr1", "password",getPermissionNode("eval",Capability.READ),getCollectionNode("http://permission-collections/"), "rest-writer","rest-reader" );
45-
// setMaintainLastModified(dbName, true);
42+
setupJavaRESTServer(dbName, fNames[0], restServerName,restPort);
43+
createRESTUser("app-user", "password","rest-writer","rest-reader" );
44+
createRESTUserWithPermissions("usr1", "password",getPermissionNode("eval",Capability.READ),getCollectionNode("http://permission-collections/"), "rest-writer","rest-reader" );
45+
setMaintainLastModified(dbName, true);
4646
}
4747
@AfterClass
4848
public static void tearDownAfterClass() throws Exception {
4949
System.out.println("In tear down" );
50-
// tearDownJavaRESTServer(dbName, fNames, restServerName);
51-
// deleteRESTUser("app-user");
52-
// deleteRESTUser("usr1");
50+
tearDownJavaRESTServer(dbName, fNames, restServerName);
51+
deleteRESTUser("app-user");
52+
deleteRESTUser("usr1");
5353
}
5454
@Before
5555
public void setUp() throws Exception {
@@ -135,7 +135,7 @@ public void validateRecord(DocumentRecord record,Format type) {
135135
assertEquals("All records are expected to be in same format", type, record.getFormat());
136136
}
137137
/*
138-
* This test is trying to bulk insert in
138+
* This test is trying to bulk insert documents with transaction open and not commited and try to read documents before commit.
139139
*/
140140
@Test
141141
public void testBulkWritewithTransactions() throws Exception {
@@ -162,7 +162,7 @@ public void testBulkWritewithTransactions() throws Exception {
162162
for(int i =0;i<102;i++){
163163
uris[i]=DIRECTORY+"foo"+i+".xml";
164164
}
165-
// t1.commit();
165+
166166
count=0;
167167
DocumentPage page = docMgr.read(t1,uris);
168168
DOMHandle dh = new DOMHandle();
@@ -175,6 +175,7 @@ public void testBulkWritewithTransactions() throws Exception {
175175
}
176176

177177
assertEquals("document count", 102,count);
178+
t1.rollback();
178179
}
179180

180181
}

0 commit comments

Comments
 (0)