KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > bugs > bug387 > TestInterfaceImpl


1 package org.jacorb.test.bugs.bug387;
2
3 import org.omg.CORBA.*;
4 import org.omg.CORBA.portable.InputStream JavaDoc;
5 import org.omg.CORBA.portable.OutputStream JavaDoc;
6 import org.omg.CORBA.portable.ResponseHandler JavaDoc;
7 import org.omg.PortableServer.*;
8
9 public class TestInterfaceImpl extends TestInterfacePOA {
10     
11     public Any test_return_value()
12     {
13         TestStruct testStruct = new TestStruct("STRINGTEST", null, 1);
14         Any any = _orb().create_any();
15         TestStructHelper.insert(any, testStruct);
16         return any;
17     }
18     
19     public Any test_return_null()
20     {
21         TestStruct testStruct = new TestStruct(null, null, 1);
22         Any any = _orb().create_any();
23         TestStructHelper.insert(any, testStruct);
24         return any;
25     }
26     
27     public boolean test_pass_value(Any a, String JavaDoc expected)
28     {
29         TestStruct testStruct = TestStructHelper.extract(a);
30         return expected.equals (testStruct.name);
31     }
32      
33     public boolean test_pass_null(Any a)
34     {
35         TestStruct testStruct = TestStructHelper.extract(a);
36         return testStruct.name == null;
37     }
38
39     public boolean test_pass_shared(Any a)
40     {
41         TestStruct t = TestStructHelper.extract(a);
42         return t.name == t.other;
43     }
44         
45 }
46
Popular Tags