Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv5682/test/unit/org/webmacro Modified Files: TestBroker.java TestContext.java TestFastWriter.java TestMultipleInstances.java TestStaticIdentityCM.java TestVersion.java Log Message: Updates include: RelaxedDirectiveBuilding Property. Test Cases for above property. assert() --> assertTrue() allowing compilation under java1.4 some additions/improvements to the standard macro library all tests run without error under jdk 1.3, solaris 2.8. some work needs to be done on test cases to remove unix dependencies. Index: TestBroker.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/TestBroker.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestBroker.java 21 Jun 2001 01:28:09 -0000 1.2 --- TestBroker.java 23 Mar 2003 02:00:34 -0000 1.3 *************** *** 31,35 **** _broker.setBrokerLocal ("MyName", "Mud"); ! assert (_broker.getBrokerLocal ("MyName") .toString().equals ("Mud")); } --- 31,35 ---- _broker.setBrokerLocal ("MyName", "Mud"); ! assertTrue (_broker.getBrokerLocal ("MyName") .toString().equals ("Mud")); } *************** *** 37,42 **** public void testGetSettings() throws Exception { Settings s = _broker.getSettings(); ! assert (s != null); ! assert (_broker.getSetting("ErrorTemplate") .equals ("error.wm")); } --- 37,42 ---- public void testGetSettings() throws Exception { Settings s = _broker.getSettings(); ! assertTrue (s != null); ! assertTrue (_broker.getSetting("ErrorTemplate") .equals ("error.wm")); } *************** *** 44,61 **** public void testGetProvider() throws Exception { Provider p = _broker.getProvider ("template"); ! assert (p != null); } public void testGetLog() throws Exception { Log l = _broker.getLog ("template"); ! assert (l != null); l = _broker.getLog ("NewLog"); ! assert (l != null); } public void testGetResource() throws Exception { java.net.URL url = _broker.getResource ("WebMacro.defaults"); ! assert (url != null); } } --- 44,61 ---- public void testGetProvider() throws Exception { Provider p = _broker.getProvider ("template"); ! assertTrue (p != null); } public void testGetLog() throws Exception { Log l = _broker.getLog ("template"); ! assertTrue (l != null); l = _broker.getLog ("NewLog"); ! assertTrue (l != null); } public void testGetResource() throws Exception { java.net.URL url = _broker.getResource ("WebMacro.defaults"); ! assertTrue (url != null); } } Index: TestContext.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/TestContext.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestContext.java 14 Dec 2001 05:58:29 -0000 1.1 --- TestContext.java 23 Mar 2003 02:00:34 -0000 1.2 *************** *** 28,32 **** _context.put ("Foo", null); Object o = _context.get("Foo"); ! assert (_context.get("Foo") == null); } --- 28,32 ---- _context.put ("Foo", null); Object o = _context.get("Foo"); ! assertTrue (_context.get("Foo") == null); } *************** *** 34,38 **** _context.put ("Foo", 123); Integer i = (Integer) _context.get ("Foo"); ! assert (i.intValue() == 123); } --- 34,38 ---- _context.put ("Foo", 123); Integer i = (Integer) _context.get ("Foo"); ! assertTrue (i.intValue() == 123); } *************** *** 40,44 **** _context.put ("Foo", true); Boolean b = (Boolean) _context.get ("Foo"); ! assert (b.booleanValue() == true); } --- 40,44 ---- _context.put ("Foo", true); Boolean b = (Boolean) _context.get ("Foo"); ! assertTrue (b.booleanValue() == true); } *************** *** 47,51 **** _context.put ("Foo", (byte)123); Byte b = (Byte) _context.get ("Foo"); ! assert (b.byteValue() == (byte) 123); } --- 47,51 ---- _context.put ("Foo", (byte)123); Byte b = (Byte) _context.get ("Foo"); ! assertTrue (b.byteValue() == (byte) 123); } *************** *** 53,57 **** _context.put ("Foo", (char)123); Character c = (Character) _context.get ("Foo"); ! assert (c.charValue() == (char)123); } --- 53,57 ---- _context.put ("Foo", (char)123); Character c = (Character) _context.get ("Foo"); ! assertTrue (c.charValue() == (char)123); } *************** *** 59,63 **** _context.put ("Foo", this.getClass()); Object o = _context.get ("Foo"); ! assert (o instanceof org.webmacro.engine.StaticClassWrapper); } --- 59,63 ---- _context.put ("Foo", this.getClass()); Object o = _context.get ("Foo"); ! assertTrue (o instanceof org.webmacro.engine.StaticClassWrapper); } *************** *** 65,69 **** _context.put ("Foo", 123.4D); Double d= (Double) _context.get ("Foo"); ! assert (d.doubleValue() == 123.4D); } --- 65,69 ---- _context.put ("Foo", 123.4D); Double d= (Double) _context.get ("Foo"); ! assertTrue (d.doubleValue() == 123.4D); } *************** *** 71,75 **** _context.put ("Foo", 123L); Long l = (Long) _context.get ("Foo"); ! assert (l.longValue() == 123L); } --- 71,75 ---- _context.put ("Foo", 123L); Long l = (Long) _context.get ("Foo"); ! assertTrue (l.longValue() == 123L); } *************** *** 77,81 **** _context.put ("Foo", (short) 123); Short s = (Short) _context.get ("Foo"); ! assert (s.shortValue() == (short) 123); } --- 77,81 ---- _context.put ("Foo", (short) 123); Short s = (Short) _context.get ("Foo"); ! assertTrue (s.shortValue() == (short) 123); } Index: TestFastWriter.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/TestFastWriter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestFastWriter.java 17 Dec 2002 06:45:29 -0000 1.1 --- TestFastWriter.java 23 Mar 2003 02:00:35 -0000 1.2 *************** *** 43,47 **** System.err.println (size + " bytes in " + ((end-start)/1000D) + " seconds."); ! assert (after.equals(data)); } --- 43,47 ---- System.err.println (size + " bytes in " + ((end-start)/1000D) + " seconds."); ! assertTrue (after.equals(data)); } Index: TestMultipleInstances.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/TestMultipleInstances.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestMultipleInstances.java 5 Jan 2002 22:19:33 -0000 1.3 --- TestMultipleInstances.java 23 Mar 2003 02:00:35 -0000 1.4 *************** *** 47,51 **** executeStringTemplate(_instanceOne, _instanceOne.getContext(), template); } catch (Exception e) { ! assert(e.toString().indexOf("No such directive #foo") > -1); } --- 47,51 ---- executeStringTemplate(_instanceOne, _instanceOne.getContext(), template); } catch (Exception e) { ! assertTrue(e.toString().indexOf("No such directive #foo") > -1); } *************** *** 54,58 **** System.err.println ("----------- instance 2 -----------------"); output = executeStringTemplate(_instanceTwo, _instanceTwo.getContext(), template); ! assert(output.equals("foo")); } --- 54,58 ---- System.err.println ("----------- instance 2 -----------------"); output = executeStringTemplate(_instanceTwo, _instanceTwo.getContext(), template); ! assertTrue(output.equals("foo")); } Index: TestStaticIdentityCM.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/TestStaticIdentityCM.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestStaticIdentityCM.java 27 Sep 2001 10:57:23 -0000 1.1 --- TestStaticIdentityCM.java 23 Mar 2003 02:00:36 -0000 1.2 *************** *** 47,51 **** } for (int i=0; i < THREADS; i++) { ! assert("Test integrity check failed in thread "+i, threads[i].correct); } --- 47,51 ---- } for (int i=0; i < THREADS; i++) { ! assertTrue("Test integrity check failed in thread "+i, threads[i].correct); } *************** *** 59,63 **** String key1 = new String("foo"); String key2 = new String("foo"); ! assert("test preconditions not met: keys should be different", key1 != key2 && key1.equals(key2)); Object cached1 = new Object(); --- 59,63 ---- String key1 = new String("foo"); String key2 = new String("foo"); ! assertTrue("test preconditions not met: keys should be different", key1 != key2 && key1.equals(key2)); Object cached1 = new Object(); *************** *** 65,71 **** cm.put(key1,cached1); cm.put(key2,cached2); ! assert("cm returned wrong object", cm.get(key1) == cached1); ! assert("cm returned wrong object", cm.get(key2) == cached2); } --- 65,71 ---- cm.put(key1,cached1); cm.put(key2,cached2); ! assertTrue("cm returned wrong object", cm.get(key1) == cached1); ! assertTrue("cm returned wrong object", cm.get(key2) == cached2); } Index: TestVersion.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/TestVersion.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestVersion.java 7 Jan 2003 06:30:30 -0000 1.3 --- TestVersion.java 23 Mar 2003 02:00:36 -0000 1.4 *************** *** 25,33 **** */ public void testVersion () throws Exception { ! assert (!WebMacro.VERSION.equals("@VERSION@")); } public void testBuildDate() throws Exception { ! assert (!WebMacro.BUILD_DATE.equals("@BUILD_DATE@")); } } --- 25,33 ---- */ public void testVersion () throws Exception { ! assertTrue (!WebMacro.VERSION.equals("@VERSION@")); } public void testBuildDate() throws Exception { ! assertTrue (!WebMacro.BUILD_DATE.equals("@BUILD_DATE@")); } } |