01: package com.canoo.ant.table;
02:
03: import java.io.File;
04: import java.util.Properties;
05:
06: import com.canoo.ant.filter.AllEqualsFilter;
07:
08: public class DirectoryTableTest extends BaseTestCase {
09:
10: public DirectoryTableTest(String name) {
11: super (name);
12: }
13:
14: public void testFull() throws Exception {
15: final APropertyTable table = new DirectoryPropertyTable();
16:
17: final File tableContainer = getPackageResource("container");
18: assertTrue(tableContainer.exists());
19: table.setContainer(tableContainer);
20: table.setTable("roles");
21: table.setFilter(new AllEqualsFilter("role.name"));
22: // find lastname of the first user with role "guest"
23: Properties firstProp = (Properties) table.getPropertiesList(
24: "guest", null).get(0);
25: assertEquals("Koenig", firstProp.getProperty("user.last"));
26: assertEquals("Mittie", firstProp.getProperty("user.file.name"));
27: assertEquals("guest", firstProp.getProperty("roles.file.name"));
28: }
29:
30: }
|