Skip to content
Snippets Groups Projects
Commit ac82a305 authored by felmer's avatar felmer
Browse files

LMS-1361 system test added

SVN: 14879
parent fd1d9bda
No related branches found
No related tags found
No related merge requests found
...@@ -156,7 +156,7 @@ public class QueryEditingTest extends QuerySystemTestCase ...@@ -156,7 +156,7 @@ public class QueryEditingTest extends QuerySystemTestCase
} }
} }
@Test(groups = "broken") @Test
public void testCreateQueryResult() public void testCreateQueryResult()
{ {
logIntoCommonClientService(); logIntoCommonClientService();
...@@ -166,6 +166,33 @@ public class QueryEditingTest extends QuerySystemTestCase ...@@ -166,6 +166,33 @@ public class QueryEditingTest extends QuerySystemTestCase
TableModelReference table = TableModelReference table =
queryClientService.createQueryResultsReport( queryClientService.createQueryResultsReport(
"select id, code from sample_types where id = ${id}", bindings); "select id, code from sample_types where id = ${id}", bindings);
checkTable(table);
}
@Test
public void testRegisterQueryAndExecuteIt()
{
logIntoCommonClientService();
NewExpression query =
createQuery("query", "select id, code from sample_types where id = ${id}", true);
queryClientService.registerQuery(query);
List<QueryExpression> queries = queryClientService.listQueries();
assertEquals(1, queries.size());
QueryExpression actualQuery = queries.get(0);
QueryParameterBindings bindings = new QueryParameterBindings();
bindings.addBinding("id", "1");
TableModelReference table =
queryClientService.createQueryResultsReport(new TechId(actualQuery.getId()),
bindings);
checkTable(table);
}
private void checkTable(TableModelReference table)
{
List<TableModelColumnHeader> headers = table.getHeader(); List<TableModelColumnHeader> headers = table.getHeader();
assertEquals("id", headers.get(0).getTitle()); assertEquals("id", headers.get(0).getTitle());
assertEquals(DataTypeCode.INTEGER, headers.get(0).getDataType()); assertEquals(DataTypeCode.INTEGER, headers.get(0).getDataType());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment