Skip to content

Commit

Permalink
#86 : automated tests for windows (fixed one test that was broken on …
Browse files Browse the repository at this point in the history
…windows)
  • Loading branch information
pj-spoelders committed Apr 29, 2021
1 parent 7c88818 commit 4261c35
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions src/test/java/com/exasol/drivers/JdbcDriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import org.testcontainers.shaded.org.apache.commons.lang.StringUtils;

@Tag("fast")
class JdbcDriverTest {
Expand Down Expand Up @@ -87,14 +88,27 @@ void testToString() {

@Test
void testToStringWithSourceFile() {
assertThat(JdbcDriver //
.builder("the_name") //
.prefix("jdbc:the_prefix") //
.sourceFile(Path.of("/the/path")) //
.mainClass("com.example.Driver") //
.build() //
.toString(), //
equalTo("JDBC driver \"the_name\" (com.example.Driver), source: \"/the/path\""));
final String osName = System.getProperty("os.name");
final String windowsStr = "Windows";
if (StringUtils.containsIgnoreCase(osName, windowsStr)) {
assertThat(JdbcDriver //
.builder("the_name") //
.prefix("jdbc:the_prefix") //
.sourceFile(Path.of("/the/path")) //
.mainClass("com.example.Driver") //
.build() //
.toString(), //
equalTo("JDBC driver \"the_name\" (com.example.Driver), source: \"\\the\\path\""));
} else {
assertThat(JdbcDriver //
.builder("the_name") //
.prefix("jdbc:the_prefix") //
.sourceFile(Path.of("/the/path")) //
.mainClass("com.example.Driver") //
.build() //
.toString(), //
equalTo("JDBC driver \"the_name\" (com.example.Driver), source: \"/the/path\""));
}
}

@Test
Expand Down

0 comments on commit 4261c35

Please sign in to comment.