mocklib-checkins Mailing List for mocklib (Page 27)
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...> - 2005-12-21 18:46:11
|
Update of /cvsroot/mocklib/mocklib2/bldfiles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3628/bldfiles Modified Files: build.xml Log Message: trigger build Index: build.xml =================================================================== RCS file: /cvsroot/mocklib/mocklib2/bldfiles/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.xml 27 Jun 2005 03:40:32 -0000 1.1 --- build.xml 21 Dec 2005 18:45:58 -0000 1.2 *************** *** 419,422 **** --- 419,423 ---- *********************************************************************** --> + <target name="testall" depends="instrumentation" description="Run ALL junit and abbot tests after compiling code"> <mkdir dir="${junit.results}"/> |
From: Nobody <fas...@us...> - 2005-12-21 18:44:31
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3250 Modified Files: build Log Message: build Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** build 21 Dec 2005 18:35:15 -0000 1.13 --- build 21 Dec 2005 18:44:19 -0000 1.14 *************** *** 1,4 **** - - #************************************ # Generated file. Do not modify --- 1,2 ---- |
From: Nobody <fas...@us...> - 2005-12-21 18:35:29
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32422 Modified Files: build Log Message: testing agian Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** build 21 Dec 2005 18:31:41 -0000 1.12 --- build 21 Dec 2005 18:35:15 -0000 1.13 *************** *** 1,6 **** - - #************************************ # Generated file. Do not modify --- 1,4 ---- |
From: Nobody <fas...@us...> - 2005-12-21 18:31:49
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31617 Modified Files: build Log Message: hello Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** build 21 Dec 2005 18:29:26 -0000 1.11 --- build 21 Dec 2005 18:31:41 -0000 1.12 *************** *** 1,3 **** --- 1,6 ---- + + + #************************************ # Generated file. Do not modify |
From: Nobody <fas...@us...> - 2005-12-21 18:29:36
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31097 Modified Files: build Log Message: testing Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** build 21 Dec 2005 18:23:57 -0000 1.10 --- build 21 Dec 2005 18:29:26 -0000 1.11 *************** *** 1,6 **** - - - #************************************ # Generated file. Do not modify --- 1,3 ---- |
From: Nobody <fas...@us...> - 2005-12-21 18:24:09
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29817 Modified Files: build Log Message: testing build again Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** build 21 Dec 2005 18:13:43 -0000 1.9 --- build 21 Dec 2005 18:23:57 -0000 1.10 *************** *** 1,3 **** --- 1,6 ---- + + + #************************************ # Generated file. Do not modify |
From: Nobody <fas...@us...> - 2005-12-21 18:13:51
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27128 Modified Files: build Log Message: testing again Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** build 21 Dec 2005 18:12:56 -0000 1.8 --- build 21 Dec 2005 18:13:43 -0000 1.9 *************** *** 1,6 **** - - - #************************************ # Generated file. Do not modify --- 1,3 ---- |
From: Nobody <fas...@us...> - 2005-12-21 18:13:05
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26879 Modified Files: build Log Message: testing build Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** build 21 Dec 2005 18:06:15 -0000 1.7 --- build 21 Dec 2005 18:12:56 -0000 1.8 *************** *** 1,2 **** --- 1,6 ---- + + + + #************************************ # Generated file. Do not modify |
From: Nobody <fas...@us...> - 2005-12-21 18:06:28
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24023 Modified Files: build Log Message: testing build only Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** build 21 Dec 2005 18:03:53 -0000 1.6 --- build 21 Dec 2005 18:06:15 -0000 1.7 *************** *** 1,5 **** - - - #************************************ # Generated file. Do not modify --- 1,2 ---- |
From: Nobody <fas...@us...> - 2005-12-21 18:04:04
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22250 Modified Files: build Log Message: test build again Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** build 21 Dec 2005 18:01:04 -0000 1.5 --- build 21 Dec 2005 18:03:53 -0000 1.6 *************** *** 1,4 **** --- 1,5 ---- + #************************************ # Generated file. Do not modify |
From: Nobody <fas...@us...> - 2005-12-21 18:01:16
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20336 Modified Files: build Log Message: test build again Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build 21 Dec 2005 17:53:07 -0000 1.4 --- build 21 Dec 2005 18:01:04 -0000 1.5 *************** *** 1,3 **** --- 1,4 ---- + #************************************ # Generated file. Do not modify |
From: Nobody <fas...@us...> - 2005-12-21 17:53:18
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18518 Modified Files: build Log Message: testing build again. Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build 21 Dec 2005 17:01:36 -0000 1.3 --- build 21 Dec 2005 17:53:07 -0000 1.4 *************** *** 1,4 **** - #************************************ # Generated file. Do not modify --- 1,3 ---- |
From: Nobody <fas...@us...> - 2005-12-21 17:01:45
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7488 Modified Files: build Log Message: testing autobuild Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib2/build,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build 27 Jun 2005 03:40:32 -0000 1.2 --- build 21 Dec 2005 17:01:36 -0000 1.3 *************** *** 1,3 **** --- 1,4 ---- + #************************************ # Generated file. Do not modify |
From: Nobody <fas...@us...> - 2005-09-24 05:41:32
|
Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28353/javasrc/biz/xsoftware/mock Modified Files: MockSuperclass.java Log Message: jdk must have changed.....stack trace not being filled in on the throws statement now....need to fill it in ourselves before throwing it. Index: MockSuperclass.java =================================================================== RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock/MockSuperclass.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MockSuperclass.java 1 Jul 2005 12:30:13 -0000 1.4 --- MockSuperclass.java 24 Sep 2005 05:41:22 -0000 1.5 *************** *** 203,206 **** --- 203,207 ---- methodToException.remove(method); + t.fillInStackTrace(); log.fine("throw exception on method="+method+" exc="+t); throw (Throwable)t; |
From: Nobody <fas...@us...> - 2005-09-18 17:10:32
|
Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20450/input/javasrc/biz/xsoftware/mock Modified Files: MockObjectImpl.java Log Message: add nice exception for when a null is returned and a primitive is needed. Index: MockObjectImpl.java =================================================================== RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock/MockObjectImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MockObjectImpl.java 27 Jun 2005 03:40:32 -0000 1.4 --- MockObjectImpl.java 18 Sep 2005 17:10:24 -0000 1.5 *************** *** 51,56 **** if(isMethodInSuper.contains(method)) return callSuperMethod(proxy, method, args); ! return methodCalledImpl(method.getName(), args); } /** --- 51,64 ---- if(isMethodInSuper.contains(method)) return callSuperMethod(proxy, method, args); + + Object o = methodCalledImpl(method.getName(), args); ! if(o == null) { ! Class c = method.getReturnType(); ! if(!Object.class.isAssignableFrom(c) && !"void".equals(c.getName())) { ! throw new RuntimeException("Must call addReturnValue and specify a non-null value as method="+method.getName()+" returns a primitive value"); ! } ! } ! return o; } /** |
From: Nobody <fas...@us...> - 2005-09-18 17:10:32
|
Update of /cvsroot/mocklib/mocklib2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20450 Modified Files: .classpath Log Message: add nice exception for when a null is returned and a primitive is needed. Index: .classpath =================================================================== RCS file: /cvsroot/mocklib/mocklib2/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .classpath 26 Jun 2005 12:57:14 -0000 1.2 --- .classpath 18 Sep 2005 17:10:23 -0000 1.3 *************** *** 4,7 **** <classpathentry kind="lib" path="tools/ant-junit/junit.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="output" path="eclipsegen2"/> </classpath> --- 4,7 ---- <classpathentry kind="lib" path="tools/ant-junit/junit.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="output" path="output/eclipsegen"/> </classpath> |
From: Nobody <fas...@us...> - 2005-08-05 19:26:20
|
Update of /cvsroot/mocklib/mocklib/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31590/tools Modified Files: buildtemplate.version Log Message: change refs to mocklib, and mocklib project numbers to mocklib project number instead of mockobject project number. Index: buildtemplate.version =================================================================== RCS file: /cvsroot/mocklib/mocklib/tools/buildtemplate.version,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buildtemplate.version 7 May 2005 18:26:19 -0000 1.1 --- buildtemplate.version 5 Aug 2005 19:26:11 -0000 1.2 *************** *** 1,5 **** ! #DO NOT EDIT THIS FILE, IT IS GENERATED ! #Mon Sep 20 22:27:36 MDT 2004 ! bldfiles/dist.xml=1095740836153 ! version=Developer-Build ! file0=bldfiles/dist.xml --- 1,9 ---- ! #DO NOT EDIT THIS FILE, IT IS GENERATED ! #Fri Aug 05 13:10:57 MDT 2005 ! version=Developer-Build ! file2=build ! bldfiles/directories.txt=1123269051374 ! file1=build.bat ! build.bat=1123269051394 ! file0=bldfiles/directories.txt ! build=1123269051404 |
From: Nobody <fas...@us...> - 2005-08-05 19:26:19
|
Update of /cvsroot/mocklib/mocklib/input/staging/mocklib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31590/input/staging/mocklib Modified Files: README.html index.html Log Message: change refs to mocklib, and mocklib project numbers to mocklib project number instead of mockobject project number. Index: README.html =================================================================== RCS file: /cvsroot/mocklib/mocklib/input/staging/mocklib/README.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README.html 7 May 2005 18:26:17 -0000 1.1 --- README.html 5 Aug 2005 19:26:11 -0000 1.2 *************** *** 2,5 **** --- 2,10 ---- <h1><a href="index.html">Click here for documentation</a></h1> + + <br/><br/><br/><br/> + <a href=http://sourceforge.net> + <IMG src=http://sourceforge.net/sflogo.php?group_id=134303 width=210 height=62 border=0 alt=SourceForge Logo> + </a> </HTML> Index: index.html =================================================================== RCS file: /cvsroot/mocklib/mocklib/input/staging/mocklib/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.html 7 May 2005 18:26:17 -0000 1.1 --- index.html 5 Aug 2005 19:26:11 -0000 1.2 *************** *** 8,12 **** This is a very small library but powerful enough to create most of your mockobjects for you. The ones it can't create, you can leverage the library to create. <br/><br/> ! <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> --- 8,12 ---- This is a very small library but powerful enough to create most of your mockobjects for you. The ones it can't create, you can leverage the library to create. <br/><br/> ! <a href="http://sourceforge.net/projects/mocklib">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> *************** *** 50,54 **** <br/><br/><br/><br/> <a href=http://sourceforge.net> ! <IMG src=http://sourceforge.net/sflogo.php?group_id=113040 width=210 height=62 border=0 alt=SourceForge Logo> </a> </BODY> --- 50,54 ---- <br/><br/><br/><br/> <a href=http://sourceforge.net> ! <IMG src=http://sourceforge.net/sflogo.php?group_id=134303 width=210 height=62 border=0 alt=SourceForge Logo> </a> </BODY> |
From: Nobody <fas...@us...> - 2005-08-05 19:26:19
|
Update of /cvsroot/mocklib/mocklib/bldfiles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31590/bldfiles Modified Files: ant.properties directories.txt Log Message: change refs to mocklib, and mocklib project numbers to mocklib project number instead of mockobject project number. Index: directories.txt =================================================================== RCS file: /cvsroot/mocklib/mocklib/bldfiles/directories.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** directories.txt 7 May 2005 18:26:17 -0000 1.1 --- directories.txt 5 Aug 2005 19:26:10 -0000 1.2 *************** *** 1,113 **** ! # ! # NOTE: These are the properties used by build.xml and dist.xml ! # override them in ant.properties. Overriding them here will not ! # affect the build in any way. These are purely documentation here. ! ! #----------------------------------------------------------------------- ! # OUTPUT DIRECTORIES ! #----------------------------------------------------------------------- ! generated =output ! ! intermediate =${generated}/misc ! #will contain a generated manifest ! #any other intermediate files will go here too(none yet) ! ! build =${generated}/build ! #will contain all the *.class files after compile ! #will contain all the *.jpg files from ${properties} ! #will contain all the *.properties files from ${properties} ! #will contain all the *.gif files from ${properties} ! #will contain all the *.html files from ${properties} ! #will contain all the *.* files from ${properties} ! #will NOT contain *.html, *.htm, *.jpg, *.gif from ${javacode} ! ! jardist =${generated}/jardist ! #will contain a *.jar containing everything in ${build} ! ! dist =${generated}/dist ! #contains the release that gets released to the world ! ! codecov =${generated}/codecoverage ! #contains the code coverage reports of what the unit tests ! #covered ! codecov.temp =${generated}/codecoveragetemp ! #intermediate directory that contains instrumented classes to ! #run testall against so a code coverage report can be spit out. ! ! javadoc =${generated}/javadoc ! #contains the javadoc of biz.xsoftware.api ! ! junit.results =${generated}/test_results ! #contains junit test results ! ! staging =${generated}/staging ! projstaging =${generated}/staging/${name} ! #will contain all *.html generated by javadoc ! #will contain all *.html from ${javacode} directory(such as package.html) ! #will contain all *.jpg from ${javacode} directory ! #will contain all *.gif from ${javacode} directory ! ! rmi.stubs =${generated}/rmistubs ! #contains all Remote*.class files copied from ${build} ! #contains all *_stub.class files copied from ${build} ! #contains all *_skel.class files copied from ${build} ! #this directory is only created if RMI*.class exists ! ! test.area =${generated}/tests ! #This is sometimes created by JUnit tests to do temporary ! #testing. It usually gets deleted afterwards. ! ! #----------------------------------------------------------------------- ! # INPUT DIRECTORIES - don't change these after the project is started. ! #----------------------------------------------------------------------- ! input =input ! #contains all stuff that is an input into the build ! ! config =${input} ! #contains build.xml for the module, and any other build scripts ! #plus build property files ! ! javacode =${input}/javasrc ! #Contains all *.java source files ! #Contains all *.html files needed by javadoc ! #Contains all *.jpg files needed by javadoc ! #Contains all *.gif files needed by javadoc ! #Contains all *.* files needed by javadoc ! #Will NOT contain any *.jpg, *.gif, *.html, *.htm needed by application ! #Use ${properties} for *.jpg, *.gif, *.html, *.htm needed by application ! ! properties =${input}/properties ! #contains *.property files for i18n ! #contains *.gif needed for application ! #contains *.* any other resource files needed for application ! ! lib =${input}/lib ! #contains all *.jar needed to run the app ! #does not contain *.jars needed to compile the app(such as junit.jar) ! ! staging.in =${input}/staging ! #build copies everything from here to ${staging} so staging area can just be ! #zipped up or rpm'd up or whatever during the dist target. ! #typically, there will be another directory in here called <project> ! #or something. Some projects won't but most will. ! ! scripts =${input}/tests/scripts ! #DO NOT MODIFY. This is hardcoded in TestSuiteAllScripts.java. ! #contains all *.xml abbot scripts to do GUI testing. ! test.input =${input}/tests/input ! #for miscellaneous input to junit tests. ! ! #----------------------------------------------------------------------- ! # MISCELLANEOUS ! #----------------------------------------------------------------------- ! junit.pattern1=biz/xsoftware/test/**/Test*.class ! junit.pattern2=**/test/Test*.class ! build.sysclasspath=ignore ! # Change this value and I call you a complete idiot(cp = classpath) ! # ignore - trust build file to get the cp right ! # first - concatenate build file cp AFTER build runners cp ! # last - concatenate build runners cp AFTER build file cp ! ! #output = build.log ! #uncomment this to activate the logging ! --- 1,113 ---- ! # ! # NOTE: These are the properties used by build.xml and dist.xml ! # override them in ant.properties. Overriding them here will not ! # affect the build in any way. These are purely documentation here. ! ! #----------------------------------------------------------------------- ! # OUTPUT DIRECTORIES ! #----------------------------------------------------------------------- ! generated =output ! ! intermediate =${generated}/misc ! #will contain a generated manifest ! #any other intermediate files will go here too(none yet) ! ! build =${generated}/build ! #will contain all the *.class files after compile ! #will contain all the *.jpg files from ${properties} ! #will contain all the *.properties files from ${properties} ! #will contain all the *.gif files from ${properties} ! #will contain all the *.html files from ${properties} ! #will contain all the *.* files from ${properties} ! #will NOT contain *.html, *.htm, *.jpg, *.gif from ${javacode} ! ! jardist =${generated}/jardist ! #will contain a *.jar containing everything in ${build} ! ! dist =${generated}/dist ! #contains the release that gets released to the world ! ! codecov =${generated}/codecoverage ! #contains the code coverage reports of what the unit tests ! #covered ! codecov.temp =${generated}/codecoveragetemp ! #intermediate directory that contains instrumented classes to ! #run testall against so a code coverage report can be spit out. ! ! javadoc =${generated}/javadoc ! #contains the javadoc of biz.xsoftware.api ! ! junit.results =${generated}/test_results ! #contains junit test results ! ! staging =${generated}/staging ! projstaging =${generated}/staging/${name} ! #will contain all *.html generated by javadoc ! #will contain all *.html from ${javacode} directory(such as package.html) ! #will contain all *.jpg from ${javacode} directory ! #will contain all *.gif from ${javacode} directory ! ! rmi.stubs =${generated}/rmistubs ! #contains all Remote*.class files copied from ${build} ! #contains all *_stub.class files copied from ${build} ! #contains all *_skel.class files copied from ${build} ! #this directory is only created if RMI*.class exists ! ! test.area =${generated}/tests ! #This is sometimes created by JUnit tests to do temporary ! #testing. It usually gets deleted afterwards. ! ! #----------------------------------------------------------------------- ! # INPUT DIRECTORIES - don't change these after the project is started. ! #----------------------------------------------------------------------- ! input =input ! #contains all stuff that is an input into the build ! ! config =${input} ! #contains build.xml for the module, and any other build scripts ! #plus build property files ! ! javacode =${input}/javasrc ! #Contains all *.java source files ! #Contains all *.html files needed by javadoc ! #Contains all *.jpg files needed by javadoc ! #Contains all *.gif files needed by javadoc ! #Contains all *.* files needed by javadoc ! #Will NOT contain any *.jpg, *.gif, *.html, *.htm needed by application ! #Use ${properties} for *.jpg, *.gif, *.html, *.htm needed by application ! ! properties =${input}/properties ! #contains *.property files for i18n ! #contains *.gif needed for application ! #contains *.* any other resource files needed for application ! ! lib =${input}/lib ! #contains all *.jar needed to run the app ! #does not contain *.jars needed to compile the app(such as junit.jar) ! ! staging.in =${input}/staging ! #build copies everything from here to ${staging} so staging area can just be ! #zipped up or rpm'd up or whatever during the dist target. ! #typically, there will be another directory in here called <project> ! #or something. Some projects won't but most will. ! ! scripts =${input}/tests/scripts ! #DO NOT MODIFY. This is hardcoded in TestSuiteAllScripts.java. ! #contains all *.xml abbot scripts to do GUI testing. ! test.input =${input}/tests/input ! #for miscellaneous input to junit tests. ! ! #----------------------------------------------------------------------- ! # MISCELLANEOUS ! #----------------------------------------------------------------------- ! junit.pattern1=biz/xsoftware/test/**/Test*.class ! junit.pattern2=**/test/Test*.class ! build.sysclasspath=ignore ! # Change this value and I call you a complete idiot(cp = classpath) ! # ignore - trust build file to get the cp right ! # first - concatenate build file cp AFTER build runners cp ! # last - concatenate build runners cp AFTER build file cp ! ! #output = build.log ! #uncomment this to activate the logging ! Index: ant.properties =================================================================== RCS file: /cvsroot/mocklib/mocklib/bldfiles/ant.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ant.properties 7 May 2005 18:26:17 -0000 1.1 --- ant.properties 5 Aug 2005 19:26:10 -0000 1.2 *************** *** 19,23 **** javadoc.bottom = If you would like a shared copyright, contact me at dea...@us...<br> \ <a href=http://sourceforge.net> \ ! <IMG src=http://sourceforge.net/sflogo.php?group_id=113040 width=210 height=62 border=0 alt=SourceForge Logo> \ </a> --- 19,23 ---- javadoc.bottom = If you would like a shared copyright, contact me at dea...@us...<br> \ <a href=http://sourceforge.net> \ ! <IMG src=http://sourceforge.net/sflogo.php?group_id=134303 width=210 height=62 border=0 alt=SourceForge Logo> \ </a> |
From: Nobody <fas...@us...> - 2005-08-05 19:26:19
|
Update of /cvsroot/mocklib/mocklib/input/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31590/input/misc Modified Files: examplesoverview.html mockoverview.html Log Message: change refs to mocklib, and mocklib project numbers to mocklib project number instead of mockobject project number. Index: examplesoverview.html =================================================================== RCS file: /cvsroot/mocklib/mocklib/input/misc/examplesoverview.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** examplesoverview.html 7 May 2005 18:26:17 -0000 1.1 --- examplesoverview.html 5 Aug 2005 19:26:11 -0000 1.2 *************** *** 5,8 **** --- 5,13 ---- <BODY> These are the mockobject examples. Each package has a different example. Pick the one that is closest to your needs which will show you how to utilize the mockobject library. + + <br/><br/><br/><br/> + <a href=http://sourceforge.net> + <IMG src=http://sourceforge.net/sflogo.php?group_id=134303 width=210 height=62 border=0 alt=SourceForge Logo> + </a> </BODY> </HTML> Index: mockoverview.html =================================================================== RCS file: /cvsroot/mocklib/mocklib/input/misc/mockoverview.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mockoverview.html 7 May 2005 18:26:17 -0000 1.1 --- mockoverview.html 5 Aug 2005 19:26:11 -0000 1.2 *************** *** 6,9 **** --- 6,13 ---- This is the MockObject library, a very small library that can create mock objects for you, or allows you to create more complicated mockobjects. + <br/><br/><br/><br/> + <a href=http://sourceforge.net> + <IMG src=http://sourceforge.net/sflogo.php?group_id=134303 width=210 height=62 border=0 alt=SourceForge Logo> + </a> </BODY> </HTML> |
From: Nobody <fas...@us...> - 2005-08-05 19:26:19
|
Update of /cvsroot/mocklib/mocklib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31590 Modified Files: build build.bat Log Message: change refs to mocklib, and mocklib project numbers to mocklib project number instead of mockobject project number. Index: build =================================================================== RCS file: /cvsroot/mocklib/mocklib/build,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build 7 May 2005 18:26:17 -0000 1.1 --- build 5 Aug 2005 19:26:10 -0000 1.2 *************** *** 1,11 **** ! ! #************************************ ! # 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/conf/ant ! ! java -jar tools/buildtemplate.jar -installed $@ --- 1,11 ---- ! ! #************************************ ! # 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/conf/ant ! ! java -jar tools/buildtemplate.jar -installed $@ Index: build.bat =================================================================== RCS file: /cvsroot/mocklib/mocklib/build.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.bat 7 May 2005 18:26:17 -0000 1.1 --- build.bat 5 Aug 2005 19:26:10 -0000 1.2 *************** *** 1,25 **** ! ! ! rem ************************************** ! rem Generated file, do not modify!!!! ! rem ! rem ! rem ************************************** ! ! @echo off ! if "%JAVA_HOME%" == "" goto noJavaHome ! ! set ANT_HOME=%CD%\conf\ant ! java -jar tools\buildtemplate.jar -installed %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 \ No newline at end of file --- 1,25 ---- ! ! ! rem ************************************** ! rem Generated file, do not modify!!!! ! rem ! rem ! rem ************************************** ! ! @echo off ! if "%JAVA_HOME%" == "" goto noJavaHome ! ! set ANT_HOME=%CD%\conf\ant ! java -jar tools\buildtemplate.jar -installed %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 \ No newline at end of file |
From: Nobody <fas...@us...> - 2005-07-01 12:30:22
|
Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5535/input/javasrc/biz/xsoftware/mock Modified Files: Cloner.java MockSuperclass.java Log Message: add ability to pass back array so can tell the difference between two params of the same type. Index: Cloner.java =================================================================== RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock/Cloner.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Cloner.java 26 Jun 2005 12:20:14 -0000 1.1 --- Cloner.java 1 Jul 2005 12:30:13 -0000 1.2 *************** *** 14,18 **** * @return */ ! public Object clone(Object o); } --- 14,18 ---- * @return */ ! public Object[] clone(Object[] o); } Index: MockSuperclass.java =================================================================== RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock/MockSuperclass.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MockSuperclass.java 27 Jun 2005 03:40:32 -0000 1.3 --- MockSuperclass.java 1 Jul 2005 12:30:13 -0000 1.4 *************** *** 566,574 **** return params; ! Object[] retVal = new Object[params.length]; ! for(int i = 0; i < params.length; i++) { ! retVal[i] = cloner.clone(params[i]); ! } ! return retVal; } --- 566,570 ---- return params; ! return cloner.clone(params); } |
From: Nobody <fas...@us...> - 2005-06-27 16:37:41
|
Update of /cvsroot/mocklib/netmocklib/input/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11532/input/src Added Files: AssemblyInfo.cs src.csproj Log Message: no message --- NEW FILE: src.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{B615D0F5-52D3-4684-A4C3-AD056CB4ABDA}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "src" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "Biz.XSoftware.Mocklib" RunPostBuildEvent = "OnBuildSuccess" StartupObject = "" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "false" OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> <Config Name = "Release" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "TRACE" DocumentationFile = "" DebugSymbols = "false" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "true" OutputPath = "bin\Release\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.XML" HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> </References> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> <Folder RelPath = "MockLib\" /> <File RelPath = "Proxy\IProxyInvocationHandler.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Proxy\MetaDataFactory.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Proxy\Proxy.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Proxy\ProxyFactory.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> --- NEW FILE: AssemblyInfo.cs --- using System.Reflection; using System.Runtime.CompilerServices; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle("")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")] // // In order to sign your assembly you must specify a key to use. Refer to the // Microsoft .NET Framework documentation for more information on assembly signing. // // Use the attributes below to control which key is used for signing. // // Notes: // (*) If no key is specified, the assembly is not signed. // (*) KeyName refers to a key that has been installed in the Crypto Service // Provider (CSP) on your machine. KeyFile refers to a file which contains // a key. // (*) If the KeyFile and the KeyName values are both specified, the // following processing occurs: // (1) If the KeyName can be found in the CSP, that key is used. // (2) If the KeyName does not exist and the KeyFile does exist, the key // in the KeyFile is installed into the CSP and used. // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. // When specifying the KeyFile, the location of the KeyFile should be // relative to the project output directory which is // %Project Directory%\obj\<configuration>. For example, if your KeyFile is // located in the project directory, you would specify the AssemblyKeyFile // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // documentation for more information on this. // [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] |
From: Nobody <fas...@us...> - 2005-06-27 16:37:41
|
Update of /cvsroot/mocklib/netmocklib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11532 Added Files: netmocklib.sln Log Message: no message --- NEW FILE: netmocklib.sln --- Microsoft Visual Studio Solution File, Format Version 8.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "src", "input\src\src.csproj", "{B615D0F5-52D3-4684-A4C3-AD056CB4ABDA}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {B615D0F5-52D3-4684-A4C3-AD056CB4ABDA}.Debug.ActiveCfg = Debug|.NET {B615D0F5-52D3-4684-A4C3-AD056CB4ABDA}.Debug.Build.0 = Debug|.NET {B615D0F5-52D3-4684-A4C3-AD056CB4ABDA}.Release.ActiveCfg = Release|.NET {B615D0F5-52D3-4684-A4C3-AD056CB4ABDA}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal |
Update of /cvsroot/mocklib/netmocklib/input/src/Proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11532/input/src/Proxy Added Files: DynamicProxyTest.cs IProxyInvocationHandler.cs MetaDataFactory.cs Proxy.cs ProxyFactory.cs SecurityManager.cs SecurityProxy.cs Log Message: no message --- NEW FILE: Proxy.cs --- using System; namespace DynamicProxy { /// <summary> /// Summary description for Proxy. /// </summary> public class Proxy { private Proxy() { } public static InvocationHandler GetInvocationHandler(Object proxy) { throw NotImplementedException("not implemented yet, sorry"); } public static Class GetProxyClass(ClassLoader loader, Type[] interfaces) { throw NotImplementedException("not implemented yet, sorry"); } public static boolean isProxyClass(Type cl) { throw NotImplementedException("not implemented yet, sorry"); } public static object newProxyInstance(Type[] interfaces, IProxyInvocationHandler h) { if(interfaces == null) throw new ArgumentException("interfaces cannot be null"); else if(h == null) throw new ArgumentException("h cannot be null"); else if(interfaces.Length < 1) throw new ArgumentException("interfaces array cannot be empty"); else if(interfaces.Length > 1) throw new NotImplementedException("Sorry, creating a class implementing multiple interfaces is not implemented yet"); ProxyFactory.GetInstance().Create(h, interfaces[0]); } } } --- NEW FILE: ProxyFactory.cs --- using System; using System.Collections; using System.Reflection; using System.Reflection.Emit; using System.Threading; namespace DynamicProxy { /// <summary> /// </summary> public class ProxyFactory { private static ProxyFactory instance; private static Object lockObj = new Object(); private Hashtable typeMap = Hashtable.Synchronized( new Hashtable() ); private static readonly Hashtable opCodeTypeMapper = new Hashtable(); private const string PROXY_SUFFIX = "Proxy"; private const string ASSEMBLY_NAME = "ProxyAssembly"; private const string MODULE_NAME = "ProxyModule"; private const string HANDLER_NAME = "handler"; // Initialize the value type mapper. This is needed for methods with intrinsic // return types, used in the Emit process. static ProxyFactory() { opCodeTypeMapper.Add( typeof( System.Boolean ), OpCodes.Ldind_I1 ); opCodeTypeMapper.Add( typeof( System.Int16 ), OpCodes.Ldind_I2 ); opCodeTypeMapper.Add( typeof( System.Int32 ), OpCodes.Ldind_I4 ); opCodeTypeMapper.Add( typeof( System.Int64 ), OpCodes.Ldind_I8 ); opCodeTypeMapper.Add( typeof( System.Double ), OpCodes.Ldind_R8 ); opCodeTypeMapper.Add( typeof( System.Single ), OpCodes.Ldind_R4 ); opCodeTypeMapper.Add( typeof( System.UInt16 ), OpCodes.Ldind_U2 ); opCodeTypeMapper.Add( typeof( System.UInt32 ), OpCodes.Ldind_U4 ); } private ProxyFactory() { } public static ProxyFactory GetInstance() { if ( instance == null ) { CreateInstance(); } return instance; } private static void CreateInstance() { lock ( lockObj ) { if ( instance == null ) { instance = new ProxyFactory(); } } } public Object Create( IProxyInvocationHandler handler, Type objType, bool isObjInterface ) { string typeName = objType.FullName + PROXY_SUFFIX; Type type = (Type)typeMap[ typeName ]; // check to see if the type was in the cache. If the type was not cached, then // create a new instance of the dynamic type and add it to the cache. if ( type == null ) { if ( isObjInterface ) { type = CreateType( handler, new Type[] { objType }, typeName ); } else { type = CreateType( handler, objType.GetInterfaces(), typeName ); } typeMap.Add( typeName, type ); } // return a new instance of the type. return Activator.CreateInstance( type, new object[] { handler } ); } public Object Create( IProxyInvocationHandler handler, Type objType ) { return Create( handler, objType, false ); } private Type CreateType( IProxyInvocationHandler handler, Type[] interfaces, string dynamicTypeName ) { Type retVal = null; if ( handler != null && interfaces != null ) { Type objType = typeof( System.Object ); Type handlerType = typeof( IProxyInvocationHandler ); AppDomain domain = Thread.GetDomain(); AssemblyName assemblyName = new AssemblyName(); assemblyName.Name = ASSEMBLY_NAME; assemblyName.Version = new Version( 1, 0, 0, 0 ); // create a new assembly for this proxy, one that isn't presisted on the file system AssemblyBuilder assemblyBuilder = domain.DefineDynamicAssembly( assemblyName, AssemblyBuilderAccess.Run ); // create a new module for this proxy ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule( MODULE_NAME ); // Set the class to be public and sealed TypeAttributes typeAttributes = TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.Sealed; // Gather up the proxy information and create a new type builder. One that // inherits from Object and implements the interface passed in TypeBuilder typeBuilder = moduleBuilder.DefineType( dynamicTypeName, typeAttributes, objType, interfaces ); // Define a member variable to hold the delegate FieldBuilder handlerField = typeBuilder.DefineField( HANDLER_NAME, handlerType, FieldAttributes.Private ); // build a constructor that takes the delegate object as the only argument //ConstructorInfo defaultObjConstructor = objType.GetConstructor( new Type[0] ); ConstructorInfo superConstructor = objType.GetConstructor(new Type[0]); ConstructorBuilder delegateConstructor = typeBuilder.DefineConstructor( MethodAttributes.Public, CallingConventions.Standard, new Type[] { handlerType } ); #region( "Constructor IL Code" ) ILGenerator constructorIL = delegateConstructor.GetILGenerator(); // Load "this" constructorIL.Emit( OpCodes.Ldarg_0 ); // Load first constructor parameter constructorIL.Emit( OpCodes.Ldarg_1 ); // Set the first parameter into the handler field constructorIL.Emit( OpCodes.Stfld, handlerField ); // Load "this" constructorIL.Emit( OpCodes.Ldarg_0 ); // Call the super constructor constructorIL.Emit( OpCodes.Call, superConstructor ); // Constructor return constructorIL.Emit( OpCodes.Ret ); #endregion // for every method that the interfaces define, build a corresponding // method in the dynamic type that calls the handlers invoke method. foreach ( Type interfaceType in interfaces ) { GenerateMethod( interfaceType, handlerField, typeBuilder ); } retVal = typeBuilder.CreateType(); } return retVal; } private void GenerateMethod( Type interfaceType, FieldBuilder handlerField, TypeBuilder typeBuilder ) { MetaDataFactory.Add( interfaceType ); MethodInfo[] interfaceMethods = interfaceType.GetMethods(); if ( interfaceMethods != null ) { for ( int i = 0; i < interfaceMethods.Length; i++ ) { MethodInfo methodInfo = interfaceMethods[i]; // Get the method parameters since we need to create an array // of parameter types ParameterInfo[] methodParams = methodInfo.GetParameters(); int numOfParams = methodParams.Length; Type[] methodParameters = new Type[ numOfParams ]; // convert the ParameterInfo objects into Type for ( int j = 0; j < numOfParams; j++ ) { methodParameters[j] = methodParams[j].ParameterType; } // create a new builder for the method in the interface MethodBuilder methodBuilder = typeBuilder.DefineMethod( methodInfo.Name, MethodAttributes.Public | MethodAttributes.Virtual, CallingConventions.Standard, methodInfo.ReturnType, methodParameters ); #region( "Handler Method IL Code" ) ILGenerator methodIL = methodBuilder.GetILGenerator(); // Emit a declaration of a local variable if there is a return // type defined if ( !methodInfo.ReturnType.Equals( typeof( void ) ) ) { methodIL.DeclareLocal( methodInfo.ReturnType ); if ( methodInfo.ReturnType.IsValueType && !methodInfo.ReturnType.IsPrimitive ) { methodIL.DeclareLocal( methodInfo.ReturnType ); } } // if we have any parameters for the method, then declare an // Object array local var. if ( numOfParams > 0 ) { methodIL.DeclareLocal( typeof( System.Object[] ) ); } // declare a label for invoking the handler Label handlerLabel = methodIL.DefineLabel(); // declare a lable for returning from the mething Label returnLabel = methodIL.DefineLabel(); // load "this" methodIL.Emit( OpCodes.Ldarg_0 ); // load the handler instance variable methodIL.Emit( OpCodes.Ldfld, handlerField ); // jump to the handlerLabel if the handler instance variable is not null methodIL.Emit( OpCodes.Brtrue_S, handlerLabel ); // the handler is null, so return null if the return type of // the method is not void, otherwise return nothing if ( !methodInfo.ReturnType.Equals( typeof( void ) ) ) { if ( methodInfo.ReturnType.IsValueType && !methodInfo.ReturnType.IsPrimitive && !methodInfo.ReturnType.IsEnum ) { methodIL.Emit( OpCodes.Ldloc_1 ); } else { // load null onto the stack methodIL.Emit( OpCodes.Ldnull ); } // store the null return value methodIL.Emit( OpCodes.Stloc_0 ); // jump to return methodIL.Emit( OpCodes.Br_S, returnLabel ); } // the handler is not null, so continue with execution methodIL.MarkLabel( handlerLabel ); // load "this" methodIL.Emit( OpCodes.Ldarg_0 ); // load the handler methodIL.Emit( OpCodes.Ldfld, handlerField ); // load "this" since its needed for the call to invoke methodIL.Emit( OpCodes.Ldarg_0 ); // load the name of the interface, used to get the MethodInfo object // from MetaDataFactory methodIL.Emit( OpCodes.Ldstr, interfaceType.FullName ); // load the index, used to get the MethodInfo object // from MetaDataFactory methodIL.Emit( OpCodes.Ldc_I4, i ); // invoke GetMethod in MetaDataFactory methodIL.Emit( OpCodes.Call, typeof( DynamicProxy.MetaDataFactory ).GetMethod( "GetMethod", new Type[] { typeof( string ), typeof( int ) } ) ); // load the number of parameters onto the stack methodIL.Emit( OpCodes.Ldc_I4, numOfParams ); // create a new array, using the size that was just pused on the stack methodIL.Emit( OpCodes.Newarr, typeof( System.Object ) ); // if we have any parameters, then iterate through and set the values // of each element to the corresponding arguments if ( numOfParams > 0 ) { methodIL.Emit( OpCodes.Stloc_1 ); for ( int j = 0; j < numOfParams; j++ ) { methodIL.Emit( OpCodes.Ldloc_1 ); methodIL.Emit( OpCodes.Ldc_I4, j ); methodIL.Emit( OpCodes.Ldarg, j + 1 ); if ( methodParameters[j].IsValueType ) { methodIL.Emit( OpCodes.Box, methodParameters[j] ); } methodIL.Emit( OpCodes.Stelem_Ref ); } methodIL.Emit( OpCodes.Ldloc_1 ); } // call the Invoke method methodIL.Emit( OpCodes.Callvirt, typeof( DynamicProxy.IProxyInvocationHandler ).GetMethod( "Invoke" ) ); if ( !methodInfo.ReturnType.Equals( typeof( void ) ) ) { // if the return type if a value type, then unbox the return value // so that we don't get junk. if ( methodInfo.ReturnType.IsValueType ) { methodIL.Emit( OpCodes.Unbox, methodInfo.ReturnType ); if ( methodInfo.ReturnType.IsEnum ) { methodIL.Emit( OpCodes.Ldind_I4 ); } else if ( !methodInfo.ReturnType.IsPrimitive ) { methodIL.Emit( OpCodes.Ldobj, methodInfo.ReturnType ); } else { methodIL.Emit( (OpCode) opCodeTypeMapper[ methodInfo.ReturnType ] ); } } // store the result methodIL.Emit( OpCodes.Stloc_0 ); // jump to the return statement methodIL.Emit( OpCodes.Br_S, returnLabel ); // mark the return statement methodIL.MarkLabel( returnLabel ); // load the value stored before we return. This will either be // null (if the handler was null) or the return value from Invoke methodIL.Emit( OpCodes.Ldloc_0 ); } else { // pop the return value that Invoke returned from the stack since // the method's return type is void. methodIL.Emit( OpCodes.Pop ); //mark the return statement methodIL.MarkLabel( returnLabel ); } // Return methodIL.Emit( OpCodes.Ret ); #endregion } } // Iterate through the parent interfaces and recursively call this method foreach ( Type parentType in interfaceType.GetInterfaces() ) { GenerateMethod( parentType, handlerField, typeBuilder ); } } } } --- NEW FILE: SecurityProxy.cs --- using System; namespace DynamicProxy { /// <summary> /// Test proxy invocation handler which is used to check a methods security /// before invoking the method /// </summary> public class SecurityProxy : IProxyInvocationHandler { Object obj = null; ///<summary> /// Class constructor ///</summary> ///<param name="obj">Instance of object to be proxied</param> private SecurityProxy( Object obj ) { this.obj = obj; } ///<summary> /// Factory method to create a new proxy instance. ///</summary> ///<param name="obj">Instance of object to be proxied</param> public static Object NewInstance( Object obj ) { return ProxyFactory.GetInstance().Create( new SecurityProxy( obj ), obj.GetType() ); } ///<summary> /// IProxyInvocationHandler method that gets called from within the proxy /// instance. ///</summary> ///<param name="proxy">Instance of proxy</param> ///<param name="method">Method instance public Object Invoke(Object proxy, System.Reflection.MethodInfo method, Object[] parameters) { Object retVal = null; string userRole = "role"; // if the user has permission to invoke the method, the method // is invoked, otherwise an exception is thrown indicating they // do not have permission if ( SecurityManager.IsMethodInRole( userRole, method.Name ) ) { // The actual method is invoked retVal = method.Invoke( obj, parameters ); } else { throw new Exception( "Invalid permission to invoke " + method.Name ); } return retVal; } } } --- NEW FILE: SecurityManager.cs --- using System; namespace DynamicProxy { /// <summary> /// Test class. /// </summary> public class SecurityManager { ///<summary> /// Class constructor ///</summary> public SecurityManager() { } ///<summary> /// Test method which can be implemented to check if a given method can /// be accessed by a user given the following role. /// NOTE: This does not have any implementation...it's only used as a placeholder ///</summary> public static bool IsMethodInRole( string userRole, string methodName ) { // check if the specified user role can invoke the method return true; } } } --- NEW FILE: MetaDataFactory.cs --- using System; using System.Reflection; using System.Collections; namespace DynamicProxy { /// <summary> /// Factory class used to cache Types instances /// </summary> public class MetaDataFactory { private static Hashtable typeMap = new Hashtable(); /// <summary> /// Class constructor. Private because this is a static class. /// </summary> private MetaDataFactory() { } ///<summary> /// Method to add a new Type to the cache, using the type's fully qualified /// name as the key ///</summary> ///<param name="interfaceType">Type to cache</param> public static void Add( Type interfaceType ) { if ( interfaceType != null ) { lock ( typeMap.SyncRoot ) { if ( !typeMap.ContainsKey( interfaceType.FullName ) ) { typeMap.Add( interfaceType.FullName, interfaceType ); } } } } ///<summary> /// Method to return the method of a given type at a specified index. ///</summary> ///<param name="name">Fully qualified name of the method to return</param> ///<param name="i">Index to use to return MethodInfo</param> ///<returns>MethodInfo</returns> public static MethodInfo GetMethod( string name, int i ) { Type type = null; lock ( typeMap.SyncRoot ) { type = (Type) typeMap[ name ]; } MethodInfo[] methods = type.GetMethods(); if ( i < methods.Length ) { return methods[i]; } return null; } } } --- NEW FILE: DynamicProxyTest.cs --- using System; namespace DynamicProxy { /// <summary> /// </summary> public class TestBed { /// <summary> /// </summary> [STAThread] static void Main( string[] args ) { ITest test = (ITest)SecurityProxy.NewInstance( new TestImpl() ); test.TestFunctionOne(); test.TestFunctionTwo( new Object(), new Object() ); } } public interface ITest { void TestFunctionOne(); Object TestFunctionTwo( Object a, Object b ); } public class TestImpl : ITest { public void TestFunctionOne() { Console.WriteLine( "In TestImpl.TestFunctionOne()" ); } public Object TestFunctionTwo( Object a, Object b ) { Console.WriteLine( "In TestImpl.TestFunctionTwo( Object a, Object b )" ); return null; } } } --- NEW FILE: IProxyInvocationHandler.cs --- using System; using System.Reflection; namespace DynamicProxy { /// <summary> /// Interface that a user defined proxy handler needs to implement. This interface /// defines one method that gets invoked by the generated proxy. /// </summary> public interface IProxyInvocationHandler { /// <param name="proxy">The instance of the proxy</param> /// <param name="method">The method info that can be used to invoke the actual method on the object implementation</param> /// <param name="parameters">Parameters to pass to the method</param> /// <returns>Object</returns> Object Invoke( Object proxy, MethodInfo method, Object[] parameters ); } } |