Skip to content

Commit

Permalink
fix groovy unit tests on windows (#7052)
Browse files Browse the repository at this point in the history
  • Loading branch information
EfimovVladimir authored and scottdraves committed Mar 26, 2018
1 parent e26e182 commit d7c718e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private File getInspectFile(){
Path workingDirectory = null;
try {
workingDirectory= Paths.get(
BeakerxWidget.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()
BeakerxWidget.class.getProtectionDomain().getCodeSource().getLocation().toURI()
).getParent().getParent();
} catch (URISyntaxException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void unableToResolveClass() throws Exception {
//then
assertThat(evaluate.isError()).isTrue();
System.out.println(evaluate.error());
assertThat(evaluate.error()).startsWith("unable to resolve class IntSlider @ line 1, column 1.");
assertThat(evaluate.error()).contains("unable to resolve class IntSlider");
}

// @Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ public static void tearDownClass() throws Exception {
@Test
public void evaluateInspectFooWoBracketCaretAtEnd() throws Exception {
//given
String code = "import com.twosigma.beakerx.table.*\n" +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat\n" +
"\n" +
"csv = new CsvPlotReader()\n" +
String code = "import com.twosigma.beakerx.table.*" + System.lineSeparator() +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat" + System.lineSeparator() +
"csv = new CsvPlotReader()" + System.lineSeparator() +
"csv.re\0ad";
String expected = METHOD_CSV_PLOT_READER_READ;

Expand All @@ -78,9 +77,8 @@ public void evaluateInspectFooWoBracketCaretAtEnd() throws Exception {
@Test
public void evaluateInspectOnClassName() throws Exception {
//given
String code = "import com.twosigma.beakerx.table.*\n" +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat\n" +
"\n" +
String code = "import com.twosigma.beakerx.table.*" + System.lineSeparator() +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat" + System.lineSeparator() +
"csv = new CsvPlot\0Reader()";
String expected = CLASS_CSV_PLOT_READER;
//when
Expand All @@ -92,10 +90,9 @@ public void evaluateInspectOnClassName() throws Exception {
@Test
public void evaluateInspectFooWBracketCaretInBracket() throws Exception {
//given
String code = "import com.twosigma.beakerx.table.*\n" +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat\n" +
"\n" +
"csv = new CsvPlotReader()\n" +
String code = "import com.twosigma.beakerx.table.*" + System.lineSeparator() +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat" + System.lineSeparator() +
"csv = new CsvPlotReader()" + System.lineSeparator() +
"csv.read(\0)";
String expected = METHOD_CSV_PLOT_READER_READ;
//when
Expand All @@ -108,10 +105,10 @@ public void evaluateInspectFooWBracketCaretInBracket() throws Exception {
@Test
public void evaluateInspectFooWoSimpleInitCaretInFooName() throws Exception {
//given
String code = "import com.twosigma.beakerx.table.*\n" +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat\n" +
"\n" +
"table = new TableDisplay(new CsvPlotReader().read('../resources/data/interest-rates.csv'))\n" +
String code = "import com.twosigma.beakerx.table.*" + System.lineSeparator() +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat" + System.lineSeparator() +
"table = new TableDisplay(new CsvPlotReader().read('../resources/data/interest-rates.csv'))" +
System.lineSeparator() +
"table.setDoubleCli\0ckAction()";
String expected = METHOD_TABLE_DISPLAY_SETDBLCLICK;
//when
Expand All @@ -124,9 +121,8 @@ public void evaluateInspectFooWoSimpleInitCaretInFooName() throws Exception {
@Test
public void evaluateInspectClassNameWithoutNew() throws Exception {
//given
String code = "import com.twosigma.beakerx.table.*\n" +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat\n" +
"\n" +
String code = "import com.twosigma.beakerx.table.*" + System.lineSeparator() +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat" + System.lineSeparator() +
"table = new TableDisplay(new CsvPlotReader().read('ar\0gs'))";
String expected = METHOD_CSV_PLOT_READER_READ;
//when
Expand All @@ -139,10 +135,10 @@ public void evaluateInspectClassNameWithoutNew() throws Exception {
@Test
public void evaluateInspectClassNameInsideConstructor() throws Exception {
//given
String code = "import com.twosigma.beakerx.table.*\n" +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat\n" +
"\n" +
"display = new TableDisplay(new CsvPlot\0Reader().read(\"../resources/data/interest-rates.csv\"))\n" +
String code = "import com.twosigma.beakerx.table.*" + System.lineSeparator() +
"import com.twosigma.beakerx.table.format.TableDisplayStringFormat" + System.lineSeparator() +
"display = new TableDisplay(new CsvPlot\0Reader().read(\"../resources/data/interest-rates.csv\"))" +
System.lineSeparator() +
"display.setStringFormatForColumn(\"test\")";
String expected = CLASS_CSV_PLOT_READER;
//when
Expand All @@ -154,7 +150,7 @@ public void evaluateInspectClassNameInsideConstructor() throws Exception {
@Test
public void evaluateInspectOnVariableWithDefKeyword() throws Exception {
//given
String code = "def display = new TableDisplay()\n" +
String code = "def display = new TableDisplay()" + System.lineSeparator() +
"dis\0play.setDoubleClickAction()";
String expected = CLASS_TABLE_DISPLAY;
//when
Expand All @@ -166,7 +162,7 @@ public void evaluateInspectOnVariableWithDefKeyword() throws Exception {
@Test
public void evaluateInspectOnMethodVarWithDefKeyword() throws Exception {
//given
String code = "def display = new TableDisplay()\n" +
String code = "def display = new TableDisplay()" + System.lineSeparator() +
"display.setDoubleCli\0ckAction()";
String expected = METHOD_TABLE_DISPLAY_SETDBLCLICK;
//when
Expand Down

0 comments on commit d7c718e

Please sign in to comment.