|
Friki example source code file (PolicyTest.java)
The Friki PolicyTest.java source codepackage tests; import java.io.File; import java.util.*; import junit.framework.*; import com.efsol.friki.*; public class PolicyTest extends TestCase { private Map map; private File tmp; private File base; private Policy p1; public PolicyTest(String name) { super(name); } public void setUp() { map = new HashMap(); tmp = new File("tmp"); base = new File("base"); p1 = new Policy(map, tmp, base); } public void testMissing() { assertEquals("PolicyTest.missing 1", null, p1.getObject("hoopla")); } public void testPresent() { map.put("hoopla", "dunno"); assertEquals("PolicyTest.present 1", "dunno", p1.getObject("hoopla")); } public void testConstructor() { Policy p2 = new Policy(PolicyHelper.makeMap(new String[] { "true=false", "black=white" }), tmp, base); assertEquals("PolicyTest.constructor 1", null, p2.getObject("hoopla")); assertEquals("PolicyTest.constructor 2", "false", p2.getObject("true")); assertEquals("PolicyTest.constructor 3", "white", p2.getObject("black")); } } Other Friki examples (source code examples)Here is a short list of links related to this Friki PolicyTest.java source code file: |
... this post is sponsored by my books ... | |
![]() #1 New Release! |
![]() FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.