Mercurial > dive4elements > river
annotate flys-backend/src/test/java/de/intevation/flys/AppTest.java @ 5509:627584bc0586
Datacage: Added <dc:filter> element. This allows cleaner way to narrow the datasets.
Example:
<dc:context>
<dc:statement>
SELECT DISTINCT
name AS hws_name,
official AS hws_official,
kind_id AS hws_kind
FROM hws_lines
WHERE river_id = ${river_id}
</dc:statement>
<dc:if test="dc:has-result()">
<lines>
<dc:macro name="hws-lines">
<dc:elements>
<hws factory="hwsfactory" name="{$hws_name}"/>
</dc:elements>
</dc:macro>
<dc:filter expr="$hws_official=1">
<dc:if test="dc:has-result()">
<official>
<dc:filter expr="$hws_kind=1">
<dc:if test="dc:has-result()">
<Durchlass><dc:call-macro name="hws-lines"></Durchlass>
</dc:if>
</dc:filter>
<dc:filter expr="$hws_kind=2">
<dc:if test="dc:has-result()">
<Damm><dc:call-macro name="hws-lines"></Damm>
</dc:if>
</dc:filter>
<dc:filter expr="$hws_kind=3">
<dc:if test="dc:has-result()">
<Graben><dc:call-macro name="hws-lines"></Graben>
</dc:if>
</dc:filter>
</official>
</dc:if>
</dc:filter>
</lines>
</dc:if>
</dc:context>
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 28 Mar 2013 16:51:15 +0100 |
parents | d37ccb04ab5d |
children |
rev | line source |
---|---|
165
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys; |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import junit.framework.Test; |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 import junit.framework.TestCase; |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import junit.framework.TestSuite; |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 /** |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 * Unit test for simple App. |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 */ |
464
d37ccb04ab5d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
165
diff
changeset
|
10 public class AppTest |
165
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 extends TestCase |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 { |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 /** |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 * Create the test case |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 * |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 * @param testName name of the test case |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 */ |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 public AppTest( String testName ) |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 { |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 super( testName ); |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 } |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 /** |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 * @return the suite of tests being tested |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 */ |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 public static Test suite() |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 { |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 return new TestSuite( AppTest.class ); |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 } |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 /** |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 * Rigourous Test :-) |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 */ |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 public void testApp() |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 { |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 assertTrue( true ); |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 } |
a69b8494fcac
Created a new empty maven project
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 } |