Revision 2074
Added by Matt Jones about 20 years ago
QuerySpecificationTest.java | ||
---|---|---|
87 | 87 |
TestSuite suite = new TestSuite(); |
88 | 88 |
suite.addTest(new QuerySpecificationTest("testPrintSQL")); |
89 | 89 |
suite.addTest(new QuerySpecificationTest("testPrintExtendedSQL")); |
90 |
suite.addTest(new QuerySpecificationTest("testAttributeSQL")); |
|
90 | 91 |
return suite; |
91 | 92 |
} |
92 | 93 |
|
... | ... | |
96 | 97 |
public void testPrintSQL() |
97 | 98 |
{ |
98 | 99 |
try { |
99 |
System.out.println("----------------------"); |
|
100 |
System.out.println("---- SQL ------------------");
|
|
100 | 101 |
QuerySpecification qspec = new QuerySpecification(xml, |
101 | 102 |
MetaCatUtil.getOption("saxparser"), |
102 | 103 |
MetaCatUtil.getOption("accNumberSeparator")); |
... | ... | |
112 | 113 |
public void testPrintExtendedSQL() |
113 | 114 |
{ |
114 | 115 |
try { |
115 |
System.out.println("----------------------"); |
|
116 |
System.out.println("---- EXT SQL ------------------");
|
|
116 | 117 |
Hashtable controlPairs = new Hashtable(); |
117 | 118 |
QuerySpecification qspec = new QuerySpecification(xml, |
118 | 119 |
MetaCatUtil.getOption("saxparser"), |
119 | 120 |
MetaCatUtil.getOption("accNumberSeparator")); |
120 | 121 |
System.out.println( |
121 |
qspec.printExtendedSQL("'obfs.45337', 'obfs.45338', 'obfs.45346'", |
|
122 |
qspec.printExtendedSQL( |
|
123 |
"'obfs.45337', 'obfs.45338', 'obfs.45346'", |
|
122 | 124 |
controlPairs, false)); |
123 | 125 |
} catch (IOException e) { |
124 | 126 |
fail(e.getMessage()); |
125 | 127 |
} |
126 | 128 |
} |
127 | 129 |
|
130 |
/** |
|
131 |
* Print the extended SQL for a result set. |
|
132 |
*/ |
|
133 |
public void testAttributeSQL() |
|
134 |
{ |
|
135 |
try { |
|
136 |
System.out.println("---- ATT SQL ------------------"); |
|
137 |
Hashtable controlPairs = new Hashtable(); |
|
138 |
QuerySpecification qspec = new QuerySpecification(xml, |
|
139 |
MetaCatUtil.getOption("saxparser"), |
|
140 |
MetaCatUtil.getOption("accNumberSeparator")); |
|
141 |
System.out.println( |
|
142 |
qspec.printAttributeQuery( |
|
143 |
"'obfs.45337', 'obfs.45338', 'obfs.45346'", false)); |
|
144 |
} catch (IOException e) { |
|
145 |
fail(e.getMessage()); |
|
146 |
} |
|
147 |
} |
|
128 | 148 |
} |
Also available in: Unified diff
Changed printAttributeQuery() to no longer depend on the xml_index table. Now, if useXMLIndex is false, the method will use a recursive query on xml_nodes to match paths instead of using xml_index.