Browse Source

Fix IDL/IIOP handling of rmic-with-backwards compat; added tests for everything working.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@433792 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 19 years ago
parent
commit
99abfd7bf5
3 changed files with 42 additions and 4 deletions
  1. +11
    -0
      src/etc/testcases/taskdefs/rmic/rmic.xml
  2. +13
    -4
      src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
  3. +18
    -0
      src/testcases/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java

+ 11
- 0
src/etc/testcases/taskdefs/rmic/rmic.xml View File

@@ -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>

+ 13
- 4
src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java View File

@@ -192,7 +192,7 @@ public abstract class DefaultRmicAdapter implements RmicAdapter {
//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 @@ public abstract class DefaultRmicAdapter implements RmicAdapter {
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");
}


+ 18
- 0
src/testcases/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java View File

@@ -212,6 +212,24 @@ public class RmicAdvancedTest extends BuildFileTest {
executeTarget("testXnewForked");
}

/**
* 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


Loading…
Cancel
Save