@Test void conversionTest() { Result result = new Result("Select * From table", 0); result.getPathResults().add(buildPathResult(1)); result.getPathResults().add(buildPathResult(2)); EvoSQLRunner evoSQLRunner = new EvoSQLRunner(); nl.tudelft.serg.evosql.brew.data.Result brewResult = evoSQLRunner.convertResult(result); assertThat(brewResult.getInputQuery()).isEqualTo("Select * From table"); assertThat(brewResult.getPaths().size()).isEqualTo(2); assertThat(brewResult.getPaths().get(0).getFixture().getTables().size()).isEqualTo(3); assertThat(brewResult.getPaths().get(0).getPathSql()).isEqualTo("Select * From table1"); assertThat(brewResult.getPaths().get(1).getFixture().getTables().get(1).getSchema().getName()) .isEqualTo("testTable2"); assertThat(brewResult.getPaths().get(0).getFixture().getTables().get(0).getRows().get(0).getValues().get("testColumn1_1")) .isEqualTo("'string1'"); assertThat(brewResult.getPaths().get(0).getFixture().getTables().get(2).getRows().get(1).getValues().get("testColumn3_2")) .isEqualTo("20"); }
Result convertResult(nl.tudelft.serg.evosql.Result evoSqlResult) { return new Result( evoSqlResult.getInputQuery(), evoSqlResult.getPathResults().stream() .filter(pr -> pr.getFixture() != null) .filter(pr -> pr.isSuccess()) .map(this::convertPathResult) .collect(Collectors.toList()) ); }
EvoSQLRunner implements QueryRunner { Result convertResult(nl.tudelft.serg.evosql.Result evoSqlResult) { return new Result( evoSqlResult.getInputQuery(), evoSqlResult.getPathResults().stream() .filter(pr -> pr.getFixture() != null) .filter(pr -> pr.isSuccess()) .map(this::convertPathResult) .collect(Collectors.toList()) ); } }
EvoSQLRunner implements QueryRunner { Result convertResult(nl.tudelft.serg.evosql.Result evoSqlResult) { return new Result( evoSqlResult.getInputQuery(), evoSqlResult.getPathResults().stream() .filter(pr -> pr.getFixture() != null) .filter(pr -> pr.isSuccess()) .map(this::convertPathResult) .collect(Collectors.toList()) ); }  }
EvoSQLRunner implements QueryRunner { Result convertResult(nl.tudelft.serg.evosql.Result evoSqlResult) { return new Result( evoSqlResult.getInputQuery(), evoSqlResult.getPathResults().stream() .filter(pr -> pr.getFixture() != null) .filter(pr -> pr.isSuccess()) .map(this::convertPathResult) .collect(Collectors.toList()) ); }  @Override Result runQuery(@NonNull String sqlQuery, @NonNull ConnectionData connectionData); }
EvoSQLRunner implements QueryRunner { Result convertResult(nl.tudelft.serg.evosql.Result evoSqlResult) { return new Result( evoSqlResult.getInputQuery(), evoSqlResult.getPathResults().stream() .filter(pr -> pr.getFixture() != null) .filter(pr -> pr.isSuccess()) .map(this::convertPathResult) .collect(Collectors.toList()) ); }  @Override Result runQuery(@NonNull String sqlQuery, @NonNull ConnectionData connectionData);  }