river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patricia Shanahan <p...@acm.org>
Subject Re: Unexpected Test Results
Date Mon, 13 Sep 2010 22:38:18 GMT
Interesting. As it happens, I also found a build anomaly last night. My 
issue is whether Iterable<SomeType> is a valid foreach expression. Is 
the following a valid program?

import java.util.Arrays;

public class TestFor {
         static String[] strings = {"AAA","bbb"};
         static Iterable<String> it = Arrays.asList(strings);
         public static void main(String[] args) {
                 for(String s : it){
                         System.out.println(s);
                 }
         }
}

Eclipse thinks this is valid. So does the compiler I'm using to build 
River, if the only parameter is the source file. If I copy TestFor.java 
into the River source tree so that it gets compiled as part of the ant 
all.build, I get the following error message:

     [javac] C:\apache2\River\src\com\sun\jini\thread\TestFor.java:7: 
foreach not applicable to expression type
     [javac]             for(String s : it){

I wrote this program because I wanted to use Iterable<TaskManager.Task> 
as the runAfter parameter, and got similar error messages. It works with 
Collection<TaskManager.Task> instead.

Here's a theory. There is some parameter (or parameters) we don't know 
about being passed to javac as part of the ant all.build that affects 
the compiler's personality. It is generating 1.5 compatible code, and 
rejecting a construct that I think should be accepted.

They are somewhat separate issues, because a genuine 1.5 compiler by 
default accepts TestFor.java, but I think the way to get a handle on 
both our issues is to find out exactly what parameters are being passed 
to javac. I'll look into it.

Patricia




On 9/13/2010 1:16 PM, Peter Firmstone wrote:
>   [java] -----------------------------------------
> [java]
> [java] # of tests started = 581
> [java] # of tests completed = 581
> [java] # of tests skipped = 21
> [java] # of tests passed = 581
> [java] # of tests failed = 0
> [java]
> [java] -----------------------------------------
> [java]
> [java] Date finished:
> [java] Tue Sep 14 01:08:05 EST 2010
> [java] Time elapsed:
> [java] 19953 seconds
> [java]
>
> BUILD SUCCESSFUL
> Total time: 332 minutes 40 seconds
>
> These test results are from qa.run executing on Java 5, so I was
> expecting some test failures, knowing that the test suite doesn't
> compile with JDK 1.5.
>
> [java] -----------------------------------------
> [java]
> [java] Running
> com/sun/jini/test/spec/servicediscovery/lookup/LookupFilter.td
> [java] Time is Tue Sep 14 00:41:56 EST 2010
> [java] Starting test in separate process with command:
> [java] /usr/jdk/instances/jdk1.5.0/jre/bin/java
> -Djava.security.policy=file:/opt/src/apache_river/pepe/qa/harness/policy/defaulttest.policy
> -Djava.rmi.server.codebase=http://bluto:8082/qa1-servicediscovery-dl.jar
> -cp
> /opt/src/apache_river/pepe/qa/lib/jiniharness.jar:/opt/src/apache_river/pepe/qa/lib/jinitests.jar:/opt/src/apache_river/pepe/lib/jsk-platform.jar:/opt/src/apache_river/pepe/lib/jsk-lib.jar
> -client
> -Djava.ext.dirs=/usr/jdk/instances/jdk1.5.0/jre/lib/ext:/opt/src/apache_river/pepe/qa/lib-ext:/opt/src/apache_river/pepe/lib-ext
> -Dcom.sun.jini.jsk.port=8080 -Dcom.sun.jini.qa.port=8081
> -Dcom.sun.jini.jsk.home=/opt/src/apache_river/pepe
> -Dcom.sun.jini.qa.home=/opt/src/apache_river/pepe/qa
> -Dcom.sun.jini.qa.harness.harnessJar=/opt/src/apache_river/pepe/qa/lib/jiniharness.jar
> -Dcom.sun.jini.qa.harness.testJar=/opt/src/apache_river/pepe/qa/lib/jinitests.jar
> -Dcom.sun.jini.qa.harness.runjiniserver=true
> -Dcom.sun.jini.qa.harness.runkitserver=true
> -Djava.security.properties=file:/opt/src/apache_river/pepe/qa/harness/trust/dynamic-policy.properties
> -Dcom.sun.jini.qa.harness.testhosts=
> -Djava.util.logging.config.file=/home/peter/logging.properties
> -Dcom.sun.jini.test.home=/opt/src/apache_river/pepe/qa
> -Dcom.sun.jini.test.port=8082
> -Dcom.sun.jini.qa.harness.policies=file:/opt/src/apache_river/pepe/qa/src/com/sun/jini/test/resources/jinitest.policy
> -Djava.ext.dirs=/usr/jdk/instances/jdk1.5.0/jre/lib/ext:/opt/src/apache_river/pepe/qa/lib-ext:/opt/src/apache_river/pepe/lib-ext
> com.sun.jini.qa.harness.MasterTest
> com/sun/jini/test/spec/servicediscovery/lookup/LookupFilter.td
> [java]
> [java] TIME: 00:41:59
> [java]
> [java] MasterTest.doTest INFO:
> [java] ============================== CALLING SETUP()
> ==============================
> [java]
> [java] 14/09/2010 00:41:59 com.sun.jini.tool.ClassServer run
> [java] INFO: ClassServer started [[/opt/src/apache_river/pepe/qa/lib/],
> port 8081]
> [java] 14/09/2010 00:41:59 com.sun.jini.tool.ClassServer run
> [java] INFO: ClassServer started [[/opt/src/apache_river/pepe/lib-dl/],
> port 8080]
> [java] 14/09/2010 00:41:59 com.sun.jini.tool.ClassServer run
> [java] INFO: ClassServer started [[/opt/src/apache_river/pepe/qa/lib/],
> port 8082]
> [java] NonActGrp-out: 14/09/2010 00:42:06
> com.sun.jini.reggie.RegistrarImpl init
> [java] NonActGrp-out: INFO: started Reggie:
> 8ffba3da-41a2-4867-964b-a61c66feb893, [SDMGroup0_bluto_1284388916422],
> ConstrainableLookupLocator[[jini://bluto/], [null]]
> [java] NonActGrp-out: 14/09/2010 00:42:09
> com.sun.jini.reggie.RegistrarImpl init
> [java] NonActGrp-out: INFO: started Reggie:
> ea75fe72-819a-4914-8dd3-bd62df34cf88, [SDMGroup0_bluto_1284388916422],
> ConstrainableLookupLocator[[jini://bluto:41824/], [null]]
> [java] NonActGrp-out: 14/09/2010 00:42:10
> com.sun.jini.reggie.RegistrarImpl init
> [java] NonActGrp-out: INFO: started Reggie:
> c42cc2b9-5c5b-499c-aa1a-670f7e75597f, [SDMGroup0_bluto_1284388916422],
> ConstrainableLookupLocator[[jini://bluto:41827/], [null]]
> [java]
> [java] TIME: 00:42:13
> [java]
> [java] MasterTest.doTest INFO:
> [java] =============================== CALLING RUN()
> ===============================
> [java]
> [java]
> [java] TIME: 00:42:44
> [java]
> [java] MasterTest.doTest INFO:
> [java] ============================ CALLING TEARDOWN()
> =============================
> [java]
> [java] NonActGrp-out: 14/09/2010 00:42:51
> com.sun.jini.reggie.RegistrarImpl destroy
> [java] NonActGrp-out: INFO: starting Reggie shutdown
> [java] NonActGrp-out: 14/09/2010 00:42:52
> com.sun.jini.reggie.RegistrarImpl destroy
> [java] NonActGrp-out: INFO: starting Reggie shutdown
> [java] NonActGrp-out: 14/09/2010 00:42:52
> com.sun.jini.reggie.RegistrarImpl destroy
> [java] NonActGrp-out: INFO: starting Reggie shutdown
> [java] NonActGrp-out: 14/09/2010 00:42:52
> com.sun.jini.reggie.RegistrarImpl$DestroyThread run
> [java] NonActGrp-out: INFO: Reggie shutdown completed
> [java] NonActGrp-out: 14/09/2010 00:42:53
> com.sun.jini.reggie.RegistrarImpl$DestroyThread run
> [java] NonActGrp-out: INFO: Reggie shutdown completed
> [java] NonActGrp-out: 14/09/2010 00:42:53
> com.sun.jini.reggie.RegistrarImpl$DestroyThread run
> [java] NonActGrp-out: INFO: Reggie shutdown completed
> [java] 14/09/2010 00:42:54 com.sun.jini.tool.ClassServer terminate
> [java] INFO: ClassServer terminated [port 8081]
> [java] 14/09/2010 00:42:54 com.sun.jini.tool.ClassServer terminate
> [java] INFO: ClassServer terminated [port 8081]
> [java] 14/09/2010 00:42:54 com.sun.jini.tool.ClassServer terminate
> [java] INFO: ClassServer terminated [port 8082]
> [java] 14/09/2010 00:42:54 com.sun.jini.tool.ClassServer terminate
> [java] INFO: ClassServer terminated [port 8082]
> [java] 14/09/2010 00:42:54 com.sun.jini.tool.ClassServer terminate
> [java] INFO: ClassServer terminated [port 8080]
> [java] 14/09/2010 00:42:54 com.sun.jini.tool.ClassServer terminate
> [java] INFO: ClassServer terminated [port 8080]
> [java]
> [java] TIME: 00:42:55
> [java]
> [java] Test process was destroyed and returned code 0
> [java] com/sun/jini/test/spec/servicediscovery/lookup/LookupFilter.td
> [java] Test Passed: OK
> [java]
> [java]
>
>
>


Mime
View raw message