mocklib-checkins Mailing List for mocklib (Page 6)
Brought to you by:
bittwidler,
fastdragon
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
(1) |
Aug
(5) |
Sep
(3) |
Oct
|
Nov
|
Dec
(46) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(54) |
Feb
(120) |
Mar
(31) |
Apr
(11) |
May
(8) |
Jun
(5) |
Jul
|
Aug
(22) |
Sep
(295) |
Oct
(6) |
Nov
(10) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
(2) |
Dec
(8) |
2008 |
Jan
|
Feb
(1) |
Mar
|
Apr
(8) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2009 |
Jan
|
Feb
(17) |
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Nobody <fas...@us...> - 2006-09-12 04:55:22
|
Update of /cvsroot/mocklib/gwtmocklib/input/staging In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18298/input/staging Log Message: Directory /cvsroot/mocklib/gwtmocklib/input/staging added to the repository |
From: Nobody <fas...@us...> - 2006-09-12 04:55:22
|
Update of /cvsroot/mocklib/gwtmocklib/.settings In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18298/.settings Log Message: Directory /cvsroot/mocklib/gwtmocklib/.settings added to the repository |
From: Nobody <fas...@us...> - 2006-09-12 04:55:22
|
Update of /cvsroot/mocklib/gwtmocklib/input/javasrc/biz/xsoftware/mock/client/example1 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18298/input/javasrc/biz/xsoftware/mock/client/example1 Log Message: Directory /cvsroot/mocklib/gwtmocklib/input/javasrc/biz/xsoftware/mock/client/example1 added to the repository |
From: Nobody <fas...@us...> - 2006-09-12 04:55:22
|
Update of /cvsroot/mocklib/gwtmocklib/input/staging/htmlcode In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18298/input/staging/htmlcode Log Message: Directory /cvsroot/mocklib/gwtmocklib/input/staging/htmlcode added to the repository |
From: Nobody <fas...@us...> - 2006-09-12 04:55:22
|
Update of /cvsroot/mocklib/gwtmocklib/tools/ant-java2html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18298/tools/ant-java2html Log Message: Directory /cvsroot/mocklib/gwtmocklib/tools/ant-java2html added to the repository |
From: Nobody <fas...@us...> - 2006-09-12 04:55:22
|
Update of /cvsroot/mocklib/gwtmocklib/input/javasrc/biz/xsoftware/mock/client/test In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18298/input/javasrc/biz/xsoftware/mock/client/test Log Message: Directory /cvsroot/mocklib/gwtmocklib/input/javasrc/biz/xsoftware/mock/client/test added to the repository |
From: Nobody <fas...@us...> - 2006-09-12 04:55:22
|
Update of /cvsroot/mocklib/gwtmocklib/input/javasrc/biz/xsoftware/mock In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18298/input/javasrc/biz/xsoftware/mock Log Message: Directory /cvsroot/mocklib/gwtmocklib/input/javasrc/biz/xsoftware/mock added to the repository |
From: Nobody <fas...@us...> - 2006-09-12 03:39:28
|
Update of /cvsroot/mocklib/mocklib3/bldfiles In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19749/bldfiles Modified Files: build.xml Log Message: add message Index: build.xml =================================================================== RCS file: /cvsroot/mocklib/mocklib3/bldfiles/build.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** build.xml 12 Sep 2006 03:23:28 -0000 1.5 --- build.xml 12 Sep 2006 03:39:25 -0000 1.6 *************** *** 686,689 **** --- 686,690 ---- <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="rm /home/groups/m/mo/mocklib/${name}*.zip" /--> + <echo message="Trying to tag cvs now....."/> <cvs failonerror="true" command="tag ${version}"/> |
From: Nobody <fas...@us...> - 2006-09-12 03:29:02
|
Update of /cvsroot/mocklib/mocklib3/input/staging In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15140/input/staging Modified Files: index.html Log Message: correct index.html file. Index: index.html =================================================================== RCS file: /cvsroot/mocklib/mocklib3/input/staging/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.html 12 Sep 2006 02:21:01 -0000 1.2 --- index.html 12 Sep 2006 03:28:58 -0000 1.3 *************** *** 10,14 **** <a href="http://sourceforge.net/projects/mockobject">MockLib</a> <br/><br/> ! <a href="http://sourceforge.net/project/showfiles.php?group_id=113040&package_id=122340">Download MockLib library plus these web pages</a> <br/> <a href="codecoverage/index.html">Test coverage report</a> --- 10,14 ---- <a href="http://sourceforge.net/projects/mockobject">MockLib</a> <br/><br/> ! <a href="http://sourceforge.net/project/showfiles.php?group_id=134303&package_id=151809">Download MockLib library plus these web pages</a> <br/> <a href="codecoverage/index.html">Test coverage report</a> |
From: Nobody <fas...@us...> - 2006-09-12 03:23:31
|
Update of /cvsroot/mocklib/mocklib3/bldfiles In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13080/bldfiles Modified Files: build.xml Log Message: add small change. Index: build.xml =================================================================== RCS file: /cvsroot/mocklib/mocklib3/bldfiles/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build.xml 12 Sep 2006 02:21:00 -0000 1.4 --- build.xml 12 Sep 2006 03:23:28 -0000 1.5 *************** *** 681,685 **** <scp file="${dist}/${name}-${version}.zip" todir="${user}@shell.sourceforge.net:/home/groups/m/mo/mocklib" password="${password}" /> ! <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="rm -rf /home/groups/m/mo/mocklib/htdocs/*" /> <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="unzip /home/groups/m/mo/mocklib/${name}-${version}.zip -d /home/groups/m/mo/mocklib/htdocs/" /> <!--sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="mv /home/groups/m/mo/mocklib/htdocs/${name}/* /home/groups/m/mo/mocklib/htdocs" /> --- 681,685 ---- <scp file="${dist}/${name}-${version}.zip" todir="${user}@shell.sourceforge.net:/home/groups/m/mo/mocklib" password="${password}" /> ! <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="rm -rf /home/groups/m/mo/mocklib/htdocs/${name}/*" /> <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="unzip /home/groups/m/mo/mocklib/${name}-${version}.zip -d /home/groups/m/mo/mocklib/htdocs/" /> <!--sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="mv /home/groups/m/mo/mocklib/htdocs/${name}/* /home/groups/m/mo/mocklib/htdocs" /> |
From: Nobody <fas...@us...> - 2006-09-12 02:21:05
|
Update of /cvsroot/mocklib/mocklib3/input/staging In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19035/input/staging Modified Files: index.html Log Message: changes to mocklib3 to prepare for delivery. Index: index.html =================================================================== RCS file: /cvsroot/mocklib/mocklib3/input/staging/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.html 11 Sep 2006 05:08:35 -0000 1.1 --- index.html 12 Sep 2006 02:21:01 -0000 1.2 *************** *** 16,20 **** <a href="findbugs/index.html">FindBugs report</a> <br/> ! <a href="impl/index.html">MockLib Javadoc</a> <br/><br/> <h3>All MockLib Examples</h3> --- 16,20 ---- <a href="findbugs/index.html">FindBugs report</a> <br/> ! <a href="api/index.html">MockLib Javadoc</a> <br/><br/> <h3>All MockLib Examples</h3> *************** *** 45,49 **** </ol> - <a href="examples/index.html">All MockLib Examples</a> <br/><br/><br/><br/> <a href=http://sourceforge.net> --- 45,48 ---- |
From: Nobody <fas...@us...> - 2006-09-12 02:21:04
|
Update of /cvsroot/mocklib/mocklib3/bldfiles In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19035/bldfiles Modified Files: design.xml build.xml Removed Files: release.xml Log Message: changes to mocklib3 to prepare for delivery. Index: design.xml =================================================================== RCS file: /cvsroot/mocklib/mocklib3/bldfiles/design.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** design.xml 10 Sep 2006 22:35:21 -0000 1.2 --- design.xml 12 Sep 2006 02:21:00 -0000 1.3 *************** *** 24,32 **** </package> ! <package name="impl" package="biz.xsoftware.mock.impl"> <depends>api</depends> </package> ! <package name="testImpl" package="biz.xsoftware.mock.impl.test"> <depends>api</depends> <depends>impl</depends> --- 24,32 ---- </package> ! <package name="impl" package="biz.xsoftware.impl.mock"> <depends>api</depends> </package> ! <package name="testImpl" package="biz.xsoftware.impl.mock.test"> <depends>api</depends> <depends>impl</depends> Index: build.xml =================================================================== RCS file: /cvsroot/mocklib/mocklib3/bldfiles/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build.xml 12 Sep 2006 01:46:52 -0000 1.3 --- build.xml 12 Sep 2006 02:21:00 -0000 1.4 *************** *** 178,186 **** <mkdir dir="${libexclude}"/> <mkdir dir="${staging.in}"/> - <mkdir dir="${properties}"/> - <mkdir dir="${scripts}"/> - <mkdir dir="${test.input}"/> - <mkdir dir="${native}"/> - <mkdir dir="${schemas}"/> <mkdir dir="${jardist}"/> --- 178,181 ---- *************** *** 232,247 **** <exclude name="**/.nbattrs"/> </fileset> - <!-- copy all *.property files or other misc. files over(*.gif, *.jpg, etc.) - from the ${properties} directory --> - <fileset dir="${properties}"> - <exclude name="**/*.java"/> - <exclude name="**/*.bak"/> - <exclude name="**/*~"/> - </fileset> </copy> - - <!-- convert any asian languages from UTF-8 to ascii so they can be used--> - <native2ascii encoding="UTF-8" src="${properties}" dest="${build}" - includes="**/*.utf8-properties" ext=".properties"/> <!--check for rmi stubs so if there are we will do the next target--> --- 227,231 ---- *************** *** 397,414 **** </target> - <!-- - ================================================================================ - Creates the distribution - ================================================================================ - --> - <target name="createdist" depends="jar" description="Creates the distribution"> - <mkdir dir="${dist}"/> - <mkdir dir="${staging}"/> - - <copy todir="${staging}"> - <fileset dir="${staging.in}" includes="**/*"/> - </copy> - - </target> <!-- --- 381,384 ---- *************** *** 648,654 **** *********************************************************************** --> ! <target name="release" depends="all" description="Builds official release"> ! <ant antfile="${config}/release.xml" inheritRefs="true"/> </target> <!-- *********************************************************************** --- 618,692 ---- *********************************************************************** --> ! <property name="misc" value="${input}/misc" /> ! <property name="javadoc.examples.title" value="MockLib Examples" /> ! ! <!-- temporary until we fix buildtemplate to not erase every folder in tools --> ! <property name="taglet" value="${tool.dir}/taglet" /> ! ! <!-- ! *********************************************************************** ! JAVADOC TARGET ! *********************************************************************** ! --> ! ! <target name="createdist" depends="all"> ! ! <copy todir="${projstaging}"> ! <fileset dir="${staging.in}" includes="**/*"/> ! <fileset dir="${reports}" /> ! <fileset dir="${jardist}" includes="${jar.name}" /> ! </copy> ! ! <!-- ! <copy file="README" tofile="${dist.build.dir}/README" overwrite="yes" /> ! <copy file="LICENSE" tofile="${dist.build.dir}/LICENSE" overwrite="yes" /> ! --> ! <mkdir dir="${dist}" /> ! <!-- package everything up nice and tidy --> ! <zip zipfile="${dist}/${name}-${version}.zip" basedir="${staging}" includes="**" update="yes" /> ! ! <!--tar tarfile="${dist.dir}/${name}-${version}.tar" basedir="${dist.build.dir}" includes="**" /> ! <gzip zipfile="${dist.dir}/${name}-${version}.tar.gz" src="${dist.dir}/${name}-${version}.tar" /--> ! ! <copy tofile="${dist}/${name}-${version}.jar"> ! <fileset dir="${jardist}"> ! <include name="${jar.name}" /> ! </fileset> ! </copy> ! </target> + + <!-- this is run after createdist is run and after testall is + run so codecoverage, the release, can all be posted to some + website --> + <target name="release" depends="createdist" if="password"> + <echo message="***************************************************************" /> + <echo message="***************************************************************" /> + <echo message=" Delivering zip=${name}-${version}.zip to" /> + <echo message=" sourceforge ftp site, and to ${name} website" /> + <echo message=" The website will be updated at mocklib.sourceforge.net" /> + <echo message=" Please finish this and go to sourceforge.net/projects/mocklib" /> + <echo message=" to pick up the release and release it to the world" /> + <echo message="" /> + <echo message=" ps. This will take a while" /> + <echo message="***************************************************************" /> + <echo message="***************************************************************" /> + + <ftp server="upload.sourceforge.net" remotedir="incoming" userid="anonymous" passive="true" binary="true" verbose="true" password="${user}@user.sourceforge.net"> + <fileset dir="${dist}"> + <include name="${name}-${version}.zip" /> + <include name="${name}-${version}.jar" /> + </fileset> + </ftp> + + <scp file="${dist}/${name}-${version}.zip" todir="${user}@shell.sourceforge.net:/home/groups/m/mo/mocklib" password="${password}" /> + <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="rm -rf /home/groups/m/mo/mocklib/htdocs/*" /> + <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="unzip /home/groups/m/mo/mocklib/${name}-${version}.zip -d /home/groups/m/mo/mocklib/htdocs/" /> + <!--sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="mv /home/groups/m/mo/mocklib/htdocs/${name}/* /home/groups/m/mo/mocklib/htdocs" /> + <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="rm /home/groups/m/mo/mocklib/${name}*.zip" /--> + + <cvs failonerror="true" command="tag ${version}"/> + + </target> <!-- *********************************************************************** *************** *** 680,683 **** --- 718,722 ---- <fileset dir="${javacode}"> <include name="**/.java"/> + <exclude name="**/impl/**"/> </fileset> --- release.xml DELETED --- |
From: Nobody <fas...@us...> - 2006-09-12 02:21:04
|
Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19035/input/javasrc/biz/xsoftware/mock Modified Files: MockObjectFactory.java Log Message: changes to mocklib3 to prepare for delivery. Index: MockObjectFactory.java =================================================================== RCS file: /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock/MockObjectFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MockObjectFactory.java 10 Sep 2006 22:35:21 -0000 1.3 --- MockObjectFactory.java 12 Sep 2006 02:21:01 -0000 1.4 *************** *** 110,114 **** private static void loadFactory() { ! String className = "biz.xsoftware.mock.impl.MockObjectFactoryImpl"; try { Class<?> clazz = Class.forName(className); --- 110,114 ---- private static void loadFactory() { ! String className = "biz.xsoftware.impl.mock.MockObjectFactoryImpl"; try { Class<?> clazz = Class.forName(className); |
From: Nobody <fas...@us...> - 2006-09-12 02:21:04
|
Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/impl/mock/test In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19035/input/javasrc/biz/xsoftware/impl/mock/test Added Files: ListenerOne.java TestOrderedCalls.java MockOne.java Log Message: changes to mocklib3 to prepare for delivery. --- NEW FILE: ListenerOne.java --- /* * Created on Apr 24, 2004 * * To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */ package biz.xsoftware.impl.mock.test; import java.io.IOException; /** * @author Dean Hiller * * To change the template for this generated type comment go to * Window - Preferences - Java - Code Generation - Code and Comments */ public interface ListenerOne { public void callMeFirst(int s); public void callMeSecond(String s) throws IOException; public void multipleParams(String x, Integer i); } --- NEW FILE: MockOne.java --- /* * Created on Apr 24, 2004 * * To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */ package biz.xsoftware.impl.mock.test; import biz.xsoftware.impl.mock.MockSuperclass; /** * @author Dean Hiller * * To change the template for this generated type comment go to * Window - Preferences - Java - Code Generation - Code and Comments */ public class MockOne extends MockSuperclass implements ListenerOne { public static final String FIRST = "callMeFirst"; public static final String SECOND = "callMeSecond"; public static final String EXTRA = "callMeExtra"; public static final String MULTIPLE_PARAMS = "multipleParams"; public MockOne(int delay) { super(delay); } /* (non-Javadoc) * @see test.biz.xsoftware.testlib.test.ListenerOne#callMeFirst() */ public void callMeFirst(int s) { methodCalled(FIRST, new Integer(s)); } /* (non-Javadoc) * @see test.biz.xsoftware.testlib.test.ListenerOne#callMeSecond() */ public void callMeSecond(String s) { methodCalled(SECOND, s); } public void callMeExtra() { methodCalled(EXTRA, null); } /* (non-Javadoc) * @see biz.xsoftware.test.ListenerOne#multipleParams(java.lang.String, java.lang.Integer) */ public void multipleParams(String x, Integer i) { methodCalled(MULTIPLE_PARAMS, new Object[] { x, i }); } /* (non-Javadoc) * @see biz.xsoftware.mock.MockSuperclass#getClasses() */ @Override public Class[] getClasses() { return new Class[] { MockOne.class }; } public Object inst() { // TODO Auto-generated method stub return null; } } --- NEW FILE: TestOrderedCalls.java --- /* * Created on Apr 24, 2004 * * To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */ package biz.xsoftware.impl.mock.test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.textui.TestRunner; import biz.xsoftware.mock.ExpectFailedException; /** * @author Dean Hiller * * To change the template for this generated type comment go to * Window - Preferences - Java - Code Generation - Code and Comments */ public class TestOrderedCalls extends TestCase { //private final static Logger log = Logger.getLogger(TestOrderedCalls.class.getName()); /** * @param name */ public TestOrderedCalls(String name) { super(name); } public void testBasicEventBeforeExpect() { MockOne one = new MockOne(3000); one.callMeFirst(4); one.expect(MockOne.FIRST); } public void testBasicExpectBeforeEvent() { final MockOne one = new MockOne(3000); Thread r = new Thread() { @Override public void run() { delay(1000); one.callMeFirst(4); } }; r.start(); one.expect(MockOne.FIRST); } public void testOrderAfter() { MockOne one = new MockOne(3000); one.callMeFirst(4); one.callMeSecond("dummy"); String[] evts = new String[] { MockOne.FIRST, MockOne.SECOND }; one.expect(evts); } public void testOrderBefore() { final MockOne one = new MockOne(3000); Thread r = new Thread() { @Override public void run() { delay(1000); one.callMeFirst(4); one.callMeSecond("dummy"); } }; r.start(); String[] evts = new String[] { MockOne.FIRST, MockOne.SECOND }; one.expect(evts); } public void testOrderAfterFails() { MockOne one = new MockOne(3000); one.callMeFirst(7); one.callMeSecond("dummy"); String[] evts = new String[] { MockOne.SECOND, MockOne.FIRST }; try { one.expect(evts); fail("Should have failed this test case"); } catch(ExpectFailedException e) { /*gulp*/ } } public void testOrderBeforeFails() { final MockOne one = new MockOne(3000); Thread r = new Thread() { @Override public void run() { delay(1000); one.callMeFirst(14); one.callMeSecond("dummy"); } }; String[] evts = new String[] { MockOne.SECOND, MockOne.FIRST }; try { r.run(); one.expect(evts); fail("Should have failed this test case"); } catch(ExpectFailedException e) { /*gulp*/ } } public void testLeftOverEventFails() { MockOne one = new MockOne(3000); one.callMeFirst(234); one.callMeSecond("dummy"); one.callMeFirst(43); String[] evts = new String[] { MockOne.FIRST, MockOne.SECOND }; try { one.expect(evts); fail("Should have failed this test case"); } catch(ExpectFailedException e) { /*gulp*/ } } public void testExceptionThrown() { MockOne one = new MockOne(3000); RuntimeException e = new IllegalStateException("Test for robustness"); one.addThrowException(e, MockOne.FIRST); try { one.callMeFirst(324); fail("Should have thrown exception"); } catch(IllegalStateException e2) {} one.callMeSecond("dummy"); String[] methods = new String[] {MockOne.FIRST, MockOne.SECOND }; one.expect(methods); } private void delay(int time) { try { Thread.sleep(time); } catch (InterruptedException e) { throw new RuntimeException("Sleep ended abrubtly"); } } public static void main(String[] args) { TestSuite suite = new TestSuite(); suite.addTest(new TestOrderedCalls("testExceptionThrown")); // suite.addTest(new TestMockSuperclass("testMockCreator")); // suite.addTest(new TestMockSuperclass("testMockCreatorFail")); // suite.addTest(new TestMockSuperclass("testMockCreatorCreatesCar")); // suite.addTest(new TestMockSuperclass("testThrowCheckedException")); TestRunner.run(suite); } } |
From: Nobody <fas...@us...> - 2006-09-12 02:21:04
|
Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock/impl/test In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19035/input/javasrc/biz/xsoftware/mock/impl/test Removed Files: MockOne.java TestOrderedCalls.java ListenerOne.java Log Message: changes to mocklib3 to prepare for delivery. --- ListenerOne.java DELETED --- --- MockOne.java DELETED --- --- TestOrderedCalls.java DELETED --- |
From: Nobody <fas...@us...> - 2006-09-12 02:21:04
|
Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock/impl In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19035/input/javasrc/biz/xsoftware/mock/impl Removed Files: ThrowException.java MethodVerifier.java MockObjectFactoryImpl.java GenericAction.java MockObjectImpl.java MockSuperclass.java Action.java BehaviorInfo.java MessageHelper.java ReturnValue.java Log Message: changes to mocklib3 to prepare for delivery. --- ReturnValue.java DELETED --- --- GenericAction.java DELETED --- --- ThrowException.java DELETED --- --- BehaviorInfo.java DELETED --- --- MockObjectFactoryImpl.java DELETED --- --- Action.java DELETED --- --- MockSuperclass.java DELETED --- --- MessageHelper.java DELETED --- --- MockObjectImpl.java DELETED --- --- MethodVerifier.java DELETED --- |
From: Nobody <fas...@us...> - 2006-09-12 02:21:03
|
Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/impl/mock In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19035/input/javasrc/biz/xsoftware/impl/mock Added Files: MessageHelper.java MockSuperclass.java BehaviorInfo.java Action.java MockObjectFactoryImpl.java MethodVerifier.java ReturnValue.java GenericAction.java ThrowException.java MockObjectImpl.java Log Message: changes to mocklib3 to prepare for delivery. --- NEW FILE: ReturnValue.java --- package biz.xsoftware.impl.mock; public class ReturnValue extends GenericAction implements Action { private Object retVal; public ReturnValue(Object retVal) { this.retVal = retVal; } public Object execute(Object[] args) { return retVal; } } --- NEW FILE: GenericAction.java --- package biz.xsoftware.impl.mock; import java.lang.reflect.Method; public class GenericAction { private Method method; public Method getMethod() { return method; } public void setMethod(Method method) { this.method = method; } } --- NEW FILE: ThrowException.java --- package biz.xsoftware.impl.mock; public class ThrowException extends GenericAction implements Action { private Throwable e; public ThrowException(Throwable e) { this.e = e; } public Object execute(Object[] args) throws Throwable { e.fillInStackTrace(); throw e; } } --- NEW FILE: BehaviorInfo.java --- package biz.xsoftware.impl.mock; import java.lang.reflect.Method; import biz.xsoftware.mock.Behavior; public class BehaviorInfo extends GenericAction implements Action { private Behavior behavior; private Method behaviorMethod; private Method clonerMethod; public BehaviorInfo(Behavior behavior) { this.behavior = behavior; } public Object execute(Object[] args) throws Throwable { return behaviorMethod.invoke(behavior, args); } public Object[] runClonerMethod(Object[] args) throws Throwable { return (Object[])clonerMethod.invoke(behavior, args); } public void setBehaviorMethod(Method behaviorMethod) { this.behaviorMethod = behaviorMethod; } public void setClonerMethod(Method clonerMethod) { this.clonerMethod = clonerMethod; } } --- NEW FILE: MockObjectFactoryImpl.java --- package biz.xsoftware.impl.mock; import java.lang.reflect.Proxy; import biz.xsoftware.mock.MockObject; import biz.xsoftware.mock.MockObjectFactory; public class MockObjectFactoryImpl extends MockObjectFactory { public MockObject createMockImpl(String id, Class[] interfaces) { Class[] interfacesPlusMock = new Class[interfaces.length+1]; interfacesPlusMock[0] = MockObject.class; for(int i = 1; i < interfacesPlusMock.length; i++) { interfacesPlusMock[i] = interfaces[i-1]; } ClassLoader cl = MockObjectFactory.class.getClassLoader(); MockObjectImpl impl = new MockObjectImpl(id, interfaces); Object o = Proxy.newProxyInstance(cl, interfacesPlusMock, impl); MockObject m = (MockObject)o; return m; } } --- NEW FILE: Action.java --- package biz.xsoftware.impl.mock; import java.lang.reflect.Method; public interface Action { public Object execute(Object[] args) throws Throwable; public void setMethod(Method m); public Method getMethod(); } --- NEW FILE: MockSuperclass.java --- package biz.xsoftware.impl.mock; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import biz.xsoftware.mock.Behavior; import biz.xsoftware.mock.CalledMethod; import biz.xsoftware.mock.ExpectFailedException; import biz.xsoftware.mock.MockObject; /** * This is a super class for mock Objects. It has the following options * <ol> * <li>Guarantee order of events and that events happen on one object</li> * <li>Guarantee events called with order not mattering on one object</li> * <li>Guarantee order of events is correct between two objects(One mock obj. implements two interfaces)</li> * </ol> * This class will also return the parameters that were passed into the MockObject * so they can be introspected in testing to make sure they were correct. * * The MockObject extending this class can also be told to throw exceptions on certain * methods so we can test error leg behavior. * * Example of how to use * MockActionListener implements ActionListener and extends this class * The only method in MockActionListener * is * <PRE> * public final static ACTION_METHOD = "actionPerformed method"; * public void actionPerformed(ActionEvent evt) { * super.methodCalled(ACTION_METHOD, evt); * } * </PRE> * * In the test, when you expect an ActionEvent, you can call * <PRE> * Object o = MockActionListener.expectEvent(ACTION_METHOD); * ActionEvent evt = (ActionEvent)evt; * assertNonNull(evt.getSource()); * </PRE> * * Another useful behavior is throwing any type of exception using * setExceptionOnMethod(String method, Throwable e). This can test * robustness in a system to make sure listeners or services that * throw exceptions don't affect your system, or at least affect * your system in the proper way. * * @author Dean Hiller (de...@xs...) */ public abstract class MockSuperclass implements MockObject { private static final Logger log = Logger.getLogger(MockSuperclass.class.getName()); /** * List of the current methods that have been called. */ private List<CalledMethod> methodsCalled = new LinkedList<CalledMethod>(); /** * A map of queues, containing either * 1. objects to return when methods are called * 2. Behaviors to run which return objects to return * 3. Exceptions to throw */ private Map<String, List<Action>> methodToReturnVal = new HashMap<String, List<Action>>(); /** * A map of default return values, which are used to return if the * queue for the method is empty. */ private Map<String, Action> methodToDefaultRetVal = new HashMap<String, Action>(); private List<String> ignoredMethods = new ArrayList<String>(); /** * Default wait time to wait for a method to be called once expectCall is * called. */ public static final int DEFAULT_WAIT_TIME = 10000; private int waitTime = DEFAULT_WAIT_TIME; private String id; /** * Default constructor of superclass of all mockObjects with a delay of * 10 seconds. This delay is the amount of time the mock object waits for * a method to be called when a client calls expectCall. */ public MockSuperclass() { } /** * The constructor to use to override the default delay({@link #DEFAULT_WAIT_TIME}) * such that the mock object will give methods a longer time to be called * before timing out to fail the test. * * @param delay The amount of time in milliseconds to wait for a method to be * called. */ public MockSuperclass(int delay) { waitTime = delay; } public MockSuperclass(String id) { this.id = id; } public void setExpectTimeout(int delay) { this.waitTime = delay; } public int getExpectTimeout() { return waitTime; } public void addIgnore(String method, Class ... argTypes) { ignoreImpl(method); } public void removeIgnore(String method, Class ... argTypes) { removeIgnoreImpl(method); } private void removeIgnoreImpl(String ... methods) { for(String method : methods) { ignoredMethods.remove(method); } } private void ignoreImpl(String ... methods) { addIgnoredMethods(methods); } public void addIgnoredMethods(String[] methods) { if(methods == null) return; verifyMethodsExist(methods); for(String method : methods) { ignoredMethods.add(method); } } public void setIgnoredMethods(String[] methods) { if(methods == null) return; ignoredMethods = new ArrayList<String>(); verifyMethodsExist(methods); for(String method : methods) { ignoredMethods.add(method); } } /** * Subclasses should call this method when a method on their interface * is called. This method is for users to create subclasses and call so * they don't have to wrap it in a try-catch block. * * @param method * @param parameters * @return whatever the client has specified using addReturnValue */ protected Object methodCalled(String method, Object parameters) { try { if(!(parameters instanceof Object[])) { parameters = new Object[] {parameters}; } return methodCalledImpl(method, (Object[])parameters); } catch (Throwable e) { if(e instanceof RuntimeException) throw (RuntimeException)e; throw new RuntimeException("Sorry, must wrap exception, unwrap in " + "your mockobject, or have mockObject call methodCalledImpl instead", e); } } protected synchronized Object methodCalledImpl(String method, Object[] parameters) throws Throwable { method = method.intern(); String params = ""; if(parameters == null) { params = "no params"; } else { Object[] array = parameters; for(int i = 0; i < array.length-1; i++) { params += array[i]+", "; } params += array[array.length-1]; } if (log.isLoggable(Level.FINE)) log.log(Level.FINE, id+"method called="+method+"("+params+") on obj="+this); //sometimes, the contract is for the "code" to give a parameter //to a library and then modify the parameter after the library //is done with it. This means the object the "code" gave to //the MockObject will change out from under the MockObject and be //corrupted meaning you can't write a test to test the contract //without cloning the object so it can't be changed. Object[] newParams = clone(method, parameters); methodsCalled.add(new CalledMethod(method, newParams, new Throwable().fillInStackTrace())); this.notifyAll(); return findNextAction(method, parameters); } private Object findNextAction(String method, Object[] params) throws Throwable { Action action = methodToDefaultRetVal.get(method); List<Action> l = methodToReturnVal.get(method); if(l != null) { action = l.remove(0); //if that was the last one in the list, remove the list... if(l.size()<=0) methodToReturnVal.remove(method); } if(action != null) return action.execute(params); return null; } // /** // * @see biz.xsoftware.mock.MockObject#expectUnorderedCalls(java.lang.String[]) // */ // public synchronized CalledMethod[] expectUnorderedCalls(String[] methods) { // if(methods == null) // throw new IllegalArgumentException("methods cannot be null"); // else if(methods.length <= 0) // throw new IllegalArgumentException("methods.length must be >= 1"); // for(int i = 0; i < methods.length; i++) { // if(methods[i] == null) // throw new IllegalArgumentException("None of values in methods " + // "can be null, yet methods["+i+"] was null"); // } // // Map<String, Integer> expectedMethods = new HashMap<String, Integer>(); // for(int i = 0; i < methods.length; i++) { // expectedMethods.put(methods[i], new Integer(i)); // } // // Set<String> ignorables = createIgnorableMap(ignoredMethods); // CalledMethod[] retVal = new CalledMethod[methods.length]; // // List<CalledMethod> methodsCalledList = new ArrayList<CalledMethod>(); // for(int i = 0; i < methods.length; i++) { // if(ANY.equals(methods[i])) // throw new IllegalArgumentException("The parameter 'methods' in " + // "expectUnorderedCalls cannot contain MockSuperclass.ANY(use expectOrderedCalls instead)"); // // CalledMethod o = expectUnignoredCall(ANY, ignorables, methodsCalledList); // if(o == null) { // String reason = putTogetherReason(methods, ignorables, methodsCalledList, // "timed out on next expected method\n"); // throw new ExpectFailedException("Timed out waiting for a method call\n" // +reason, retVal, ExpectFailedException.TIMED_OUT); // } // Integer index = expectedMethods.remove(o.getMethodName()); // if(index == null) { // String reason = putTogetherReason(methods, ignorables, methodsCalledList, null); // throw new ExpectFailedException(reason, retVal, ExpectFailedException.UNEXPECTED_CALL_BEFORE); // } // // retVal[index.intValue()] = o; // } // // LeftOverMethods leftOver = getLeftOverMethods(ignorables); // if(leftOver != null) { // String reason = putTogetherReason(methods, ignorables, methodsCalledList, "extra method(s)="+leftOver+"\n"); // throw new ExpectFailedException("There was a method called after your expected methods.\n"+reason, retVal // , ExpectFailedException.UNEXPECTED_CALL_AFTER); // } // // return retVal; // } private CalledMethod[] cleanup(CalledMethod[] methods, int size) { CalledMethod[] retVal = new CalledMethod[size]; for(int i = 0; i < retVal.length; i++) { retVal[i] = methods[i]; } return retVal; } /** * @see biz.xsoftware.mock.MockObject#expect(java.lang.String) */ public CalledMethod expect(String method) { return expectImpl(method)[0]; } /** * @see biz.xsoftware.mock.MockObject#expect(java.lang.String[]) */ public synchronized CalledMethod[] expect(String ... methods) { return expectImpl(methods); } /** * @see biz.xsoftware.mock.MockObject#expectOrderedCalls(java.lang.String[]) */ private synchronized CalledMethod[] expectImpl(String ... methods) { if(methods == null) throw new IllegalArgumentException("methods cannot be null"); else if(methods.length <= 0) throw new IllegalArgumentException("methods.length must be >= 1"); for(int i = 0; i < methods.length; i++) { if(methods[i] == null) throw new IllegalArgumentException("None of values in methods can be null, yet methods["+i+"] was null"); } verifyMethodsExist(methods); Set<String> ignorables = createIgnorableMap(ignoredMethods); List<CalledMethod> methodsCalledList = new ArrayList<CalledMethod>(); CalledMethod[] retVal = new CalledMethod[methods.length]; int i = 0; for(; i < methods.length; i++) { String method = methods[i]; CalledMethod o = null; try { o = expectUnignoredCall(method, ignorables, methodsCalledList); } catch(ExpectFailedException e) { if(!ExpectFailedException.UNEXPECTED_ON_NONE.equals(e.getReason())) { throw e; } CalledMethod[] leftOver = e.getCalledMethods(); throw new ExpectFailedException(e.getMessage(), leftOver, e.getReason()); } if(o == null) { String reason = MessageHelper.putTogetherReason(methods, ignorables, methodsCalledList, "timed out on next expected method\n"); throw new ExpectFailedException("Timed out waiting for call=" +method+"\n"+reason, cleanup(retVal, i), ExpectFailedException.TIMED_OUT); } retVal[i] = o; if(!method.equals(o.getMethodName()) && !ANY.equals(method)) { String reason = MessageHelper.putTogetherReason(methods, ignorables, methodsCalledList, null); reason += MessageHelper.getHowMethodWasCalled(o); throw new ExpectFailedException(reason, cleanup(retVal, i), null); } } LeftOverMethods leftOver = getLeftOverMethods(ignorables); if(leftOver != null) { String reason = MessageHelper.putTogetherReason(methods, ignorables, methodsCalledList, "extra method(s)="+leftOver+"\n"); reason += MessageHelper.getHowMethodWasCalled(leftOver.getMethods()[0]); CalledMethod[] calledOnes = new CalledMethod[retVal.length+1]; System.arraycopy(retVal, 0, calledOnes, 0, retVal.length); calledOnes[retVal.length] = leftOver.getMethods()[0]; throw new ExpectFailedException("There was a method called after your expected methods.\n"+reason, calledOnes , ExpectFailedException.UNEXPECTED_CALL_AFTER); } return retVal; } protected synchronized CalledMethod expectUnignoredCall(String method, Set<String> ignorables, List<CalledMethod> calledMethods) { if(method == null) method = NONE; //kind of dangerous if used with multiple threads because we might miss //a bad event coming in, but if you keep using the same listener for every test //the problem should still manifest itself in a //different test case which sucks but works. if(method.equals(NONE)) { if (log.isLoggable(Level.FINE)) log.log(Level.FINE, "method expected="+NONE+" on obj="+this); // we have to strip out all of the ignored methods from methodsCalled CalledMethod[] methods = methodsCalled.toArray(new CalledMethod[0]); for(CalledMethod calledMethod : methods) { if(ignorables.contains(calledMethod.getMethodName())) { while(methodsCalled.contains(calledMethod)) { methodsCalled.remove(calledMethod); } } } LeftOverMethods leftOver = getLeftOverMethods(ignorables); if(leftOver != null) { String reason = "You were expecting no methods to be called, but method(s) not\n" +"in the ignore list were called earlier. method(s)="+leftOver; reason += MessageHelper.getHowMethodWasCalled(leftOver.getMethods()[0]); throw new ExpectFailedException(reason, leftOver.getMethods(), ExpectFailedException.UNEXPECTED_ON_NONE); } return new CalledMethod(NONE, null, null); } try { return waitForUnignoredCall(method, ignorables, calledMethods); } catch (InterruptedException e) { throw new RuntimeException(e); } } private CalledMethod waitForUnignoredCall( String logM, Set<String> ignorables, List<CalledMethod> calledMethods) throws InterruptedException { long waitTime2 = waitTime+50; long currentTime; //only while waitTime is greater than 50 milliseconds while(waitTime2 >= 50) { //if there are no methods called yet, begin waiting if(methodsCalled.size() <= 0) { currentTime = System.currentTimeMillis(); if (log.isLoggable(Level.FINE)) log.fine("method expected(not called yet-waiting)="+logM+" on obj="+this+" wait="+waitTime2); this.wait(waitTime2); long waitedOnWait = System.currentTimeMillis() - currentTime; waitTime2 -= waitedOnWait; } //check for new methods to be called now...if no non-ignorable methods, then //continue while loop. for(int i = 0; i < methodsCalled.size(); i++) { CalledMethod calledMethod = methodsCalled.remove(0); calledMethods.add(calledMethod); if(!ignorables.contains(calledMethod.getMethodName())) { if(log.isLoggable(Level.FINE)) log.fine("method expected and was called="+logM+" on obj="+this); return calledMethod; } } } //return null means timeout.... return null; } private Set<String> createIgnorableMap(List<String> ignorableMethods) { Set<String> ignorables = new HashSet<String>(); if(ignorableMethods != null) { for(String method : ignorableMethods) { ignorables.add(method); } } return ignorables; } private LeftOverMethods getLeftOverMethods(Set<String> ignorables) { List<CalledMethod> leftOver = new ArrayList<CalledMethod>(); for(int i = 0; i < methodsCalled.size(); i++) { CalledMethod o = methodsCalled.get(i); if(!ignorables.contains(o.getMethodName()) && o != null) { leftOver.add(o); } } if(leftOver.size() <= 0) return null; CalledMethod[] m = new CalledMethod[0]; m = leftOver.toArray(m); return new LeftOverMethods(m); } private class LeftOverMethods { private CalledMethod[] leftOver; public LeftOverMethods(CalledMethod[] m) { leftOver = m; } /** */ public CalledMethod[] getMethods() { return leftOver; } @Override public String toString() { String retVal = ""; for(int i = 0; i < leftOver.length; i++) { retVal+="\n"+leftOver[i]; } return retVal; } } public void setDefaultBehavior(Behavior b, String method, Class... argTypes) { checkMethod(method, argTypes); if(b == null) throw new IllegalArgumentException("behavior parameter cannot be null"); methodToDefaultRetVal.put(method, new BehaviorInfo(b)); } public void setDefaultReturnValue(Object o, String method, Class... argTypes) { checkMethod(method, argTypes); methodToDefaultRetVal.put(method, new ReturnValue(o)); } public void addBehavior(Behavior behavior, String method, Class... argTypes) { if(behavior == null) throw new IllegalArgumentException("behavior parameter cannot be null"); BehaviorInfo action = new BehaviorInfo(behavior); addToActionList(action, method, argTypes); Method m = action.getMethod(); //verify behavior has correct methods Class clazz = behavior.getClass(); try { Method behaviorMethod = clazz.getMethod(m.getName(), (Class[])m.getParameterTypes()); action.setBehaviorMethod(behaviorMethod); behaviorMethod.setAccessible(true); } catch (SecurityException e) { throw new RuntimeException("Your Behavior class seems to be too secure. " + "I can't reflect on it and call getClass on it's class object"); } catch (NoSuchMethodException e) { String methodSig = MessageHelper.getMethodSignature(m, ""); throw new IllegalArgumentException("You Behavior class is missing the method='"+methodSig); } try { Method clonerMethod = clazz.getMethod(m.getName()+"Cloner", (Class[])m.getParameterTypes()); action.setClonerMethod(clonerMethod); if(!Object[].class.isAssignableFrom(clonerMethod.getReturnType())) throw new IllegalArgumentException("Method="+clonerMethod+" does not return Object[] which it must do"); clonerMethod.setAccessible(true); } catch (SecurityException e) { throw new RuntimeException("Your Behavior class seems to be too secure. " + "I can't reflect on it and call getClass on it's class object"); } catch (NoSuchMethodException e) { String methodSig = MessageHelper.getMethodSignature(m, "Cloner"); throw new IllegalArgumentException("You Behavior class is missing the method='"+methodSig); } } /** * @see biz.xsoftware.mock.MockObject#addThrowException(java.lang.Throwable, java.lang.String, Class...) */ public synchronized void addThrowException(Throwable e, String method, Class... argTypes) { if(e == null) throw new IllegalArgumentException("e parameter to this method cannot be null"); Action action = new ThrowException(e); addToActionList(action, method, argTypes); } /** * @see biz.xsoftware.mock.MockObject#addReturnValue(java.lang.Object, java.lang.String, Class...) */ public synchronized void addReturnValue(Object o, String method, Class... argTypes) { Action action = new ReturnValue(o); addToActionList(action, method, argTypes); } private void addToActionList(Action action, String method, Class... argTypes) { Method m = checkMethod(method, argTypes); action.setMethod(m); List<Action> l = methodToReturnVal.get(method); if(l == null) { l = new ArrayList<Action>(); methodToReturnVal.put(method, l); } l.add(action); } /** * This is the method that calls the cloner to clone * objects like ByteBuffer that can change after * they are called. * * @param o * @return * @throws Throwable */ private Object[] clone(String method, Object[] params) throws Throwable { if(params == null) return null; Action action = methodToDefaultRetVal.get(method); //now override the default if there is an override specified... List<Action> actions = methodToReturnVal.get(method); if(actions != null) { action = actions.get(0); } //check if action is a behaviorInfo object if(action instanceof BehaviorInfo) { BehaviorInfo behavior = (BehaviorInfo)action; return behavior.runClonerMethod(params); } return params; } public Class[] getClasses() { return new Class[] {this.getClass()}; } private void verifyMethodsExist(String[] methods) { for(int i = 0; i < methods.length; i++) { MethodVerifier.getMethod(getClasses(), false, methods[i]); } } private Method checkMethod(String method, Class[] argTypes) { return MethodVerifier.getMethod(getClasses(), true, method, argTypes); } } --- NEW FILE: MessageHelper.java --- package biz.xsoftware.impl.mock; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Method; import java.util.List; import java.util.Set; import biz.xsoftware.mock.CalledMethod; public final class MessageHelper { private MessageHelper() {} public static String getMethodSignature(Method method, String postfix) { String methodSig = "public "+method.getReturnType()+" "+method.getName()+postfix+"("; for(Class c : method.getParameterTypes()) { methodSig += c.getName()+", "; } return methodSig.substring(0, methodSig.length()-2)+")"; } public static String putTogetherReason(String[] methods, Set<String> ignorables, List methodsCalled, String lastLine) { String reason = "\nMethods you expected...\n"; for(int i = 0; i < methods.length; i++) { reason += "method["+i+"]="+methods[i]+"\n"; } reason += "Methods you ignored...\n"; String[] ignored = ignorables.toArray(new String[0]); if(ignored.length <= 0) reason += "no ignored methods\n"; for(int i = 0; i < ignored.length; i++) { reason += "ignored["+i+"]="+ignored[i]+"\n"; } reason += "\nMethods that were called...\n"; for(int i = 0; i < methodsCalled.size(); i++) { if(ignorables.contains(methodsCalled.get(i))) reason += "method["+i+"](ignored)="; else reason += "method["+i+"]="; reason += methodsCalled.get(i)+"\n"; } if(lastLine == null) reason += "(possibly more but we quit after finding unexpected methods)\n"; else reason += lastLine+"\n"; return reason; } public static String getHowMethodWasCalled(CalledMethod method) { Throwable t = method.getHowItWasCalled(); String retVal = "\nThe last method was="+method.getMethodName(); retVal += "\nHere is a stack trace showing "; retVal += "you how it was called...\n"; retVal += "--------BEGIN="+method.getMethodName()+"---------------\n"; StringWriter s = new StringWriter(); PrintWriter p = new PrintWriter(s); t.printStackTrace(p); retVal += s.toString(); retVal += "--------END="+method.getMethodName() +"---------------\n"; return retVal; } } --- NEW FILE: MockObjectImpl.java --- /* * Created on Jun 7, 2004 * * To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */ package biz.xsoftware.impl.mock; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import biz.xsoftware.mock.MockObject; /** * @author Dean Hiller */ public class MockObjectImpl extends MockSuperclass implements InvocationHandler { private static Set<Method> isMethodInSuper = new HashSet<Method>(); private static Map<Type, Class> primitiveToClass = new HashMap<Type, Class>(); private Class[] classes; static { //reflect and find all the methods of the superclass. Class c = MockObject.class; Method[] m = c.getMethods(); for(int i = 0; i < m.length; i++) { isMethodInSuper.add(m[i]); } c = Object.class; m = c.getMethods(); for(int i = 0; i < m.length; i++) { isMethodInSuper.add(m[i]); } primitiveToClass.put(Integer.TYPE, Integer.class); primitiveToClass.put(Double.TYPE, Double.class); primitiveToClass.put(Float.TYPE, Float.class); primitiveToClass.put(Boolean.TYPE, Boolean.class); primitiveToClass.put(Character.TYPE, Character.class); primitiveToClass.put(Byte.TYPE, Byte.class); primitiveToClass.put(Short.TYPE, Short.class); primitiveToClass.put(Long.TYPE, Long.class); } public MockObjectImpl(String id, Class[] interfaces) { super(id); this.classes = interfaces; } /* (non-Javadoc) * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if(isMethodInSuper.contains(method)) return callSuperMethod(proxy, method, args); Object o = methodCalledImpl(method.getName(), args); Class returnType = method.getReturnType(); if(returnType == null) throw new RuntimeException("This is a bug or something"); String methodString = getCleanMethodString(method); if(returnType.equals(void.class)) { //The return type is void if(o != null) throw new IllegalArgumentException("You are trying to return something on a method that returns void.\n" + "Method="+methodString+" value you tried to return="+o); } else { //Return type is not void...(could be primitive or Object) if(o == null) { if(returnType.isPrimitive()) throw new IllegalArgumentException("Must call addReturnValue and " + "specify a non-null value as method="+methodString+" returns a primitive value"); } else if(returnType.isPrimitive()) { //TODO: this is not working correctly no matter what I do here..... Class primitiveClass = primitiveToClass.get(returnType); if(!primitiveClass.isInstance(o)) throw new IllegalArgumentException("You specified an incorrect return type on method\n="+methodString+"\n" +"You specified a return type of="+o.getClass() +" which needs to be or extend type="+returnType); } else if(!returnType.isInstance(o)) //if not a primitive, make sure is assignable.... throw new IllegalArgumentException("You specified an incorrect return type on method\n="+methodString+"\n" +"You specified a return type of="+o.getClass()+" which needs to be or extend type="+returnType); } return o; } /** * @param method * @return */ private String getCleanMethodString(Method method) { String retType = method.getReturnType().getName(); String methodArgs = retType+" "+method.getName()+"("; Class<?>[] parameterTypes = method.getParameterTypes(); for(int ii = 0; ii < parameterTypes.length; ii++) { Class arg = method.getParameterTypes()[ii]; methodArgs += arg.getName(); if(ii < parameterTypes.length -1) methodArgs += ", "; } return methodArgs+")"; } // private void handlePrimitiveReturns(String methodName, Object ret, Class<?> expectedReturnType) // { // Class<?>[] primitiveTypes = {Integer.TYPE, Double.TYPE, Float.TYPE, Boolean.TYPE, // Character.TYPE, Byte.TYPE, Short.TYPE, Long.TYPE}; // Object[] primitiveClasses = {Integer.class, Double.class, Float.class, Boolean.class, // Character.class, Byte.class, Short.class, Long.class}; // if(ret.getClass().isPrimitive() && expectedReturnType.isPrimitive()) // { // for(Class<?> currentType : primitiveTypes) // { // if(ret.getClass() == currentType && expectedReturnType != currentType) // { // throwTypeException(methodName, ret, ret.getClass().getName(), expectedReturnType.getName()); // } // } // } // else if(ret.getClass().isPrimitive()) // { // for(int ii = 0; ii < primitiveTypes.length; ii++) // { // if(ret.getClass() == primitiveTypes[ii] && expectedReturnType != primitiveClasses[ii]) // { // throwTypeException(methodName, ret, ret.getClass().getName(), expectedReturnType.getName()); // } // } // } // else // { // for(int ii = 0; ii < primitiveTypes.length; ii++) // { // if(expectedReturnType == primitiveTypes[ii] && ret.getClass() != primitiveClasses[ii]) // { // throwTypeException(methodName, ret, ret.getClass().getName(), expectedReturnType.getName()); // } // } // } // } // // private void throwTypeException(String methodName, Object returnValue, // String returnType, String expectedReturnType) // { // throw new RuntimeException("You specified an incorrect return type for " + // "ignored or expected method " + methodName + "()" + // "\nYou specified: \"" + returnValue + "\" of type " + // returnType + " but should have been of type " + expectedReturnType); // } /** * * @param proxy The method was invoked on this object. This is the dynamicly * created class * @param m This is the method that was invoked * @param args These are the arguments that were passed to the method * @throws Throwable */ private Object callSuperMethod(Object proxy, Method m, Object[] args) throws Throwable { try { if("equals".equals(m.getName())) return new Boolean(proxy == args[0]); else if("toString".equals(m.getName())) return ""+this; return m.invoke(this, args); } catch(InvocationTargetException e) { if(e.getCause() != null) throw e.getCause(); throw e; } } /* (non-Javadoc) * @see biz.xsoftware.mock.MockSuperclass#getClasses() */ @Override public Class[] getClasses() { return classes; } public Object inst() { // TODO Auto-generated method stub return null; } } --- NEW FILE: MethodVerifier.java --- package biz.xsoftware.impl.mock; import java.lang.reflect.Method; import java.util.logging.Level; import java.util.logging.Logger; import biz.xsoftware.mock.MockObject; public final class MethodVerifier { private static final Logger log = Logger.getLogger(MethodVerifier.class.getName()); private MethodVerifier() {} private static boolean paramsMatch(Method method, Class[] argTypes) { Class<?>[] parameterTypes = method.getParameterTypes(); if(parameterTypes.length != argTypes.length) return false; for(int i = 0; i < parameterTypes.length; i++) { if(!(parameterTypes[i].equals(argTypes[i]))) return false; } return true; } private static boolean paramsNotNeedMatch(Class c, Method method) { Method[] classMethods = c.getMethods(); int matches = 0; for(Method m : classMethods) { if(m.getName().equals(method.getName())) matches++; } if(matches == 1) return true; return false; } private static Method methodExistInThisClass(Class c, boolean isVerifyArgs, String method, Class... argTypes) { Method[] methods = c.getMethods(); for(int i = 0; i < methods.length; i++) { if(log.isLoggable(Level.FINEST)) log.finest("method in class='"+methods[i].getName()+"' expected='"+method+"'"); if(method.equals(methods[i].getName())) { if(!isVerifyArgs) return methods[i]; else if(paramsNotNeedMatch(c, methods[i])) return methods[i]; else if(paramsMatch(methods[i], argTypes)) return methods[i]; } } return null; } static Method getMethod(Class[] classes, boolean isVerifyArgs, String method, Class ... argTypes) { if(method == null) throw new IllegalArgumentException("method parameter cannot be null"); else if(MockObject.ANY.equals(method) || MockObject.NONE.equals(method)) return null; else if(classes == null) return null; String classNames = ""; for(int i = 0; i < classes.length; i++) { if(log.isLoggable(Level.FINEST)) log.finest("class="+classes[i].getName()); Method m = methodExistInThisClass(classes[i], isVerifyArgs, method, argTypes); if(m != null) return m; classNames += "\n"+classes[i]; } String args = ""; if(argTypes != null && argTypes.length > 0) { int i = 0; for(; i < argTypes.length-1; i++) { Class c = argTypes[i]; args += c.getName()+","; } args+=argTypes[i].getName(); } String methodSig = method+"("+args+")"; throw new IllegalArgumentException("method='"+methodSig+"' is not a public method on any of the" + "\nfollowing Classes/Interfaces"+classNames); } } |
From: Nobody <fas...@us...> - 2006-09-12 02:20:56
|
Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/impl/mock/test In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19009/input/javasrc/biz/xsoftware/impl/mock/test Log Message: Directory /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/impl/mock/test added to the repository |
From: Nobody <fas...@us...> - 2006-09-12 02:20:56
|
Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/impl In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19009/input/javasrc/biz/xsoftware/impl Log Message: Directory /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/impl added to the repository |
From: Nobody <fas...@us...> - 2006-09-12 02:20:56
|
Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/impl/mock In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19009/input/javasrc/biz/xsoftware/impl/mock Log Message: Directory /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/impl/mock added to the repository |
From: Nobody <fas...@us...> - 2006-09-12 01:46:56
|
Update of /cvsroot/mocklib/mocklib3/bldfiles In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5160/bldfiles Modified Files: release.xml build.xml ant.properties Log Message: fixing up mocklib3 Index: ant.properties =================================================================== RCS file: /cvsroot/mocklib/mocklib3/bldfiles/ant.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ant.properties 10 Sep 2006 18:25:53 -0000 1.1 --- ant.properties 12 Sep 2006 01:46:52 -0000 1.2 *************** *** 3,7 **** #----------------------------------------------------------------------- ! name = mocklib #used as the jar file name(ie. ${name}.jar) #used as zip file name(ie. ${name}-version.jar) --- 3,7 ---- #----------------------------------------------------------------------- ! name = mocklib3 #used as the jar file name(ie. ${name}.jar) #used as zip file name(ie. ${name}-version.jar) Index: build.xml =================================================================== RCS file: /cvsroot/mocklib/mocklib3/bldfiles/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build.xml 10 Sep 2006 22:49:06 -0000 1.2 --- build.xml 12 Sep 2006 01:46:52 -0000 1.3 *************** *** 126,129 **** --- 126,133 ---- </tstamp> + <input message="Please enter the version number such as r1-0-1, etc." addproperty="version"/> + <input message="Please enter your sourceforge username" addproperty="user"/> + <input message="Please enter your sourceforge password" addproperty="password"/> + <!-- Override this property to build official release --> <property name="version" value="Developer-Build"/> *************** *** 652,670 **** *********************************************************************** --> ! <target name="javadoc" description="Generate JavaDoc"> ! <mkdir dir="${javadoc}"/> ! <!-- copy all package.html files, img's etc for javadoc --> ! <copy todir="${javadoc}"> ! <fileset dir="${javacode}" excludes="**/*.java"/> </copy> <echo message="package lists in=${package.list}"/> ! <javadoc sourcepath="${javacode}" ! destdir="${javadoc}" author="true" version="true" use="true" public="yes" ! overview="${javacode}/overview.html" windowtitle="${javadoc.title} ${version}" doctitle="${javadoc.title} ${version}" --- 656,674 ---- *********************************************************************** --> ! <target name="javadoc" description="Generate JavaDoc for API"> ! <mkdir dir="${projstaging}/api"/> ! <copy todir="${projstaging}/api"> ! <fileset dir="${javacode}" excludes="**\*.java"/> </copy> + <echo message="list is at ${misc}"/> <echo message="package lists in=${package.list}"/> ! <javadoc packagenames="biz.xsoftware.mock.*" sourcepath="${javacode}" ! destdir="${projstaging}/api" author="true" version="true" use="true" public="yes" ! overview="${misc}/mockoverview.html" windowtitle="${javadoc.title} ${version}" doctitle="${javadoc.title} ${version}" *************** *** 675,679 **** </classpath> <fileset dir="${javacode}"> ! <include name="${javadoc.pattern}"/> </fileset> --- 679,683 ---- </classpath> <fileset dir="${javacode}"> ! <include name="**/.java"/> </fileset> Index: release.xml =================================================================== RCS file: /cvsroot/mocklib/mocklib3/bldfiles/release.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** release.xml 11 Sep 2006 00:34:10 -0000 1.2 --- release.xml 12 Sep 2006 01:46:52 -0000 1.3 *************** *** 4,174 **** <project name="std_buildfile" default="release" basedir=".."> ! <property name="misc" value="${input}/misc"/> ! <property name="javadoc.examples.title" value="MockLib Examples"/> <!-- temporary until we fix buildtemplate to not erase every folder in tools --> ! <property name="taglet" value="${tool.dir}/taglet"/> ! ! <property name="user" value="dadrox"/> ! <!-- *********************************************************************** JAVADOC TARGET *********************************************************************** --> - <target name="javadocimpl" description="Generate JavaDoc"> - <mkdir dir="${projstaging}/impl"/> - <copy todir="${projstaging}/impl"> - <fileset dir="${javacode}" excludes="**\*.java"/> - </copy> - <echo message="list is at ${misc}"/> - <echo message="package lists in=${package.list}"/> - <javadoc packagenames="biz.xsoftware.mock.*" - sourcepath="${javacode}" - destdir="${projstaging}/impl" - author="true" - version="true" - use="true" - public="yes" - overview="${misc}/mockoverview.html" - windowtitle="${javadoc.title} ${version}" - doctitle="${javadoc.title} ${version}" - Verbose="true"> - <!-- classpath needed to link up to third_party libs without 100's of warnings --> - <classpath> - <path refid="tool.and.lib"/> - </classpath> - <fileset dir="${javacode}"> - <include name="**/.java"/> - </fileset> - - <doctitle><![CDATA[<h1>${javadoc.title} ${version}</h1>]]></doctitle> - <bottom><![CDATA[<i>${copyright}</i><br> - ${javadoc.bottom}]]> - </bottom> - <link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api" packagelistLoc="${package.list}/jdk"/> - <link offline="true" href="http://www.junit.org/junit/javadoc/3.8.1" packagelistLoc="${package.list}/junit"/> - </javadoc> - </target> - - <target name="javadocexamples" depends="javadocimpl" description="Generate JavaDoc"> - <mkdir dir="${projstaging}/examples"/> - <copy todir="${projstaging}/examples"> - <fileset dir="${javacode}" excludes="**\*.java"/> - </copy> - <echo message="list is at ${misc}"/> - <javadoc packagenames="biz.xsoftware.examples.*" - sourcepath="${javacode}" - destdir="${projstaging}/examples" - author="true" - version="true" - use="true" - private="yes" - overview="${misc}/examplesoverview.html" - windowtitle="${javadoc.examples.title} ${version}" - doctitle="${javadoc.examples.title} ${version}" - Verbose="true" - breakiterator="yes" - stylesheetfile="${taglet}/stylesheet.css"> - <taglet name="biz.xsoftware.showcode.ShowCodeTaglet" path="${taglet}/showcode.jar"/> - - <!-- classpath needed to link up to third_party libs without 100's of warnings --> - <classpath> - <path refid="tool.and.lib"/> - </classpath> - <fileset dir="${javacode}"> - <include name="**/.java"/> - </fileset> - - <doctitle><![CDATA[<h1>${javadoc.examples.title} ${version}</h1>]]></doctitle> - <bottom><![CDATA[<i>${copyright}</i><br> - ${javadoc.bottom}]]> - </bottom> - <link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api" packagelistLoc="${package.list}/jdk"/> - <link offline="true" href="http://www.junit.org/junit/javadoc/3.8.1" packagelistLoc="${package.list}/junit"/> - <link offline="false" href="../impl"/> - </javadoc> - </target> ! <target name="createdist" depends="javadocexamples"> ! <echo message="codecov=${codecov.report}"/> ! <copy todir="${projstaging}"> ! <fileset dir="${staging.in}"/> ! </copy> ! <copy todir="${projstaging}"> ! <fileset dir="${reports}"/> ! <fileset dir="${jardist}" includes="${jar.name}"/> ! </copy> ! <delete dir="${projstaging}/javadoc"/> ! ! <!-- <copy file="README" tofile="${dist.build.dir}/README" overwrite="yes" /> <copy file="LICENSE" tofile="${dist.build.dir}/LICENSE" overwrite="yes" /> --> ! <mkdir dir="${dist}"/> ! <!-- package everything up nice and tidy --> ! <zip zipfile="${dist}/${name}-${version}.zip" basedir="${staging}" includes="**" update="yes" /> ! <!--tar tarfile="${dist.dir}/${name}-${version}.tar" basedir="${dist.build.dir}" includes="**" /> <gzip zipfile="${dist.dir}/${name}-${version}.tar.gz" src="${dist.dir}/${name}-${version}.tar" /--> - - <copy tofile="${dist}/${name}-${version}.jar"> - <fileset dir="${jardist}"> - <include name="${jar.name}"/> - </fileset> - </copy> - - </target> ! <!-- this is run after createdist is run and after testall is run so codecoverage, the release, can all be posted to some website --> ! <target name="release" depends="createdist" if="pw"> ! <echo message="***************************************************************"/> ! <echo message="***************************************************************"/> ! <echo message=" Delivering zip=${name}-${version}.zip to"/> ! <echo message=" sourceforge ftp site, and to ${name} website"/> ! <echo message=" The website will be updated at mocklib.sourceforge.net"/> ! <echo message=" Please finish this and go to sourceforge.net/projects/mocklib"/> ! <echo message=" to pick up the release and release it to the world"/> ! <echo message=""/> ! <echo message=" ps. This will take a while"/> ! <echo message="***************************************************************"/> ! <echo message="***************************************************************"/> ! <ftp server="upload.sourceforge.net" ! remotedir="incoming" ! userid="anonymous" ! passive="true" ! binary="true" ! verbose="true" ! password="${user}@user.sourceforge.net"> ! <fileset dir="${dist}"> ! <include name="${name}-${version}.zip"/> ! <include name="${name}-${version}.jar"/> ! </fileset> ! </ftp> ! <scp file="${dist}/${name}-${version}.zip" ! todir="${user}@shell.sourceforge.net:/home/groups/m/mo/mocklib" ! password="${pw}"/> ! <sshexec host="shell.sourceforge.net" ! username="${user}" ! password="${pw}" ! command="rm -rf /home/groups/m/mo/mocklib/htdocs/*"/> ! <sshexec host="shell.sourceforge.net" ! username="${user}" ! password="${pw}" ! command="unzip /home/groups/m/mo/mocklib/${name}-${version}.zip -d /home/groups/m/mo/mocklib/htdocs/"/> ! <sshexec host="shell.sourceforge.net" ! username="${user}" ! password="${pw}" ! command="mv /home/groups/m/mo/mocklib/htdocs/${name}/* /home/groups/m/mo/mocklib/htdocs"/> ! <sshexec host="shell.sourceforge.net" ! username="${user}" ! password="${pw}" ! command="rm /home/groups/m/mo/mocklib/${name}*.zip"/> ! </target> </project> --- 4,77 ---- <project name="std_buildfile" default="release" basedir=".."> ! <property name="misc" value="${input}/misc" /> ! <property name="javadoc.examples.title" value="MockLib Examples" /> <!-- temporary until we fix buildtemplate to not erase every folder in tools --> ! <property name="taglet" value="${tool.dir}/taglet" /> ! <!-- *********************************************************************** JAVADOC TARGET *********************************************************************** --> ! <target name="createdist"> ! <echo message="codecov=${codecov.report}" /> ! <copy todir="${projstaging}"> ! <fileset dir="${reports}" /> ! <fileset dir="${jardist}" includes="${jar.name}" /> ! </copy> ! <!-- <copy file="README" tofile="${dist.build.dir}/README" overwrite="yes" /> <copy file="LICENSE" tofile="${dist.build.dir}/LICENSE" overwrite="yes" /> --> ! <mkdir dir="${dist}" /> ! <!-- package everything up nice and tidy --> ! <zip zipfile="${dist}/${name}-${version}.zip" basedir="${staging}" includes="**" update="yes" /> ! ! <!--tar tarfile="${dist.dir}/${name}-${version}.tar" basedir="${dist.build.dir}" includes="**" /> <gzip zipfile="${dist.dir}/${name}-${version}.tar.gz" src="${dist.dir}/${name}-${version}.tar" /--> ! <copy tofile="${dist}/${name}-${version}.jar"> ! <fileset dir="${jardist}"> ! <include name="${jar.name}" /> ! </fileset> ! </copy> ! ! </target> ! ! <!-- this is run after createdist is run and after testall is run so codecoverage, the release, can all be posted to some website --> ! <target name="release" depends="createdist" if="password"> ! <echo message="***************************************************************" /> ! <echo message="***************************************************************" /> ! <echo message=" Delivering zip=${name}-${version}.zip to" /> ! <echo message=" sourceforge ftp site, and to ${name} website" /> ! <echo message=" The website will be updated at mocklib.sourceforge.net" /> ! <echo message=" Please finish this and go to sourceforge.net/projects/mocklib" /> ! <echo message=" to pick up the release and release it to the world" /> ! <echo message="" /> ! <echo message=" ps. This will take a while" /> ! <echo message="***************************************************************" /> ! <echo message="***************************************************************" /> ! <ftp server="upload.sourceforge.net" remotedir="incoming" userid="anonymous" passive="true" binary="true" verbose="true" password="${user}@user.sourceforge.net"> ! <fileset dir="${dist}"> ! <include name="${name}-${version}.zip" /> ! <include name="${name}-${version}.jar" /> ! </fileset> ! </ftp> ! <scp file="${dist}/${name}-${version}.zip" todir="${user}@shell.sourceforge.net:/home/groups/m/mo/mocklib" password="${password}" /> ! <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="rm -rf /home/groups/m/mo/mocklib/htdocs/*" /> ! <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="unzip /home/groups/m/mo/mocklib/${name}-${version}.zip -d /home/groups/m/mo/mocklib/htdocs/" /> ! <!--sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="mv /home/groups/m/mo/mocklib/htdocs/${name}/* /home/groups/m/mo/mocklib/htdocs" /> ! <sshexec host="shell.sourceforge.net" username="${user}" password="${password}" command="rm /home/groups/m/mo/mocklib/${name}*.zip" /--> ! <cvs failonerror="true" command="tag ${version}"/> ! ! </target> </project> |
From: Nobody <fas...@us...> - 2006-09-12 01:21:16
|
Update of /cvsroot/mocklib/gwtmocklib/tools/ant-contrib In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23230/tools/ant-contrib Added Files: ant-contrib.jar bcel-head.jar Log Message: first commit of gwtmocklib module. --- NEW FILE: bcel-head.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ant-contrib.jar --- (This appears to be a binary file; contents omitted.) |
From: Nobody <fas...@us...> - 2006-09-12 01:21:15
|
Update of /cvsroot/mocklib/gwtmocklib/tools/ant-optional In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23230/tools/ant-optional Added Files: optional.jar README.txt Log Message: first commit of gwtmocklib module. --- NEW FILE: optional.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: README.txt --- Why put ant optional tasks here. Well first read the FAQ at ant.apache.org http://ant.apache.org/faq.html#delegating-classloader. I am following option 2. If I don't, I have to put junit.jar in two places tools/ant/lib with the ant-junit task AND input/lib for application developers to use the junit.jar Instead, I separate out the ant-junit.jar and put it in the tools/ant-optional folder. Then I taskdef junit against the ant-junit.jar with junit in it's classpath which I put in input/lib/tools If anyone has a better suggestion, I am all ears as this is not the optimal solution I think. nonetheless, it works for now. thanks, dean |
From: Nobody <fas...@us...> - 2006-09-12 01:21:13
|
Update of /cvsroot/mocklib/gwtmocklib/input/javasrc/descriptors In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23230/input/javasrc/descriptors Added Files: metadata.xml Log Message: first commit of gwtmocklib module. --- NEW FILE: metadata.xml --- <?xml version="1.0" encoding="UTF-8"?> <component name="Fill this in at input/javasrc/descriptors/metadata.xml" xmlns="http://www.osgi.org/xmlns/scr/v1.0.0" immediate="true"> <implementation class="biz.xsoftware.impl.Fill this in at input/javasrc/descriptors/metadata.xml"/> <service> <provide interface="biz.xsoftware.api.Fill this in at input/javasrc/descriptors/metadata.xml" /> </service> </component> |
From: Nobody <fas...@us...> - 2006-09-12 01:21:12
|
Update of /cvsroot/mocklib/gwtmocklib In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23230 Added Files: .cvsignore build.bat build .project .classpath Log Message: first commit of gwtmocklib module. --- NEW FILE: .cvsignore --- output tomcat --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>staging</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription> --- NEW FILE: build --- #************************************ # Generated file. Do not modify # # TODO: check for JAVA_HOME. if not set show error as this is # the one and only thing that has to be set!!!! #************************************ export ANT_HOME=$PWD/tools/ant chmod 755 tools/ant/bin/ant tools/ant/bin/ant -f bldfiles/build.xml $@ --- NEW FILE: build.bat --- rem ************************************** rem Generated file, do not modify!!!! rem rem rem ************************************** @echo off if "%JAVA_HOME%" == "" goto noJavaHome set ANT_HOME=%CD%\tools\ant tools\ant\bin\ant -f bldfiles\build.xml %1 %2 %3 %4 %5 %6 %7 %8 %9 goto end :noJavaHome if "%_JAVACMD%" == "" set _JAVACMD=java echo. echo Error: JAVA_HOME environment variable is not set. echo It must be set to the jdk1.4 directory echo. :end pause --- NEW FILE: .classpath --- <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="input/javasrc"/> <classpathentry kind="src" path="input/jscript"/> <classpathentry kind="lib" path="tools/ant-junit/junit.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="input/libinclude/gwt-user.jar"/> <classpathentry kind="lib" path="input/libexclude/servlet-api.jar"/> <classpathentry kind="output" path="eclipsegen"/> </classpath> |