01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: TestBlockingRepositoryServerside.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.rep;
09:
10: import com.uwyn.rife.TestCaseServerside;
11:
12: public class TestBlockingRepositoryServerside extends
13: TestCaseServerside {
14: private Repository mDefaultRep = null;
15:
16: public TestBlockingRepositoryServerside(int siteType, String name) {
17: super (siteType, name);
18: }
19:
20: public void setUp() {
21: mDefaultRep = Rep.getDefaultRepository();
22: }
23:
24: public void tearDown() throws Exception {
25: Rep.setDefaultRepository(mDefaultRep);
26: super .tearDown();
27: }
28:
29: public void testInitParams() throws Exception {
30: Repository rep = new BlockingRepository();
31: Rep.setDefaultRepository(rep);
32: rep.getProperties().remove("new.property");
33: rep.getProperties().remove("another.new.property");
34: assertFalse(rep.getProperties().contains("new.property"));
35: assertFalse(rep.getProperties()
36: .contains("another.new.property"));
37:
38: setupSite("site/empty.xml", new String[][] {
39: { "new.property", "new value" },
40: { "another.new.property", "another new value" } });
41:
42: assertTrue(rep.getProperties().contains("new.property"));
43: assertEquals(rep.getProperties().get("new.property")
44: .getValueString(), "new value");
45: assertTrue(rep.getProperties().contains("another.new.property"));
46: assertEquals(rep.getProperties().get("another.new.property")
47: .getValueString(), "another new value");
48: }
49: }
|