Skip to content

Commit

Permalink
(#28) Added free implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
svettwer committed Mar 22, 2019
1 parent 3cd3e64 commit 5ff47a7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public void truncate(final long len) {
}

@Override
public void free() throws SQLException {

public void free() {
stringBuilder.delete(0, stringBuilder.length());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,23 @@ public void testTruncate() throws Exception {
assertEquals(clobContent, expectedTruncatedString);
}

@Test
public void testFree() throws SQLException {
//We break with the jdbc contract here as it is might cause issues
//to throw such an exceptions during testing.
//The subject to test is the system using the database and not the database
//integration itself.

//GIVEN
citrusClob.setString(1, sampleText);

//WHEN
citrusClob.free();

//THEN
assertEquals(citrusClob.length(), 0);
}

@Test
public void testEqualsContract(){
EqualsVerifier
Expand Down

0 comments on commit 5ff47a7

Please sign in to comment.