1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.query.jpql.internal; |
21 |
|
|
22 |
|
import junit.framework.TestCase; |
23 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 3 |
Complexity Density: 0.25 |
|
24 |
|
public class JPQLParserTest extends TestCase |
25 |
|
{ |
26 |
|
JPQLParser parser = new JPQLParser(); |
27 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1PASS
|
|
28 |
1 |
public void testStartSpeed() throws Exception... |
29 |
|
{ |
30 |
|
|
31 |
|
|
32 |
1 |
parser.parse("select a from A as a"); |
33 |
|
} |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
35 |
1 |
public void testJPQL() throws Exception... |
36 |
|
{ |
37 |
|
|
38 |
1 |
parser.parse("select a from A as a where a.f='str'"); |
39 |
1 |
parser.parse("select a from A as a where a.f=\"str\""); |
40 |
|
|
41 |
|
|
42 |
1 |
parser.parse("select doc from Document doc, doc.object(XWiki.XWikiGroups) as g order by g.number"); |
43 |
1 |
parser.parse("select doc from Document doc, doc.object(XWiki.XWikiGroups) as g order by g.number desc"); |
44 |
1 |
parser.parse("select doc from Document doc, doc.object(XWiki.XWikiGroups) as g order by g.number asc"); |
45 |
|
|
46 |
|
|
47 |
1 |
parser.parse("select a from A as a where :param member of a.prop"); |
48 |
|
|
49 |
|
|
50 |
1 |
parser.parse("select a from A as a where a.p = ?1 or :name = a.p or ?2 member of a.p or a.p like :qwe"); |
51 |
|
} |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
53 |
1 |
public void testXWQLExtensions() throws Exception... |
54 |
|
{ |
55 |
|
|
56 |
1 |
parser.parse("select doc from Document as doc, doc.object('XWiki.Test') as test where test.some=1"); |
57 |
1 |
parser.parse("select doc from Document as doc, doc.object(XWiki.Test) as test where test.some=1"); |
58 |
|
|
59 |
|
|
60 |
1 |
parser.parse("select doc from Document as doc where doc.object('XWiki.Test').prop=1"); |
61 |
1 |
parser.parse("select doc from Document as doc where doc.object(XWiki.Test).prop=1"); |
62 |
|
} |
63 |
|
} |