ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r433792 - in /ant/core/trunk/src: etc/testcases/taskdefs/rmic/rmic.xml main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java testcases/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java
Date Tue, 22 Aug 2006 23:02:52 GMT
Author: stevel
Date: Tue Aug 22 16:02:51 2006
New Revision: 433792

URL: http://svn.apache.org/viewvc?rev=433792&view=rev
Log:
Fix IDL/IIOP handling of rmic-with-backwards compat; added tests for everything working.

Modified:
    ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java

Modified: ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml?rev=433792&r1=433791&r2=433792&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml Tue Aug 22 16:02:51 2006
@@ -263,4 +263,15 @@
     <assertBaseCompiled/>
   </target>
 
+  <target name="testIDL" depends="init">
+    <base-rmic compiler="default" idl="true"/>
+    <assertFileCreated file="RemoteTimestamp.idl"/>
+  </target>
+
+  <target name="testIIOP" depends="init">
+    <base-rmic compiler="default" iiop="true"/>
+    <assertFileCreated file="_RemoteTimestamp_Stub.class"/>
+    <assertFileCreated file="_RemoteTimestampImpl_Tie.class"/>
+  </target>
+
 </project>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java?rev=433792&r1=433791&r2=433792&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java Tue
Aug 22 16:02:51 2006
@@ -192,7 +192,7 @@
         //handle the many different stub options.
         String stubVersion = attributes.getStubVersion();
         //default is compatibility
-        String stubOption=STUB_COMPAT;
+        String stubOption = null;
         if (null != stubVersion) {
             if ("1.1".equals(stubVersion)) {
                 stubOption = STUB_1_1;
@@ -202,12 +202,21 @@
                 stubOption = STUB_COMPAT;
             } else {
                 //anything else
-                attributes.log("Unknown stub option "+stubVersion);
+                attributes.log("Unknown stub option " + stubVersion);
                 //do nothing with the value? or go -v+stubVersion??
             }
         }
-        cmd.createArgument().setValue(stubOption);
-
+        //for java1.5+, we generate compatible stubs, that is, unless
+        //the caller asked for IDL or IIOP support.
+        if (stubOption == null && 
+                !attributes.getIiop() &&
+                !attributes.getIdl()) {
+            stubOption = STUB_COMPAT;
+        }
+        if(stubOption!=null) {
+            //set the non-null stubOption
+            cmd.createArgument().setValue(stubOption);
+        }
         if (null != attributes.getSourceBase()) {
             cmd.createArgument().setValue("-keepgenerated");
         }

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java?rev=433792&r1=433791&r2=433792&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java Tue Aug
22 16:02:51 2006
@@ -213,6 +213,24 @@
     }
 
     /**
+     * test that verifies that IDL compiles.
+     *
+     * @throws Exception
+     */
+    public void testIDL() throws Exception {
+        executeTarget("testIDL");
+    }
+
+    /**
+     * test that verifies that IIOP compiles.
+     *
+     * @throws Exception
+     */
+    public void testIIOP() throws Exception {
+        executeTarget("testIIOP");
+    }
+
+    /**
      * this little bunny verifies that we can load stuff, and that
      * a failure to execute is turned into a fault
      */



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message