Commit 40c8b03b authored by Georg Fette's avatar Georg Fette
Browse files

added further cql tests

parent e8cacdd8
package de.uniwue.query;
import java.util.HashMap;
import java.util.Map;
public class GraphLibrary {
public Map<String, GraphQuery> queries = new HashMap<String, GraphQuery>();
}
......@@ -9,6 +9,8 @@ public class GraphQuery {
public QueryOperator rootClause = new QueryOperator(OperatorType.QUERY);
public GraphLibrary library = new GraphLibrary();
public List<QueryConcept> getConceptsRecursive() {
List<QueryConcept> result = new ArrayList<QueryConcept>();
for (QueryConcept aConc : rootConcepts) {
......
......@@ -34,9 +34,17 @@ public class QueryManager {
if (!resource.exists()) {
throw new RuntimeException("resource folder '" + path + "' does not exist");
}
File[] listFiles = resource.getFile().listFiles();
for (int i = 0; i < listFiles.length; i++) {
readQueries(resource.getFile());
}
private void readQueries(File aDir) throws IOException {
File[] listFiles = aDir.listFiles();
for (int i = 0; i < listFiles.length; i++) {
File aFile = listFiles[i];
if (aFile.isDirectory()) {
readQueries(aFile);
continue;
}
if (!aFile.getName().matches(".*\\.txt")) {
continue;
}
......
......@@ -26,10 +26,12 @@ public class Test_CQL_2_CQL {
initialize();
QueryManager queryManager = new QueryManager();
for (MultiQuery aMultiQuery : queryManager.queries) {
if (aMultiQuery.name.equals("query_CQL_1Conc_2Constr")) {
if (aMultiQuery.name.equals("CQL_AllTrue")) {
processQuery(aMultiQuery);
return;
}
}
throw new RuntimeException("query not found");
}
private void initialize() {
......
......@@ -28,7 +28,7 @@ public class Test_CQL_2_Cypher {
QueryManager queryManager = new QueryManager();
initialize();
for (MultiQuery aMultiQuery : queryManager.queries) {
if (aMultiQuery.name.equals("query_CQL_2_Cypher_EncInPatient_2Sources")) {
if (aMultiQuery.name.equals("query_CQL_2_Cypher_Count")) {
processQuery(aMultiQuery);
}
}
......@@ -63,8 +63,8 @@ public class Test_CQL_2_Cypher {
public static void main(String[] args) throws IOException, XMLStreamException, ParseException,
JDOMException, ParserConfigurationException, SAXException {
Test_CQL_2_Cypher test = new Test_CQL_2_Cypher();
// test.debugTest();
test.testCQL_2_Cypher();
test.debugTest();
// test.testCQL_2_Cypher();
}
@Test
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment