Skip to content
Permalink
Browse files
Allow meta calls for classes with two self-references
  • Loading branch information
ngmr committed Aug 3, 2015
1 parent ffe65d6 commit 42943b77904364d8c8ffcaf79f8683572b259026
Showing 4 changed files with 42 additions and 46 deletions.
@@ -127,15 +127,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Djava.endorsed.dirs=${basedir}/target/endorsed</argLine>
<includes>
<include>**/org/apache/yoko/*Test.java</include>
</includes>
<systemProperties>
<property>
<name>java.endorsed.dirs</name>
<value>${basedir}/target/endorsed</value>
</property>
</systemProperties>
</configuration>
</plugin>

@@ -1229,8 +1229,9 @@ static public void _OB_embedRecTC(TypeCode outer, TypeCode inner) {
if (inner.recId_ != null) {
if (inner.recId_.equals(outer.id_)) {
if (inner.recType_ != null) {
// Recursive TC already embedded - ensure it's the right one
org.apache.yoko.orb.OB.Assert
._OB_assert(inner.recType_ != outer);
._OB_assert(inner.recType_ == outer);
} else {
//
// Embed the recursive placeholder TypeCode
@@ -1,18 +1,49 @@
package org.apache.yoko;

import java.io.Serializable;

import javax.rmi.CORBA.Util;
import javax.rmi.CORBA.ValueHandler;

import junit.framework.TestCase;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.omg.CORBA.ValueDefPackage.FullValueDescription;
import org.omg.SendingContext.CodeBase;

import test.fvd.Marshalling;

public class MetaTest extends TestCase {

public class MetaTest extends AbstractOrbTestBase {
public static void testMetaForClassWithASelfReference() throws Exception {
ValueHandler vh = Util.createValueHandler();
CodeBase codebase = (CodeBase)vh.getRunTimeCodeBase();
String dataClassRepid = vh.getRMIRepositoryID(Data.class);
FullValueDescription fvd = codebase.meta(dataClassRepid);
Assert.assertNotNull(fvd);
}

public void testMetaForClassWithTwoSelfReferences() {
Marshalling.DEFAULT_VERSION.select();
ValueHandler vh = Util.createValueHandler();
CodeBase codebase = (CodeBase)vh.getRunTimeCodeBase();
String dataClassRepid = vh.getRMIRepositoryID(X.class);
System.out.println(dataClassRepid);
FullValueDescription fvd = codebase.meta(dataClassRepid);
Assert.assertNotNull(fvd);
}

@Before
public void setUp() throws Exception {
super.setUp();
setWaitForFile("Test.ref");
public static class Data implements Serializable {
private static final long serialVersionUID = 1L;
public Data d;
}

@Test
public void testMeta() throws Exception {
client.invokeMain("test.meta.TestMeta");
public static class X {
X x1;
X x2;
}
}


This file was deleted.

0 comments on commit 42943b7

Please sign in to comment.