logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Nice/src/nice/tools/testsuite TestNice.java,1.26,1.27 TestCase.java,1.25,1.: msg#00140

Subject: Nice/src/nice/tools/testsuite TestNice.java,1.26,1.27 TestCase.java,1.25,1.26 TestSuiteClassLoader.java,1.5,NONE
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite
In directory sc8-pr-cvs1:/tmp/cvs-serv4323/src/nice/tools/testsuite

Modified Files:
        TestNice.java TestCase.java 
Removed Files:
        TestSuiteClassLoader.java 
Log Message:
In the testengine, load classes in priority from the generated ones instead
of the runtime, in case they are more precise (new nice.lang.dispatch, for
instance).


Index: TestNice.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestNice.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** TestNice.java       13 Jun 2003 22:45:28 -0000      1.26
--- TestNice.java       27 Nov 2003 22:45:59 -0000      1.27
***************
*** 16,19 ****
--- 16,20 ----
  import java.io.*;
  import java.util.*;
+ import java.net.URL;
  
  import nice.tools.testsuite.output.*;
***************
*** 493,496 ****
--- 494,521 ----
        }
  
+ 
+       /**
+                @return the classloader used to run generated code.
+       */
+       static ClassLoader getClassLoader() {
+               ClassLoader classLoader = null;
+ 
+               try {
+                       // This is normally where the compiled classes are in 
the dev tree.
+                       if (_runtime == null)
+                               _runtime = "classes";
+ 
+                       URL[] urls = { 
+                               new URL("file://" + 
getTempFolder().getAbsolutePath() + "/"),
+                               new URL("file://" + new 
File(getRuntime()).getAbsolutePath() + "/") 
+                       };
+                       classLoader = new java.net.URLClassLoader(urls, null);
+               }
+               catch(java.net.MalformedURLException ex) {
+                       throw new Error(ex.toString());
+               }
+ 
+               return classLoader;
+       }
  
        /**

Index: TestCase.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestCase.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** TestCase.java       11 Jun 2003 22:24:05 -0000      1.25
--- TestCase.java       27 Nov 2003 22:45:59 -0000      1.26
***************
*** 357,363 ****
                                {
                                        try {
!                                               Class c = 
Class.forName(sourceFile.getPackage() + ".fun",
!                                                                       true,
!                                                                       new 
TestSuiteClassLoader(this.getClass().getClassLoader()));
                                                Class[] parameterTypes = new 
Class[] {String[].class};
                                                Method m = c.getMethod("main", 
parameterTypes);
--- 357,364 ----
                                {
                                        try {
!                                               Class c = Class.forName
!                                                       
(sourceFile.getPackage() + ".fun",
!                                                        true,
!                                                        
TestNice.getClassLoader());
                                                Class[] parameterTypes = new 
Class[] {String[].class};
                                                Method m = c.getMethod("main", 
parameterTypes);

--- TestSuiteClassLoader.java DELETED ---




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/


<Prev in Thread] Current Thread [Next in Thread>