index
int64
0
0
repo_id
stringlengths
9
205
file_path
stringlengths
31
246
content
stringlengths
1
12.2M
__index_level_0__
int64
0
10k
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/InsTest.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko; public class InsTest extends AbstractOrbTestBase { private static final String SERVER_CLASS = "test.ins.Server"; private static final String CLIENT_CLASS = "test.ins.Client"; public void testUrl() throws Exception { runServerClientTest(SERVER_CLASS, new String[] { "TestINS", "TestINS.ref" }, CLIENT_CLASS, new String[] { "1", "relfile:TestINS.ref" }); } }
5,900
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/TestFrameworkTest.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @version $Rev: 491396 $ $Date: 2006-12-30 22:06:13 -0800 (Sat, 30 Dec 2006) $ */ package org.apache.yoko; import java.io.FileWriter; import java.io.PrintWriter; import java.nio.file.Files; import java.nio.file.Paths; /** * This test is only to ensure the framework is correctly reporting failures in * server and client processes. * @author nrichard */ public class TestFrameworkTest extends AbstractOrbTestBase { private static final String TEST_FILE = "FrameworkTest.txt"; public void setUp() throws Exception { super.setUp(); setWaitForFile(TEST_FILE); System.setProperty("server.forked", "true"); System.setProperty("client.forked", "true"); } public void tearDown() throws Exception { super.tearDown(); System.getProperties().remove("server.forked"); System.getProperties().remove("client.forked"); } public void testGoodClasses() throws Exception { runServerClientTest(GoodServer.class.getName(), GoodClient.class.getName()); } public void testBadClasses() throws Exception { try { runServerClientTest(BadServer.class.getName(), BadClient.class.getName()); fail("Should have thrown an exception"); } catch (Exception e) { assertRootCause(Exception.class, e); } } public void testWorseClasses() throws Exception { try { runServerClientTest(WorseServer.class.getName(), WorseClient.class.getName()); fail("Should have thrown an error"); } catch (Exception e) { assertRootCause(Error.class, e); } } public void testBadServer() throws Exception { try { runServerClientTest(BadServer.class.getName(), GoodClient.class.getName()); fail("Should have thrown an exception"); } catch (Exception e) { assertRootCause(Exception.class, e); } } public void testWorseServer() throws Exception { try { runServerClientTest(WorseServer.class.getName(), GoodClient.class.getName()); fail("Should have thrown an error"); } catch (Exception e) { assertRootCause(Error.class, e); } } public void testBadClient() throws Exception { try { runServerClientTest(GoodServer.class.getName(), BadClient.class.getName()); fail("Should have thrown an exception"); } catch (Exception e) { assertRootCause(Exception.class, e); } } public void testWorseClient() throws Exception { try { runServerClientTest(GoodServer.class.getName(), WorseClient.class.getName()); fail("Should have thrown an error"); } catch (Exception e) { assertRootCause(Error.class, e); } } private void assertRootCause(Class<? extends Throwable> expectedExceptionClass, Throwable t) { while (t.getCause() != null) t = t.getCause(); assertEquals(expectedExceptionClass, t.getClass()); } public static final class GoodServer { public static void main(String[] args) throws Exception { try (FileWriter fw = new FileWriter(TEST_FILE)) { try (PrintWriter pw = new PrintWriter(fw)) { pw.println("Hello, World."); } } } } public static final class GoodClient { public static void main(String[] args) throws Exception { Files.delete(Paths.get(TEST_FILE)); } } public static final class BadServer { public static void main(String[] args) throws Exception { GoodServer.main(args); throw new Exception(); } } public static final class BadClient { public static void main(String[] args) throws Exception { GoodClient.main(args); throw new Exception(); } } public static final class WorseServer { public static void main(String[] args) throws Exception { GoodServer.main(args); throw new Error(); } } public static final class WorseClient { public static void main(String[] args) throws Exception { GoodClient.main(args); throw new Error(); } } public static final class WorstServer { public static void main(String[] args) throws Exception { GoodServer.main(args); System.exit(1); } } public static final class WorstClient { public static void main(String[] args) throws Exception { GoodClient.main(args); System.exit(2); } } }
5,901
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/AbstractMatrixOrbTestBase.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko; import java.io.File; import java.util.Arrays; import junit.framework.TestSuite; /** * * Generates a test matrix of server- and client configurations. A default * matrix is provided. */ public class AbstractMatrixOrbTestBase extends AbstractOrbTestBase { protected static String[][] defaultServers = new String[][] { new String[] { "-OAthreaded" }, new String[] { "-OAthread_per_client" }, new String[] { "-OAthread_per_request" }, new String[] { "-OAthread_pool" , "10" } }; private static String[][] defaultClients = new String[][] { new String[] { "-ORBthreaded" }}; private String serverClass, clientClass; private String[] serverArgs, clientArgs; public AbstractMatrixOrbTestBase(String name) { super(name); } public void init(String serverClass, String[] serverArgs, String clientClass, String[] clientArgs, File waitForFile) { this.serverClass = serverClass; this.clientClass = clientClass; this.serverArgs = serverArgs; this.clientArgs = clientArgs; this.waitForFile = waitForFile; } public void test() throws Exception { runServerClientTest(serverClass, serverArgs, clientClass, clientArgs); } public static TestSuite generateTestSuite(String serverClass, String clientClass, File waitForFile) { return generateTestSuite(serverClass, defaultServers, clientClass, defaultClients, waitForFile); } public static TestSuite generateTestSuite(String serverClass, String[][] servers, String clientClass, String[][] clients, File waitForFile) { TestSuite suite = new TestSuite(); for(String[] serverArgs: servers) { for(String[] clientArgs: clients) { AbstractMatrixOrbTestBase test = new AbstractMatrixOrbTestBase("test"); test.init(serverClass, serverArgs, clientClass, clientArgs, waitForFile); suite.addTest(test); } } return suite; } }
5,902
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/LocalTest.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko; public class LocalTest extends AbstractOrbTestBase { private static final String SERVER_CLASS = "test.local.Server"; private static final String CLIENT_CLASS = "test.local.Client"; private static final String OUTPUT_FILE = "Test.ref"; public void setUp() throws Exception { super.setUp(); setWaitForFile(OUTPUT_FILE); } public void testLocal() throws Exception { runServerClientTest(SERVER_CLASS, CLIENT_CLASS); } }
5,903
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/FVDTest.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @version $Rev: 491396 $ $Date: 2006-12-30 22:06:13 -0800 (Sat, 30 Dec 2006) $ */ package org.apache.yoko; import static test.fvd.Marshalling.VERSION1; import static test.fvd.Marshalling.VERSION2; import test.fvd.MissingFieldsClient; import test.fvd.MissingFieldsServer; public class FVDTest extends AbstractOrbTestBase { public void testMissingFields() throws Exception { if (true) return; final String refFile = "missingfields.ref"; setWaitForFile(refFile); runServerClientTest(MissingFieldsServer.class, MissingFieldsClient.class, refFile, VERSION1.name(), VERSION2.name()); } }
5,904
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/ConnectionCachingTest.java
package org.apache.yoko; import org.apache.yoko.orb.OBPortableServer.POA; import org.apache.yoko.orb.OBPortableServer.POAHelper; import org.apache.yoko.orb.OBPortableServer.POAManager; import org.apache.yoko.orb.OBPortableServer.POAManagerHelper; import org.apache.yoko.orb.OCI.Acceptor; import org.apache.yoko.orb.OCI.IIOP.AcceptorInfo; import org.apache.yoko.orb.OCI.IIOP.AcceptorInfoHelper; import org.apache.yoko.orb.spi.naming.NameServiceInitializer; import org.apache.yoko.orb.spi.naming.RemoteAccess; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.LocalObject; import org.omg.CORBA.ORB; import org.omg.CORBA.portable.OutputStream; import org.omg.CORBA.portable.ResponseHandler; import org.omg.CORBA_2_3.portable.InputStream; import org.omg.CosNaming.*; import org.omg.PortableInterceptor.*; import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName; import test.util.Skellington; import java.rmi.Remote; import java.rmi.RemoteException; import java.util.Properties; import static javax.rmi.PortableRemoteObject.narrow; public class ConnectionCachingTest { private static final NameComponent[] OBJECT_NAME = { new NameComponent("object", "")}; ORB serverORB; ORB clientORB; @Before public void setup() throws Exception { serverORB = Util.createServerOrb(); clientORB = Util.createClientORB(serverORB); // make a GIOP 1.0 call first NamingContext ctx = NamingContextHelper.narrow(clientORB.string_to_object(Util.getNameServerUrl(serverORB))); ctx.new_context(); } @Test public void testSingleNull() throws Exception { Assert.assertEquals(null, newRemoteImpl(clientORB).bounce(null)); } @Test public void testSingleNullSameOrb() throws Exception { Assert.assertEquals(null, newRemoteImpl(serverORB).bounce(null)); } @Test public void testSingleEmptyString() throws Exception { Assert.assertEquals("", newRemoteImpl(clientORB).bounce("")); } @Test public void testSingleEmptyStringSameOrb() throws Exception { Assert.assertEquals("", newRemoteImpl(serverORB).bounce("")); } @Test public void testSingleNonEmptyString() throws Exception { Assert.assertEquals("hello", newRemoteImpl(clientORB).bounce("hello")); } @Test public void testSingleNonEmptyStringSameOrb() throws Exception { Assert.assertEquals("hello", newRemoteImpl(serverORB).bounce("hello")); } @Test public void testLotsOfInvocations() throws Exception { Assert.assertEquals(null, newRemoteImpl(clientORB).bounce(null)); Assert.assertEquals("", newRemoteImpl(clientORB).bounce("")); Assert.assertEquals("a", newRemoteImpl(clientORB).bounce("a")); Assert.assertEquals("ab", newRemoteImpl(clientORB).bounce("ab")); Assert.assertEquals("abc", newRemoteImpl(clientORB).bounce("abc")); Assert.assertEquals("abcd", newRemoteImpl(clientORB).bounce("abcd")); Assert.assertEquals("abcde", newRemoteImpl(clientORB).bounce("abcde")); } @Test public void testLotsOfInvocationsSameOrb() throws Exception { Assert.assertEquals(null, newRemoteImpl(serverORB).bounce(null)); Assert.assertEquals("", newRemoteImpl(serverORB).bounce("")); Assert.assertEquals("a", newRemoteImpl(serverORB).bounce("a")); Assert.assertEquals("ab", newRemoteImpl(serverORB).bounce("ab")); Assert.assertEquals("abc", newRemoteImpl(serverORB).bounce("abc")); Assert.assertEquals("abcd", newRemoteImpl(serverORB).bounce("abcd")); Assert.assertEquals("abcde", newRemoteImpl(serverORB).bounce("abcde")); } private TheInterface newRemoteImpl(ORB callerOrb) throws Exception { TheImpl theImpl = new TheImpl(); theImpl.publish(serverORB); // bind it into the naming context Util.getNameService(serverORB).rebind(OBJECT_NAME, theImpl.thisObject()); // look it up from the caller orb Object stub = Util.getNameService(callerOrb).resolve(OBJECT_NAME); return (TheInterface)narrow(stub, TheInterface.class); } public interface TheInterface extends Remote { String bounce(String text) throws RemoteException; } private static class TheImpl extends Skellington implements TheInterface { @Override protected OutputStream dispatch(String method, InputStream in, ResponseHandler reply) throws RemoteException { switch (method) { case "bounce": String result = bounce((String) in.read_value(String.class)); OutputStream out = reply.createReply(); ((org.omg.CORBA_2_3.portable.OutputStream) out).write_value(result, String.class); return out; default: throw new BAD_OPERATION(); } } @Override public String bounce(String s) {return s;} } public static class DummyInterceptor extends LocalObject implements ORBInitializer, ServerRequestInterceptor { @Override public String name() { return "DummyInterceptor"; } @Override public void destroy() {} @Override public void pre_init(ORBInitInfo info) {} @Override public void post_init(ORBInitInfo info) { try { info.add_server_request_interceptor(this); } catch (DuplicateName duplicateName) { throw new Error(duplicateName); } } @Override public void receive_request_service_contexts(ServerRequestInfo ri) throws ForwardRequest {} @Override public void receive_request(ServerRequestInfo ri) throws ForwardRequest {} @Override public void send_reply(ServerRequestInfo ri) {} @Override public void send_exception(ServerRequestInfo ri) throws ForwardRequest {} @Override public void send_other(ServerRequestInfo ri) throws ForwardRequest {} } private static class Util { private static int getPort(ORB orb) throws Exception { POA rootPoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); POAManager poaMgr = POAManagerHelper.narrow(rootPoa.the_POAManager()); for (Acceptor acceptor : poaMgr.get_acceptors()) { AcceptorInfo info = AcceptorInfoHelper.narrow(acceptor.get_info()); if (info != null) return (char) info.port(); } throw new Error("No IIOP Acceptor found"); } private static String getNameServerUrl(ORB orb) throws Exception { return "corbaname::localhost:" + getPort(orb); } private static ORB createServerOrb() throws Exception { Properties serverProps = new Properties(); serverProps.put(NameServiceInitializer.NS_ORB_INIT_PROP, ""); serverProps.put(NameServiceInitializer.NS_REMOTE_ACCESS_ARG, RemoteAccess.readWrite.toString()); serverProps.put(ORBInitializer.class.getName() + "Class." + DummyInterceptor.class.getName(), ""); ORB orb = ORB.init((String[])null, serverProps); POAHelper.narrow(orb.resolve_initial_references("RootPOA")).the_POAManager().activate(); return orb; } private static ORB createClientORB(ORB targetORB) throws Exception { return ORB.init(new String[]{"-ORBInitRef", "NameService=" + getNameServerUrl(targetORB)}, null); } private static NamingContextExt getNameService(ORB orb) throws Exception { return NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService")); } } }
5,905
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/TestFrameworkUnforkedTest.java
package org.apache.yoko; public class TestFrameworkUnforkedTest extends TestFrameworkTest { @Override public void setUp() throws Exception { super.setUp(); System.setProperty("server.forked","false"); System.setProperty("client.forked","false"); } }
5,906
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/AbstractOrbTestBase.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko; import static java.util.concurrent.TimeUnit.SECONDS; import java.io.File; import java.rmi.registry.Registry; import java.util.Map.Entry; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; import org.apache.yoko.processmanager.JavaProcess; import org.apache.yoko.processmanager.ProcessManager; /** * Superclass for ORB tests. Takes care of setting up a a server process and a client process. * It also sets the java.endorsed.dirs property and launches the client process. * * Currently, the client waits for the server to create a file containing an IOR. This * is used to delay the client until the server has started. the setWaitFile(File) method * can be used to set the name of this file, which varies in the ORB tests. */ public class AbstractOrbTestBase extends TestCase { protected ProcessManager processManager; protected JavaProcess server, client; protected File waitForFile; int waitForFileTimeout = 10000; public AbstractOrbTestBase() { super(); } public AbstractOrbTestBase(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); processManager = new ProcessManager(Registry.REGISTRY_PORT); client = new JavaProcess("client", processManager); client.addSystemProperty("java.endorsed.dirs"); server = new JavaProcess("server", processManager); server.addSystemProperty("java.endorsed.dirs"); JavaProcess[] processes = new JavaProcess[] {server, client}; for(int i = 0; i < processes.length; i++) { JavaProcess process = processes[i]; for(Entry<?, ?> entry: System.getProperties().entrySet()) { String key = entry.getKey().toString(); if(key.startsWith(process.getName() + ":")){ int pos = key.indexOf(':') + 1; String property = key.substring(pos); String value = entry.getValue().toString(); System.out.println("Adding (" + property + ", " + value + ")"); process.addSystemProperty(property, value); } } } client.launch(); } public void tearDown() throws Exception { client.exit(0); if(getWaitForFile() != null && getWaitForFile().exists()) { getWaitForFile().delete(); } } protected void runServerClientTest(Class<?> serverClass, Class<?> clientClass, String...commonArgs) throws Exception { runServerClientTest(serverClass.getName(), commonArgs, clientClass.getName(), commonArgs); } protected void runServerClientTest(String serverClass, String clientClass) throws Exception { runServerClientTest(serverClass, new String[0], clientClass, new String[0]); } protected void runServerClientTest(String serverClass, String[] serverArgs, String clientClass, String[] clientArgs) throws Exception { server.launch(); Future<Void> serverFuture = server.invokeMainAsync(serverClass, serverArgs); waitForFile(); client.invokeMain(clientClass, clientArgs); try { serverFuture.get(2, SECONDS); } catch (TimeoutException e) { System.out.println("Ignoring server exception: " + e); } server.exit(0); } public void setWaitForFile(String file) { this.waitForFile = new File(file); } public final File getWaitForFile() { return waitForFile; } protected void waitForFile() { File file = getWaitForFile(); if(file != null) { waitFor(file, waitForFileTimeout); } } public static void waitFor(File file, int timeout) throws Error { long timeBefore = System.currentTimeMillis(); do { try { if(file.exists()) { break; } Thread.sleep(50); if(System.currentTimeMillis() > timeBefore + timeout) { fail("The file " + file + " was not created within " + timeout + "ms"); } } catch(InterruptedException e) { throw new Error(e); } } while(true); file.deleteOnExit(); } }
5,907
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/CosNamingTest.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @version $Rev: 491396 $ $Date: 2006-12-30 22:06:13 -0800 (Sat, 30 Dec 2006) $ */ package org.apache.yoko; import test.tnaming.ClientForReadOnlyNameService; import test.tnaming.ClientForReadWriteNameService; import test.tnaming.ServerWithReadWriteIntegralNameService; import test.tnaming.ServerWithReadOnlyIntegralNameService; import test.tnaming.ServerWithReadWriteStandaloneNameService; public class CosNamingTest extends AbstractOrbTestBase { public void testReadOnlyIntegralNameService() throws Exception { final String refFile = "readonlyintegralnameservice.ref"; setWaitForFile(refFile); runServerClientTest(ServerWithReadOnlyIntegralNameService.class, ClientForReadOnlyNameService.class, refFile); } public void testReadWriteIntegralNameService() throws Exception { final String refFile = "readwriteintegralnameservice.ref"; setWaitForFile(refFile); runServerClientTest(ServerWithReadWriteIntegralNameService.class, ClientForReadWriteNameService.class, refFile); } public void testReadWriteStandaloneNameService() throws Exception { final String refFile = "readwritestandalonenameservice.ref"; setWaitForFile(refFile); runServerClientTest(ServerWithReadWriteStandaloneNameService.class, ClientForReadWriteNameService.class, refFile); } }
5,908
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/AbstractCollocTestBase.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko; import junit.framework.TestSuite; public class AbstractCollocTestBase extends AbstractOrbTestBase { protected String mainClass; protected String[] args; public AbstractCollocTestBase(String testName) { super(testName); } public void testColloc() throws Exception { client.invokeMain(mainClass, args); } public static TestSuite generateTestSuite(String mainClass, String[][] args) { TestSuite suite = new TestSuite(); for(int i = 0; i < args.length; i++) { AbstractCollocTestBase test = new AbstractCollocTestBase("testColloc"); test.mainClass = mainClass; test.args = args[i]; suite.addTest(test); } return suite; } }
5,909
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/IIOPPluginTest.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @version $Rev: 554983 $ $Date: 2007-07-10 08:38:17 -0700 (Tue, 10 Jul 2007) $ */ package org.apache.yoko; public class IIOPPluginTest extends AbstractOrbTestBase { private static final String SERVER_CLASS = "test.iiopplugin.Server"; private static final String CLIENT_CLASS = "test.iiopplugin.Client"; private static final String OUTPUT_FILE = "Test.ref"; public void setUp() throws Exception { super.setUp(); setWaitForFile(OUTPUT_FILE); } public void testLocal() throws Exception { runServerClientTest(SERVER_CLASS, CLIENT_CLASS); } }
5,910
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/RMIExceptionHandlingTest.java
package org.apache.yoko; import java.rmi.RemoteException; import java.util.Properties; import javax.rmi.PortableRemoteObject; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.omg.CORBA.ORB; import org.omg.PortableServer.POA; import org.omg.PortableServer.POAHelper; import test.rmi.exceptionhandling.MyAppException; import test.rmi.exceptionhandling.MyClientRequestInterceptor; import test.rmi.exceptionhandling.MyRuntimeException; import test.rmi.exceptionhandling.MyServerRequestInterceptor; import test.rmi.exceptionhandling.Thrower; import test.rmi.exceptionhandling.ThrowerImpl; import test.rmi.exceptionhandling._ThrowerImpl_Tie; @SuppressWarnings("serial") public class RMIExceptionHandlingTest { private static ORB serverOrb; private static ORB clientOrb; private static String ior; private static MyAppException mae = null; private static MyRuntimeException mre = null; private static ORB initOrb(Properties props, String... args) { return ORB.init(args, props); } private static void initExceptions() { if (mae == null) mae = new MyAppException(); if (mre == null) mre = new MyRuntimeException(); } @BeforeClass public static void createServerORB() throws Exception { initExceptions(); ThrowerImpl.myAppException = mae; ThrowerImpl.myRuntimeException = mre; serverOrb = initOrb(new Properties() {{ put("org.omg.PortableInterceptor.ORBInitializerClass." + MyClientRequestInterceptor.class.getName(),""); put("org.omg.PortableInterceptor.ORBInitializerClass." + MyServerRequestInterceptor.class.getName(),""); }}); POA poa = POAHelper.narrow(serverOrb.resolve_initial_references("RootPOA")); poa.the_POAManager().activate(); _ThrowerImpl_Tie tie = new _ThrowerImpl_Tie(); tie.setTarget(new ThrowerImpl(serverOrb)); poa.activate_object(tie); ior = serverOrb.object_to_string(tie.thisObject()); System.out.println(ior); } @BeforeClass public static void createClientORB() { clientOrb = initOrb(new Properties() {{ put("org.omg.PortableInterceptor.ORBInitializerClass." + MyClientRequestInterceptor.class.getName(),""); }}); } @AfterClass public static void shutdownServerORB() { serverOrb.shutdown(true); serverOrb.destroy(); ior = null; } @AfterClass public static void shutdownClientORB() { clientOrb.shutdown(true); clientOrb.destroy(); } @Test(expected=MyRuntimeException.class) public void testRuntimeException() throws RemoteException { getThrower(clientOrb).throwRuntimeException(); } @Test(expected=MyAppException.class) public void testAppException() throws RemoteException, MyAppException { getThrower(clientOrb).throwAppException(); } private Thrower getThrower(ORB orb) { Object o = orb.string_to_object(ior); Thrower thrower = (Thrower) PortableRemoteObject.narrow(o, Thrower.class); return thrower; } public static void main(String...args) throws Exception { if (0 == args.length) { System.out.println("Starting server"); mae = new MyAppException(); mre = new MyRuntimeException(); createServerORB(); System.out.println(serverOrb.getClass().getName()); serverOrb.run(); } else { System.out.println("Starting client"); ior = args[0]; createClientORB(); System.out.println(clientOrb.getClass().getName()); RMIExceptionHandlingTest test = new RMIExceptionHandlingTest(); try { test.testRuntimeException(); throw new Exception("no exception seen"); } catch (MyRuntimeException e) { } } } }
5,911
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/ConnectionCleanupTest.java
package org.apache.yoko; import static javax.rmi.PortableRemoteObject.narrow; import org.apache.yoko.orb.OBPortableServer.POAHelper; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; import org.omg.CORBA.ORBPackage.InvalidName; import org.omg.CORBA.portable.OutputStream; import org.omg.CORBA.portable.ResponseHandler; import org.omg.CORBA_2_3.portable.InputStream; import org.omg.PortableServer.POA; import org.omg.PortableServer.POAManagerPackage.AdapterInactive; import org.omg.PortableServer.POAPackage.ServantAlreadyActive; import org.omg.PortableServer.POAPackage.WrongPolicy; import test.util.MultiException; import test.util.Skellington; import java.rmi.Remote; import java.rmi.RemoteException; import java.util.*; import java.util.concurrent.*; public class ConnectionCleanupTest { ORB serverORB; ORB clientORB; @Before public void setup() throws Exception { serverORB = ORB.init((String[])null, null); clientORB = ORB.init((String[])null, null); } @Test public void testOneClient() throws Exception { newRemoteImpl().gcAndSleep(1000); } private TheInterface newRemoteImpl() { try { return (TheInterface)narrow(clientORB.string_to_object(new TheImpl().publish(serverORB)), TheInterface.class); } catch (InvalidName | AdapterInactive | WrongPolicy | ServantAlreadyActive e) { e.printStackTrace(); throw new AssertionError(e); } } @Test public void testRecursiveClient() throws Exception { newRemoteImpl().gcAndSleepRecursive(10000, 100); } //@Test public void doNotTestOneHundredClients() throws Throwable { // To avoid multiple threads initializing the singleton at once // during the first call to PRO.narrow() force it to be called // once before the other threads start. testOneClient(); // OK - now do a hundred threads. List<Future<Throwable>> futures = new ArrayList<>(); ExecutorService xs = Executors.newFixedThreadPool(100); final CyclicBarrier cb = new CyclicBarrier(101); for (int i = 0; i < 100; i++) { futures.add(xs.submit(new Callable<Throwable>() { @Override public Throwable call() throws Exception { try { cb.await(); recurse(10); // use recursion so stack trace tells us how far in we failed return null; } catch (Throwable t) { return t; } } private void recurse(int times) throws Exception { testOneClient(); if (times > 0) recurse(times - 1); } })); } cb.await(); MultiException me = new MultiException(futures); if (me.isEmpty()) return; throw me; } public interface TheInterface extends Remote { void gcAndSleep(long millis) throws RemoteException; void gcAndSleepRecursive(long millis, int depth) throws RemoteException; } private class TheImpl extends Skellington implements TheInterface { @Override public void gcAndSleep(long millis) { //forceGarbageCollection(); try { Thread.sleep(millis); } catch (InterruptedException ignored) {} } @Override public void gcAndSleepRecursive(long millis, int depth) throws RemoteException { if (depth == 1) newRemoteImpl().gcAndSleep(millis); else newRemoteImpl().gcAndSleepRecursive(millis, depth - 1); } @Override protected OutputStream dispatch(String method, InputStream in, ResponseHandler reply) throws RemoteException { switch (method) { case "gcAndSleep": gcAndSleep(in.read_longlong()); return reply.createReply(); case "gcAndSleepRecursive": gcAndSleepRecursive(in.read_longlong(), in.read_long()); return reply.createReply(); default: throw new BAD_OPERATION(); } } } private static long forceGarbageCollection() { List<byte[]> extents = new ArrayList<>(); long tally = 0; // allocate as much as possible, halve the size and try again for (int i = 30; i >= 0; i--) { try { do { int alloc = 1 << i; extents.add(new byte[alloc]); tally += alloc; } while (true); } catch (OutOfMemoryError oom) {} } // now the heap should be full so even the smallest allocation should fail try { for (int i = 0; i < 1024; i++) extents.add(new byte[128]); Assert.fail("this allocation should have failed"); } catch (OutOfMemoryError e) {} System.gc(); return tally; } }
5,912
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/PiTest.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko; import java.io.File; import junit.framework.TestSuite; public class PiTest extends AbstractOrbTestBase { private static final String SERVER_CLASS = "test.pi.Server"; private static final String CLIENT_CLASS = "test.pi.Client"; private static final String COLLOC_MAIN_CLASS = "test.pi.Collocated"; private static final File waitForFile = new File("TestInterface.ref"); public static TestSuite suite() { TestSuite suite = AbstractMatrixOrbTestBase.generateTestSuite(SERVER_CLASS, CLIENT_CLASS, waitForFile); suite.addTest(AbstractCollocTestBase.generateTestSuite(COLLOC_MAIN_CLASS, AbstractMatrixOrbTestBase.defaultServers)); return suite; } }
5,913
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/processmanager/JavaProcess.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.processmanager; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.rmi.RemoteException; import java.rmi.registry.Registry; import java.util.Properties; import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executors; import java.util.concurrent.Future; import org.apache.yoko.processmanager.internal.ProcessAgent; import org.apache.yoko.processmanager.internal.ProcessAgentImpl; import org.apache.yoko.processmanager.internal.Util; public class JavaProcess { private final boolean inProcess; private final String name; private final Properties systemProperties; private ProcessAgent processAgent; private ProcessManager manager; CountDownLatch processExited = new CountDownLatch(1); CountDownLatch processStarted = new CountDownLatch(1); public JavaProcess(String name, ProcessManager manager) { this.name = name; this.manager = manager; this.inProcess = "false".equals(System.getProperty(name + ".fork")); systemProperties = new Properties(); manager.registerProcess(this); } public void addSystemProperty(String key, String value) { systemProperties.put(key, value); } public void addSystemProperty(String key) { systemProperties.put(key, System.getProperty(key)); } /** * Starts the process. * */ public void launch() { launch(5000); } public void launch(int timeoutMillis) { try { if(inProcess) { ProcessAgentImpl.startLocalProcess(manager, this.name); } else { Process proc = Util.execJava(ProcessAgentImpl.class.getName(), systemProperties, name, "localhost", ""+Registry.REGISTRY_PORT, manager.getName()); Util.redirectStream(proc.getInputStream(), System.out, name+":out"); Util.redirectStream(proc.getErrorStream(), System.err, name+":err"); waitForProcessStartup(timeoutMillis); } } catch(Exception e) { throw new Error(e); } } public Object invokeMain(String className, String...args) throws InvocationTargetException { return invokeStatic(className, "main", new Object[] { args }); } public Future<Void> invokeMainAsync(String className, String...args) { return invokeStaticAsync(className, "main", new Object[] { args }); } public Future<Void> invokeStaticAsync(final String className, final String method, final Object[] args) { return Executors.newSingleThreadExecutor().submit(new Callable<Void>() { @Override public Void call() throws Exception { invokeStatic(className, method, args); return null; } }); } /** * Invokes a static method within the process. The static method cannot return a Throwable. */ public Object invokeStatic(String className, String method, Object[] args) throws InvocationTargetException { Object result = null; try { result = processAgent.invokeStatic(className, method, args); } catch(RemoteException e) { if(processExited.getCount() != 0) { e.printStackTrace(); throw new Error(e); } else { //System.out.println("invokeStatic terminated process"); } } if(result instanceof Throwable) { if(result instanceof InvocationTargetException) { throw (InvocationTargetException) result; } else throw new Error((Throwable) result); } return result; } protected void setAgent(ProcessAgent agent) { this.processAgent = agent; } public String getName() { return name; } /** * If this process is forked, this method terminates the process with the given exit code. Waits for the process to terminate. * @param exitCode */ public void exit(int exitCode) { if (inProcess) return; try { processAgent.exit(exitCode); } catch(RemoteException e) { //throw new Error(e); } try { processExited.await(); } catch (InterruptedException e) { throw new Error(e); } } private void waitForProcessStartup(int maxWaitMillis) { try { processStarted.await(); } catch (InterruptedException e) { throw new Error(e); } if(processAgent == null) { throw new Error("Failed to start "+name+" process"); } } }
5,914
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/processmanager/ProcessManager.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.processmanager; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.rmi.server.UnicastRemoteObject; import java.util.HashMap; import java.util.Map; import org.apache.yoko.processmanager.internal.ProcessAgent; import org.apache.yoko.processmanager.internal.ProcessManagerRemoteIF; public class ProcessManager extends UnicastRemoteObject implements ProcessManagerRemoteIF { private Registry rmiRegistry; private Map javaProcesses; private String name = "ProcessManager"; public ProcessManager(int registryPort) throws RemoteException { javaProcesses = new HashMap(); try { rmiRegistry = LocateRegistry.createRegistry(registryPort); } catch (RemoteException e) { try { rmiRegistry = LocateRegistry.getRegistry(registryPort); } catch(RemoteException e2) { throw new Error(e2); } } try { rmiRegistry.rebind(name, this); } catch (Throwable e) { e.printStackTrace(); throw new Error(e); } } public void registerProcess(JavaProcess process) { javaProcesses.put(process.getName(), process); } public void agentReady(ProcessAgent agent) throws RemoteException { JavaProcess process = (JavaProcess) javaProcesses.get(agent.getName()); if(process == null) { throw new Error("Unexpected: agentReady from unregistered agent"); } else { process.setAgent(agent); process.processStarted.countDown(); } } public String getName() { return name; } public void agentExited(ProcessAgent agent) throws RemoteException { JavaProcess process = (JavaProcess) javaProcesses.get(agent.getName()); if(process == null) { throw new Error("Unexpected: agentExited from unregistered agent"); } else { process.setAgent(agent); process.processExited.countDown(); } } public void isAlive() {} }
5,915
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/processmanager
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/processmanager/internal/ProcessAgent.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.processmanager.internal; import java.rmi.Remote; import java.rmi.RemoteException; public interface ProcessAgent extends Remote { public String getName() throws RemoteException; public Object invokeStatic(String className, String methodName, Object[] args) throws RemoteException; public void exit(int exitCode) throws RemoteException; }
5,916
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/processmanager
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/processmanager/internal/ProcessManagerRemoteIF.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.processmanager.internal; import java.rmi.Remote; import java.rmi.RemoteException; public interface ProcessManagerRemoteIF extends Remote { void agentReady(ProcessAgent agent) throws RemoteException; void isAlive() throws RemoteException; void agentExited(ProcessAgent agent) throws RemoteException; }
5,917
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/processmanager
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/processmanager/internal/Util.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.processmanager.internal; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.Properties; public class Util { // Forks a new java process. public static Process execJava(String className, Properties props, String...javaArgs) throws IOException { // Get path to java binary File javaHome = new File(System.getProperty("java.home")); File javaBin = new File(new File(javaHome, "bin"), "java"); // Get current class path URLClassLoader cl = (URLClassLoader) Util.class.getClassLoader(); URL[] classPathUrls = cl.getURLs(); // Construct list of arguments List binArgs = new ArrayList(); // First argument is the java binary to run binArgs.add(javaBin.getPath()); // Add the classpath to argument list binArgs.add("-classpath"); String classPath = "" + new File(classPathUrls[0].getPath().replaceAll("%20", " ")); for (int i = 1; i < classPathUrls.length; i++) { classPath += File.pathSeparator + new File(classPathUrls[i].getPath() .replaceAll("%20", " ")); } classPath += ""; binArgs.add(classPath); // Add properties to argument list Enumeration en = props.keys(); while (en.hasMoreElements()) { String key = (String) en.nextElement(); binArgs.add("-D" + key + "=" + props.getProperty(key)); } // Add class containing main method to arg list binArgs.add(className); // Add java arguments for (int i = 0; i < javaArgs.length; i++) { binArgs.add(javaArgs[i]); } // Convert arg list to array String[] argArray = new String[binArgs.size()]; for (int i = 0; i < argArray.length; i++) { argArray[i] = (String) binArgs.get(i); } /*for (int i = 0; i < argArray.length; i++) { System.out.print(argArray[i] + " "); } System.out.println(); */ // Fork process return Runtime.getRuntime().exec(argArray); } public static void redirectStream(final InputStream in, final OutputStream out, final String streamName) { Thread stdoutTransferThread = new Thread() { public void run() { PrintWriter pw = new PrintWriter(new OutputStreamWriter(out), true); try { BufferedReader reader = new BufferedReader( new InputStreamReader(in)); String line; while ((line = reader.readLine()) != null) { pw.print("["); pw.print(streamName); pw.print("] "); pw.println(line); } } catch (Throwable e) { e.printStackTrace(); // throw new Error(e); } } }; stdoutTransferThread.start(); } }
5,918
0
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/processmanager
Create_ds/geronimo-yoko/yoko-core/src/test/java/org/apache/yoko/processmanager/internal/ProcessAgentImpl.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.processmanager.internal; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.rmi.server.UnicastRemoteObject; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import org.apache.yoko.osgi.ProviderLocator; public class ProcessAgentImpl extends UnicastRemoteObject implements ProcessAgent { private static final long serialVersionUID = 1L; private String name; private ProcessManagerRemoteIF processManager; protected ProcessAgentImpl() throws RemoteException { super(); } private CountDownLatch shutdownCountDown = new CountDownLatch(1); private boolean agentExited = false; private boolean exitedFromParent = false; private int exitCode = 0; private Thread shutdownHook, mainThread; public String getName() { return name; } private void init(String name, ProcessManagerRemoteIF processManager) { this.name = name; this.processManager = processManager; this.mainThread = Thread.currentThread(); try { processManager.agentReady(this); } catch (RemoteException e) { e.printStackTrace(); System.exit(1); } } /** this is the main routine run in test agents */ public static void main(String[] args) throws Exception { String agentName = args[0]; String registryHost = args[1]; int registryPort = Integer.parseInt(args[2]); String processManagerName = args[3]; Registry reg = LocateRegistry.getRegistry(registryHost, registryPort); final ProcessAgentImpl agent = new ProcessAgentImpl(); agent.shutdownHook = new Thread(new Runnable() { public void run() { agent.shutdownCountDown.countDown(); try { agent.mainThread.join(); } catch (InterruptedException e) { e.printStackTrace(); } } }); Runtime.getRuntime().addShutdownHook(agent.shutdownHook); ProcessManagerRemoteIF manager = (ProcessManagerRemoteIF) reg.lookup(processManagerName); agent.init(agentName,manager); agent.waitForShutdown(); agent.notifyManagerOnExit(); if(agent.exitedFromParent) { Runtime.getRuntime().removeShutdownHook(agent.shutdownHook); System.exit(agent.exitCode); } } public static void startLocalProcess(ProcessManagerRemoteIF manager, String agentName) throws Exception { new ProcessAgentImpl().init(agentName,manager); } private void waitForShutdown() { try { while(true) { if(shutdownCountDown.await(1000, TimeUnit.MILLISECONDS)) { break; } // Throws RemoteException if processManager is gone. processManager.isAlive(); } } catch(Exception e) { // Parent process died. Runtime.getRuntime().removeShutdownHook(shutdownHook); System.exit(1); } } private void notifyManagerOnExit() { try { if(!agentExited) { processManager.agentExited(this); agentExited = true; } } catch(Exception e) { e.printStackTrace(); } } public void exit(int exitCode) throws RemoteException { this.exitedFromParent = true; this.exitCode = exitCode; shutdownCountDown.countDown(); } public Object invokeStatic(String className, String methodName, Object[] args) { try { Class[] parameters = new Class[args.length]; for(int i = 0; i < parameters.length; i++) { parameters[i] = args[i].getClass(); } // get the appropriate class for the loading. ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class cl = ProviderLocator.loadClass(className, getClass(), loader); Method method = cl.getMethod(methodName, parameters); return method.invoke(null, args); } catch(InvocationTargetException e) { return e; } catch(Exception e) { throw new Error(e); } } }
5,919
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestObjectExceptionsExt_2_3.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import static org.junit.Assert.assertTrue; import org.omg.CORBA.*; public class TestObjectExceptionsExt_2_3 extends test.common.TestBase implements TestObject { private ORB m_orb; ORBTest.Intf m_test_intf; public TestObjectExceptionsExt_2_3(ORB orb, ORBTest.Intf test_intf) { m_orb = orb; m_test_intf = test_intf; } public boolean is_supported(org.omg.CORBA.Object obj) { boolean is_supported = false; if (obj != null) { try { ORBTest_ExceptionsExt_2_3.Intf ti = (ORBTest_ExceptionsExt_2_3.IntfHelper .narrow(obj)); is_supported = true; } catch (BAD_PARAM e) { is_supported = false; } } return is_supported; } public void test_SII(org.omg.CORBA.Object obj) { ORBTest_ExceptionsExt_2_3.Intf ti = (ORBTest_ExceptionsExt_2_3.IntfHelper .narrow(obj)); try { ti.op_CODESET_INCOMPATIBLE_Ex(); assertTrue(false); } catch (CODESET_INCOMPATIBLE ex) { assertTrue(ex.minor == 31); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_REBIND_Ex(); assertTrue(false); } catch (REBIND ex) { assertTrue(ex.minor == 32); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_TIMEOUT_Ex(); assertTrue(false); } catch (TIMEOUT ex) { assertTrue(ex.minor == 33); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_TRANSACTION_UNAVAILABLE_Ex(); assertTrue(false); } catch (TRANSACTION_UNAVAILABLE ex) { assertTrue(ex.minor == 34); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_TRANSACTION_MODE_Ex(); assertTrue(false); } catch (TRANSACTION_MODE ex) { assertTrue(ex.minor == 35); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_BAD_QOS_Ex(); assertTrue(false); } catch (BAD_QOS ex) { assertTrue(ex.minor == 36); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } } public void test_DII(org.omg.CORBA.Object obj) { // REVISIT } }
5,920
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestCaseHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/TestCase:1.0 // final public class TestCaseHelper { public static void insert(org.omg.CORBA.Any any, TestCase val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static TestCase extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[2]; members[0] = new org.omg.CORBA.StructMember(); members[0].name = "impl_description"; members[0].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_string); members[1] = new org.omg.CORBA.StructMember(); members[1].name = "impl"; members[1].type = orb.create_interface_tc("IDL:omg.org/CORBA/Object:1.0", "Object"); typeCode_ = orb.create_struct_tc(id(), "TestCase", members); } return typeCode_; } public static String id() { return "IDL:ORBTest/TestCase:1.0"; } public static TestCase read(org.omg.CORBA.portable.InputStream in) { TestCase _ob_v = new TestCase(); _ob_v.impl_description = in.read_string(); _ob_v.impl = in.read_Object(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, TestCase val) { out.write_string(val.impl_description); out.write_Object(val.impl); } }
5,921
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfLongLong_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; final class TestIntfLongLong_impl extends ORBTest_LongLong.IntfPOA { private POA m_poa; private long m_aLongLong; private long m_aULongLong; public TestIntfLongLong_impl(POA poa) { m_poa = poa; } public synchronized long attrLongLong() { return m_aLongLong; } public synchronized void attrLongLong(long value) { m_aLongLong = value; } public synchronized long opLongLong(long a0, LongHolder a1, LongHolder a2) { m_aLongLong = a0 + a1.value; a1.value = a2.value = m_aLongLong; return m_aLongLong; } public synchronized long opLongLongEx(long a0, LongHolder a1, LongHolder a2) throws ORBTest_LongLong.ExLongLong { m_aLongLong = a0 + a1.value; throw new ORBTest_LongLong.ExLongLong(m_aLongLong); } public synchronized long attrULongLong() { return m_aULongLong; } public synchronized void attrULongLong(long value) { m_aULongLong = value; } public synchronized long opULongLong(long a0, LongHolder a1, LongHolder a2) { m_aULongLong = a0 + a1.value; a1.value = a2.value = m_aULongLong; return m_aULongLong; } public synchronized long opULongLongEx(long a0, LongHolder a1, LongHolder a2) throws ORBTest_LongLong.ExULongLong { m_aULongLong = a0 + a1.value; throw new ORBTest_LongLong.ExULongLong(m_aULongLong); } public org.omg.PortableServer.POA _default_POA() { return m_poa; } }
5,922
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfStubTimeout_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; final class TestIntfStubTimeout_impl extends ORBTest_StubTimeout.IntfPOA { private POA m_poa; public TestIntfStubTimeout_impl(POA poa) { m_poa = poa; } public synchronized void sleep_oneway(int sec) { try { Thread.currentThread().sleep(sec * 1000); } catch (java.lang.InterruptedException ex) { } } public synchronized void sleep_twoway(int sec) { try { Thread.currentThread().sleep(sec * 1000); } catch (java.lang.InterruptedException ex) { } } public org.omg.PortableServer.POA _default_POA() { return m_poa; } }
5,923
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfExceptionsExt_2_0_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; final class TestIntfExceptionsExt_2_0_impl extends ORBTest_ExceptionsExt_2_0.IntfPOA { private POA m_poa; public TestIntfExceptionsExt_2_0_impl(POA poa) { m_poa = poa; } public synchronized void op_PERSIST_STORE_Ex() { throw new PERSIST_STORE(16, CompletionStatus.COMPLETED_YES); } public synchronized void op_FREE_MEM_Ex() { throw new FREE_MEM(19, CompletionStatus.COMPLETED_YES); } public synchronized void op_INV_IDENT_Ex() { throw new INV_IDENT(20, CompletionStatus.COMPLETED_NO); } public synchronized void op_INV_FLAG_Ex() { throw new INV_FLAG(21, CompletionStatus.COMPLETED_MAYBE); } public synchronized void op_INTF_REPOS_Ex() { throw new INTF_REPOS(22, CompletionStatus.COMPLETED_YES); } public synchronized void op_BAD_CONTEXT_Ex() { throw new BAD_CONTEXT(23, CompletionStatus.COMPLETED_NO); } public synchronized void op_TRANSACTION_REQUIRED_Ex() { throw new TRANSACTION_REQUIRED(27, CompletionStatus.COMPLETED_NO); } public synchronized void op_TRANSACTION_ROLLEDBACK_Ex() { throw new TRANSACTION_ROLLEDBACK(28, CompletionStatus.COMPLETED_NO); } public synchronized void op_INVALID_TRANSACTION_Ex() { throw new INVALID_TRANSACTION(29, CompletionStatus.COMPLETED_NO); } public org.omg.PortableServer.POA _default_POA() { return m_poa; } }
5,924
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestCaseHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/TestCase:1.0 // final public class TestCaseHolder implements org.omg.CORBA.portable.Streamable { public TestCase value; public TestCaseHolder() { } public TestCaseHolder(TestCase initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = TestCaseHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { TestCaseHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return TestCaseHelper.type(); } }
5,925
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/Client.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import java.util.Properties; import org.omg.CORBA.*; public class Client extends test.common.TestBase { public static int run(ORB orb, boolean local, String[] args) throws org.omg.CORBA.UserException { // // Get TestIntf // String refFile = "TestIntf.ref"; // // Get the stringified IOR // String impl; try { java.io.FileInputStream file = new java.io.FileInputStream(refFile); java.io.BufferedReader in = new java.io.BufferedReader( new java.io.InputStreamReader(file)); impl = in.readLine(); file.close(); } catch (java.io.IOException ex) { System.err.println("Can't read from `" + ex.getMessage() + "'"); return 1; } // // Run tests // System.out.print("Testing string_to_object()... "); System.out.flush(); org.omg.CORBA.Object obj = orb.string_to_object(impl); System.out.println("Done!"); System.out.print("Testing narrow()... "); System.out.flush(); ORBTest.Intf ti = ORBTest.IntfHelper.narrow(obj); System.out.println("Done!"); TestObjectBasic test_basic = new TestObjectBasic(orb, ti); TestObjectContext test_context = new TestObjectContext(orb, ti); TestObjectExceptions test_exceptions = (new TestObjectExceptions(orb, ti)); TestObjectExceptionsExt_2_0 test_exceptions_ext_2_0 = (new TestObjectExceptionsExt_2_0( orb, ti)); TestObjectWChar test_wchar = new TestObjectWChar(orb, ti); TestObjectFixed test_fixed = new TestObjectFixed(orb, ti); TestObjectLongLong test_long_long = new TestObjectLongLong(orb, ti); TestObjectExceptionsExt_2_3 test_exceptions_ext_2_3 = (new TestObjectExceptionsExt_2_3( orb, ti)); TestObjectStubTimeout test_stub_timeout = (new TestObjectStubTimeout( orb, ti, local)); ORBTest.TestCase[] test_case_list = ti.get_test_case_list(); ORBTest.TestDefn test_defns[] = { new ORBTest.TestDefn("2.0 types", test_basic), new ORBTest.TestDefn("2.0 Contexts", test_context), new ORBTest.TestDefn("2.0 Exceptions", test_exceptions), new ORBTest.TestDefn("2.0 non-OBE Exceptions", test_exceptions_ext_2_0), new ORBTest.TestDefn("2.3 types", test_wchar), new ORBTest.TestDefn("2.3 Fixed", test_fixed), new ORBTest.TestDefn("2.3 LongLong", test_long_long), new ORBTest.TestDefn("2.3 Exceptions", test_exceptions_ext_2_3), new ORBTest.TestDefn("timeouts", test_stub_timeout) }; // Run the SII tests // for (int i = 0; i < test_case_list.length; ++i) { for (int j = 0; j < test_defns.length; ++j) { if (test_defns[j].test_object().is_supported( test_case_list[i].impl)) { System.out.print("Testing the SII with the "); System.out.print(test_case_list[i].impl_description + " implementation and "); System.out.print(test_defns[j].description() + "... "); System.out.flush(); test_defns[j].test_object() .test_SII(test_case_list[i].impl); System.out.println("Done!"); } } } // Run the DII tests // for (int i = 0; i < test_case_list.length; ++i) { for (int j = 0; j < test_defns.length; ++j) { if (test_defns[j].test_object().is_supported( test_case_list[i].impl)) { System.out.print("Testing the DII with the "); System.out.print(test_case_list[i].impl_description + " implementation and "); System.out.print(test_defns[j].description() + "... "); System.out.flush(); test_defns[j].test_object() .test_DII(test_case_list[i].impl); System.out.println("Done!"); } } } TestPolicyIntf.run(orb); // // Deactivate the server // ORBType ORB_type = ti.get_ORB_type(); if (ORB_type == ORBType.ORBacus3) { try { ti.deactivate(); } catch (TRANSIENT ex) { } } else { ti.deactivate(); } return 0; } public static void main(String[] args) { java.util.Properties props = new Properties(); props.putAll(System.getProperties()); props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB"); props.put("org.omg.CORBA.ORBSingletonClass", "org.apache.yoko.orb.CORBA.ORBSingleton"); int status = 0; ORB orb = null; try { orb = ORB.init(args, props); status = run(orb, false, args); } catch (Exception ex) { ex.printStackTrace(); status = 1; } if (orb != null) { try { orb.destroy(); } catch (Exception ex) { ex.printStackTrace(); status = 1; } } System.exit(status); } }
5,926
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfContext_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; import ORBTest_Context.*; final class TestIntfContext_impl extends ORBTest_Context.IntfPOA { private POA m_poa; public TestIntfContext_impl(POA poa) { m_poa = poa; } public synchronized String[] opContext(String pattern, Context ctx) { NVList values = ctx.get_values("", 0, pattern); int len = values.count(); String[] result = new String[len * 2]; for (int i = 0; i < len; i++) { try { String s = values.item(i).value().extract_string(); result[i * 2] = values.item(i).name(); result[i * 2 + 1] = s; } catch (org.omg.CORBA.Bounds ex) { } } return result; } public org.omg.PortableServer.POA _default_POA() { return m_poa; } }
5,927
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfFixedDSI_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; class TestIntfFixedDSI_impl extends org.omg.PortableServer.DynamicImplementation { private ORB m_orb; private ORBTest_Fixed.Intf m_ti; TestIntfFixedDSI_impl(ORB orb, ORBTest_Fixed.Intf ti) { m_orb = orb; m_ti = ti; } static final String[] m_ids = { "IDL:ORBTest_Fixed/Intf:1.0" }; public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] object_id) { return m_ids; } public void invoke(ServerRequest request) { String name = request.operation(); boolean ex; if (name.length() > 2 && name.endsWith("Ex")) { name = name.substring(0, name.length() - 2); ex = true; } else { ex = false; } if (name.equals("_get_attrFixed")) { NVList list = m_orb.create_list(0); request.arguments(list); java.math.BigDecimal ret = m_ti.attrFixed(); Any any = m_orb.create_any(); any.insert_fixed(ret, m_orb.create_fixed_tc((short) 24, (short) 8)); request.set_result(any); return; } if (name.equals("_set_attrFixed")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.create_fixed_tc((short) 24, (short) 8)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); java.math.BigDecimal arg = any.extract_fixed(); m_ti.attrFixed(arg); return; } if (name.equals("opFixed")) { NVList list = m_orb.create_list(0); TypeCode tcFixed = m_orb.create_fixed_tc((short) 24, (short) 8); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(tcFixed); any1.type(tcFixed); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); java.math.BigDecimal arg0 = any0.extract_fixed(); FixedHolder arg1 = new FixedHolder(); arg1.value = any1.extract_fixed(); FixedHolder arg2 = new FixedHolder(); java.math.BigDecimal ret = m_ti.opFixed(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Fixed.ExFixedHelper.insert(exAny, new ORBTest_Fixed.ExFixed(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_fixed(ret, tcFixed); request.set_result(result); any1.insert_fixed(arg1.value, tcFixed); any2.insert_fixed(arg2.value, tcFixed); } return; } System.err.println("DSI implementation: unknown operation: " + name); NVList list = m_orb.create_list(0); request.arguments(list); Any exAny = m_orb.create_any(); BAD_OPERATIONHelper.insert(exAny, new BAD_OPERATION()); request.set_exception(exAny); } }
5,928
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/IntfPOATie.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/Intf:1.0 // public class IntfPOATie extends IntfPOA { private IntfOperations _ob_delegate_; private org.omg.PortableServer.POA _ob_poa_; public IntfPOATie(IntfOperations delegate) { _ob_delegate_ = delegate; } public IntfPOATie(IntfOperations delegate, org.omg.PortableServer.POA poa) { _ob_delegate_ = delegate; _ob_poa_ = poa; } public IntfOperations _delegate() { return _ob_delegate_; } public void _delegate(IntfOperations delegate) { _ob_delegate_ = delegate; } public org.omg.PortableServer.POA _default_POA() { if(_ob_poa_ != null) return _ob_poa_; else return super._default_POA(); } // // IDL:ORBTest/Intf/get_ORB_type:1.0 // public ORBType get_ORB_type() { return _ob_delegate_.get_ORB_type(); } // // IDL:ORBTest/Intf/deactivate:1.0 // public void deactivate() { _ob_delegate_.deactivate(); } // // IDL:ORBTest/Intf/concurrent_request_execution:1.0 // public boolean concurrent_request_execution() { return _ob_delegate_.concurrent_request_execution(); } // // IDL:ORBTest/Intf/get_test_case_list:1.0 // public TestCase[] get_test_case_list() { return _ob_delegate_.get_test_case_list(); } }
5,929
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/Collocated.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import java.util.Properties; import org.omg.CORBA.*; import org.omg.PortableServer.*; public class Collocated extends test.common.TestBase { public static void main(String[] args) { java.util.Properties props = new Properties(); props.putAll(System.getProperties()); props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB"); props.put("org.omg.CORBA.ORBSingletonClass", "org.apache.yoko.orb.CORBA.ORBSingleton"); int status = 0; ORB orb = null; try { orb = ORB.init(args, props); status = Server.run(orb, true, args); if (status == 0) { status = Client.run(orb, true, args); // // The ORB must be totally shutdown before the // servants are deleted. // orb.shutdown(true); Server.cleanup(); } } catch (Exception ex) { ex.printStackTrace(); status = 1; } if (orb != null) { try { orb.destroy(); } catch (Exception ex) { ex.printStackTrace(); status = 1; } } System.exit(status); } }
5,930
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfLongLongDSI_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; class TestIntfLongLongDSI_impl extends org.omg.PortableServer.DynamicImplementation { private ORB m_orb; private ORBTest_LongLong.Intf m_ti; TestIntfLongLongDSI_impl(ORB orb, ORBTest_LongLong.Intf ti) { m_orb = orb; m_ti = ti; } static final String[] m_ids = { "IDL:ORBTest_LongLong/Intf:1.0" }; public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] object_id) { return m_ids; } public void invoke(ServerRequest request) { String name = request.operation(); boolean ex; if (name.length() > 2 && name.endsWith("Ex")) { name = name.substring(0, name.length() - 2); ex = true; } else { ex = false; } if (name.equals("_get_attrLongLong")) { NVList list = m_orb.create_list(0); request.arguments(list); long ret = m_ti.attrLongLong(); Any any = m_orb.create_any(); any.insert_longlong(ret); request.set_result(any); return; } if (name.equals("_set_attrLongLong")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_longlong)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); long arg = any.extract_longlong(); m_ti.attrLongLong(arg); return; } if (name.equals("opLongLong")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_longlong)); any1.type(m_orb.get_primitive_tc(TCKind.tk_longlong)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); long arg0 = any0.extract_longlong(); LongHolder arg1 = new LongHolder(); arg1.value = any1.extract_longlong(); LongHolder arg2 = new LongHolder(); long ret = m_ti.opLongLong(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_LongLong.ExLongLongHelper.insert(exAny, new ORBTest_LongLong.ExLongLong(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_longlong(ret); request.set_result(result); any1.insert_longlong(arg1.value); any2.insert_longlong(arg2.value); } return; } if (name.equals("_get_attrULongLong")) { NVList list = m_orb.create_list(0); request.arguments(list); long ret = m_ti.attrULongLong(); Any any = m_orb.create_any(); any.insert_ulonglong(ret); request.set_result(any); return; } if (name.equals("_set_attrULongLong")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_ulonglong)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); long arg = any.extract_ulonglong(); m_ti.attrULongLong(arg); return; } if (name.equals("opULongLong")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_ulonglong)); any1.type(m_orb.get_primitive_tc(TCKind.tk_ulonglong)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); long arg0 = any0.extract_ulonglong(); LongHolder arg1 = new LongHolder(); arg1.value = any1.extract_ulonglong(); LongHolder arg2 = new LongHolder(); long ret = m_ti.opULongLong(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_LongLong.ExULongLongHelper.insert(exAny, new ORBTest_LongLong.ExULongLong(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_ulonglong(ret); request.set_result(result); any1.insert_ulonglong(arg1.value); any2.insert_ulonglong(arg2.value); } return; } System.err.println("DSI implementation: unknown operation: " + name); NVList list = m_orb.create_list(0); request.arguments(list); Any exAny = m_orb.create_any(); BAD_OPERATIONHelper.insert(exAny, new BAD_OPERATION()); request.set_exception(exAny); } }
5,931
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfStubTimeoutDSI_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; class TestIntfStubTimeoutDSI_impl extends org.omg.PortableServer.DynamicImplementation { private ORB m_orb; private ORBTest_StubTimeout.Intf m_ti; TestIntfStubTimeoutDSI_impl(ORB orb, ORBTest_StubTimeout.Intf ti) { m_orb = orb; m_ti = ti; } static final String[] m_ids = { "IDL:ORBTest_StubTimeout/Intf:1.0" }; public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] object_id) { return m_ids; } public void invoke(ServerRequest request) { String name = request.operation(); if (name.equals("sleep_oneway")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_ulong)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); int arg = any.extract_ulong(); m_ti.sleep_oneway(arg); return; } if (name.equals("sleep_twoway")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_ulong)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); int arg = any.extract_ulong(); m_ti.sleep_twoway(arg); return; } System.err.println("DSI implementation: unknown operation: " + name); NVList list = m_orb.create_list(0); request.arguments(list); Any exAny = m_orb.create_any(); BAD_OPERATIONHelper.insert(exAny, new BAD_OPERATION()); request.set_exception(exAny); } }
5,932
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfContextDSI_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; class TestIntfContextDSI_impl extends org.omg.PortableServer.DynamicImplementation { private ORB m_orb; private ORBTest_Context.Intf m_ti; TestIntfContextDSI_impl(ORB orb, ORBTest_Context.Intf ti) { m_orb = orb; m_ti = ti; } static final String[] m_ids = { "IDL:ORBTest_Context/Intf:1.0" }; public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] object_id) { return m_ids; } public void invoke(ServerRequest request) { String name = request.operation(); boolean ex; if (name.length() > 2 && name.endsWith("Ex")) { name = name.substring(0, name.length() - 2); ex = true; } else ex = false; if (name.equals("opContext")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_string)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); org.omg.CORBA.Context context = request.ctx(); String pattern = any.extract_string(); try { String[] ret = m_ti.opContext(pattern, context); Any result = m_orb.create_any(); ORBTest_Context.StringSequenceHelper.insert(result, ret); request.set_result(result); } catch (BAD_CONTEXT e) { Any anyEx = m_orb.create_any(); BAD_CONTEXTHelper.insert(anyEx, e); request.set_exception(anyEx); } return; } System.err.println("DSI implementation: unknown operation: " + name); NVList list = m_orb.create_list(0); request.arguments(list); Any exAny = m_orb.create_any(); BAD_OPERATIONHelper.insert(exAny, new BAD_OPERATION()); request.set_exception(exAny); } }
5,933
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestPolicyIntf.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import static org.junit.Assert.assertTrue; import org.omg.CORBA.ORB; import org.omg.CORBA.ORBPackage.InvalidName; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_PARAM; import org.omg.CORBA.Policy; import org.omg.CORBA.PolicyManager; import org.omg.CORBA.PolicyManagerHelper; import org.omg.CORBA.SetOverrideType; import org.omg.CORBA.PolicyError; import org.omg.CORBA.InvalidPolicies; import org.apache.yoko.orb.OB.RetryPolicy; import org.apache.yoko.orb.OB.RetryPolicyHelper; import org.apache.yoko.orb.OB.TimeoutPolicy; import org.apache.yoko.orb.OB.TimeoutPolicyHelper; import org.apache.yoko.orb.OB.MinorCodes; import ORBTest_Basic.*; public class TestPolicyIntf extends test.common.TestBase { static void run(ORB orb) { PolicyManager pm = null; try { pm = PolicyManagerHelper.narrow(orb .resolve_initial_references("ORBPolicyManager")); } catch (InvalidName ex) { assertTrue(false); } assertTrue(pm != null); int[] policyTypes = new int[0]; Policy[] origPolicies = pm.get_policy_overrides(policyTypes); { try { Policy[] pl = new Policy[1]; Any any = orb.create_any(); any.insert_short(org.apache.yoko.orb.OB.RETRY_ALWAYS.value); pl[0] = orb.create_policy( org.apache.yoko.orb.OB.RETRY_POLICY_ID.value, any); pm.set_policy_overrides(pl, SetOverrideType.ADD_OVERRIDE); } catch (PolicyError ex) { assertTrue(false); } catch (InvalidPolicies ex) { assertTrue(false); } policyTypes = new int[1]; policyTypes[0] = org.apache.yoko.orb.OB.RETRY_POLICY_ID.value; Policy[] policy = pm.get_policy_overrides(policyTypes); assertTrue(policy.length == 1 && policy[0].policy_type() == org.apache.yoko.orb.OB.RETRY_POLICY_ID.value); RetryPolicy p = RetryPolicyHelper.narrow(policy[0]); assertTrue(p.retry_mode() == org.apache.yoko.orb.OB.RETRY_ALWAYS.value); } { try { Policy[] pl = new Policy[2]; Any any = orb.create_any(); any.insert_short(org.apache.yoko.orb.OB.RETRY_STRICT.value); pl[0] = orb.create_policy( org.apache.yoko.orb.OB.RETRY_POLICY_ID.value, any); any = orb.create_any(); any.insert_ulong(3000); pl[1] = orb.create_policy( org.apache.yoko.orb.OB.TIMEOUT_POLICY_ID.value, any); pm.set_policy_overrides(pl, SetOverrideType.ADD_OVERRIDE); } catch (PolicyError ex) { assertTrue(false); } catch (InvalidPolicies ex) { assertTrue(false); } policyTypes = new int[2]; policyTypes[0] = org.apache.yoko.orb.OB.RETRY_POLICY_ID.value; policyTypes[1] = org.apache.yoko.orb.OB.TIMEOUT_POLICY_ID.value; Policy[] policies = pm.get_policy_overrides(policyTypes); assertTrue(policies.length == 2); for (int i = 0; i < policies.length; ++i) { switch (policies[i].policy_type()) { case org.apache.yoko.orb.OB.RETRY_POLICY_ID.value: { try { RetryPolicy policy = RetryPolicyHelper .narrow(policies[i]); assertTrue(policy != null); assertTrue(policy.retry_mode() == org.apache.yoko.orb.OB.RETRY_STRICT.value); } catch (BAD_PARAM ex) { assertTrue(false); } break; } case org.apache.yoko.orb.OB.TIMEOUT_POLICY_ID.value: { try { TimeoutPolicy policy = TimeoutPolicyHelper .narrow(policies[i]); assertTrue(policy != null); assertTrue(policy.value() == 3000); } catch (BAD_PARAM ex) { assertTrue(false); } break; } default: assertTrue(("org.omg.CORBA.PolicyManager.get_policy_overrides()" + " returned policies with unexpected types") == null); } } } { try { Any any = orb.create_any(); any.insert_short(org.apache.yoko.orb.OB.RETRY_ALWAYS.value); Policy[] pl = new Policy[2]; pl[0] = orb.create_policy( org.apache.yoko.orb.OB.RETRY_POLICY_ID.value, any); pl[1] = orb.create_policy( org.apache.yoko.orb.OB.RETRY_POLICY_ID.value, any); pm.set_policy_overrides(pl, SetOverrideType.ADD_OVERRIDE); assertTrue(("org.omg.CORBA.PolicyManager.set_policy_overrides() " + "BAD_PARAM(30, COMPLETED_NO) expected") == null); } catch (PolicyError ex) { assertTrue(false); } catch (InvalidPolicies ex) { assertTrue(false); } catch (BAD_PARAM ex) { assertTrue(ex.minor == MinorCodes.MinorDuplicatePolicyType); } // // Reset original policies. // try { pm.set_policy_overrides(origPolicies, SetOverrideType.SET_OVERRIDE); } catch (InvalidPolicies ex) { assertTrue(false); } policyTypes = new int[0]; Policy[] current = pm.get_policy_overrides(policyTypes); assertTrue(current.length == origPolicies.length); for (int i = 0; i < current.length; ++i) { boolean matched = false; for (int j = 0; j < origPolicies.length; ++j) { if (current[i].policy_type() == origPolicies[j] .policy_type()) { matched = true; break; } } assertTrue(matched); } } } }
5,934
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestObject.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; public interface TestObject { boolean is_supported(org.omg.CORBA.Object obj); void test_SII(org.omg.CORBA.Object obj); void test_DII(org.omg.CORBA.Object obj); }
5,935
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestObjectExceptions.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import static org.junit.Assert.assertTrue; import org.omg.CORBA.*; public class TestObjectExceptions extends test.common.TestBase implements TestObject { private ORB m_orb; ORBTest.Intf m_test_intf; public TestObjectExceptions(ORB orb, ORBTest.Intf test_intf) { m_orb = orb; m_test_intf = test_intf; } public boolean is_supported(org.omg.CORBA.Object obj) { boolean is_supported = false; if (obj != null) { try { ORBTest_Exceptions.Intf ti = (ORBTest_Exceptions.IntfHelper .narrow(obj)); is_supported = true; } catch (BAD_PARAM e) { is_supported = false; } } return is_supported; } public void test_SII(org.omg.CORBA.Object obj) { ORBTest_Exceptions.Intf ti = (ORBTest_Exceptions.IntfHelper.narrow(obj)); try { ti.op_UNKNOWN_Ex(); assertTrue(false); } catch (UNKNOWN ex) { assertTrue(ex.minor == 1); assertTrue(ex.completed == CompletionStatus.COMPLETED_YES); } try { ti.op_BAD_PARAM_Ex(); assertTrue(false); } catch (BAD_PARAM ex) { assertTrue(ex.minor == 2); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_NO_MEMORY_Ex(); assertTrue(false); } catch (NO_MEMORY ex) { assertTrue(ex.minor == 3); assertTrue(ex.completed == CompletionStatus.COMPLETED_MAYBE); } try { ti.op_IMP_LIMIT_Ex(); assertTrue(false); } catch (IMP_LIMIT ex) { assertTrue(ex.minor == 4); assertTrue(ex.completed == CompletionStatus.COMPLETED_YES); } try { ti.op_COMM_FAILURE_Ex(); assertTrue(false); } catch (COMM_FAILURE ex) { assertTrue(ex.minor == 5); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_INV_OBJREF_Ex(); assertTrue(false); } catch (INV_OBJREF ex) { assertTrue(ex.minor == 6); assertTrue(ex.completed == CompletionStatus.COMPLETED_MAYBE); } try { ti.op_NO_PERMISSION_Ex(); assertTrue(false); } catch (NO_PERMISSION ex) { assertTrue(ex.minor == 7); assertTrue(ex.completed == CompletionStatus.COMPLETED_YES); } try { ti.op_INTERNAL_Ex(); assertTrue(false); } catch (INTERNAL ex) { assertTrue(ex.minor == 8); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_MARSHAL_Ex(); assertTrue(false); } catch (MARSHAL ex) { assertTrue(ex.minor == 9); assertTrue(ex.completed == CompletionStatus.COMPLETED_MAYBE); } try { ti.op_INITIALIZE_Ex(); assertTrue(false); } catch (INITIALIZE ex) { assertTrue(ex.minor == 10); assertTrue(ex.completed == CompletionStatus.COMPLETED_YES); } try { ti.op_NO_IMPLEMENT_Ex(); assertTrue(false); } catch (NO_IMPLEMENT ex) { assertTrue(ex.minor == 11); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_BAD_TYPECODE_Ex(); assertTrue(false); } catch (BAD_TYPECODE ex) { assertTrue(ex.minor == 12); assertTrue(ex.completed == CompletionStatus.COMPLETED_MAYBE); } try { ti.op_BAD_OPERATION_Ex(); assertTrue(false); } catch (BAD_OPERATION ex) { assertTrue(ex.minor == 13); assertTrue(ex.completed == CompletionStatus.COMPLETED_YES); } try { ti.op_NO_RESOURCES_Ex(); assertTrue(false); } catch (NO_RESOURCES ex) { assertTrue(ex.minor == 14); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_NO_RESPONSE_Ex(); assertTrue(false); } catch (NO_RESPONSE ex) { assertTrue(ex.minor == 15); assertTrue(ex.completed == CompletionStatus.COMPLETED_MAYBE); } try { ti.op_BAD_INV_ORDER_Ex(); assertTrue(false); } catch (BAD_INV_ORDER ex) { assertTrue(ex.minor == 17); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_TRANSIENT_Ex(); assertTrue(false); } catch (TRANSIENT ex) { assertTrue(ex.minor == 18); assertTrue(ex.completed == CompletionStatus.COMPLETED_MAYBE); } try { ti.op_OBJ_ADAPTER_Ex(); assertTrue(false); } catch (OBJ_ADAPTER ex) { assertTrue(ex.minor == 24); assertTrue(ex.completed == CompletionStatus.COMPLETED_MAYBE); } try { ti.op_DATA_CONVERSION_Ex(); assertTrue(false); } catch (DATA_CONVERSION ex) { assertTrue(ex.minor == 25); assertTrue(ex.completed == CompletionStatus.COMPLETED_YES); } try { ti.op_OBJECT_NOT_EXIST_Ex(); assertTrue(false); } catch (OBJECT_NOT_EXIST ex) { assertTrue(ex.minor == 26); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_INV_POLICY_Ex(); assertTrue(false); } catch (INV_POLICY ex) { assertTrue(ex.minor == 30); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } } public void test_DII(org.omg.CORBA.Object obj) { ORBTest_Exceptions.Intf ti = (ORBTest_Exceptions.IntfHelper.narrow(obj)); Request request; try { request = ti._request("op_BAD_PARAM_Ex"); request.invoke(); Exception ex = request.env().exception(); assertTrue(ex != null); BAD_PARAM bp = (BAD_PARAM) ex; throw bp; } catch (BAD_PARAM ex) { assertTrue(ex.minor == 2); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } } }
5,936
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/ORBTypeHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/ORBType:1.0 // final public class ORBTypeHelper { public static void insert(org.omg.CORBA.Any any, ORBType val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static ORBType extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); String[] members = new String[5]; members[0] = "ORBacus3"; members[1] = "ORBacus4"; members[2] = "OrbixE"; members[3] = "Orbix3"; members[4] = "Orbix2000"; typeCode_ = orb.create_enum_tc(id(), "ORBType", members); } return typeCode_; } public static String id() { return "IDL:ORBTest/ORBType:1.0"; } public static ORBType read(org.omg.CORBA.portable.InputStream in) { ORBType _ob_v; _ob_v = ORBType.from_int(in.read_ulong()); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, ORBType val) { out.write_ulong(val.value()); } }
5,937
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/ORBTypeHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/ORBType:1.0 // final public class ORBTypeHolder implements org.omg.CORBA.portable.Streamable { public ORBType value; public ORBTypeHolder() { } public ORBTypeHolder(ORBType initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ORBTypeHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ORBTypeHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ORBTypeHelper.type(); } }
5,938
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/ORBType.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/ORBType:1.0 // /***/ public class ORBType implements org.omg.CORBA.portable.IDLEntity { private static ORBType [] values_ = new ORBType[5]; private int value_; public final static int _ORBacus3 = 0; public final static ORBType ORBacus3 = new ORBType(_ORBacus3); public final static int _ORBacus4 = 1; public final static ORBType ORBacus4 = new ORBType(_ORBacus4); public final static int _OrbixE = 2; public final static ORBType OrbixE = new ORBType(_OrbixE); public final static int _Orbix3 = 3; public final static ORBType Orbix3 = new ORBType(_Orbix3); public final static int _Orbix2000 = 4; public final static ORBType Orbix2000 = new ORBType(_Orbix2000); protected ORBType(int value) { values_[value] = this; value_ = value; } public int value() { return value_; } public static ORBType from_int(int value) { if(value < values_.length) return values_[value]; else throw new org.omg.CORBA.BAD_PARAM("Value (" + value + ") out of range", 25, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } private java.lang.Object readResolve() throws java.io.ObjectStreamException { return from_int(value()); } }
5,939
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfBasic_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; import ORBTest_Basic.*; final class TestIntfBasic_impl extends ORBTest_Basic.IntfPOA { private POA m_poa; private short m_aShort; private short m_aUShort; private int m_aLong; private int m_aULong; private float m_aFloat; private double m_aDouble; private boolean m_aBoolean; private char m_aChar; private byte m_aOctet; private String m_aString; private Any m_aAny; private ORBTest_Basic.TestEnum m_aTestEnum; private ORBTest_Basic.Intf m_aTestIntfBasic; private FixedStruct m_aFixedStruct; private VariableStruct m_aVariableStruct; private FixedUnion m_aFixedUnion; private VariableUnion m_aVariableUnion; private String[] m_aStringSequence; private short[][][] m_aFixedArray; private String[][] m_aVariableArray; private short[][][][] m_aFixedArraySequence; private String[][][] m_aVariableArraySequence; private short[][][][] m_aFixedArrayBoundSequence; private String[][][] m_aVariableArrayBoundSequence; private ORBTest_Basic.RecursiveStruct m_aRecursiveStruct; public TestIntfBasic_impl(POA poa) { m_poa = poa; } public synchronized void opVoid() { } public synchronized void opVoidEx() throws ExVoid { throw new ExVoid(); } public synchronized short attrShort() { return m_aShort; } public synchronized void attrShort(short value) { m_aShort = value; } public synchronized short opShort(short a0, ShortHolder a1, ShortHolder a2) { m_aShort = (short) (a0 + a1.value); a1.value = a2.value = m_aShort; return m_aShort; } public synchronized short opShortEx(short a0, ShortHolder a1, ShortHolder a2) throws ExShort { m_aShort = (short) (a0 + a1.value); throw new ExShort(m_aShort); } public synchronized int attrLong() { return m_aLong; } public synchronized void attrLong(int value) { m_aLong = value; } public synchronized int opLong(int a0, IntHolder a1, IntHolder a2) { m_aLong = a0 + a1.value; a1.value = a2.value = m_aLong; return m_aLong; } public synchronized int opLongEx(int a0, IntHolder a1, IntHolder a2) throws ExLong { m_aLong = a0 + a1.value; throw new ExLong(m_aLong); } public synchronized short attrUShort() { return m_aUShort; } public synchronized void attrUShort(short value) { m_aUShort = value; } public synchronized short opUShort(short a0, ShortHolder a1, ShortHolder a2) { m_aUShort = (short) (a0 + a1.value); a1.value = a2.value = m_aUShort; return m_aUShort; } public synchronized short opUShortEx(short a0, ShortHolder a1, ShortHolder a2) throws ExUShort { m_aUShort = (short) (a0 + a1.value); throw new ExUShort(m_aUShort); } public synchronized int attrULong() { return m_aULong; } public synchronized void attrULong(int value) { m_aULong = value; } public synchronized int opULong(int a0, IntHolder a1, IntHolder a2) { m_aULong = a0 + a1.value; a1.value = a2.value = m_aULong; return m_aULong; } public synchronized int opULongEx(int a0, IntHolder a1, IntHolder a2) throws ExULong { m_aULong = a0 + a1.value; throw new ExULong(m_aULong); } public synchronized float attrFloat() { return m_aFloat; } public synchronized void attrFloat(float value) { m_aFloat = value; } public synchronized float opFloat(float a0, FloatHolder a1, FloatHolder a2) { m_aFloat = a0 + a1.value; a1.value = a2.value = m_aFloat; return m_aFloat; } public synchronized float opFloatEx(float a0, FloatHolder a1, FloatHolder a2) throws ExFloat { m_aFloat = a0 + a1.value; throw new ExFloat(m_aFloat); } public synchronized double attrDouble() { return m_aDouble; } public synchronized void attrDouble(double value) { m_aDouble = value; } public synchronized double opDouble(double a0, DoubleHolder a1, DoubleHolder a2) { m_aDouble = a0 + a1.value; a1.value = a2.value = m_aDouble; return m_aDouble; } public synchronized double opDoubleEx(double a0, DoubleHolder a1, DoubleHolder a2) throws ExDouble { m_aDouble = a0 + a1.value; throw new ExDouble(m_aDouble); } public synchronized boolean attrBoolean() { return m_aBoolean; } public synchronized void attrBoolean(boolean value) { m_aBoolean = value; } public synchronized boolean opBoolean(boolean a0, BooleanHolder a1, BooleanHolder a2) { m_aBoolean = a0 && a1.value; a1.value = a2.value = m_aBoolean; return m_aBoolean; } public synchronized boolean opBooleanEx(boolean a0, BooleanHolder a1, BooleanHolder a2) throws ExBoolean { m_aBoolean = a0 && a1.value; throw new ExBoolean(m_aBoolean); } public synchronized char attrChar() { return m_aChar; } public synchronized void attrChar(char value) { m_aChar = value; } public synchronized char opChar(char a0, CharHolder a1, CharHolder a2) { m_aChar = (char) (a0 + a1.value); a1.value = a2.value = m_aChar; return m_aChar; } public synchronized char opCharEx(char a0, CharHolder a1, CharHolder a2) throws ExChar { m_aChar = (char) (a0 + a1.value); throw new ExChar(m_aChar); } public synchronized byte attrOctet() { return m_aOctet; } public synchronized void attrOctet(byte value) { m_aOctet = value; } public synchronized byte opOctet(byte a0, ByteHolder a1, ByteHolder a2) { m_aOctet = (byte) (a0 + a1.value); a1.value = a2.value = m_aOctet; return m_aOctet; } public synchronized byte opOctetEx(byte a0, ByteHolder a1, ByteHolder a2) throws ExOctet { m_aOctet = (byte) (a0 + a1.value); throw new ExOctet(m_aOctet); } public synchronized String attrString() { return m_aString; } public synchronized void attrString(String value) { m_aString = value; } public synchronized String opString(String a0, StringHolder a1, StringHolder a2) { m_aString = a0 + a1.value; a1.value = a2.value = m_aString; return m_aString; } public synchronized String opStringEx(String a0, StringHolder a1, StringHolder a2) throws ExString { m_aString = a0 + a1.value; throw new ExString(m_aString); } public synchronized Any attrAny() { return m_aAny; } public synchronized void attrAny(Any value) { m_aAny = value; } public synchronized Any opAny(Any a0, AnyHolder a1, AnyHolder a2) { m_aAny = a0; a1.value = a2.value = m_aAny; return m_aAny; } public synchronized Any opAnyEx(Any a0, AnyHolder a1, AnyHolder a2) throws ExAny { m_aAny = a0; throw new ExAny(m_aAny); } public synchronized ORBTest_Basic.TestEnum attrTestEnum() { return m_aTestEnum; } public synchronized void attrTestEnum(ORBTest_Basic.TestEnum value) { m_aTestEnum = value; } public synchronized ORBTest_Basic.TestEnum opTestEnum( ORBTest_Basic.TestEnum a0, ORBTest_Basic.TestEnumHolder a1, ORBTest_Basic.TestEnumHolder a2) { m_aTestEnum = a0; a1.value = a2.value = m_aTestEnum; return m_aTestEnum; } public synchronized ORBTest_Basic.TestEnum opTestEnumEx( ORBTest_Basic.TestEnum a0, ORBTest_Basic.TestEnumHolder a1, ORBTest_Basic.TestEnumHolder a2) throws ExTestEnum { m_aTestEnum = a0; throw new ExTestEnum(m_aTestEnum); } public synchronized ORBTest_Basic.Intf attrIntf() { return m_aTestIntfBasic; } public synchronized void attrIntf(ORBTest_Basic.Intf value) { m_aTestIntfBasic = value; } public synchronized ORBTest_Basic.Intf opIntf(ORBTest_Basic.Intf a0, ORBTest_Basic.IntfHolder a1, ORBTest_Basic.IntfHolder a2) { m_aTestIntfBasic = a0; a1.value = a2.value = m_aTestIntfBasic; return m_aTestIntfBasic; } public synchronized ORBTest_Basic.Intf opIntfEx(ORBTest_Basic.Intf a0, ORBTest_Basic.IntfHolder a1, ORBTest_Basic.IntfHolder a2) throws ORBTest_Basic.ExIntf { m_aTestIntfBasic = a0; throw new ORBTest_Basic.ExIntf(m_aTestIntfBasic); } public synchronized FixedStruct attrFixedStruct() { return m_aFixedStruct; } public synchronized void attrFixedStruct(FixedStruct value) { m_aFixedStruct = value; } public synchronized FixedStruct opFixedStruct(FixedStruct a0, FixedStructHolder a1, FixedStructHolder a2) { m_aFixedStruct = a0; a1.value = a2.value = m_aFixedStruct; return m_aFixedStruct; } public synchronized FixedStruct opFixedStructEx(FixedStruct a0, FixedStructHolder a1, FixedStructHolder a2) throws ExFixedStruct { m_aFixedStruct = a0; throw new ExFixedStruct(m_aFixedStruct); } public synchronized VariableStruct attrVariableStruct() { return m_aVariableStruct; } public synchronized void attrVariableStruct(VariableStruct value) { m_aVariableStruct = value; } public synchronized VariableStruct opVariableStruct(VariableStruct a0, VariableStructHolder a1, VariableStructHolder a2) { m_aVariableStruct = a0; a1.value = a2.value = m_aVariableStruct; return m_aVariableStruct; } public synchronized VariableStruct opVariableStructEx(VariableStruct a0, VariableStructHolder a1, VariableStructHolder a2) throws ExVariableStruct { m_aVariableStruct = a0; throw new ExVariableStruct(m_aVariableStruct); } public synchronized FixedUnion attrFixedUnion() { return m_aFixedUnion; } public synchronized void attrFixedUnion(FixedUnion value) { m_aFixedUnion = value; } public synchronized FixedUnion opFixedUnion(FixedUnion a0, FixedUnionHolder a1, FixedUnionHolder a2) { m_aFixedUnion = a0; a1.value = a2.value = m_aFixedUnion; return m_aFixedUnion; } public synchronized FixedUnion opFixedUnionEx(FixedUnion a0, FixedUnionHolder a1, FixedUnionHolder a2) throws ExFixedUnion { m_aFixedUnion = a0; throw new ExFixedUnion(m_aFixedUnion); } public synchronized VariableUnion attrVariableUnion() { return m_aVariableUnion; } public synchronized void attrVariableUnion(VariableUnion value) { m_aVariableUnion = value; } public synchronized VariableUnion opVariableUnion(VariableUnion a0, VariableUnionHolder a1, VariableUnionHolder a2) { m_aVariableUnion = a0; a1.value = a2.value = m_aVariableUnion; return m_aVariableUnion; } public synchronized VariableUnion opVariableUnionEx(VariableUnion a0, VariableUnionHolder a1, VariableUnionHolder a2) throws ExVariableUnion { m_aVariableUnion = a0; throw new ExVariableUnion(m_aVariableUnion); } public synchronized String[] attrStringSequence() { return m_aStringSequence; } public synchronized void attrStringSequence(String[] value) { m_aStringSequence = value; } public synchronized String[] opStringSequence(String[] a0, StringSequenceHolder a1, StringSequenceHolder a2) { m_aStringSequence = new String[a0.length + a1.value.length]; int idx = 0; for (int i = 0; i < a0.length; i++) { m_aStringSequence[idx++] = a0[i]; } for (int i = 0; i < a1.value.length; i++) { m_aStringSequence[idx++] = a1.value[i]; } a1.value = a2.value = m_aStringSequence; return m_aStringSequence; } public synchronized String[] opStringSequenceEx(String[] a0, StringSequenceHolder a1, StringSequenceHolder a2) throws ExStringSequence { m_aStringSequence = new String[a0.length + a1.value.length]; int idx = 0; for (int i = 0; i < a0.length; i++) { m_aStringSequence[idx++] = a0[i]; } for (int i = 0; i < a1.value.length; i++) { m_aStringSequence[idx++] = a1.value[i]; } throw new ExStringSequence(m_aStringSequence); } public synchronized short[][][] attrFixedArray() { return m_aFixedArray; } public synchronized void attrFixedArray(short[][][] value) { m_aFixedArray = value; } public synchronized short[][][] opFixedArray(short[][][] a0, FixedArrayHolder a1, FixedArrayHolder a2) { m_aFixedArray = a0; a1.value = a2.value = m_aFixedArray; return m_aFixedArray; } public synchronized short[][][] opFixedArrayEx(short[][][] a0, FixedArrayHolder a1, FixedArrayHolder a2) throws ExFixedArray { m_aFixedArray = a0; throw new ExFixedArray(m_aFixedArray); } public synchronized String[][] attrVariableArray() { return m_aVariableArray; } public synchronized void attrVariableArray(String[][] value) { m_aVariableArray = value; } public synchronized String[][] opVariableArray(String[][] a0, VariableArrayHolder a1, VariableArrayHolder a2) { m_aVariableArray = a0; a1.value = a2.value = m_aVariableArray; return m_aVariableArray; } public synchronized String[][] opVariableArrayEx(String[][] a0, VariableArrayHolder a1, VariableArrayHolder a2) throws ExVariableArray { m_aVariableArray = a0; throw new ExVariableArray(m_aVariableArray); } public synchronized short[][][][] attrFixedArraySequence() { return m_aFixedArraySequence; } public synchronized void attrFixedArraySequence(short[][][][] value) { m_aFixedArraySequence = value; } public synchronized short[][][][] opFixedArraySequence(short[][][][] a0, FixedArraySequenceHolder a1, FixedArraySequenceHolder a2) { m_aFixedArraySequence = new short[a0.length + a1.value.length][][][]; int idx = 0; for (int i = 0; i < a0.length; i++) { m_aFixedArraySequence[idx++] = a0[i]; } for (int i = 0; i < a1.value.length; i++) { m_aFixedArraySequence[idx++] = a1.value[i]; } a1.value = a2.value = m_aFixedArraySequence; return m_aFixedArraySequence; } public synchronized short[][][][] opFixedArraySequenceEx(short[][][][] a0, FixedArraySequenceHolder a1, FixedArraySequenceHolder a2) throws ExFixedArraySequence { m_aFixedArraySequence = new short[a0.length + a1.value.length][][][]; int idx = 0; for (int i = 0; i < a0.length; i++) { m_aFixedArraySequence[idx++] = a0[i]; } for (int i = 0; i < a1.value.length; i++) { m_aFixedArraySequence[idx++] = a1.value[i]; } throw new ExFixedArraySequence(m_aFixedArraySequence); } public synchronized String[][][] attrVariableArraySequence() { return m_aVariableArraySequence; } public synchronized void attrVariableArraySequence(String[][][] value) { m_aVariableArraySequence = value; } public synchronized String[][][] opVariableArraySequence(String[][][] a0, VariableArraySequenceHolder a1, VariableArraySequenceHolder a2) { m_aVariableArraySequence = new String[a0.length + a1.value.length][][]; int idx = 0; for (int i = 0; i < a0.length; i++) { m_aVariableArraySequence[idx++] = a0[i]; } for (int i = 0; i < a1.value.length; i++) { m_aVariableArraySequence[idx++] = a1.value[i]; } a1.value = a2.value = m_aVariableArraySequence; return m_aVariableArraySequence; } public synchronized String[][][] opVariableArraySequenceEx(String[][][] a0, VariableArraySequenceHolder a1, VariableArraySequenceHolder a2) throws ExVariableArraySequence { m_aVariableArraySequence = new String[a0.length + a1.value.length][][]; int idx = 0; for (int i = 0; i < a0.length; i++) { m_aVariableArraySequence[idx++] = a0[i]; } for (int i = 0; i < a1.value.length; i++) { m_aVariableArraySequence[idx++] = a1.value[i]; } throw new ExVariableArraySequence(m_aVariableArraySequence); } public synchronized short[][][][] attrFixedArrayBoundSequence() { return m_aFixedArrayBoundSequence; } public synchronized void attrFixedArrayBoundSequence(short[][][][] value) { m_aFixedArrayBoundSequence = value; } public synchronized short[][][][] opFixedArrayBoundSequence( short[][][][] a0, FixedArrayBoundSequenceHolder a1, FixedArrayBoundSequenceHolder a2) { m_aFixedArrayBoundSequence = (new short[a0.length + a1.value.length][][][]); int idx = 0; for (int i = 0; i < a0.length; i++) { m_aFixedArrayBoundSequence[idx++] = a0[i]; } for (int i = 0; i < a1.value.length; i++) { m_aFixedArrayBoundSequence[idx++] = a1.value[i]; } a1.value = a2.value = m_aFixedArrayBoundSequence; return m_aFixedArrayBoundSequence; } public synchronized short[][][][] opFixedArrayBoundSequenceEx( short[][][][] a0, FixedArrayBoundSequenceHolder a1, FixedArrayBoundSequenceHolder a2) throws ExFixedArrayBoundSequence { m_aFixedArrayBoundSequence = (new short[a0.length + a1.value.length][][][]); int idx = 0; for (int i = 0; i < a0.length; i++) { m_aFixedArrayBoundSequence[idx++] = a0[i]; } for (int i = 0; i < a1.value.length; i++) { m_aFixedArrayBoundSequence[idx++] = a1.value[i]; } throw new ExFixedArrayBoundSequence(m_aFixedArrayBoundSequence); } public synchronized String[][][] attrVariableArrayBoundSequence() { return m_aVariableArrayBoundSequence; } public synchronized void attrVariableArrayBoundSequence(String[][][] value) { m_aVariableArrayBoundSequence = value; } public synchronized String[][][] opVariableArrayBoundSequence( String[][][] a0, VariableArrayBoundSequenceHolder a1, VariableArrayBoundSequenceHolder a2) { m_aVariableArrayBoundSequence = (new String[a0.length + a1.value.length][][]); int idx = 0; for (int i = 0; i < a0.length; i++) { m_aVariableArrayBoundSequence[idx++] = a0[i]; } for (int i = 0; i < a1.value.length; i++) { m_aVariableArrayBoundSequence[idx++] = a1.value[i]; } a1.value = a2.value = m_aVariableArrayBoundSequence; return m_aVariableArrayBoundSequence; } public synchronized String[][][] opVariableArrayBoundSequenceEx( String[][][] a0, VariableArrayBoundSequenceHolder a1, VariableArrayBoundSequenceHolder a2) throws ExVariableArrayBoundSequence { m_aVariableArrayBoundSequence = (new String[a0.length + a1.value.length][][]); int idx = 0; for (int i = 0; i < a0.length; i++) { m_aVariableArrayBoundSequence[idx++] = a0[i]; } for (int i = 0; i < a1.value.length; i++) { m_aVariableArrayBoundSequence[idx++] = a1.value[i]; } throw new ExVariableArrayBoundSequence(m_aVariableArraySequence); } public synchronized void opExRecursiveStruct() throws ORBTest_Basic.ExRecursiveStruct { m_aRecursiveStruct = new ORBTest_Basic.RecursiveStruct(); m_aRecursiveStruct.s = "test"; m_aRecursiveStruct.i = 2; m_aRecursiveStruct.rs = new ORBTest_Basic.RecursiveStruct[1]; m_aRecursiveStruct.rs[0] = new ORBTest_Basic.RecursiveStruct(); m_aRecursiveStruct.rs[0].s = "ORBTest_Basic_RecursiveStruct"; m_aRecursiveStruct.rs[0].i = 111; m_aRecursiveStruct.rs[0].rs = new ORBTest_Basic.RecursiveStruct[0]; throw new ORBTest_Basic.ExRecursiveStruct((short) 1, m_aRecursiveStruct); } public org.omg.PortableServer.POA _default_POA() { return m_poa; } }
5,940
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/Intf.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/Intf:1.0 // /***/ public interface Intf extends IntfOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity { }
5,941
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestObjectFixed.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import static org.junit.Assert.assertTrue; import org.omg.CORBA.*; public class TestObjectFixed extends test.common.TestBase implements TestObject { private ORB m_orb; ORBTest.Intf m_test_intf; public TestObjectFixed(ORB orb, ORBTest.Intf test_intf) { m_orb = orb; m_test_intf = test_intf; } public boolean is_supported(org.omg.CORBA.Object obj) { boolean is_supported = false; if (obj != null) { try { ORBTest_Fixed.Intf ti = ORBTest_Fixed.IntfHelper.narrow(obj); is_supported = true; } catch (BAD_PARAM e) { is_supported = false; } } return is_supported; } public void test_SII(org.omg.CORBA.Object obj) { ORBTest_Fixed.Intf ti = ORBTest_Fixed.IntfHelper.narrow(obj); { java.math.BigDecimal b; java.math.BigDecimal ret; b = new java.math.BigDecimal("0.00000000"); ti.attrFixed(b); ret = ti.attrFixed(); assertTrue(ret.equals(b)); b = new java.math.BigDecimal("1234567890.12345670"); ti.attrFixed(b); ret = ti.attrFixed(); assertTrue(ret.equals(b)); b = new java.math.BigDecimal("-9876543210.87654320"); ti.attrFixed(b); ret = ti.attrFixed(); assertTrue(ret.equals(b)); FixedHolder inOut = new FixedHolder(new java.math.BigDecimal( "20.00000000")); FixedHolder out = new FixedHolder(); ret = ti.opFixed(new java.math.BigDecimal("10.00000000"), inOut, out); b = new java.math.BigDecimal("30.00000000"); assertTrue(ret.equals(b)); assertTrue(inOut.value.equals(b)); assertTrue(out.value.equals(b)); } } public void test_DII(org.omg.CORBA.Object obj) { ORBTest_Fixed.Intf ti = ORBTest_Fixed.IntfHelper.narrow(obj); Request request; java.math.BigDecimal ret; FixedHolder inOut = new FixedHolder(); FixedHolder out = new FixedHolder(); request = ti._request("_set_attrFixed"); request.add_in_arg().insert_fixed( new java.math.BigDecimal("1234567890.12345670"), m_orb.create_fixed_tc((short) 24, (short) 8)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); request = ti._request("_get_attrFixed"); request.set_return_type(m_orb.create_fixed_tc((short) 24, (short) 8)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); ret = request.return_value().extract_fixed(); assertTrue(ret.equals(new java.math.BigDecimal("1234567890.12345670"))); request = ti._request("opFixed"); request.add_in_arg().insert_fixed( new java.math.BigDecimal("10.00000000"), m_orb.create_fixed_tc((short) 24, (short) 8)); Any inOutAny = request.add_inout_arg(); inOutAny.insert_fixed(new java.math.BigDecimal("20.00000000"), m_orb .create_fixed_tc((short) 24, (short) 8)); Any outAny = request.add_out_arg(); outAny.insert_fixed(new java.math.BigDecimal("0.00000000"), m_orb .create_fixed_tc((short) 24, (short) 8)); request.set_return_type(m_orb.create_fixed_tc((short) 24, (short) 8)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); inOut.value = inOutAny.extract_fixed(); out.value = outAny.extract_fixed(); ret = request.return_value().extract_fixed(); assertTrue(ret.equals(new java.math.BigDecimal("30.00000000"))); assertTrue(inOut.value.equals(new java.math.BigDecimal("30.00000000"))); assertTrue(out.value.equals(new java.math.BigDecimal("30.00000000"))); } }
5,942
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestObjectStubTimeout.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import static org.junit.Assert.assertTrue; import org.omg.CORBA.*; public class TestObjectStubTimeout extends test.common.TestBase implements TestObject { private ORB m_orb; ORBTest.Intf m_test_intf; private boolean m_local; public TestObjectStubTimeout(ORB orb, ORBTest.Intf test_intf, boolean local) { m_orb = orb; m_test_intf = test_intf; m_local = local; } public boolean is_supported(org.omg.CORBA.Object obj) { // Timeout test are not for collocated client and servers // if (m_local) { return false; } boolean is_supported = false; if (obj != null) { try { ORBTest_StubTimeout.Intf ti = (ORBTest_StubTimeout.IntfHelper .narrow(obj)); is_supported = true; } catch (BAD_PARAM e) { is_supported = false; } } return is_supported; } public void test_SII(org.omg.CORBA.Object obj) { ORBTest_StubTimeout.Intf tiOriginal = (ORBTest_StubTimeout.IntfHelper .narrow(obj)); // // Create policy list containing new timeout policy // Policy[] pl = new Policy[1]; Any any = m_orb.create_any(); any.insert_ulong(2000); try { pl[0] = (m_orb.create_policy( org.apache.yoko.orb.OB.TIMEOUT_POLICY_ID.value, any)); } catch (PolicyError e) { assertTrue(false); } // // _set_policy_override returns new proxy with the policies applied // org.omg.CORBA.Object new_obj = tiOriginal._set_policy_override(pl, SetOverrideType.ADD_OVERRIDE); // // _narrow to correct type // ORBTest_StubTimeout.Intf ti = (ORBTest_StubTimeout.IntfHelper .narrow(new_obj)); try { ti.sleep_twoway(3); assertTrue(false); } catch (NO_RESPONSE ex) { } try { Thread.currentThread().sleep(2000); } catch (InterruptedException ex) { } // // The following test doesn't work, because there is a race // between the sleep_oneway and the sleep_twoway if the server // is running in thread pool or thread-per-request mode. (This // isn't such an exiting test anyway, so perhaps we should // permanently remove it in a future version.) // /* * try { ti.sleep_oneway(3); } catch(NO_RESPONSE ex) { TEST(false); } * * try { ti.sleep_twoway(0); TEST(false); } catch(NO_RESPONSE ex) { } * * try { Thread.currentThread().sleep(2000); } * catch(InterruptedException ex) { } */ try { ti.sleep_twoway(0); } catch (NO_RESPONSE ex) { assertTrue(false); } } public void test_DII(org.omg.CORBA.Object obj) { } }
5,943
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/IntfPOA.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/Intf:1.0 // public abstract class IntfPOA extends org.omg.PortableServer.Servant implements org.omg.CORBA.portable.InvokeHandler, IntfOperations { static final String[] _ob_ids_ = { "IDL:ORBTest/Intf:1.0", }; public Intf _this() { return IntfHelper.narrow(super._this_object()); } public Intf _this(org.omg.CORBA.ORB orb) { return IntfHelper.narrow(super._this_object(orb)); } public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectId) { return _ob_ids_; } public org.omg.CORBA.portable.OutputStream _invoke(String opName, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { final String[] _ob_names = { "concurrent_request_execution", "deactivate", "get_ORB_type", "get_test_case_list" }; int _ob_left = 0; int _ob_right = _ob_names.length; int _ob_index = -1; while(_ob_left < _ob_right) { int _ob_m = (_ob_left + _ob_right) / 2; int _ob_res = _ob_names[_ob_m].compareTo(opName); if(_ob_res == 0) { _ob_index = _ob_m; break; } else if(_ob_res > 0) _ob_right = _ob_m; else _ob_left = _ob_m + 1; } if(_ob_index == -1 && opName.charAt(0) == '_') { _ob_left = 0; _ob_right = _ob_names.length; String _ob_ami_op = opName.substring(1); while(_ob_left < _ob_right) { int _ob_m = (_ob_left + _ob_right) / 2; int _ob_res = _ob_names[_ob_m].compareTo(_ob_ami_op); if(_ob_res == 0) { _ob_index = _ob_m; break; } else if(_ob_res > 0) _ob_right = _ob_m; else _ob_left = _ob_m + 1; } } switch(_ob_index) { case 0: // concurrent_request_execution return _OB_op_concurrent_request_execution(in, handler); case 1: // deactivate return _OB_op_deactivate(in, handler); case 2: // get_ORB_type return _OB_op_get_ORB_type(in, handler); case 3: // get_test_case_list return _OB_op_get_test_case_list(in, handler); } throw new org.omg.CORBA.BAD_OPERATION(); } private org.omg.CORBA.portable.OutputStream _OB_op_concurrent_request_execution(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; boolean _ob_r = concurrent_request_execution(); out = handler.createReply(); out.write_boolean(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_deactivate(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; deactivate(); out = handler.createReply(); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_get_ORB_type(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; ORBType _ob_r = get_ORB_type(); out = handler.createReply(); ORBTypeHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_get_test_case_list(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; TestCase[] _ob_r = get_test_case_list(); out = handler.createReply(); TestCaseListHelper.write(out, _ob_r); return out; } }
5,944
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfExceptionsExt_2_3DSI_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; class TestIntfExceptionsExt_2_3DSI_impl extends org.omg.PortableServer.DynamicImplementation { private ORB m_orb; TestIntfExceptionsExt_2_3DSI_impl(ORB orb) { m_orb = orb; } static final String[] m_ids = { "IDL:ORBTest_ExceptionsExt_2_3/Intf:1.0" }; public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] object_id) { return m_ids; } public void invoke(ServerRequest request) { String name = request.operation(); boolean ex; if (name.length() > 2 && name.endsWith("Ex")) { name = name.substring(0, name.length() - 2); ex = true; } else { ex = false; } if (name.equals("op_CODESET_INCOMPATIBLE_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); CODESET_INCOMPATIBLEHelper.insert(any, new CODESET_INCOMPATIBLE(31, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_REBIND_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); REBINDHelper.insert(any, new REBIND(32, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_TIMEOUT_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); TIMEOUTHelper.insert(any, new TIMEOUT(33, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_TRANSACTION_UNAVAILABLE_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); TRANSACTION_UNAVAILABLEHelper.insert(any, new TRANSACTION_UNAVAILABLE(34, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_TRANSACTION_MODE_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); TRANSACTION_MODEHelper.insert(any, new TRANSACTION_MODE(35, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_BAD_QOS_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); BAD_QOSHelper.insert(any, new BAD_QOS(36, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } System.err.println("DSI implementation: unknown operation: " + name); NVList list = m_orb.create_list(0); request.arguments(list); Any exAny = m_orb.create_any(); BAD_OPERATIONHelper.insert(exAny, new BAD_OPERATION()); request.set_exception(exAny); } }
5,945
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestObjectWChar.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import static org.junit.Assert.assertTrue; import org.omg.CORBA.*; public class TestObjectWChar extends test.common.TestBase implements TestObject { private ORB m_orb; ORBTest.Intf m_test_intf; public TestObjectWChar(ORB orb, ORBTest.Intf test_intf) { m_orb = orb; m_test_intf = test_intf; } public boolean is_supported(org.omg.CORBA.Object obj) { boolean is_supported = false; if (obj != null) { try { ORBTest_WChar.Intf ti = ORBTest_WChar.IntfHelper.narrow(obj); is_supported = true; } catch (BAD_PARAM e) { is_supported = false; } } return is_supported; } public void test_SII(org.omg.CORBA.Object obj) { ORBTest_WChar.Intf ti = ORBTest_WChar.IntfHelper.narrow(obj); { char ret; ti.attrWChar('a'); ret = ti.attrWChar(); assertTrue(ret == 'a'); ti.attrWChar((char) 224); ret = ti.attrWChar(); assertTrue(ret == (char) 224); ti.attrWChar((char) 0x20ac); ret = ti.attrWChar(); assertTrue(ret == (char) 0x20ac); CharHolder inOut = new CharHolder((char) 1); CharHolder out = new CharHolder(); ret = ti.opWChar('a', inOut, out); assertTrue(ret == 'b'); assertTrue(inOut.value == 'b'); assertTrue(out.value == 'b'); } { String ret; ti.attrWString(""); ret = ti.attrWString(); assertTrue(ret.equals("")); ti.attrWString("Hello"); ret = ti.attrWString(); assertTrue(ret.equals("Hello")); StringHolder inOut = new StringHolder("world!"); StringHolder out = new StringHolder(); ret = ti.opWString("Hello, ", inOut, out); assertTrue(ret.equals("Hello, world!")); assertTrue(out.value.equals("Hello, world!")); } { CharHolder inOut = new CharHolder((char) 1); CharHolder out = new CharHolder(); try { ti.opWCharEx('a', inOut, out); assertTrue(false); } catch (ORBTest_WChar.ExWChar ex) { assertTrue(ex.value == 'b'); } } { StringHolder inOut = new StringHolder("world!"); StringHolder out = new StringHolder(); try { ti.opWStringEx("Hello, ", inOut, out); assertTrue(false); } catch (ORBTest_WChar.ExWString ex) { assertTrue(ex.value.equals("Hello, world!")); } } } public void test_DII(org.omg.CORBA.Object obj) { // REVISIT } }
5,946
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestDefn.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; public class TestDefn { private String m_description; private TestObject m_test_object; public TestDefn(String description, TestObject test_object) { m_description = description; m_test_object = test_object; } public String description() { return m_description; } public TestObject test_object() { return m_test_object; } }
5,947
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/_IntfStub.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/Intf:1.0 // public class _IntfStub extends org.omg.CORBA.portable.ObjectImpl implements Intf { private static final String[] _ob_ids_ = { "IDL:ORBTest/Intf:1.0", }; public String[] _ids() { return _ob_ids_; } final public static java.lang.Class _ob_opsClass = IntfOperations.class; // // IDL:ORBTest/Intf/get_ORB_type:1.0 // public ORBType get_ORB_type() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("get_ORB_type", true); in = _invoke(out); ORBType _ob_r = ORBTypeHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("get_ORB_type", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.get_ORB_type(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest/Intf/deactivate:1.0 // public void deactivate() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("deactivate", true); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("deactivate", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { _ob_self.deactivate(); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest/Intf/concurrent_request_execution:1.0 // public boolean concurrent_request_execution() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("concurrent_request_execution", true); in = _invoke(out); boolean _ob_r = in.read_boolean(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("concurrent_request_execution", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.concurrent_request_execution(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest/Intf/get_test_case_list:1.0 // public TestCase[] get_test_case_list() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("get_test_case_list", true); in = _invoke(out); TestCase[] _ob_r = TestCaseListHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("get_test_case_list", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.get_test_case_list(); } finally { _servant_postinvoke(_ob_so); } } } } }
5,948
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfWChar_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; final class TestIntfWChar_impl extends ORBTest_WChar.IntfPOA { private POA m_poa; private char m_aWChar; private String m_aWString; public TestIntfWChar_impl(POA poa) { m_poa = poa; } public synchronized char attrWChar() { return m_aWChar; } public synchronized void attrWChar(char value) { m_aWChar = value; } public synchronized char opWChar(char a0, CharHolder a1, CharHolder a2) { m_aWChar = (char) (a0 + a1.value); a1.value = a2.value = m_aWChar; return m_aWChar; } public synchronized char opWCharEx(char a0, CharHolder a1, CharHolder a2) throws ORBTest_WChar.ExWChar { m_aWChar = (char) (a0 + a1.value); throw new ORBTest_WChar.ExWChar(m_aWChar); } public synchronized String attrWString() { return m_aWString; } public synchronized void attrWString(String value) { m_aWString = value; } public synchronized String opWString(String a0, StringHolder a1, StringHolder a2) { m_aWString = a0 + a1.value; a1.value = a2.value = m_aWString; return m_aWString; } public synchronized String opWStringEx(String a0, StringHolder a1, StringHolder a2) throws ORBTest_WChar.ExWString { m_aWString = a0 + a1.value; throw new ORBTest_WChar.ExWString(m_aWString); } public org.omg.PortableServer.POA _default_POA() { return m_poa; } }
5,949
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/IntfHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/Intf:1.0 // final public class IntfHelper { public static void insert(org.omg.CORBA.Any any, Intf val) { any.insert_Object(val, type()); } public static Intf extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_Object()); throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); typeCode_ = orb.create_interface_tc(id(), "Intf"); } return typeCode_; } public static String id() { return "IDL:ORBTest/Intf:1.0"; } public static Intf read(org.omg.CORBA.portable.InputStream in) { org.omg.CORBA.Object _ob_v = in.read_Object(); try { return (Intf)_ob_v; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ob_impl = (org.omg.CORBA.portable.ObjectImpl)_ob_v; _IntfStub _ob_stub = new _IntfStub(); _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } public static void write(org.omg.CORBA.portable.OutputStream out, Intf val) { out.write_Object(val); } public static Intf narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Intf)val; } catch(ClassCastException ex) { } if(val._is_a(id())) { org.omg.CORBA.portable.ObjectImpl _ob_impl; _IntfStub _ob_stub = new _IntfStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } throw new org.omg.CORBA.BAD_PARAM(); } return null; } public static Intf unchecked_narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Intf)val; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _IntfStub _ob_stub = new _IntfStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } return null; } }
5,950
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfExceptions_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; final class TestIntfExceptions_impl extends ORBTest_Exceptions.IntfPOA { private POA m_poa; public TestIntfExceptions_impl(POA poa) { m_poa = poa; } public synchronized void op_UNKNOWN_Ex() { throw new UNKNOWN(1, CompletionStatus.COMPLETED_YES); } public synchronized void op_BAD_PARAM_Ex() { throw new BAD_PARAM(2, CompletionStatus.COMPLETED_NO); } public synchronized void op_NO_MEMORY_Ex() { throw new NO_MEMORY(3, CompletionStatus.COMPLETED_MAYBE); } public synchronized void op_IMP_LIMIT_Ex() { throw new IMP_LIMIT(4, CompletionStatus.COMPLETED_YES); } public synchronized void op_COMM_FAILURE_Ex() { throw new COMM_FAILURE(5, CompletionStatus.COMPLETED_NO); } public synchronized void op_INV_OBJREF_Ex() { throw new INV_OBJREF(6, CompletionStatus.COMPLETED_MAYBE); } public synchronized void op_NO_PERMISSION_Ex() { throw new NO_PERMISSION(7, CompletionStatus.COMPLETED_YES); } public synchronized void op_INTERNAL_Ex() { throw new INTERNAL(8, CompletionStatus.COMPLETED_NO); } public synchronized void op_MARSHAL_Ex() { throw new MARSHAL(9, CompletionStatus.COMPLETED_MAYBE); } public synchronized void op_INITIALIZE_Ex() { throw new INITIALIZE(10, CompletionStatus.COMPLETED_YES); } public synchronized void op_NO_IMPLEMENT_Ex() { throw new NO_IMPLEMENT(11, CompletionStatus.COMPLETED_NO); } public synchronized void op_BAD_TYPECODE_Ex() { throw new BAD_TYPECODE(12, CompletionStatus.COMPLETED_MAYBE); } public synchronized void op_BAD_OPERATION_Ex() { throw new BAD_OPERATION(13, CompletionStatus.COMPLETED_YES); } public synchronized void op_NO_RESOURCES_Ex() { throw new NO_RESOURCES(14, CompletionStatus.COMPLETED_NO); } public synchronized void op_NO_RESPONSE_Ex() { throw new NO_RESPONSE(15, CompletionStatus.COMPLETED_MAYBE); } public synchronized void op_BAD_INV_ORDER_Ex() { throw new BAD_INV_ORDER(17, CompletionStatus.COMPLETED_NO); } public synchronized void op_TRANSIENT_Ex() { throw new TRANSIENT(18, CompletionStatus.COMPLETED_MAYBE); } public synchronized void op_OBJ_ADAPTER_Ex() { throw new OBJ_ADAPTER(24, CompletionStatus.COMPLETED_MAYBE); } public synchronized void op_DATA_CONVERSION_Ex() { throw new DATA_CONVERSION(25, CompletionStatus.COMPLETED_YES); } public synchronized void op_OBJECT_NOT_EXIST_Ex() { throw new OBJECT_NOT_EXIST(26, CompletionStatus.COMPLETED_NO); } public synchronized void op_INV_POLICY_Ex() { throw new INV_POLICY(30, CompletionStatus.COMPLETED_NO); } public org.omg.PortableServer.POA _default_POA() { return m_poa; } }
5,951
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestCaseListHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/TestCaseList:1.0 // final public class TestCaseListHelper { public static void insert(org.omg.CORBA.Any any, TestCase[] val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static TestCase[] extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); typeCode_ = orb.create_alias_tc(id(), "TestCaseList", orb.create_sequence_tc(0, TestCaseHelper.type())); } return typeCode_; } public static String id() { return "IDL:ORBTest/TestCaseList:1.0"; } public static TestCase[] read(org.omg.CORBA.portable.InputStream in) { TestCase[] _ob_v; int len0 = in.read_ulong(); _ob_v = new TestCase[len0]; for(int i0 = 0; i0 < len0; i0++) _ob_v[i0] = TestCaseHelper.read(in); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, TestCase[] val) { int len0 = val.length; out.write_ulong(len0); for(int i0 = 0; i0 < len0; i0++) TestCaseHelper.write(out, val[i0]); } }
5,952
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestObjectContext.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import static org.junit.Assert.assertTrue; import org.omg.CORBA.*; public class TestObjectContext extends test.common.TestBase implements TestObject { private ORB m_orb; ORBTest.Intf m_test_intf; public TestObjectContext(ORB orb, ORBTest.Intf test_intf) { m_orb = orb; m_test_intf = test_intf; } public boolean is_supported(org.omg.CORBA.Object obj) { boolean is_supported = false; if (obj != null) { try { ORBTest_Context.Intf ti = ORBTest_Context.IntfHelper .narrow(obj); is_supported = true; } catch (BAD_PARAM e) { is_supported = false; } } return is_supported; } public void test_SII(org.omg.CORBA.Object obj) { ORBTest_Context.Intf ti = ORBTest_Context.IntfHelper.narrow(obj); Context ctx; Context ctx2; { ctx = m_orb.get_default_context(); String[] seq; try { seq = ti.opContext("*", ctx); assertTrue(false); } catch (BAD_CONTEXT ex) { // Expected } } { Any any = m_orb.create_any(); int i; String[] seq; ctx = m_orb.get_default_context(); any.insert_string("A1"); ctx.set_one_value("A", any); any.insert_string("A2"); ctx.set_one_value("AAA", any); any.insert_string("B1"); ctx.set_one_value("B", any); any.insert_string("B2"); ctx.set_one_value("BBB", any); any.insert_string("X1"); ctx.set_one_value("X", any); any.insert_string("X2"); ctx.set_one_value("XXX", any); any.insert_string("Y1"); ctx.set_one_value("Y", any); any.insert_string("Y2"); ctx.set_one_value("YYY", any); seq = ti.opContext("*", ctx); assertTrue(seq.length == 3 * 2); for (i = 0; i < seq.length; i += 2) { if (seq[i].equals("A")) assertTrue(seq[i + 1].equals("A1")); if (seq[i].equals("AAA")) assertTrue(seq[i + 1].equals("A2")); if (seq[i].equals("X")) assertTrue(seq[i + 1].equals("X1")); } seq = ti.opContext("A*", ctx); assertTrue(seq.length == 2 * 2); for (i = 0; i < seq.length; i += 2) { if (seq[i].equals("A")) assertTrue(seq[i + 1].equals("A1")); if (seq[i].equals("AAA")) assertTrue(seq[i + 1].equals("A2")); } seq = ti.opContext("AA*", ctx); assertTrue(seq.length == 1 * 2); assertTrue(seq[0].equals("AAA") && seq[1].equals("A2")); seq = ti.opContext("A", ctx); assertTrue(seq.length == 1 * 2); assertTrue(seq[0].equals("A") && seq[1].equals("A1")); ctx2 = ctx.create_child("child"); any.insert_string("C1"); ctx2.set_one_value("C", any); any.insert_string("C2"); ctx2.set_one_value("CCC", any); any.insert_string("X1-1"); ctx2.set_one_value("X", any); seq = ti.opContext("*", ctx2); assertTrue(seq.length == 5 * 2); for (i = 0; i < seq.length; i += 2) { if (seq[i].equals("A")) assertTrue(seq[i + 1].equals("A1")); if (seq[i].equals("AAA")) assertTrue(seq[i + 1].equals("A2")); if (seq[i].equals("C")) assertTrue(seq[i + 1].equals("C1")); if (seq[i].equals("CCC")) assertTrue(seq[i + 1].equals("C2")); if (seq[i].equals("X")) assertTrue(seq[i + 1].equals("X1-1")); } } } public void test_DII(org.omg.CORBA.Object obj) { ORBTest_Context.Intf ti = ORBTest_Context.IntfHelper.narrow(obj); Context ctx; { ctx = m_orb.get_default_context(); Request request; request = ti._request("opContext"); request.contexts().add("A*"); request.contexts().add("C*"); request.contexts().add("X"); request.contexts().add("Z"); request.ctx(ctx); request.add_in_arg().insert_string("*"); request .set_return_type(ORBTest_Context.StringSequenceHelper .type()); try { request.invoke(); Exception ex = request.env().exception(); assertTrue(ex != null); BAD_CONTEXT bex = (BAD_CONTEXT) ex; } catch (BAD_CONTEXT ex) { // Expected (if yoko.m_orb.raise_dii_exceptions = true) } } { ctx = m_orb.get_default_context(); Any any = m_orb.create_any(); int i; any.insert_string("A1"); ctx.set_one_value("A", any); any.insert_string("A2"); ctx.set_one_value("AAA", any); any.insert_string("B1"); ctx.set_one_value("B", any); any.insert_string("B2"); ctx.set_one_value("BBB", any); any.insert_string("X1"); ctx.set_one_value("X", any); any.insert_string("X2"); ctx.set_one_value("XXX", any); any.insert_string("Y1"); ctx.set_one_value("Y", any); any.insert_string("Y2"); ctx.set_one_value("YYY", any); Request request; String[] seq; request = ti._request("opContext"); request.contexts().add("A*"); request.contexts().add("C*"); request.contexts().add("X"); request.contexts().add("Z"); request.ctx(ctx); request .set_return_type(ORBTest_Context.StringSequenceHelper .type()); request.add_in_arg().insert_string("*"); request.invoke(); seq = (ORBTest_Context.StringSequenceHelper.extract(request .return_value())); assertTrue(seq.length == 3 * 2); for (i = 0; i < seq.length; i += 2) { if (seq[i].equals("A")) assertTrue(seq[i + 1].equals("A1")); if (seq[i].equals("AAA")) assertTrue(seq[i + 1].equals("A2")); if (seq[i].equals("X")) assertTrue(seq[i + 1].equals("X1")); } request = ti._request("opContext"); request.contexts().add("A*"); request.contexts().add("C*"); request.contexts().add("X"); request.contexts().add("Z*"); request.ctx(ctx); request .set_return_type(ORBTest_Context.StringSequenceHelper .type()); request.add_in_arg().insert_string("A*"); request.invoke(); seq = (ORBTest_Context.StringSequenceHelper.extract(request .return_value())); assertTrue(seq.length == 2 * 2); for (i = 0; i < seq.length; i += 2) { if (seq[i].equals("A")) assertTrue(seq[i + 1].equals("A1")); if (seq[i].equals("AAA")) assertTrue(seq[i + 1].equals("A2")); } request = ti._request("opContext"); request.contexts().add("A*"); request.contexts().add("C*"); request.contexts().add("X"); request.contexts().add("Z"); request.ctx(ctx); request .set_return_type(ORBTest_Context.StringSequenceHelper .type()); request.add_in_arg().insert_string("AA*"); request.invoke(); seq = (ORBTest_Context.StringSequenceHelper.extract(request .return_value())); assertTrue(seq.length == 1 * 2); assertTrue(seq[0].equals("AAA") && seq[1].equals("A2")); request = ti._request("opContext"); request.contexts().add("A*"); request.contexts().add("C*"); request.contexts().add("X"); request.contexts().add("Z"); request.ctx(ctx); request .set_return_type(ORBTest_Context.StringSequenceHelper .type()); request.add_in_arg().insert_string("A"); request.invoke(); seq = (ORBTest_Context.StringSequenceHelper.extract(request .return_value())); assertTrue(seq.length == 1 * 2); assertTrue(seq[0].equals("A") && seq[1].equals("A1")); } } }
5,953
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestObjectLongLong.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import static org.junit.Assert.assertTrue; import org.omg.CORBA.*; public class TestObjectLongLong extends test.common.TestBase implements TestObject { private ORB m_orb; ORBTest.Intf m_test_intf; public TestObjectLongLong(ORB orb, ORBTest.Intf test_intf) { m_orb = orb; m_test_intf = test_intf; } public boolean is_supported(org.omg.CORBA.Object obj) { boolean is_supported = false; if (obj != null) { try { ORBTest_LongLong.Intf ti = (ORBTest_LongLong.IntfHelper .narrow(obj)); is_supported = true; } catch (BAD_PARAM e) { is_supported = false; } } return is_supported; } public void test_SII(org.omg.CORBA.Object obj) { ORBTest_LongLong.Intf ti = ORBTest_LongLong.IntfHelper.narrow(obj); { long ret; ti.attrLongLong(-9223372036854775807L - 1); ret = ti.attrLongLong(); assertTrue(ret == -9223372036854775807L - 1); ti.attrLongLong(9223372036854775807L); ret = ti.attrLongLong(); assertTrue(ret == 9223372036854775807L); LongHolder inOut = new LongHolder(20); LongHolder out = new LongHolder(); ret = ti.opLongLong(10, inOut, out); assertTrue(ret == 30); assertTrue(inOut.value == 30); assertTrue(out.value == 30); } { long ret; ti.attrULongLong(9223372036854775807L); ret = ti.attrULongLong(); assertTrue(ret == 9223372036854775807L); LongHolder inOut = new LongHolder(20); LongHolder out = new LongHolder(); ret = ti.opULongLong(10, inOut, out); assertTrue(ret == 30); assertTrue(inOut.value == 30); assertTrue(out.value == 30); } { LongHolder inOut = new LongHolder(20); LongHolder out = new LongHolder(); try { ti.opLongLongEx(10, inOut, out); assertTrue(false); } catch (ORBTest_LongLong.ExLongLong ex) { assertTrue(ex.value == 30); } } { LongHolder inOut = new LongHolder(20); LongHolder out = new LongHolder(); try { ti.opULongLongEx(10, inOut, out); assertTrue(false); } catch (ORBTest_LongLong.ExULongLong ex) { assertTrue(ex.value == 30); } } } public void test_DII(org.omg.CORBA.Object obj) { // REVISIT } }
5,954
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntf_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; final class TestIntf_impl extends ORBTest.IntfPOA { private ORB m_orb; private POA m_poa; private TestIntfBasic_impl m_test_intf_basic_impl; private ORBTest_Basic.IntfPOATie m_test_intf_basic_tie_impl; private TestIntfBasicDSI_impl m_test_intf_basic_dsi_impl; private ORBTest_Basic.Intf m_test_intf_basic; private ORBTest_Basic.Intf m_test_intf_basic_tie; private ORBTest_Basic.Intf m_test_intf_basic_dsi; private TestIntfContext_impl m_test_intf_context_impl; private ORBTest_Context.IntfPOATie m_test_intf_context_tie_impl; private TestIntfContextDSI_impl m_test_intf_context_dsi_impl; private ORBTest_Context.Intf m_test_intf_context; private ORBTest_Context.Intf m_test_intf_context_tie; private ORBTest_Context.Intf m_test_intf_context_dsi; private TestIntfExceptions_impl m_test_intf_exceptions_impl; private ORBTest_Exceptions.IntfPOATie m_test_intf_exceptions_tie_impl; private TestIntfExceptionsDSI_impl m_test_intf_exceptions_dsi_impl; private ORBTest_Exceptions.Intf m_test_intf_exceptions; private ORBTest_Exceptions.Intf m_test_intf_exceptions_tie; private ORBTest_Exceptions.Intf m_test_intf_exceptions_dsi; private TestIntfExceptionsExt_2_0_impl m_test_intf_exceptions_ext_2_0_impl; private ORBTest_ExceptionsExt_2_0.IntfPOATie m_test_intf_exceptions_ext_2_0_tie_impl; private TestIntfExceptionsExt_2_0DSI_impl m_test_intf_exceptions_ext_2_0_dsi_impl; private ORBTest_ExceptionsExt_2_0.Intf m_test_intf_exceptions_ext_2_0; private ORBTest_ExceptionsExt_2_0.Intf m_test_intf_exceptions_ext_2_0_tie; private ORBTest_ExceptionsExt_2_0.Intf m_test_intf_exceptions_ext_2_0_dsi; private TestIntfWChar_impl m_test_intf_wchar_impl; private ORBTest_WChar.IntfPOATie m_test_intf_wchar_tie_impl; private TestIntfWCharDSI_impl m_test_intf_wchar_dsi_impl; private ORBTest_WChar.Intf m_test_intf_wchar; private ORBTest_WChar.Intf m_test_intf_wchar_tie; private ORBTest_WChar.Intf m_test_intf_wchar_dsi; private TestIntfFixed_impl m_test_intf_fixed_impl; private ORBTest_Fixed.IntfPOATie m_test_intf_fixed_tie_impl; private TestIntfFixedDSI_impl m_test_intf_fixed_dsi_impl; private ORBTest_Fixed.Intf m_test_intf_fixed; private ORBTest_Fixed.Intf m_test_intf_fixed_tie; private ORBTest_Fixed.Intf m_test_intf_fixed_dsi; private TestIntfLongLong_impl m_test_intf_long_long_impl; private ORBTest_LongLong.IntfPOATie m_test_intf_long_long_tie_impl; private TestIntfLongLongDSI_impl m_test_intf_long_long_dsi_impl; private ORBTest_LongLong.Intf m_test_intf_long_long; private ORBTest_LongLong.Intf m_test_intf_long_long_tie; private ORBTest_LongLong.Intf m_test_intf_long_long_dsi; private TestIntfExceptionsExt_2_3_impl m_test_intf_exceptions_ext_2_3_impl; private ORBTest_ExceptionsExt_2_3.IntfPOATie m_test_intf_exceptions_ext_2_3_tie_impl; private TestIntfExceptionsExt_2_3DSI_impl m_test_intf_exceptions_ext_2_3_dsi_impl; private ORBTest_ExceptionsExt_2_3.Intf m_test_intf_exceptions_ext_2_3; private ORBTest_ExceptionsExt_2_3.Intf m_test_intf_exceptions_ext_2_3_tie; private ORBTest_ExceptionsExt_2_3.Intf m_test_intf_exceptions_ext_2_3_dsi; private TestIntfStubTimeout_impl m_test_intf_stub_timeout_impl; private ORBTest_StubTimeout.IntfPOATie m_test_intf_stub_timeout_tie_impl; private TestIntfStubTimeoutDSI_impl m_test_intf_stub_timeout_dsi_impl; private ORBTest_StubTimeout.Intf m_test_intf_stub_timeout; private ORBTest_StubTimeout.Intf m_test_intf_stub_timeout_tie; private ORBTest_StubTimeout.Intf m_test_intf_stub_timeout_dsi; interface TestCaseInitializer { public void init(org.omg.CORBA.ORB orb, TestIntf_impl impl, ORBTest.TestCase test_case); } private class TestIntfBasicInitializer implements TestCaseInitializer { ImplType m_impl_type; public TestIntfBasicInitializer(ImplType impl_type) { m_impl_type = impl_type; } public void init(org.omg.CORBA.ORB orb, TestIntf_impl impl, ORBTest.TestCase test_case) { // SSI implementation // if (impl.m_test_intf_basic_impl == null) { impl.m_test_intf_basic_impl = (new TestIntfBasic_impl( impl.m_poa)); impl.m_test_intf_basic = (impl.m_test_intf_basic_impl ._this(m_orb)); } // Tie implementation // if (m_impl_type.equals(ImplType.Tie) && impl.m_test_intf_basic_tie_impl == null) { impl.m_test_intf_basic_tie_impl = (new ORBTest_Basic.IntfPOATie( impl.m_test_intf_basic_impl, impl.m_poa)); impl.m_test_intf_basic_tie = (impl.m_test_intf_basic_tie_impl ._this(m_orb)); } // DSI implementation // if (m_impl_type.equals(ImplType.DSI) && impl.m_test_intf_basic_dsi_impl == null) { impl.m_test_intf_basic_dsi_impl = (new TestIntfBasicDSI_impl( impl.m_orb, impl.m_test_intf_basic)); try { byte[] id = impl.m_poa .activate_object(impl.m_test_intf_basic_dsi_impl); org.omg.CORBA.Object obj = (impl.m_poa .create_reference_with_id(id, "IDL:ORBTest_Basic/Intf:1.0")); impl.m_test_intf_basic_dsi = (ORBTest_Basic.IntfHelper .narrow(obj)); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { } } test_case.impl_description = m_impl_type.to_string(); if (m_impl_type.equals(ImplType.SSI)) { test_case.impl = impl.m_test_intf_basic; } else if (m_impl_type.equals(ImplType.Tie)) { test_case.impl = impl.m_test_intf_basic_tie; } else if (m_impl_type.equals(ImplType.DSI)) { test_case.impl = impl.m_test_intf_basic_dsi; } } } private class TestIntfContextInitializer implements TestCaseInitializer { ImplType m_impl_type; public TestIntfContextInitializer(ImplType impl_type) { m_impl_type = impl_type; } public void init(org.omg.CORBA.ORB orb, TestIntf_impl impl, ORBTest.TestCase test_case) { // SSI implementation // if (impl.m_test_intf_context_impl == null) { impl.m_test_intf_context_impl = (new TestIntfContext_impl( impl.m_poa)); impl.m_test_intf_context = (impl.m_test_intf_context_impl ._this(m_orb)); } // Tie implementation // if (m_impl_type.equals(ImplType.Tie) && impl.m_test_intf_context_tie_impl == null) { impl.m_test_intf_context_tie_impl = (new ORBTest_Context.IntfPOATie( impl.m_test_intf_context_impl, impl.m_poa)); impl.m_test_intf_context_tie = (impl.m_test_intf_context_tie_impl ._this(m_orb)); } // DSI implementation // if (m_impl_type.equals(ImplType.DSI) && impl.m_test_intf_context_dsi_impl == null) { impl.m_test_intf_context_dsi_impl = (new TestIntfContextDSI_impl( impl.m_orb, impl.m_test_intf_context)); try { byte[] id = impl.m_poa .activate_object(impl.m_test_intf_context_dsi_impl); org.omg.CORBA.Object obj = (impl.m_poa .create_reference_with_id(id, "IDL:ORBTest_Context/Intf:1.0")); impl.m_test_intf_context_dsi = (ORBTest_Context.IntfHelper .narrow(obj)); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { } } test_case.impl_description = m_impl_type.to_string(); if (m_impl_type.equals(ImplType.SSI)) { test_case.impl = impl.m_test_intf_context; } else if (m_impl_type.equals(ImplType.Tie)) { test_case.impl = impl.m_test_intf_context_tie; } else if (m_impl_type.equals(ImplType.DSI)) { test_case.impl = impl.m_test_intf_context_dsi; } } } private class TestIntfExceptionsInitializer implements TestCaseInitializer { ImplType m_impl_type; public TestIntfExceptionsInitializer(ImplType impl_type) { m_impl_type = impl_type; } public void init(org.omg.CORBA.ORB orb, TestIntf_impl impl, ORBTest.TestCase test_case) { // SSI implementation // if (impl.m_test_intf_exceptions_impl == null) { impl.m_test_intf_exceptions_impl = (new TestIntfExceptions_impl( impl.m_poa)); impl.m_test_intf_exceptions = (impl.m_test_intf_exceptions_impl ._this(m_orb)); } // Tie implementation // if (m_impl_type.equals(ImplType.Tie) && impl.m_test_intf_exceptions_tie_impl == null) { impl.m_test_intf_exceptions_tie_impl = (new ORBTest_Exceptions.IntfPOATie( impl.m_test_intf_exceptions_impl, impl.m_poa)); impl.m_test_intf_exceptions_tie = (impl.m_test_intf_exceptions_tie_impl ._this(m_orb)); } // DSI implementation // if (m_impl_type.equals(ImplType.DSI) && impl.m_test_intf_exceptions_dsi_impl == null) { impl.m_test_intf_exceptions_dsi_impl = (new TestIntfExceptionsDSI_impl( impl.m_orb)); try { byte[] id = impl.m_poa .activate_object(impl.m_test_intf_exceptions_dsi_impl); org.omg.CORBA.Object obj = (impl.m_poa .create_reference_with_id(id, "IDL:ORBTest_Exceptions/Intf:1.0")); impl.m_test_intf_exceptions_dsi = (ORBTest_Exceptions.IntfHelper .narrow(obj)); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { } } test_case.impl_description = m_impl_type.to_string(); if (m_impl_type.equals(ImplType.SSI)) { test_case.impl = impl.m_test_intf_exceptions; } else if (m_impl_type.equals(ImplType.Tie)) { test_case.impl = impl.m_test_intf_exceptions_tie; } else if (m_impl_type.equals(ImplType.DSI)) { test_case.impl = impl.m_test_intf_exceptions_dsi; } } } private class TestIntfExceptionsExt_2_0Initializer implements TestCaseInitializer { ImplType m_impl_type; public TestIntfExceptionsExt_2_0Initializer(ImplType impl_type) { m_impl_type = impl_type; } public void init(org.omg.CORBA.ORB orb, TestIntf_impl impl, ORBTest.TestCase test_case) { // SSI implementation // if (impl.m_test_intf_exceptions_ext_2_0_impl == null) { impl.m_test_intf_exceptions_ext_2_0_impl = (new TestIntfExceptionsExt_2_0_impl( impl.m_poa)); impl.m_test_intf_exceptions_ext_2_0 = (impl.m_test_intf_exceptions_ext_2_0_impl ._this(m_orb)); } // Tie implementation // if (m_impl_type.equals(ImplType.Tie) && impl.m_test_intf_exceptions_ext_2_0_tie_impl == null) { impl.m_test_intf_exceptions_ext_2_0_tie_impl = (new ORBTest_ExceptionsExt_2_0.IntfPOATie( impl.m_test_intf_exceptions_ext_2_0_impl, impl.m_poa)); impl.m_test_intf_exceptions_ext_2_0_tie = (impl.m_test_intf_exceptions_ext_2_0_tie_impl ._this(m_orb)); } // DSI implementation // if (m_impl_type.equals(ImplType.DSI) && impl.m_test_intf_exceptions_ext_2_0_dsi_impl == null) { impl.m_test_intf_exceptions_ext_2_0_dsi_impl = (new TestIntfExceptionsExt_2_0DSI_impl( impl.m_orb)); try { byte[] id = impl.m_poa .activate_object(impl.m_test_intf_exceptions_ext_2_0_dsi_impl); org.omg.CORBA.Object obj = (impl.m_poa .create_reference_with_id(id, "IDL:ORBTest_ExceptionsExt_2_0/Intf:1.0")); impl.m_test_intf_exceptions_ext_2_0_dsi = (ORBTest_ExceptionsExt_2_0.IntfHelper .narrow(obj)); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { } } test_case.impl_description = m_impl_type.to_string(); if (m_impl_type.equals(ImplType.SSI)) { test_case.impl = impl.m_test_intf_exceptions_ext_2_0; } else if (m_impl_type.equals(ImplType.Tie)) { test_case.impl = impl.m_test_intf_exceptions_ext_2_0_tie; } else if (m_impl_type.equals(ImplType.DSI)) { test_case.impl = impl.m_test_intf_exceptions_ext_2_0_dsi; } } } private class TestIntfWCharInitializer implements TestCaseInitializer { ImplType m_impl_type; public TestIntfWCharInitializer(ImplType impl_type) { m_impl_type = impl_type; } public void init(org.omg.CORBA.ORB orb, TestIntf_impl impl, ORBTest.TestCase test_case) { // SSI implementation // if (impl.m_test_intf_wchar_impl == null) { impl.m_test_intf_wchar_impl = (new TestIntfWChar_impl( impl.m_poa)); impl.m_test_intf_wchar = (impl.m_test_intf_wchar_impl ._this(m_orb)); } // Tie implementation // if (m_impl_type.equals(ImplType.Tie) && impl.m_test_intf_wchar_tie_impl == null) { impl.m_test_intf_wchar_tie_impl = (new ORBTest_WChar.IntfPOATie( impl.m_test_intf_wchar_impl, impl.m_poa)); impl.m_test_intf_wchar_tie = (impl.m_test_intf_wchar_tie_impl ._this(m_orb)); } // DSI implementation // if (m_impl_type.equals(ImplType.DSI) && impl.m_test_intf_wchar_dsi_impl == null) { impl.m_test_intf_wchar_dsi_impl = (new TestIntfWCharDSI_impl( impl.m_orb, impl.m_test_intf_wchar)); try { byte[] id = impl.m_poa .activate_object(impl.m_test_intf_wchar_dsi_impl); org.omg.CORBA.Object obj = (impl.m_poa .create_reference_with_id(id, "IDL:ORBTest_WChar/Intf:1.0")); impl.m_test_intf_wchar_dsi = (ORBTest_WChar.IntfHelper .narrow(obj)); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { } } test_case.impl_description = m_impl_type.to_string(); if (m_impl_type.equals(ImplType.SSI)) { test_case.impl = impl.m_test_intf_wchar; } else if (m_impl_type.equals(ImplType.Tie)) { test_case.impl = impl.m_test_intf_wchar_tie; } else if (m_impl_type.equals(ImplType.DSI)) { test_case.impl = impl.m_test_intf_wchar_dsi; } } } private class TestIntfFixedInitializer implements TestCaseInitializer { ImplType m_impl_type; public TestIntfFixedInitializer(ImplType impl_type) { m_impl_type = impl_type; } public void init(org.omg.CORBA.ORB orb, TestIntf_impl impl, ORBTest.TestCase test_case) { // SSI implementation // if (impl.m_test_intf_fixed_impl == null) { impl.m_test_intf_fixed_impl = (new TestIntfFixed_impl( impl.m_poa)); impl.m_test_intf_fixed = (impl.m_test_intf_fixed_impl ._this(m_orb)); } // Tie implementation // if (m_impl_type.equals(ImplType.Tie) && impl.m_test_intf_fixed_tie_impl == null) { impl.m_test_intf_fixed_tie_impl = (new ORBTest_Fixed.IntfPOATie( impl.m_test_intf_fixed_impl, impl.m_poa)); impl.m_test_intf_fixed_tie = (impl.m_test_intf_fixed_tie_impl ._this(m_orb)); } // DSI implementation // if (m_impl_type.equals(ImplType.DSI) && impl.m_test_intf_fixed_dsi_impl == null) { impl.m_test_intf_fixed_dsi_impl = (new TestIntfFixedDSI_impl( impl.m_orb, impl.m_test_intf_fixed)); try { byte[] id = impl.m_poa .activate_object(impl.m_test_intf_fixed_dsi_impl); org.omg.CORBA.Object obj = (impl.m_poa .create_reference_with_id(id, "IDL:ORBTest_Fixed/Intf:1.0")); impl.m_test_intf_fixed_dsi = (ORBTest_Fixed.IntfHelper .narrow(obj)); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { } } test_case.impl_description = m_impl_type.to_string(); if (m_impl_type.equals(ImplType.SSI)) { test_case.impl = impl.m_test_intf_fixed; } else if (m_impl_type.equals(ImplType.Tie)) { test_case.impl = impl.m_test_intf_fixed_tie; } else if (m_impl_type.equals(ImplType.DSI)) { test_case.impl = impl.m_test_intf_fixed_dsi; } } } private class TestIntfLongLongInitializer implements TestCaseInitializer { ImplType m_impl_type; public TestIntfLongLongInitializer(ImplType impl_type) { m_impl_type = impl_type; } public void init(org.omg.CORBA.ORB orb, TestIntf_impl impl, ORBTest.TestCase test_case) { // SSI implementation // if (impl.m_test_intf_long_long_impl == null) { impl.m_test_intf_long_long_impl = (new TestIntfLongLong_impl( impl.m_poa)); impl.m_test_intf_long_long = (impl.m_test_intf_long_long_impl ._this(m_orb)); } // Tie implementation // if (m_impl_type.equals(ImplType.Tie) && impl.m_test_intf_long_long_tie_impl == null) { impl.m_test_intf_long_long_tie_impl = (new ORBTest_LongLong.IntfPOATie( impl.m_test_intf_long_long_impl, impl.m_poa)); impl.m_test_intf_long_long_tie = (impl.m_test_intf_long_long_tie_impl ._this(m_orb)); } // DSI implementation // if (m_impl_type.equals(ImplType.DSI) && impl.m_test_intf_long_long_dsi_impl == null) { impl.m_test_intf_long_long_dsi_impl = (new TestIntfLongLongDSI_impl( impl.m_orb, impl.m_test_intf_long_long)); try { byte[] id = impl.m_poa .activate_object(impl.m_test_intf_long_long_dsi_impl); org.omg.CORBA.Object obj = (impl.m_poa .create_reference_with_id(id, "IDL:ORBTest_LongLong/Intf:1.0")); impl.m_test_intf_long_long_dsi = (ORBTest_LongLong.IntfHelper .narrow(obj)); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { } } test_case.impl_description = m_impl_type.to_string(); if (m_impl_type.equals(ImplType.SSI)) { test_case.impl = impl.m_test_intf_long_long; } else if (m_impl_type.equals(ImplType.Tie)) { test_case.impl = impl.m_test_intf_long_long_tie; } else if (m_impl_type.equals(ImplType.DSI)) { test_case.impl = impl.m_test_intf_long_long_dsi; } } } private class TestIntfExceptionsExt_2_3Initializer implements TestCaseInitializer { ImplType m_impl_type; public TestIntfExceptionsExt_2_3Initializer(ImplType impl_type) { m_impl_type = impl_type; } public void init(org.omg.CORBA.ORB orb, TestIntf_impl impl, ORBTest.TestCase test_case) { // SSI implementation // if (impl.m_test_intf_exceptions_ext_2_3_impl == null) { impl.m_test_intf_exceptions_ext_2_3_impl = (new TestIntfExceptionsExt_2_3_impl( impl.m_poa)); impl.m_test_intf_exceptions_ext_2_3 = (impl.m_test_intf_exceptions_ext_2_3_impl ._this(m_orb)); } // Tie implementation // if (m_impl_type.equals(ImplType.Tie) && impl.m_test_intf_exceptions_ext_2_3_tie_impl == null) { impl.m_test_intf_exceptions_ext_2_3_tie_impl = (new ORBTest_ExceptionsExt_2_3.IntfPOATie( impl.m_test_intf_exceptions_ext_2_3_impl, impl.m_poa)); impl.m_test_intf_exceptions_ext_2_3_tie = (impl.m_test_intf_exceptions_ext_2_3_tie_impl ._this(m_orb)); } // DSI implementation // if (m_impl_type.equals(ImplType.DSI) && impl.m_test_intf_exceptions_ext_2_3_dsi_impl == null) { impl.m_test_intf_exceptions_ext_2_3_dsi_impl = (new TestIntfExceptionsExt_2_3DSI_impl( impl.m_orb)); try { byte[] id = impl.m_poa .activate_object(impl.m_test_intf_exceptions_ext_2_3_dsi_impl); org.omg.CORBA.Object obj = (impl.m_poa .create_reference_with_id(id, "IDL:ORBTest_ExceptionsExt_2_3/Intf:1.0")); impl.m_test_intf_exceptions_ext_2_3_dsi = (ORBTest_ExceptionsExt_2_3.IntfHelper .narrow(obj)); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { } } test_case.impl_description = m_impl_type.to_string(); if (m_impl_type.equals(ImplType.SSI)) { test_case.impl = impl.m_test_intf_exceptions_ext_2_3; } else if (m_impl_type.equals(ImplType.Tie)) { test_case.impl = impl.m_test_intf_exceptions_ext_2_3_tie; } else if (m_impl_type.equals(ImplType.DSI)) { test_case.impl = impl.m_test_intf_exceptions_ext_2_3_dsi; } } } private class TestIntfStubTimeoutInitializer implements TestCaseInitializer { ImplType m_impl_type; public TestIntfStubTimeoutInitializer(ImplType impl_type) { m_impl_type = impl_type; } public void init(org.omg.CORBA.ORB orb, TestIntf_impl impl, ORBTest.TestCase test_case) { // SSI implementation // if (impl.m_test_intf_stub_timeout_impl == null) { impl.m_test_intf_stub_timeout_impl = (new TestIntfStubTimeout_impl( impl.m_poa)); impl.m_test_intf_stub_timeout = (impl.m_test_intf_stub_timeout_impl ._this(m_orb)); } // Tie implementation // if (m_impl_type.equals(ImplType.Tie) && impl.m_test_intf_stub_timeout_tie_impl == null) { impl.m_test_intf_stub_timeout_tie_impl = (new ORBTest_StubTimeout.IntfPOATie( impl.m_test_intf_stub_timeout_impl, impl.m_poa)); impl.m_test_intf_stub_timeout_tie = (impl.m_test_intf_stub_timeout_tie_impl ._this(m_orb)); } // DSI implementation // if (m_impl_type.equals(ImplType.DSI) && impl.m_test_intf_stub_timeout_dsi_impl == null) { impl.m_test_intf_stub_timeout_dsi_impl = (new TestIntfStubTimeoutDSI_impl( impl.m_orb, impl.m_test_intf_stub_timeout)); try { byte[] id = impl.m_poa .activate_object(impl.m_test_intf_stub_timeout_dsi_impl); org.omg.CORBA.Object obj = (impl.m_poa .create_reference_with_id(id, "IDL:ORBTest_StubTimeout/Intf:1.0")); impl.m_test_intf_stub_timeout_dsi = (ORBTest_StubTimeout.IntfHelper .narrow(obj)); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { } } test_case.impl_description = m_impl_type.to_string(); if (m_impl_type.equals(ImplType.SSI)) { test_case.impl = impl.m_test_intf_stub_timeout; } else if (m_impl_type.equals(ImplType.Tie)) { test_case.impl = impl.m_test_intf_stub_timeout_tie; } else if (m_impl_type.equals(ImplType.DSI)) { test_case.impl = impl.m_test_intf_stub_timeout_dsi; } } } private TestCaseInitializer test_case_initializers[] = { new TestIntfBasicInitializer(ImplType.SSI), new TestIntfContextInitializer(ImplType.SSI), new TestIntfExceptionsInitializer(ImplType.SSI), new TestIntfExceptionsExt_2_0Initializer(ImplType.SSI), new TestIntfWCharInitializer(ImplType.SSI), new TestIntfFixedInitializer(ImplType.SSI), new TestIntfLongLongInitializer(ImplType.SSI), new TestIntfExceptionsExt_2_3Initializer(ImplType.SSI), new TestIntfStubTimeoutInitializer(ImplType.SSI), new TestIntfBasicInitializer(ImplType.Tie), new TestIntfContextInitializer(ImplType.Tie), new TestIntfExceptionsInitializer(ImplType.Tie), new TestIntfExceptionsExt_2_0Initializer(ImplType.Tie), new TestIntfWCharInitializer(ImplType.Tie), new TestIntfFixedInitializer(ImplType.Tie), new TestIntfLongLongInitializer(ImplType.Tie), new TestIntfExceptionsExt_2_3Initializer(ImplType.Tie), new TestIntfStubTimeoutInitializer(ImplType.Tie), new TestIntfBasicInitializer(ImplType.DSI), new TestIntfContextInitializer(ImplType.DSI), new TestIntfExceptionsInitializer(ImplType.DSI), new TestIntfExceptionsExt_2_0Initializer(ImplType.DSI), new TestIntfWCharInitializer(ImplType.DSI), new TestIntfFixedInitializer(ImplType.DSI), new TestIntfLongLongInitializer(ImplType.DSI), new TestIntfExceptionsExt_2_3Initializer(ImplType.DSI), new TestIntfStubTimeoutInitializer(ImplType.DSI) }; public TestIntf_impl(ORB orb, POA poa) { m_orb = orb; m_poa = poa; } public ORBType get_ORB_type() { return ORBTest.ORBType.ORBacus4; } public synchronized void deactivate() { m_orb.shutdown(false); } public synchronized boolean concurrent_request_execution() { POA poa = _default_POA(); org.apache.yoko.orb.OBPortableServer.POA obpoa = org.apache.yoko.orb.OBPortableServer.POAHelper .narrow(poa); org.apache.yoko.orb.OB.DispatchStrategy strategy = obpoa .the_dispatch_strategy(); return strategy.id() != org.apache.yoko.orb.OB.SAME_THREAD.value; } public synchronized TestCase[] get_test_case_list() { int num_test_cases = test_case_initializers.length; ORBTest.TestCase[] ret = new ORBTest.TestCase[num_test_cases]; // Construct the list of supported test cases // for (int i = 0; i < num_test_cases; ++i) { ret[i] = new ORBTest.TestCase(); test_case_initializers[i].init(m_orb, this, ret[i]); } return ret; } public org.omg.PortableServer.POA _default_POA() { return m_poa; } }
5,955
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/ImplType.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // Typesafe enum pattern // public class ImplType { private final String m_name; private ImplType(String name) { m_name = name; } public String to_string() { return m_name; } public static final ImplType SSI = new ImplType("SSI"); public static final ImplType Tie = new ImplType("Tie"); public static final ImplType DSI = new ImplType("DSI"); };
5,956
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestCaseListHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/TestCaseList:1.0 // final public class TestCaseListHolder implements org.omg.CORBA.portable.Streamable { public TestCase[] value; public TestCaseListHolder() { } public TestCaseListHolder(TestCase[] initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = TestCaseListHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { TestCaseListHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return TestCaseListHelper.type(); } }
5,957
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfExceptionsDSI_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; class TestIntfExceptionsDSI_impl extends org.omg.PortableServer.DynamicImplementation { private ORB m_orb; TestIntfExceptionsDSI_impl(ORB orb) { m_orb = orb; } static final String[] m_ids = { "IDL:ORBTest_Exceptions/Intf:1.0" }; public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] object_id) { return m_ids; } public void invoke(ServerRequest request) { String name = request.operation(); boolean ex; if (name.length() > 2 && name.endsWith("Ex")) { name = name.substring(0, name.length() - 2); ex = true; } else { ex = false; } if (name.equals("op_UNKNOWN_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); UNKNOWNHelper.insert(any, new UNKNOWN(1, CompletionStatus.COMPLETED_YES)); request.set_exception(any); return; } if (name.equals("op_BAD_PARAM_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); BAD_PARAMHelper.insert(any, new BAD_PARAM(2, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_NO_MEMORY_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); NO_MEMORYHelper.insert(any, new NO_MEMORY(3, CompletionStatus.COMPLETED_MAYBE)); request.set_exception(any); return; } if (name.equals("op_IMP_LIMIT_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); IMP_LIMITHelper.insert(any, new IMP_LIMIT(4, CompletionStatus.COMPLETED_YES)); request.set_exception(any); return; } if (name.equals("op_COMM_FAILURE_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); COMM_FAILUREHelper.insert(any, new COMM_FAILURE(5, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_INV_OBJREF_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); INV_OBJREFHelper.insert(any, new INV_OBJREF(6, CompletionStatus.COMPLETED_MAYBE)); request.set_exception(any); return; } if (name.equals("op_NO_PERMISSION_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); NO_PERMISSIONHelper.insert(any, new NO_PERMISSION(7, CompletionStatus.COMPLETED_YES)); request.set_exception(any); return; } if (name.equals("op_INTERNAL_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); INTERNALHelper.insert(any, new INTERNAL(8, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_MARSHAL_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); MARSHALHelper.insert(any, new MARSHAL(9, CompletionStatus.COMPLETED_MAYBE)); request.set_exception(any); return; } if (name.equals("op_INITIALIZE_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); INITIALIZEHelper.insert(any, new INITIALIZE(10, CompletionStatus.COMPLETED_YES)); request.set_exception(any); return; } if (name.equals("op_NO_IMPLEMENT_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); NO_IMPLEMENTHelper.insert(any, new NO_IMPLEMENT(11, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_BAD_TYPECODE_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); BAD_TYPECODEHelper.insert(any, new BAD_TYPECODE(12, CompletionStatus.COMPLETED_MAYBE)); request.set_exception(any); return; } if (name.equals("op_BAD_OPERATION_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); BAD_OPERATIONHelper.insert(any, new BAD_OPERATION(13, CompletionStatus.COMPLETED_YES)); request.set_exception(any); return; } if (name.equals("op_NO_RESOURCES_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); NO_RESOURCESHelper.insert(any, new NO_RESOURCES(14, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_NO_RESPONSE_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); NO_RESPONSEHelper.insert(any, new NO_RESPONSE(15, CompletionStatus.COMPLETED_MAYBE)); request.set_exception(any); return; } if (name.equals("op_BAD_INV_ORDER_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); BAD_INV_ORDERHelper.insert(any, new BAD_INV_ORDER(17, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_TRANSIENT_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); TRANSIENTHelper.insert(any, new TRANSIENT(18, CompletionStatus.COMPLETED_MAYBE)); request.set_exception(any); return; } if (name.equals("op_OBJ_ADAPTER_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); OBJ_ADAPTERHelper.insert(any, new OBJ_ADAPTER(24, CompletionStatus.COMPLETED_MAYBE)); request.set_exception(any); return; } if (name.equals("op_DATA_CONVERSION_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); DATA_CONVERSIONHelper.insert(any, new DATA_CONVERSION(25, CompletionStatus.COMPLETED_YES)); request.set_exception(any); return; } if (name.equals("op_OBJECT_NOT_EXIST_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); OBJECT_NOT_EXISTHelper.insert(any, new OBJECT_NOT_EXIST(26, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_INV_POLICY_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); INV_POLICYHelper.insert(any, new INV_POLICY(30, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } System.err.println("DSI implementation: unknown operation: " + name); NVList list = m_orb.create_list(0); request.arguments(list); Any exAny = m_orb.create_any(); BAD_OPERATIONHelper.insert(exAny, new BAD_OPERATION()); request.set_exception(exAny); } }
5,958
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfExceptionsExt_2_0DSI_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; class TestIntfExceptionsExt_2_0DSI_impl extends org.omg.PortableServer.DynamicImplementation { private ORB m_orb; TestIntfExceptionsExt_2_0DSI_impl(ORB orb) { m_orb = orb; } static final String[] m_ids = { "IDL:ORBTest_ExceptionsExt_2_0/Intf:1.0" }; public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] object_id) { return m_ids; } public void invoke(ServerRequest request) { String name = request.operation(); boolean ex; if (name.length() > 2 && name.endsWith("Ex")) { name = name.substring(0, name.length() - 2); ex = true; } else { ex = false; } if (name.equals("op_PERSIST_STORE_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); PERSIST_STOREHelper.insert(any, new PERSIST_STORE(16, CompletionStatus.COMPLETED_YES)); request.set_exception(any); return; } if (name.equals("op_FREE_MEM_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); FREE_MEMHelper.insert(any, new FREE_MEM(19, CompletionStatus.COMPLETED_YES)); request.set_exception(any); return; } if (name.equals("op_INV_IDENT_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); INV_IDENTHelper.insert(any, new INV_IDENT(20, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_INV_FLAG_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); INV_FLAGHelper.insert(any, new INV_FLAG(21, CompletionStatus.COMPLETED_MAYBE)); request.set_exception(any); return; } if (name.equals("op_INTF_REPOS_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); INTF_REPOSHelper.insert(any, new INTF_REPOS(22, CompletionStatus.COMPLETED_YES)); request.set_exception(any); return; } if (name.equals("op_BAD_CONTEXT_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); BAD_CONTEXTHelper.insert(any, new BAD_CONTEXT(23, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_TRANSACTION_REQUIRED_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); TRANSACTION_REQUIREDHelper.insert(any, new TRANSACTION_REQUIRED(27, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_TRANSACTION_ROLLEDBACK_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); TRANSACTION_ROLLEDBACKHelper.insert(any, new TRANSACTION_ROLLEDBACK(28, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } if (name.equals("op_INVALID_TRANSACTION_")) { if (!ex) throw new RuntimeException(); NVList list = m_orb.create_list(0); request.arguments(list); Any any = m_orb.create_any(); INVALID_TRANSACTIONHelper.insert(any, new INVALID_TRANSACTION(29, CompletionStatus.COMPLETED_NO)); request.set_exception(any); return; } System.err.println("DSI implementation: unknown operation: " + name); NVList list = m_orb.create_list(0); request.arguments(list); Any exAny = m_orb.create_any(); BAD_OPERATIONHelper.insert(exAny, new BAD_OPERATION()); request.set_exception(exAny); } }
5,959
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/IntfHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/Intf:1.0 // final public class IntfHolder implements org.omg.CORBA.portable.Streamable { public Intf value; public IntfHolder() { } public IntfHolder(Intf initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = IntfHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { IntfHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return IntfHelper.type(); } }
5,960
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfWCharDSI_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; class TestIntfWCharDSI_impl extends org.omg.PortableServer.DynamicImplementation { private ORB m_orb; private ORBTest_WChar.Intf m_ti; TestIntfWCharDSI_impl(ORB orb, ORBTest_WChar.Intf ti) { m_orb = orb; m_ti = ti; } static final String[] m_ids = { "IDL:ORBTest_WChar/Intf:1.0" }; public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] object_id) { return m_ids; } public void invoke(ServerRequest request) { String name = request.operation(); boolean ex; if (name.length() > 2 && name.endsWith("Ex")) { name = name.substring(0, name.length() - 2); ex = true; } else { ex = false; } if (name.equals("_get_attrWChar")) { NVList list = m_orb.create_list(0); request.arguments(list); char ret = m_ti.attrWChar(); Any any = m_orb.create_any(); any.insert_wchar(ret); request.set_result(any); return; } if (name.equals("_set_attrWChar")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_wchar)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); char arg = any.extract_wchar(); m_ti.attrWChar(arg); return; } if (name.equals("opWChar")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_wchar)); any1.type(m_orb.get_primitive_tc(TCKind.tk_wchar)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); char arg0 = any0.extract_wchar(); CharHolder arg1 = new CharHolder(); arg1.value = any1.extract_wchar(); CharHolder arg2 = new CharHolder(); char ret = m_ti.opWChar(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_WChar.ExWCharHelper.insert(exAny, new ORBTest_WChar.ExWChar(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_wchar(ret); request.set_result(result); any1.insert_wchar(arg1.value); any2.insert_wchar(arg2.value); } return; } if (name.equals("_get_attrWString")) { NVList list = m_orb.create_list(0); request.arguments(list); String ret = m_ti.attrWString(); Any any = m_orb.create_any(); any.insert_wstring(ret); request.set_result(any); return; } if (name.equals("_set_attrWString")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_wstring)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); String arg = any.extract_wstring(); m_ti.attrWString(arg); return; } if (name.equals("opWString")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_wstring)); any1.type(m_orb.get_primitive_tc(TCKind.tk_wstring)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); String arg0 = any0.extract_wstring(); StringHolder arg1 = new StringHolder(); arg1.value = any1.extract_wstring(); StringHolder arg2 = new StringHolder(); String ret = m_ti.opWString(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_WChar.ExWStringHelper.insert(exAny, new ORBTest_WChar.ExWString(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_wstring(ret); request.set_result(result); any1.insert_wstring(arg1.value); any2.insert_wstring(arg2.value); } return; } System.err.println("DSI implementation: unknown operation: " + name); NVList list = m_orb.create_list(0); request.arguments(list); Any exAny = m_orb.create_any(); BAD_OPERATIONHelper.insert(exAny, new BAD_OPERATION()); request.set_exception(exAny); } }
5,961
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/IntfOperations.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/Intf:1.0 // /***/ public interface IntfOperations { // // IDL:ORBTest/Intf/get_ORB_type:1.0 // /***/ ORBType get_ORB_type(); // // IDL:ORBTest/Intf/deactivate:1.0 // /***/ void deactivate(); // // IDL:ORBTest/Intf/concurrent_request_execution:1.0 // /***/ boolean concurrent_request_execution(); // // IDL:ORBTest/Intf/get_test_case_list:1.0 // /***/ TestCase[] get_test_case_list(); }
5,962
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestObjectBasic.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import static org.junit.Assert.assertTrue; import org.omg.CORBA.*; import ORBTest_Basic.*; public class TestObjectBasic extends test.common.TestBase implements TestObject { private ORB m_orb; ORBTest.Intf m_test_intf; public TestObjectBasic(ORB orb, ORBTest.Intf test_intf) { m_orb = orb; m_test_intf = test_intf; } public boolean is_supported(org.omg.CORBA.Object obj) { boolean is_supported = false; if (obj != null) { try { ORBTest_Basic.Intf ti = ORBTest_Basic.IntfHelper.narrow(obj); is_supported = true; } catch (BAD_PARAM e) { is_supported = false; } } return is_supported; } public void test_SII(org.omg.CORBA.Object obj) { ORBTest_Basic.Intf ti = ORBTest_Basic.IntfHelper.narrow(obj); ORBType orb_type = m_test_intf.get_ORB_type(); int i, j, k, l; { ti.opVoid(); } { short ret; ti.attrShort((short) -32768); ret = ti.attrShort(); assertTrue(ret == -32768); ti.attrShort((short) 32767); ret = ti.attrShort(); assertTrue(ret == 32767); ShortHolder inOut = new ShortHolder((short) 20); ShortHolder out = new ShortHolder(); ret = ti.opShort((short) 10, inOut, out); assertTrue(ret == 30); assertTrue(inOut.value == 30); assertTrue(out.value == 30); } { int ret; ti.attrLong(-2147483647 - 1); ret = ti.attrLong(); assertTrue(ret == -2147483647 - 1); ti.attrLong(2147483647); ret = ti.attrLong(); assertTrue(ret == 2147483647); IntHolder inOut = new IntHolder(20); IntHolder out = new IntHolder(); ret = ti.opLong(10, inOut, out); assertTrue(ret == 30); assertTrue(inOut.value == 30); assertTrue(out.value == 30); } { short ret; ti.attrUShort((short) 65535); ret = ti.attrUShort(); assertTrue(ret == (short) 65535); ShortHolder inOut = new ShortHolder((short) 20); ShortHolder out = new ShortHolder(); ret = ti.opUShort((short) 10, inOut, out); assertTrue(ret == 30); assertTrue(inOut.value == 30); assertTrue(out.value == 30); } { int ret; ti.attrULong(2147483647); ret = ti.attrULong(); assertTrue(ret == 2147483647); IntHolder inOut = new IntHolder(20); IntHolder out = new IntHolder(); ret = ti.opULong(10, inOut, out); assertTrue(ret == 30); assertTrue(inOut.value == 30); assertTrue(out.value == 30); } { float ret; ti.attrFloat(3.40282347E+38F); ret = ti.attrFloat(); assertTrue(ret == 3.40282347E+38F); ti.attrFloat(1.17549435E-38F); ret = ti.attrFloat(); assertTrue(ret == 1.17549435E-38F); FloatHolder inOut = new FloatHolder(20); FloatHolder out = new FloatHolder(); ret = ti.opFloat(10, inOut, out); assertTrue(ret == 30); assertTrue(inOut.value == 30); assertTrue(out.value == 30); } { double ret; ti.attrDouble(1.7976931348623157E+308); ret = ti.attrDouble(); assertTrue(ret == 1.7976931348623157E+308); ti.attrDouble(2.2250738585072014E-308); ret = ti.attrDouble(); assertTrue(ret == 2.2250738585072014E-308); DoubleHolder inOut = new DoubleHolder(20); DoubleHolder out = new DoubleHolder(); ret = ti.opDouble(10, inOut, out); assertTrue(ret == 30); assertTrue(inOut.value == 30); assertTrue(out.value == 30); } { boolean ret; ti.attrBoolean(true); ret = ti.attrBoolean(); assertTrue(ret == true); ti.attrBoolean(false); ret = ti.attrBoolean(); assertTrue(ret == false); BooleanHolder inOut = new BooleanHolder(true); BooleanHolder out = new BooleanHolder(); ret = ti.opBoolean(true, inOut, out); assertTrue(ret == true); assertTrue(inOut.value == true); assertTrue(out.value == true); inOut.value = true; ret = ti.opBoolean(false, inOut, out); assertTrue(ret == false); assertTrue(inOut.value == false); assertTrue(out.value == false); inOut.value = false; ret = ti.opBoolean(true, inOut, out); assertTrue(ret == false); assertTrue(inOut.value == false); assertTrue(out.value == false); } { char ret; ti.attrChar('a'); ret = ti.attrChar(); assertTrue(ret == 'a'); ti.attrChar((char) 224); ret = ti.attrChar(); assertTrue(ret == (char) 224); CharHolder inOut = new CharHolder((char) 1); CharHolder out = new CharHolder(); ret = ti.opChar('a', inOut, out); assertTrue(ret == 'b'); assertTrue(inOut.value == 'b'); assertTrue(out.value == 'b'); } { byte ret; ti.attrOctet((byte) 0xff); ret = ti.attrOctet(); assertTrue(ret == (byte) 0xff); ti.attrOctet((byte) 0); ret = ti.attrOctet(); assertTrue(ret == (byte) 0); ByteHolder inOut = new ByteHolder((byte) 20); ByteHolder out = new ByteHolder(); ret = ti.opOctet((byte) 10, inOut, out); assertTrue(ret == 30); assertTrue(inOut.value == 30); assertTrue(out.value == 30); } { String ret; ti.attrString("Hello"); ret = ti.attrString(); assertTrue(ret.equals("Hello")); StringHolder inOut = new StringHolder("world!"); StringHolder out = new StringHolder(); ret = ti.opString("Hello, ", inOut, out); assertTrue(ret.equals("Hello, world!")); assertTrue(out.value.equals("Hello, world!")); } { Any any = m_orb.create_any(); Any ret; for (i = 0; i < 2; i++) { AnyHolder inOut = new AnyHolder(m_orb.create_any()); AnyHolder out = new AnyHolder(); { any.insert_string("abc"); ti.attrAny(any); ret = ti.attrAny(); String s; s = ret.extract_string(); assertTrue(s.equals("abc")); } { any.insert_long(3); ti.attrAny(any); ret = ti.attrAny(); int d; d = ret.extract_long(); assertTrue(d == 3); } { TestEnumHelper.insert(any, TestEnum.TestEnum3); ti.attrAny(any); ret = ti.attrAny(); TestEnum e; e = TestEnumHelper.extract(ret); assertTrue(e == TestEnum.TestEnum3); } { VariableStruct vStruct = new VariableStruct(); vStruct.s = "xyz"; VariableStructHelper.insert(any, vStruct); ret = ti.opAny(any, inOut, out); VariableStruct vStructRet; VariableStruct vStructInOut; VariableStruct vStructOut; vStructRet = VariableStructHelper.extract(ret); vStructInOut = VariableStructHelper.extract(inOut.value); vStructOut = VariableStructHelper.extract(out.value); assertTrue(vStructRet.s.equals("xyz")); assertTrue(vStructInOut.s.equals("xyz")); assertTrue(vStructOut.s.equals("xyz")); } { FixedUnion fUnion = new FixedUnion(); fUnion.l(1); FixedUnionHelper.insert(any, fUnion); ret = ti.opAny(any, inOut, out); FixedUnion fUnionRet; FixedUnion fUnionInOut; FixedUnion fUnionOut; fUnionRet = FixedUnionHelper.extract(ret); fUnionInOut = FixedUnionHelper.extract(inOut.value); fUnionOut = FixedUnionHelper.extract(out.value); assertTrue(fUnionRet.discriminator() == 1); assertTrue(fUnionInOut.discriminator() == 1); assertTrue(fUnionOut.discriminator() == 1); assertTrue(fUnionRet.l() == 1); assertTrue(fUnionInOut.l() == 1); assertTrue(fUnionOut.l() == 1); } { VariableUnion vUnion = new VariableUnion(); vUnion.ti(ti); VariableUnionHelper.insert(any, vUnion); ret = ti.opAny(any, inOut, out); VariableUnion vUnionRet; VariableUnion vUnionInOut; VariableUnion vUnionOut; vUnionRet = VariableUnionHelper.extract(ret); vUnionInOut = VariableUnionHelper.extract(ret); vUnionOut = VariableUnionHelper.extract(ret); assertTrue(!vUnionRet.discriminator()); assertTrue(!vUnionInOut.discriminator()); assertTrue(!vUnionOut.discriminator()); } { ORBTest_Basic.IntfHelper.insert(any, ti); ti.attrAny(any); ret = ti.attrAny(); org.omg.CORBA.Object extract_obj = ret.extract_Object(); ORBTest_Basic.Intf ti2 = (ORBTest_Basic.IntfHelper .extract(ret)); assertTrue(ti._hash(1000) == ti2._hash(1000)); assertTrue(ti._is_equivalent(ti2)); assertTrue(ti._hash(1111) == extract_obj._hash(1111)); assertTrue(ti._is_equivalent(extract_obj)); assertTrue(extract_obj._hash(1234) == ti2._hash(1234)); assertTrue(extract_obj._is_equivalent(ti2)); } { char[] char_seq = { 'a', 'b', 'c', 'd' }; CharSeqHelper.insert(any, char_seq); ti.attrAny(any); ret = ti.attrAny(); char[] ret_char_seq = CharSeqHelper.extract(any); assertTrue(ret_char_seq.length == 4); for (int idx = 0; idx < 4; ++idx) assertTrue(char_seq[idx] == ret_char_seq[idx]); } { char[] wchar_seq = { 'a', 'b', 'c', 'd' }; WCharSeqHelper.insert(any, wchar_seq); ti.attrAny(any); ret = ti.attrAny(); char[] ret_wchar_seq = WCharSeqHelper.extract(any); assertTrue(ret_wchar_seq.length == 4); for (int idx = 0; idx < 4; ++idx) assertTrue(wchar_seq[idx] == ret_wchar_seq[idx]); } } } { TestEnum ret; ti.attrTestEnum(TestEnum.TestEnum2); ret = ti.attrTestEnum(); assertTrue(ret == TestEnum.TestEnum2); ti.attrTestEnum(TestEnum.TestEnum3); ret = ti.attrTestEnum(); assertTrue(ret == TestEnum.TestEnum3); TestEnumHolder inOut = new TestEnumHolder(TestEnum.TestEnum2); TestEnumHolder out = new TestEnumHolder(); ret = ti.opTestEnum(TestEnum.TestEnum3, inOut, out); assertTrue(ret == TestEnum.TestEnum3); assertTrue(inOut.value == TestEnum.TestEnum3); assertTrue(out.value == TestEnum.TestEnum3); } { ORBTest_Basic.Intf ret; ti.attrIntf(ti); ret = ti.attrIntf(); assertTrue(ret._hash(999) == ti._hash(999)); assertTrue(ret._is_equivalent(ti)); ORBTest_Basic.IntfHolder inOut = (new ORBTest_Basic.IntfHolder( (ORBTest_Basic.Intf) (ti._duplicate()))); ORBTest_Basic.IntfHolder out = new ORBTest_Basic.IntfHolder(); ret = ti.opIntf(ti, inOut, out); assertTrue(ret._hash(1001) == ti._hash(1001)); assertTrue(ret._is_equivalent(ti)); assertTrue(inOut.value._hash(5000) == ti._hash(5000)); assertTrue(inOut.value._is_equivalent(ti)); assertTrue(out.value._hash(2000) == ti._hash(2000)); assertTrue(out.value._is_equivalent(ti)); } { FixedStruct st = new FixedStruct(); st.s = 100; st.l = -100; FixedStruct ret; ti.attrFixedStruct(st); ret = ti.attrFixedStruct(); assertTrue(ret.s == st.s); assertTrue(ret.l == st.l); FixedStructHolder inOut = new FixedStructHolder(new FixedStruct()); inOut.value.s = 10000; inOut.value.l = 100000; FixedStructHolder out = new FixedStructHolder(); ret = ti.opFixedStruct(st, inOut, out); assertTrue(ret.s == st.s); assertTrue(ret.l == st.l); assertTrue(inOut.value.s == st.s); assertTrue(out.value.l == st.l); assertTrue(inOut.value.s == st.s); assertTrue(out.value.l == st.l); } { VariableStruct st = new VariableStruct(); st.s = "$$$"; VariableStruct ret; ti.attrVariableStruct(st); ret = ti.attrVariableStruct(); assertTrue(ret.s.equals(st.s)); VariableStructHolder inOut = new VariableStructHolder( new VariableStruct()); inOut.value.s = "bla"; VariableStructHolder out = new VariableStructHolder(); ret = ti.opVariableStruct(st, inOut, out); assertTrue(ret.s.equals(st.s)); assertTrue(inOut.value.s.equals(st.s)); assertTrue(out.value.s.equals(st.s)); } { FixedUnion un = new FixedUnion(); un.l(1); FixedUnion ret; ti.attrFixedUnion(un); ret = ti.attrFixedUnion(); assertTrue(ret.discriminator() == 1); assertTrue(ret.l() == 1); un.b((short) 999, true); FixedUnionHolder inOut = new FixedUnionHolder(); inOut.value = new FixedUnion(); inOut.value.l(100); FixedUnionHolder out = new FixedUnionHolder(); ret = ti.opFixedUnion(un, inOut, out); assertTrue(ret.discriminator() == 999); assertTrue(ret.b() == true); assertTrue(out.value.discriminator() == 999); assertTrue(out.value.b() == true); assertTrue(inOut.value.discriminator() == 999); assertTrue(inOut.value.b() == true); FixedStruct st = new FixedStruct(); st.s = 10101; st.l = -10101; un.st(st); inOut.value = new FixedUnion(); inOut.value.l(100); ret = ti.opFixedUnion(un, inOut, out); assertTrue(ret.discriminator() == 3); assertTrue(ret.st().s == 10101); assertTrue(ret.st().l == -10101); assertTrue(out.value.discriminator() == 3); assertTrue(out.value.st().s == 10101); assertTrue(out.value.st().l == -10101); assertTrue(inOut.value.discriminator() == 3); assertTrue(inOut.value.st().s == 10101); assertTrue(inOut.value.st().l == -10101); } { VariableUnion un = new VariableUnion(); VariableStruct st = new VariableStruct(); st.s = "$$$"; un.st(st); VariableUnion ret; ti.attrVariableUnion(un); ret = ti.attrVariableUnion(); assertTrue(ret.st().s.equals("$$$")); un.ti(ti); VariableUnionHolder inOut = new VariableUnionHolder( new VariableUnion()); VariableUnionHolder out = new VariableUnionHolder(); inOut.value.st(st); ret = ti.opVariableUnion(un, inOut, out); assertTrue(ret.ti()._hash(1000) == ti._hash(1000)); assertTrue(ret.ti()._is_equivalent(ti)); assertTrue(inOut.value.ti()._hash(5000) == ti._hash(5000)); assertTrue(inOut.value.ti()._is_equivalent(ti)); assertTrue(out.value.ti()._hash(2000) == ti._hash(2000)); assertTrue(out.value.ti()._is_equivalent(ti)); } { String[] seq = new String[3]; seq[0] = "!!!"; seq[1] = "@@@"; seq[2] = "###"; String[] ret; ti.attrStringSequence(seq); ret = ti.attrStringSequence(); assertTrue(ret.length == 3); assertTrue(ret[0].equals("!!!")); assertTrue(ret[1].equals("@@@")); assertTrue(ret[2].equals("###")); StringSequenceHolder inOut = new StringSequenceHolder(new String[2]); inOut.value[0] = "%"; inOut.value[1] = "^^"; StringSequenceHolder out = new StringSequenceHolder(); ret = ti.opStringSequence(seq, inOut, out); assertTrue(ret.length == 5); assertTrue(ret[0].equals("!!!")); assertTrue(ret[1].equals("@@@")); assertTrue(ret[2].equals("###")); assertTrue(ret[3].equals("%")); assertTrue(ret[4].equals("^^")); assertTrue(inOut.value.length == 5); assertTrue(inOut.value[0].equals("!!!")); assertTrue(inOut.value[1].equals("@@@")); assertTrue(inOut.value[2].equals("###")); assertTrue(inOut.value[3].equals("%")); assertTrue(inOut.value[4].equals("^^")); assertTrue(out.value.length == 5); assertTrue(out.value[0].equals("!!!")); assertTrue(out.value[1].equals("@@@")); assertTrue(out.value[2].equals("###")); assertTrue(out.value[3].equals("%")); assertTrue(out.value[4].equals("^^")); } { short[][][] ar = { { { 1, 2, 3, 4 }, { 10, -10, 11, -11 }, { -999, 0, 888, 123 } }, { { 17, 27, 37, 47 }, { 710, -710, 711, -711 }, { -99, 0, 88, 13 } } }; short[][][] ret; ti.attrFixedArray(ar); ret = ti.attrFixedArray(); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(ar[i][j][k] == ret[i][j][k]); } FixedArrayHolder inOut = new FixedArrayHolder(new short[2][3][4]); FixedArrayHolder out = new FixedArrayHolder(); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) inOut.value[i][j][k] = (short) (i + j + k); ret = ti.opFixedArray(ar, inOut, out); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(ar[i][j][k] == ret[i][j][k]); assertTrue(ar[i][j][k] == inOut.value[i][j][k]); assertTrue(ar[i][j][k] == out.value[i][j][k]); } } { String[][] ar = { { "aa", "bb", "cc" }, { "AA", "BB", "CC" } }; String[][] ret; ti.attrVariableArray(ar); ret = ti.attrVariableArray(); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue((ar[i][j].equals(ret[i][j]))); } VariableArrayHolder inOut = new VariableArrayHolder( new String[2][3]); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) inOut.value[i][j] = "abc"; VariableArrayHolder out = new VariableArrayHolder(); ret = ti.opVariableArray(ar, inOut, out); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(ar[i][j].equals(ret[i][j])); assertTrue(ar[i][j].equals(inOut.value[i][j])); assertTrue(ar[i][j].equals(out.value[i][j])); } } { short[][][] ar0 = { { { 1, 2, 3, 4 }, { 10, -10, 11, -11 }, { -999, 0, 888, 123 } }, { { 17, 27, 37, 47 }, { 710, -710, 711, -711 }, { -99, 0, 88, 13 } } }; short[][][] ar1 = { { { 2, 3, 4, 1 }, { 10, 11, 11, -10 }, { -0, 939, 123, 888 } }, { { 17, 37, 47, 27 }, { 710, -710, 711, -711 }, { -0, -99, 13, 8338 } } }; short[][][] ar2 = { { { 1, 2, -3, -234 }, { 10, -11, 11, -10 }, { -999, 30, 1888, 123 } }, { { 27, 37, 117, 47 }, { 710, -7150, 711, -711 }, { -0, 13, 929, 88 } } }; short[][][][] seq = new short[3][2][3][4]; seq[0] = ar0; seq[1] = ar1; seq[2] = ar2; short[][][][] ret; ti.attrFixedArraySequence(seq); ret = ti.attrFixedArraySequence(); for (l = 0; l < 3; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(seq[l][i][j][k] == ret[l][i][j][k]); } FixedArraySequenceHolder inOut = new FixedArraySequenceHolder( new short[4][2][3][4]); for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) inOut.value[l][i][j][k] = (short) (i + j + k + l); FixedArraySequenceHolder out = new FixedArraySequenceHolder(); ret = ti.opFixedArraySequence(seq, inOut, out); assertTrue(ret.length == 7); assertTrue(inOut.value.length == 7); assertTrue(out.value.length == 7); for (l = 0; l < 3; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(seq[l][i][j][k] == ret[l][i][j][k]); assertTrue(seq[l][i][j][k] == inOut.value[l][i][j][k]); assertTrue(seq[l][i][j][k] == out.value[l][i][j][k]); } for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(ret[3 + l][i][j][k] == i + j + k + l); assertTrue(inOut.value[3 + l][i][j][k] == i + j + k + l); assertTrue(out.value[3 + l][i][j][k] == i + j + k + l); } } { String[][] ar0 = { { "aa", "bb", "cc" }, { "AA", "BB", "CC" } }; String[][] ar1 = { { "a-a", "b-b", "c-c" }, { "A-A", "B-B", "C-C" } }; String[][][] seq = new String[2][][]; seq[0] = ar0; seq[1] = ar1; String[][][] ret; ti.attrVariableArraySequence(seq); ret = ti.attrVariableArraySequence(); for (l = 0; l < 2; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(seq[l][i][j].equals(ret[l][i][j])); } VariableArraySequenceHolder inOut = new VariableArraySequenceHolder( new String[4][2][3]); for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) inOut.value[l][i][j] = "***"; VariableArraySequenceHolder out = new VariableArraySequenceHolder(); ret = ti.opVariableArraySequence(seq, inOut, out); assertTrue(ret.length == 6); assertTrue(inOut.value.length == 6); assertTrue(out.value.length == 6); for (l = 0; l < 2; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(seq[l][i][j].equals(ret[l][i][j])); assertTrue(seq[l][i][j].equals(inOut.value[l][i][j])); assertTrue(seq[l][i][j].equals(out.value[l][i][j])); } for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(ret[2 + l][i][j].equals("***")); assertTrue(inOut.value[2 + l][i][j].equals("***")); assertTrue(out.value[2 + l][i][j].equals("***")); } } { short[][][] ar0 = { { { 1, 2, 3, 4 }, { 10, -10, 11, -11 }, { -999, 0, 888, 123 } }, { { 17, 27, 37, 47 }, { 710, -710, 711, -711 }, { -99, 0, 88, 13 } } }; short[][][] ar1 = { { { 2, 3, 4, 1 }, { 10, 11, 11, -10 }, { -0, 939, 123, 888 } }, { { 17, 37, 47, 27 }, { 710, -710, 711, -711 }, { -0, -99, 13, 8338 } } }; short[][][] ar2 = { { { 1, 2, -3, -234 }, { 10, -11, 11, -10 }, { -999, 30, 1888, 123 } }, { { 27, 37, 117, 47 }, { 710, -7150, 711, -711 }, { -0, 13, 929, 88 } } }; short[][][][] seq = new short[3][2][3][4]; seq[0] = ar0; seq[1] = ar1; seq[2] = ar2; short[][][][] ret; ti.attrFixedArrayBoundSequence(seq); ret = ti.attrFixedArrayBoundSequence(); for (l = 0; l < 3; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(seq[l][i][j][k] == ret[l][i][j][k]); } FixedArrayBoundSequenceHolder inOut = new FixedArrayBoundSequenceHolder( new short[4][2][3][4]); for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) inOut.value[l][i][j][k] = (short) (i + j + k + l); FixedArrayBoundSequenceHolder out = new FixedArrayBoundSequenceHolder(); ret = ti.opFixedArrayBoundSequence(seq, inOut, out); assertTrue(ret.length == 7); assertTrue(inOut.value.length == 7); assertTrue(out.value.length == 7); for (l = 0; l < 3; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(seq[l][i][j][k] == ret[l][i][j][k]); assertTrue(seq[l][i][j][k] == inOut.value[l][i][j][k]); assertTrue(seq[l][i][j][k] == out.value[l][i][j][k]); } for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(ret[3 + l][i][j][k] == i + j + k + l); assertTrue(inOut.value[3 + l][i][j][k] == i + j + k + l); assertTrue(out.value[3 + l][i][j][k] == i + j + k + l); } } { String[][] ar0 = { { "aa", "bb", "cc" }, { "AA", "BB", "CC" } }; String[][] ar1 = { { "a-a", "b-b", "c-c" }, { "A-A", "B-B", "C-C" } }; String[][][] seq = new String[2][][]; seq[0] = ar0; seq[1] = ar1; String[][][] ret; ti.attrVariableArrayBoundSequence(seq); ret = ti.attrVariableArrayBoundSequence(); for (l = 0; l < 2; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(seq[l][i][j].equals(ret[l][i][j])); } VariableArrayBoundSequenceHolder inOut = new VariableArrayBoundSequenceHolder( new String[4][2][3]); for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) inOut.value[l][i][j] = "***"; VariableArrayBoundSequenceHolder out = new VariableArrayBoundSequenceHolder(); ret = ti.opVariableArrayBoundSequence(seq, inOut, out); assertTrue(ret.length == 6); assertTrue(inOut.value.length == 6); assertTrue(out.value.length == 6); for (l = 0; l < 2; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(seq[l][i][j].equals(ret[l][i][j])); assertTrue(seq[l][i][j].equals(inOut.value[l][i][j])); assertTrue(seq[l][i][j].equals(out.value[l][i][j])); } for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(ret[2 + l][i][j].equals("***")); assertTrue(inOut.value[2 + l][i][j].equals("***")); assertTrue(out.value[2 + l][i][j].equals("***")); } } { try { ti.opVoidEx(); assertTrue(false); } catch (ExVoid ex) { } } { ShortHolder inOut = new ShortHolder((short) 20); ShortHolder out = new ShortHolder(); try { ti.opShortEx((short) 10, inOut, out); assertTrue(false); } catch (ExShort ex) { assertTrue(ex.value == 30); } } { IntHolder inOut = new IntHolder(20); IntHolder out = new IntHolder(); try { ti.opLongEx(10, inOut, out); assertTrue(false); } catch (ExLong ex) { assertTrue(ex.value == 30); } } { ShortHolder inOut = new ShortHolder((short) 20); ShortHolder out = new ShortHolder(); try { ti.opUShortEx((short) 10, inOut, out); assertTrue(false); } catch (ExUShort ex) { assertTrue(ex.value == 30); } } { IntHolder inOut = new IntHolder(20); IntHolder out = new IntHolder(); try { ti.opULongEx(10, inOut, out); assertTrue(false); } catch (ExULong ex) { assertTrue(ex.value == 30); } } { FloatHolder inOut = new FloatHolder(20); FloatHolder out = new FloatHolder(); try { ti.opFloatEx(10, inOut, out); assertTrue(false); } catch (ExFloat ex) { assertTrue(ex.value == 30); } } { DoubleHolder inOut = new DoubleHolder(20); DoubleHolder out = new DoubleHolder(); try { ti.opDoubleEx(10, inOut, out); assertTrue(false); } catch (ExDouble ex) { assertTrue(ex.value == 30); } } { BooleanHolder inOut = new BooleanHolder(true); BooleanHolder out = new BooleanHolder(); try { ti.opBooleanEx(true, inOut, out); assertTrue(false); } catch (ExBoolean ex) { assertTrue(ex.value == true); } } { CharHolder inOut = new CharHolder((char) 1); CharHolder out = new CharHolder(); try { ti.opCharEx('a', inOut, out); assertTrue(false); } catch (ExChar ex) { assertTrue(ex.value == 'b'); } } { ByteHolder inOut = new ByteHolder((byte) 20); ByteHolder out = new ByteHolder(); try { ti.opOctetEx((byte) 10, inOut, out); assertTrue(false); } catch (ExOctet ex) { assertTrue(ex.value == 30); } } { StringHolder inOut = new StringHolder("world!"); StringHolder out = new StringHolder(); try { ti.opStringEx("Hello, ", inOut, out); assertTrue(false); } catch (ExString ex) { assertTrue(ex.value.equals("Hello, world!")); } } { VariableStruct vStruct = new VariableStruct(); vStruct.s = "xyz"; Any any = m_orb.create_any(); VariableStructHelper.insert(any, vStruct); AnyHolder inOut = new AnyHolder(m_orb.create_any()); AnyHolder out = new AnyHolder(m_orb.create_any()); try { ti.opAnyEx(any, inOut, out); assertTrue(false); } catch (ExAny ex) { VariableStruct vStructRet; vStructRet = VariableStructHelper.extract(any); assertTrue(vStructRet.s.equals("xyz")); } } { TestEnumHolder inOut = new TestEnumHolder(); TestEnumHolder out = new TestEnumHolder(); inOut.value = TestEnum.TestEnum2; try { ti.opTestEnumEx(TestEnum.TestEnum3, inOut, out); assertTrue(false); } catch (ExTestEnum ex) { assertTrue(ex.value == TestEnum.TestEnum3); } } if (orb_type == ORBType.ORBacus4) { ORBTest_Basic.IntfHolder inOut = new ORBTest_Basic.IntfHolder(); ORBTest_Basic.IntfHolder out = new ORBTest_Basic.IntfHolder(); inOut.value = (ORBTest_Basic.Intf) ti._duplicate(); try { ti.opIntfEx(ti, inOut, out); assertTrue(false); } catch (ORBTest_Basic.ExIntf ex) { assertTrue(ex.value._hash(1000) == ti._hash(1000)); assertTrue(ex.value._is_equivalent(ti)); } } { FixedStruct st = new FixedStruct(); st.s = 100; st.l = -100; FixedStructHolder inOut = new FixedStructHolder(new FixedStruct()); FixedStructHolder out = new FixedStructHolder(); inOut.value.s = 10000; inOut.value.l = 100000; try { ti.opFixedStructEx(st, inOut, out); assertTrue(false); } catch (ExFixedStruct ex) { assertTrue(ex.value.s == st.s); assertTrue(ex.value.l == st.l); } } { VariableStruct st = new VariableStruct(); st.s = "$$$"; VariableStructHolder inOut = new VariableStructHolder( new VariableStruct()); VariableStructHolder out = new VariableStructHolder(); inOut.value.s = "bla"; try { ti.opVariableStructEx(st, inOut, out); assertTrue(false); } catch (ExVariableStruct ex) { assertTrue(ex.value.s.equals(st.s)); } } { FixedUnion un = new FixedUnion(); un.b((short) 999, true); FixedUnionHolder inOut = new FixedUnionHolder(new FixedUnion()); FixedUnionHolder out = new FixedUnionHolder(); inOut.value.l(100); try { ti.opFixedUnionEx(un, inOut, out); assertTrue(false); } catch (ExFixedUnion ex) { assertTrue(ex.value.discriminator() == 999); assertTrue(ex.value.b() == true); } } if (orb_type == ORBType.ORBacus4) { VariableUnion un = new VariableUnion(); un.ti(ti); VariableUnionHolder inOut = new VariableUnionHolder( new VariableUnion()); VariableUnionHolder out = new VariableUnionHolder(); VariableStruct st = new VariableStruct(); st.s = "bla"; inOut.value.st(st); try { ti.opVariableUnionEx(un, inOut, out); assertTrue(false); } catch (ExVariableUnion ex) { assertTrue(ex.value.ti()._hash(2000) == ti._hash(2000)); assertTrue(ex.value.ti()._is_equivalent(ti)); } } { String[] seq = new String[3]; seq[0] = "!!!"; seq[1] = "@@@"; seq[2] = "###"; StringSequenceHolder inOut = new StringSequenceHolder(); StringSequenceHolder out = new StringSequenceHolder(); inOut.value = new String[2]; inOut.value[0] = "%"; inOut.value[1] = "^^"; try { ti.opStringSequenceEx(seq, inOut, out); assertTrue(false); } catch (ExStringSequence ex) { assertTrue(ex.value.length == 5); assertTrue(ex.value[0].equals("!!!")); assertTrue(ex.value[1].equals("@@@")); assertTrue(ex.value[2].equals("###")); assertTrue(ex.value[3].equals("%")); assertTrue(ex.value[4].equals("^^")); } } { short[][][] ar = { { { 1, 2, 3, 4 }, { 10, -10, 11, -11 }, { -999, 0, 888, 123 } }, { { 17, 27, 37, 47 }, { 710, -710, 711, -711 }, { -99, 0, 88, 13 } } }; short[][][] ret; FixedArrayHolder inOut = new FixedArrayHolder(new short[2][3][4]); FixedArrayHolder out = new FixedArrayHolder(); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) inOut.value[i][j][k] = (short) (i + j + k); try { ti.opFixedArrayEx(ar, inOut, out); assertTrue(false); } catch (ExFixedArray ex) { for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(ar[i][j][k] == ex.value[i][j][k]); } } } { String[][] ar = { { "aa", "bb", "cc" }, { "AA", "BB", "CC" } }; String[][] ret; VariableArrayHolder inOut = new VariableArrayHolder( new String[2][3]); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) inOut.value[i][j] = "abc"; VariableArrayHolder out = new VariableArrayHolder(); try { ti.opVariableArrayEx(ar, inOut, out); assertTrue(false); } catch (ExVariableArray ex) { for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(ar[i][j].equals(ex.value[i][j])); } } } { short[][][] ar0 = { { { 1, 2, 3, 4 }, { 10, -10, 11, -11 }, { -999, 0, 888, 123 } }, { { 17, 27, 37, 47 }, { 710, -710, 711, -711 }, { -99, 0, 88, 13 } } }; short[][][] ar1 = { { { 2, 3, 4, 1 }, { 10, 11, 11, -10 }, { -0, 239, 123, 888 } }, { { 17, 37, 47, 27 }, { 710, -710, 711, -711 }, { -0, -99, 13, 8338 } } }; short[][][] ar2 = { { { 1, 2, -3, -234 }, { 10, -11, 11, -10 }, { -999, 30, 1888, 123 } }, { { 27, 37, 117, 47 }, { 710, -7150, 711, -711 }, { -0, 13, 929, 88 } } }; short[][][][] seq = new short[3][2][3][4]; seq[0] = ar0; seq[1] = ar1; seq[2] = ar2; FixedArraySequenceHolder inOut = new FixedArraySequenceHolder( new short[4][2][3][4]); for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) inOut.value[l][i][j][k] = (short) (i + j + k + l); short[][][][] ret; FixedArraySequenceHolder out = new FixedArraySequenceHolder(); try { ret = ti.opFixedArraySequenceEx(seq, inOut, out); assertTrue(false); } catch (ExFixedArraySequence ex) { assertTrue(ex.value.length == 7); for (l = 0; l < 3; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(seq[l][i][j][k] == ex.value[l][i][j][k]); } for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) { assertTrue(ex.value[3 + l][i][j][k] == i + j + k + l); } } } { String[][] ar0 = { { "aa", "bb", "cc" }, { "AA", "BB", "CC" } }; String[][] ar1 = { { "a-a", "b-b", "c-c" }, { "A-A", "B-B", "C-C" } }; String[][][] seq = new String[2][][]; seq[0] = ar0; seq[1] = ar1; VariableArraySequenceHolder inOut = new VariableArraySequenceHolder( new String[4][2][3]); for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) inOut.value[l][i][j] = "***"; String[][][] ret; VariableArraySequenceHolder out = new VariableArraySequenceHolder(); try { ret = ti.opVariableArraySequenceEx(seq, inOut, out); assertTrue(false); } catch (ExVariableArraySequence ex) { assertTrue(ex.value.length == 6); for (l = 0; l < 2; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(seq[l][i][j].equals(ex.value[l][i][j])); } for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(ex.value[2 + l][i][j].equals("***")); } } } { short[][][] ar0 = { { { 1, 2, 3, 4 }, { 10, -10, 11, -11 }, { -999, 0, 888, 123 } }, { { 17, 27, 37, 47 }, { 710, -710, 711, -711 }, { -99, 0, 88, 13 } } }; short[][][] ar1 = { { { 2, 3, 4, 1 }, { 10, 11, 11, -10 }, { -0, 939, 123, 888 } }, { { 17, 37, 47, 27 }, { 710, -710, 711, -711 }, { -0, -99, 13, 8338 } } }; short[][][] ar2 = { { { 1, 2, -3, -234 }, { 10, -11, 11, -10 }, { -999, 30, 1888, 123 } }, { { 27, 37, 117, 47 }, { 710, -7150, 711, -711 }, { -0, 13, 929, 88 } } }; short[][][][] seq = new short[3][2][3][4]; seq[0] = ar0; seq[1] = ar1; seq[2] = ar2; FixedArrayBoundSequenceHolder inOut = new FixedArrayBoundSequenceHolder( new short[4][2][3][4]); for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) inOut.value[l][i][j][k] = (short) (i + j + k + l); short[][][][] ret; FixedArrayBoundSequenceHolder out = new FixedArrayBoundSequenceHolder(); try { ret = ti.opFixedArrayBoundSequenceEx(seq, inOut, out); assertTrue(false); } catch (ExFixedArrayBoundSequence ex) { assertTrue(ex.value.length == 7); for (l = 0; l < 3; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) assertTrue(seq[l][i][j][k] == ex.value[l][i][j][k]); for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) for (k = 0; k < 4; k++) assertTrue(ex.value[3 + l][i][j][k] == i + j + k + l); } } { String[][] ar0 = { { "aa", "bb", "cc" }, { "AA", "BB", "CC" } }; String[][] ar1 = { { "a-a", "b-b", "c-c" }, { "A-A", "B-B", "C-C" } }; String[][][] seq = new String[2][][]; seq[0] = ar0; seq[1] = ar1; VariableArrayBoundSequenceHolder inOut = new VariableArrayBoundSequenceHolder( new String[4][2][3]); for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) inOut.value[l][i][j] = "***"; String[][][] ret; VariableArrayBoundSequenceHolder out = new VariableArrayBoundSequenceHolder(); try { ret = ti.opVariableArrayBoundSequenceEx(seq, inOut, out); assertTrue(false); } catch (ExVariableArrayBoundSequence ex) { assertTrue(ex.value.length == 6); for (l = 0; l < 2; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) assertTrue(seq[l][i][j].equals(ex.value[l][i][j])); for (l = 0; l < 4; l++) for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) assertTrue(ex.value[2 + l][i][j].equals("***")); } } { try { ti.opExRecursiveStruct(); assertTrue(false); } catch (ORBTest_Basic.ExRecursiveStruct ex) { assertTrue(ex.us == 1); assertTrue(ex.rs.s.equals("test")); assertTrue(ex.rs.i == 2); assertTrue(ex.rs.rs.length == 1); assertTrue(ex.rs.rs[0].s.equals("ORBTest_Basic_RecursiveStruct")); assertTrue(ex.rs.rs[0].i == 111); assertTrue(ex.rs.rs[0].rs.length == 0); } } } public void test_DII(org.omg.CORBA.Object obj) { ORBTest_Basic.Intf ti = ORBTest_Basic.IntfHelper.narrow(obj); int i, j; { Request request; request = ti._request("opVoid"); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); } { Request request; short ret; short inOut; short out; request = ti._request("_set_attrShort"); request.add_in_arg().insert_short((short) -32768); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); request = ti._request("_get_attrShort"); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_short)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); ret = request.return_value().extract_short(); assertTrue(ret == (short) -32768); request = ti._request("_set_attrShort"); request.add_in_arg().insert_short((short) 32767); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); request = ti._request("_get_attrShort"); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_short)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); ret = request.return_value().extract_short(); assertTrue(ret == (short) 32767); request = ti._request("opShort"); request.add_in_arg().insert_short((short) 10); Any inOutAny = request.add_inout_arg(); inOutAny.insert_short((short) 20); Any outAny = request.add_out_arg(); outAny.insert_short((short) 0); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_short)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); inOut = inOutAny.extract_short(); out = outAny.extract_short(); ret = request.return_value().extract_short(); assertTrue(ret == 30); assertTrue(inOut == 30); assertTrue(out == 30); } { Request request; double ret; double inOut; double out; request = ti._request("_set_attrDouble"); request.add_in_arg().insert_double(1.7976931348623157E+308); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); request = ti._request("_get_attrDouble"); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_double)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); ret = request.return_value().extract_double(); assertTrue(ret == 1.7976931348623157E+308); request = ti._request("_set_attrDouble"); request.add_in_arg().insert_double(2.2250738585072014E-308); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); request = ti._request("_get_attrDouble"); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_double)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); ret = request.return_value().extract_double(); assertTrue(ret == 2.2250738585072014E-308); request = ti._request("opDouble"); request.add_in_arg().insert_double(10.0); Any inOutAny = request.add_inout_arg(); inOutAny.insert_double(20.0); Any outAny = request.add_out_arg(); outAny.insert_double(0); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_double)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); inOut = inOutAny.extract_double(); out = outAny.extract_double(); ret = request.return_value().extract_double(); assertTrue(ret == 30); assertTrue(inOut == 30); assertTrue(out == 30); } { Request request; String ret; String inOut; String out; request = ti._request("_set_attrString"); request.add_in_arg().insert_string("Hello"); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); request = ti._request("_get_attrString"); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_string)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); ret = request.return_value().extract_string(); assertTrue(ret.equals("Hello")); request = ti._request("opString"); request.add_in_arg().insert_string("Hello, "); Any inOutAny = request.add_inout_arg(); inOutAny.insert_string("world!"); Any outAny = request.add_out_arg(); outAny.insert_string(""); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_string)); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); inOut = inOutAny.extract_string(); out = outAny.extract_string(); ret = request.return_value().extract_string(); assertTrue(ret.equals("Hello, world!")); assertTrue(out.equals("Hello, world!")); } { Request request; String[] seq = { "!!!", "@@@", "###" }; String[] ret; String[] inOut; String[] out; request = ti._request("_set_attrStringSequence"); StringSequenceHelper.insert(request.add_in_arg(), seq); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); request = ti._request("_get_attrStringSequence"); request.set_return_type(StringSequenceHelper.type()); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); ret = StringSequenceHelper.extract(request.return_value()); assertTrue(ret.length == 3); assertTrue(ret[0].equals("!!!")); assertTrue(ret[1].equals("@@@")); assertTrue(ret[2].equals("###")); inOut = new String[2]; inOut[0] = "%"; inOut[1] = "^^"; request = ti._request("opStringSequence"); StringSequenceHelper.insert(request.add_in_arg(), seq); Any inOutAny = request.add_inout_arg(); StringSequenceHelper.insert(inOutAny, inOut); Any outAny = request.add_out_arg(); outAny.type(StringSequenceHelper.type()); request.set_return_type(StringSequenceHelper.type()); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); ret = StringSequenceHelper.extract(request.return_value()); inOut = StringSequenceHelper.extract(inOutAny); out = StringSequenceHelper.extract(outAny); assertTrue(ret.length == 5); assertTrue(ret[0].equals("!!!")); assertTrue(ret[1].equals("@@@")); assertTrue(ret[2].equals("###")); assertTrue(ret[3].equals("%")); assertTrue(ret[4].equals("^^")); assertTrue(inOut.length == 5); assertTrue(inOut[0].equals("!!!")); assertTrue(inOut[1].equals("@@@")); assertTrue(inOut[2].equals("###")); assertTrue(inOut[3].equals("%")); assertTrue(inOut[4].equals("^^")); assertTrue(out.length == 5); assertTrue(out[0].equals("!!!")); assertTrue(out[1].equals("@@@")); assertTrue(out[2].equals("###")); assertTrue(out[3].equals("%")); assertTrue(out[4].equals("^^")); } { Request request; char ret; char inOut; char out; request = ti._request("_set_attrChar"); request.add_in_arg().insert_char('a'); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); request = ti._request("_get_attrChar"); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_char)); request.send_deferred(); try { request.get_response(); } catch (WrongTransaction ex) { assertTrue(false); } ret = request.return_value().extract_char(); assertTrue(ret == 'a'); request = ti._request("opChar"); request.add_in_arg().insert_char('a'); Any inOutAny = request.add_inout_arg(); inOutAny.insert_char((char) 1); Any outAny = request.add_out_arg(); outAny.type(m_orb.get_primitive_tc(TCKind.tk_char)); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_char)); request.send_deferred(); try { request.get_response(); } catch (WrongTransaction ex) { assertTrue(false); } inOut = inOutAny.extract_char(); out = outAny.extract_char(); ret = request.return_value().extract_char(); assertTrue(ret == 'b'); assertTrue(inOut == 'b'); assertTrue(out == 'b'); } { Request request; String[][] ar = { { "aa", "bb", "cc" }, { "AA", "BB", "CC" } }; String[][] ret = new String[2][3]; String[][] inOut = new String[2][3]; String[][] out = new String[2][3]; request = ti._request("_set_attrVariableArray"); VariableArrayHelper.insert(request.add_in_arg(), ar); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); request = ti._request("_get_attrVariableArray"); request.set_return_type(VariableArrayHelper.type()); request.send_deferred(); while (!request.poll_response()) Thread.yield(); try { request.get_response(); } catch (org.omg.CORBA.WrongTransaction ex) { assertTrue(false); } ret = VariableArrayHelper.extract(request.return_value()); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(ar[i][j].equals(ret[i][j])); } String[][] ar2 = { { "abc", "abc", "abc" }, { "abc", "abc", "abc" } }; request = ti._request("opVariableArray"); VariableArrayHelper.insert(request.add_in_arg(), ar); Any inOutAny = request.add_inout_arg(); VariableArrayHelper.insert(inOutAny, ar2); Any outAny = request.add_out_arg(); outAny.type(VariableArrayHelper.type()); request.set_return_type(VariableArrayHelper.type()); request.send_deferred(); while (!request.poll_response()) Thread.yield(); try { request.get_response(); } catch (org.omg.CORBA.WrongTransaction ex) { assertTrue(false); } ret = VariableArrayHelper.extract(request.return_value()); inOut = VariableArrayHelper.extract(inOutAny); out = VariableArrayHelper.extract(outAny); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) { assertTrue(ar[i][j].equals(ret[i][j])); assertTrue(ar[i][j].equals(inOut[i][j])); assertTrue(ar[i][j].equals(out[i][j])); } } try { m_orb.poll_next_response(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } try { m_orb.get_next_response(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } catch (org.omg.CORBA.WrongTransaction ex) { assertTrue(false); } { Request request; request = ti._request("opVoid"); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); try { request.invoke(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } try { request.send_oneway(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } try { request.send_deferred(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } try { request.poll_response(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } try { request.get_response(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } catch (org.omg.CORBA.WrongTransaction ex) { assertTrue(false); } } { Request request; request = ti._request("opVoid"); try { request.poll_response(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } try { request.get_response(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } catch (org.omg.CORBA.WrongTransaction ex) { assertTrue(false); } request.send_deferred(); try { request.invoke(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } try { request.send_oneway(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } try { request.send_deferred(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } try { request.get_response(); } catch (org.omg.CORBA.WrongTransaction ex) { assertTrue(false); } try { request.poll_response(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } try { request.get_response(); assertTrue(false); } catch (org.omg.CORBA.BAD_INV_ORDER ex) { // Expected } catch (org.omg.CORBA.WrongTransaction ex) { assertTrue(false); } } { Request request; request = ti._request("_set_attrUShort"); request.add_in_arg().insert_ushort((short) 1234); request.invoke(); if (request.env().exception() != null) throw (SystemException) request.env().exception(); Request[] requests = new Request[5]; for (i = 0; i < requests.length; i++) { requests[i] = ti._request("_get_attrUShort"); requests[i].set_return_type(m_orb .get_primitive_tc(TCKind.tk_ushort)); } m_orb.send_multiple_requests_deferred(requests); for (i = 0; i < requests.length; i++) { while (!m_orb.poll_next_response()) Thread.yield(); try { request = m_orb.get_next_response(); } catch (org.omg.CORBA.WrongTransaction ex) { assertTrue(false); } short ret = request.return_value().extract_ushort(); assertTrue(ret == (short) 1234); } } if (!m_test_intf.concurrent_request_execution()) { float ret; float inOut; float out; Request request1; request1 = ti._request("_set_attrFloat"); request1.add_in_arg().insert_float(1); request1.send_deferred(); Request request2; request2 = ti._request("_get_attrFloat"); request2.set_return_type(m_orb.get_primitive_tc(TCKind.tk_float)); request2.send_deferred(); Request request3; request3 = ti._request("_set_attrFloat"); request3.add_in_arg().insert_float(-1); request3.send_deferred(); Request request4; request4 = ti._request("_get_attrFloat"); request4.set_return_type(m_orb.get_primitive_tc(TCKind.tk_float)); request4.send_deferred(); Request request5; request5 = ti._request("opFloat"); request5.add_in_arg().insert_float(10); Any inOutAny = request5.add_inout_arg(); inOutAny.insert_float(20); Any outAny = request5.add_out_arg(); outAny.insert_float(0); request5.set_return_type(m_orb.get_primitive_tc(TCKind.tk_float)); request5.send_deferred(); try { request5.get_response(); } catch (WrongTransaction ex) { assertTrue(false); } inOut = inOutAny.extract_float(); out = outAny.extract_float(); ret = request5.return_value().extract_float(); assertTrue(ret == 30); assertTrue(inOut == 30); assertTrue(out == 30); try { request2.get_response(); } catch (WrongTransaction ex) { assertTrue(false); } ret = request2.return_value().extract_float(); assertTrue(ret == 1); try { request4.get_response(); } catch (WrongTransaction ex) { assertTrue(false); } ret = request4.return_value().extract_float(); assertTrue(ret == -1); try { request1.get_response(); request3.get_response(); } catch (WrongTransaction ex) { assertTrue(false); } } Request request; { Exception ex; try { request = ti._request("opVoidEx"); request.invoke(); ex = request.env().exception(); UNKNOWN dummy = (UNKNOWN) ex; assertTrue(dummy != null); } catch (UNKNOWN e) { // expected in JDK 1.2 } request = ti._request("opVoidEx"); request.exceptions().add(ExVoidHelper.type()); request.invoke(); ex = request.env().exception(); UnknownUserException uex; uex = (UnknownUserException) ex; assertTrue(uex != null); ExVoid iex; iex = ExVoidHelper.extract(uex.except); } { request = ti._request("opShortEx"); request.exceptions().add(ExShortHelper.type()); request.add_in_arg().insert_short((short) 10); Any inOutAny = request.add_inout_arg(); inOutAny.insert_short((short) 20); Any outAny = request.add_out_arg(); outAny.insert_short((short) 0); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_short)); request.invoke(); Exception ex = request.env().exception(); UnknownUserException uex; uex = (UnknownUserException) ex; assertTrue(uex != null); ExShort iex; iex = ExShortHelper.extract(uex.except); assertTrue(iex.value == 30); } { request = ti._request("opDoubleEx"); request.exceptions().add(ExDoubleHelper.type()); request.add_in_arg().insert_double(10); Any inOutAny = request.add_inout_arg(); inOutAny.insert_double(20); Any outAny = request.add_out_arg(); outAny.insert_double(0); request.set_return_type(m_orb.get_primitive_tc(TCKind.tk_double)); request.invoke(); Exception ex = request.env().exception(); UnknownUserException uex; uex = (UnknownUserException) ex; assertTrue(uex != null); ExDouble iex; iex = ExDoubleHelper.extract(uex.except); assertTrue(iex.value == 30); } { String[] in = new String[3]; in[0] = "!!!"; in[1] = "@@@"; in[2] = "###"; String[] inOut = new String[2]; inOut[0] = "%"; inOut[1] = "^^"; request = ti._request("opStringSequenceEx"); request.exceptions().add(ExStringSequenceHelper.type()); StringSequenceHelper.insert(request.add_in_arg(), in); Any inOutAny = request.add_inout_arg(); StringSequenceHelper.insert(inOutAny, inOut); Any outAny = request.add_out_arg(); outAny.type(StringSequenceHelper.type()); request.set_return_type(StringSequenceHelper.type()); request.invoke(); Exception ex = request.env().exception(); UnknownUserException uex; uex = (UnknownUserException) ex; assertTrue(uex != null); ExStringSequence iex; iex = ExStringSequenceHelper.extract(uex.except); assertTrue(iex.value.length == 5); assertTrue(iex.value[0].equals("!!!")); assertTrue(iex.value[1].equals("@@@")); assertTrue(iex.value[2].equals("###")); assertTrue(iex.value[3].equals("%")); assertTrue(iex.value[4].equals("^^")); } { request = ti._request("opExRecursiveStruct"); request.exceptions().add( ORBTest_Basic.ExRecursiveStructHelper.type()); request.invoke(); Exception ex = request.env().exception(); UnknownUserException uex; uex = (UnknownUserException) ex; assertTrue(uex != null); ORBTest_Basic.ExRecursiveStruct iex; iex = ORBTest_Basic.ExRecursiveStructHelper.extract(uex.except); assertTrue(iex.us == 1); assertTrue(iex.rs.s.equals("test")); assertTrue(iex.rs.i == 2); assertTrue(iex.rs.rs.length == 1); assertTrue(iex.rs.rs[0].s.equals("ORBTest_Basic_RecursiveStruct")); assertTrue(iex.rs.rs[0].i == 111); assertTrue(iex.rs.rs[0].rs.length == 0); } } }
5,963
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/Server.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import java.util.Properties; import org.omg.CORBA.*; import org.omg.PortableServer.*; public class Server extends test.common.TestBase { private static final String refFile = "TestIntf.ref"; public static int run(ORB orb, boolean nonBlocking, String[] args) throws org.omg.CORBA.UserException { // // Resolve Root POA // POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); // // Activate the POA manager // POAManager manager = poa.the_POAManager(); manager.activate(); // // Create implementation objects // TestIntf_impl i = new TestIntf_impl(orb, poa); ORBTest.Intf p = i._this(orb); String impl = orb.object_to_string(p); // // Save references. This must be done after POA manager // activation, otherwise there is a potential for a race // condition between the client sending request and the server // not being ready yet. // try { java.io.FileOutputStream file = new java.io.FileOutputStream( refFile); java.io.PrintWriter out = new java.io.PrintWriter(file); out.println(impl); out.flush(); file.close(); } catch (java.io.IOException ex) { System.err.println("Can't write to `" + ex.getMessage() + "'"); return 1; } if (!nonBlocking) { // // Give up control to the ORB // orb.run(); // // Clean up // cleanup(); } return 0; } public static void cleanup() { java.io.File file = new java.io.File(refFile); file.delete(); } public static void main(String[] args) { java.util.Properties props = new Properties(); props.putAll(System.getProperties()); props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB"); props.put("org.omg.CORBA.ORBSingletonClass", "org.apache.yoko.orb.CORBA.ORBSingleton"); int status = 0; ORB orb = null; try { orb = ORB.init(args, props); status = run(orb, false, args); } catch (Exception ex) { ex.printStackTrace(); status = 1; } if (orb != null) { try { orb.destroy(); } catch (Exception ex) { ex.printStackTrace(); status = 1; } } System.exit(status); } }
5,964
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfBasicDSI_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; class TestIntfBasicDSI_impl extends org.omg.PortableServer.DynamicImplementation { private ORB m_orb; private ORBTest_Basic.Intf m_ti; private Any aVariableUnion; TestIntfBasicDSI_impl(ORB orb, ORBTest_Basic.Intf ti) { m_orb = orb; m_ti = ti; } static final String[] m_ids = { "IDL:ORBTest_Basic/Intf:1.0" }; public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] object_id) { return m_ids; } public void invoke(ServerRequest request) { String name = request.operation(); boolean ex; if (name.length() > 2 && name.endsWith("Ex")) { name = name.substring(0, name.length() - 2); ex = true; } else { ex = false; } if (name.equals("opVoid")) { NVList list = m_orb.create_list(0); request.arguments(list); if (ex) { Any any = m_orb.create_any(); ORBTest_Basic.ExVoidHelper.insert(any, new ORBTest_Basic.ExVoid()); request.set_exception(any); } return; } if (name.equals("_get_attrShort")) { NVList list = m_orb.create_list(0); request.arguments(list); short ret = m_ti.attrShort(); Any any = m_orb.create_any(); any.insert_short(ret); request.set_result(any); return; } if (name.equals("_set_attrShort")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_short)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); short arg = any.extract_short(); m_ti.attrShort(arg); return; } if (name.equals("opShort")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_short)); any1.type(m_orb.get_primitive_tc(TCKind.tk_short)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); short arg0 = any0.extract_short(); ShortHolder arg1 = new ShortHolder(); arg1.value = any1.extract_short(); ShortHolder arg2 = new ShortHolder(); short ret = m_ti.opShort(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExShortHelper.insert(exAny, new ORBTest_Basic.ExShort(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_short(ret); request.set_result(result); any1.insert_short(arg1.value); any2.insert_short(arg2.value); } return; } if (name.equals("_get_attrUShort")) { NVList list = m_orb.create_list(0); request.arguments(list); short ret = m_ti.attrUShort(); Any any = m_orb.create_any(); any.insert_ushort(ret); request.set_result(any); return; } if (name.equals("_set_attrUShort")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_ushort)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); short arg = any.extract_ushort(); m_ti.attrUShort(arg); return; } if (name.equals("opUShort")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_ushort)); any1.type(m_orb.get_primitive_tc(TCKind.tk_ushort)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); short arg0 = any0.extract_ushort(); ShortHolder arg1 = new ShortHolder(); arg1.value = any1.extract_ushort(); ShortHolder arg2 = new ShortHolder(); short ret = m_ti.opUShort(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExUShortHelper.insert(exAny, new ORBTest_Basic.ExUShort(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_ushort(ret); request.set_result(result); any1.insert_ushort(arg1.value); any2.insert_ushort(arg2.value); } return; } if (name.equals("_get_attrLong")) { NVList list = m_orb.create_list(0); request.arguments(list); int ret = m_ti.attrLong(); Any any = m_orb.create_any(); any.insert_long(ret); request.set_result(any); return; } if (name.equals("_set_attrLong")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_long)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); int arg = any.extract_long(); m_ti.attrLong(arg); return; } if (name.equals("opLong")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_long)); any1.type(m_orb.get_primitive_tc(TCKind.tk_long)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); int arg0 = any0.extract_long(); IntHolder arg1 = new IntHolder(); arg1.value = any1.extract_long(); IntHolder arg2 = new IntHolder(); int ret = m_ti.opLong(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExLongHelper.insert(exAny, new ORBTest_Basic.ExLong(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_long(ret); request.set_result(result); any1.insert_long(arg1.value); any2.insert_long(arg2.value); } return; } if (name.equals("_get_attrULong")) { NVList list = m_orb.create_list(0); request.arguments(list); int ret = m_ti.attrULong(); Any any = m_orb.create_any(); any.insert_ulong(ret); request.set_result(any); return; } if (name.equals("_set_attrULong")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_ulong)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); int arg = any.extract_ulong(); m_ti.attrULong(arg); return; } if (name.equals("opULong")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_ulong)); any1.type(m_orb.get_primitive_tc(TCKind.tk_ulong)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); int arg0 = any0.extract_ulong(); IntHolder arg1 = new IntHolder(); arg1.value = any1.extract_ulong(); IntHolder arg2 = new IntHolder(); int ret = m_ti.opULong(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExULongHelper.insert(exAny, new ORBTest_Basic.ExULong(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_ulong(ret); request.set_result(result); any1.insert_ulong(arg1.value); any2.insert_ulong(arg2.value); } return; } if (name.equals("_get_attrFloat")) { NVList list = m_orb.create_list(0); request.arguments(list); float ret = m_ti.attrFloat(); Any any = m_orb.create_any(); any.insert_float(ret); request.set_result(any); return; } if (name.equals("_set_attrFloat")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_float)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); float arg = any.extract_float(); m_ti.attrFloat(arg); return; } if (name.equals("opFloat")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_float)); any1.type(m_orb.get_primitive_tc(TCKind.tk_float)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); float arg0 = any0.extract_float(); FloatHolder arg1 = new FloatHolder(); arg1.value = any1.extract_float(); FloatHolder arg2 = new FloatHolder(); float ret = m_ti.opFloat(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExFloatHelper.insert(exAny, new ORBTest_Basic.ExFloat(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_float(ret); request.set_result(result); any1.insert_float(arg1.value); any2.insert_float(arg2.value); } return; } if (name.equals("_get_attrDouble")) { NVList list = m_orb.create_list(0); request.arguments(list); double ret = m_ti.attrDouble(); Any any = m_orb.create_any(); any.insert_double(ret); request.set_result(any); return; } if (name.equals("_set_attrDouble")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_double)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); double arg = any.extract_double(); m_ti.attrDouble(arg); return; } if (name.equals("opDouble")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_double)); any1.type(m_orb.get_primitive_tc(TCKind.tk_double)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); double arg0 = any0.extract_double(); DoubleHolder arg1 = new DoubleHolder(); arg1.value = any1.extract_double(); DoubleHolder arg2 = new DoubleHolder(); double ret = m_ti.opDouble(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExDoubleHelper.insert(exAny, new ORBTest_Basic.ExDouble(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_double(ret); request.set_result(result); any1.insert_double(arg1.value); any2.insert_double(arg2.value); } return; } if (name.equals("_get_attrBoolean")) { NVList list = m_orb.create_list(0); request.arguments(list); boolean ret = m_ti.attrBoolean(); Any any = m_orb.create_any(); any.insert_boolean(ret); request.set_result(any); return; } if (name.equals("_set_attrBoolean")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_boolean)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); boolean arg = any.extract_boolean(); m_ti.attrBoolean(arg); return; } if (name.equals("opBoolean")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_boolean)); any1.type(m_orb.get_primitive_tc(TCKind.tk_boolean)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); boolean arg0 = any0.extract_boolean(); BooleanHolder arg1 = new BooleanHolder(); arg1.value = any1.extract_boolean(); BooleanHolder arg2 = new BooleanHolder(); boolean ret = m_ti.opBoolean(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExBooleanHelper.insert(exAny, new ORBTest_Basic.ExBoolean(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_boolean(ret); request.set_result(result); any1.insert_boolean(arg1.value); any2.insert_boolean(arg2.value); } return; } if (name.equals("_get_attrChar")) { NVList list = m_orb.create_list(0); request.arguments(list); char ret = m_ti.attrChar(); Any any = m_orb.create_any(); any.insert_char(ret); request.set_result(any); return; } if (name.equals("_set_attrChar")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_char)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); char arg = any.extract_char(); m_ti.attrChar(arg); return; } if (name.equals("opChar")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_char)); any1.type(m_orb.get_primitive_tc(TCKind.tk_char)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); char arg0 = any0.extract_char(); CharHolder arg1 = new CharHolder(); arg1.value = any1.extract_char(); CharHolder arg2 = new CharHolder(); char ret = m_ti.opChar(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExCharHelper.insert(exAny, new ORBTest_Basic.ExChar(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_char(ret); request.set_result(result); any1.insert_char(arg1.value); any2.insert_char(arg2.value); } return; } if (name.equals("_get_attrOctet")) { NVList list = m_orb.create_list(0); request.arguments(list); byte ret = m_ti.attrOctet(); Any any = m_orb.create_any(); any.insert_octet(ret); request.set_result(any); return; } if (name.equals("_set_attrOctet")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_octet)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); byte arg = any.extract_octet(); m_ti.attrOctet(arg); return; } if (name.equals("opOctet")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_octet)); any1.type(m_orb.get_primitive_tc(TCKind.tk_octet)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); byte arg0 = any0.extract_octet(); ByteHolder arg1 = new ByteHolder(); arg1.value = any1.extract_octet(); ByteHolder arg2 = new ByteHolder(); byte ret = m_ti.opOctet(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExOctetHelper.insert(exAny, new ORBTest_Basic.ExOctet(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_octet(ret); request.set_result(result); any1.insert_octet(arg1.value); any2.insert_octet(arg2.value); } return; } if (name.equals("_get_attrString")) { NVList list = m_orb.create_list(0); request.arguments(list); String ret = m_ti.attrString(); Any any = m_orb.create_any(); any.insert_string(ret); request.set_result(any); return; } if (name.equals("_set_attrString")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_string)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); String arg = any.extract_string(); m_ti.attrString(arg); return; } if (name.equals("opString")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_string)); any1.type(m_orb.get_primitive_tc(TCKind.tk_string)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); String arg0 = any0.extract_string(); StringHolder arg1 = new StringHolder(); arg1.value = any1.extract_string(); StringHolder arg2 = new StringHolder(); String ret = m_ti.opString(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExStringHelper.insert(exAny, new ORBTest_Basic.ExString(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_string(ret); request.set_result(result); any1.insert_string(arg1.value); any2.insert_string(arg2.value); } return; } if (name.equals("_get_attrAny")) { NVList list = m_orb.create_list(0); request.arguments(list); Any ret = m_ti.attrAny(); Any any = m_orb.create_any(); any.insert_any(ret); request.set_result(any); return; } if (name.equals("_set_attrAny")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(m_orb.get_primitive_tc(TCKind.tk_any)); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); Any arg = any.extract_any(); m_ti.attrAny(arg); return; } if (name.equals("opAny")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(m_orb.get_primitive_tc(TCKind.tk_any)); any1.type(m_orb.get_primitive_tc(TCKind.tk_any)); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); Any arg0 = any0.extract_any(); AnyHolder arg1 = new AnyHolder(); arg1.value = any1.extract_any(); AnyHolder arg2 = new AnyHolder(); Any ret = m_ti.opAny(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExAnyHelper.insert(exAny, new ORBTest_Basic.ExAny(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); result.insert_any(ret); request.set_result(result); any1.insert_any(arg1.value); any2.insert_any(arg2.value); } return; } if (name.equals("_get_attrTestEnum")) { NVList list = m_orb.create_list(0); request.arguments(list); ORBTest_Basic.TestEnum ret = m_ti.attrTestEnum(); Any any = m_orb.create_any(); ORBTest_Basic.TestEnumHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrTestEnum")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.TestEnumHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); ORBTest_Basic.TestEnum arg = (ORBTest_Basic.TestEnumHelper .extract(any)); m_ti.attrTestEnum(arg); return; } if (name.equals("opTestEnum")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.TestEnumHelper.type()); any1.type(ORBTest_Basic.TestEnumHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); ORBTest_Basic.TestEnum arg0 = (ORBTest_Basic.TestEnumHelper .extract(any0)); ORBTest_Basic.TestEnumHolder arg1 = (new ORBTest_Basic.TestEnumHolder()); arg1._read(any1.create_input_stream()); ORBTest_Basic.TestEnumHolder arg2 = (new ORBTest_Basic.TestEnumHolder()); ORBTest_Basic.TestEnum ret = m_ti.opTestEnum(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExTestEnumHelper.insert(exAny, new ORBTest_Basic.ExTestEnum(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.TestEnumHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.TestEnumHelper.insert(any1, arg1.value); ORBTest_Basic.TestEnumHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrIntf")) { NVList list = m_orb.create_list(0); request.arguments(list); ORBTest_Basic.Intf ret = m_ti.attrIntf(); Any any = m_orb.create_any(); ORBTest_Basic.IntfHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrIntf")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.IntfHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); ORBTest_Basic.Intf arg = ORBTest_Basic.IntfHelper.extract(any); m_ti.attrIntf(arg); return; } if (name.equals("opIntf")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.IntfHelper.type()); any1.type(ORBTest_Basic.IntfHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); ORBTest_Basic.Intf arg0 = ORBTest_Basic.IntfHelper.extract(any0); ORBTest_Basic.IntfHolder arg1 = new ORBTest_Basic.IntfHolder(); arg1._read(any1.create_input_stream()); ORBTest_Basic.IntfHolder arg2 = new ORBTest_Basic.IntfHolder(); ORBTest_Basic.Intf ret = m_ti.opIntf(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExIntfHelper.insert(exAny, new ORBTest_Basic.ExIntf(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.IntfHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.IntfHelper.insert(any1, arg1.value); ORBTest_Basic.IntfHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrFixedStruct")) { NVList list = m_orb.create_list(0); request.arguments(list); ORBTest_Basic.FixedStruct ret = m_ti.attrFixedStruct(); Any any = m_orb.create_any(); ORBTest_Basic.FixedStructHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrFixedStruct")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.FixedStructHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); ORBTest_Basic.FixedStruct arg = ORBTest_Basic.FixedStructHelper .extract(any); m_ti.attrFixedStruct(arg); return; } if (name.equals("opFixedStruct")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.FixedStructHelper.type()); any1.type(ORBTest_Basic.FixedStructHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); ORBTest_Basic.FixedStruct arg0 = (ORBTest_Basic.FixedStructHelper .extract(any0)); ORBTest_Basic.FixedStructHolder arg1 = (new ORBTest_Basic.FixedStructHolder()); arg1.value = ORBTest_Basic.FixedStructHelper.extract(any1); ORBTest_Basic.FixedStructHolder arg2 = (new ORBTest_Basic.FixedStructHolder()); ORBTest_Basic.FixedStruct ret = (m_ti.opFixedStruct(arg0, arg1, arg2)); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExFixedStructHelper.insert(exAny, new ORBTest_Basic.ExFixedStruct(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.FixedStructHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.FixedStructHelper.insert(any1, arg1.value); ORBTest_Basic.FixedStructHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrVariableStruct")) { NVList list = m_orb.create_list(0); request.arguments(list); ORBTest_Basic.VariableStruct ret = m_ti.attrVariableStruct(); Any any = m_orb.create_any(); ORBTest_Basic.VariableStructHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrVariableStruct")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.VariableStructHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); ORBTest_Basic.VariableStruct arg = (ORBTest_Basic.VariableStructHelper .extract(any)); m_ti.attrVariableStruct(arg); return; } if (name.equals("opVariableStruct")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.VariableStructHelper.type()); any1.type(ORBTest_Basic.VariableStructHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); ORBTest_Basic.VariableStruct arg0 = (ORBTest_Basic.VariableStructHelper .extract(any0)); ORBTest_Basic.VariableStructHolder arg1 = (new ORBTest_Basic.VariableStructHolder()); arg1.value = ORBTest_Basic.VariableStructHelper.extract(any1); ORBTest_Basic.VariableStructHolder arg2 = (new ORBTest_Basic.VariableStructHolder()); ORBTest_Basic.VariableStruct ret = (m_ti.opVariableStruct(arg0, arg1, arg2)); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExVariableStructHelper.insert(exAny, new ORBTest_Basic.ExVariableStruct(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.VariableStructHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.VariableStructHelper.insert(any1, arg1.value); ORBTest_Basic.VariableStructHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrFixedUnion")) { NVList list = m_orb.create_list(0); request.arguments(list); ORBTest_Basic.FixedUnion ret = m_ti.attrFixedUnion(); Any any = m_orb.create_any(); ORBTest_Basic.FixedUnionHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrFixedUnion")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.FixedUnionHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); ORBTest_Basic.FixedUnion arg = (ORBTest_Basic.FixedUnionHelper .extract(any)); m_ti.attrFixedUnion(arg); return; } if (name.equals("opFixedUnion")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.FixedUnionHelper.type()); any1.type(ORBTest_Basic.FixedUnionHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); ORBTest_Basic.FixedUnion arg0 = (ORBTest_Basic.FixedUnionHelper .extract(any0)); ORBTest_Basic.FixedUnionHolder arg1 = (new ORBTest_Basic.FixedUnionHolder()); arg1.value = ORBTest_Basic.FixedUnionHelper.extract(any1); ORBTest_Basic.FixedUnionHolder arg2 = (new ORBTest_Basic.FixedUnionHolder()); ORBTest_Basic.FixedUnion ret = m_ti.opFixedUnion(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExFixedUnionHelper.insert(exAny, new ORBTest_Basic.ExFixedUnion(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.FixedUnionHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.FixedUnionHelper.insert(any1, arg1.value); ORBTest_Basic.FixedUnionHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrVariableUnion")) { NVList list = m_orb.create_list(0); request.arguments(list); ORBTest_Basic.VariableUnion ret = m_ti.attrVariableUnion(); Any any = m_orb.create_any(); ORBTest_Basic.VariableUnionHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrVariableUnion")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.VariableUnionHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); ORBTest_Basic.VariableUnion arg = ORBTest_Basic.VariableUnionHelper .extract(any); m_ti.attrVariableUnion(arg); return; } if (name.equals("opVariableUnion")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.VariableUnionHelper.type()); any1.type(ORBTest_Basic.VariableUnionHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); ORBTest_Basic.VariableUnion arg0 = (ORBTest_Basic.VariableUnionHelper .extract(any0)); ORBTest_Basic.VariableUnionHolder arg1 = (new ORBTest_Basic.VariableUnionHolder()); arg1.value = ORBTest_Basic.VariableUnionHelper.extract(any1); ORBTest_Basic.VariableUnionHolder arg2 = (new ORBTest_Basic.VariableUnionHolder()); ORBTest_Basic.VariableUnion ret = m_ti.opVariableUnion(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExVariableUnionHelper.insert(exAny, new ORBTest_Basic.ExVariableUnion(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.VariableUnionHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.VariableUnionHelper.insert(any1, arg1.value); ORBTest_Basic.VariableUnionHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrStringSequence")) { NVList list = m_orb.create_list(0); request.arguments(list); String[] ret = m_ti.attrStringSequence(); Any any = m_orb.create_any(); ORBTest_Basic.StringSequenceHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrStringSequence")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.StringSequenceHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); String[] arg = ORBTest_Basic.StringSequenceHelper.extract(any); m_ti.attrStringSequence(arg); return; } if (name.equals("opStringSequence")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.StringSequenceHelper.type()); any1.type(ORBTest_Basic.StringSequenceHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); String[] arg0 = ORBTest_Basic.StringSequenceHelper.extract(any0); ORBTest_Basic.StringSequenceHolder arg1 = (new ORBTest_Basic.StringSequenceHolder()); arg1.value = ORBTest_Basic.StringSequenceHelper.extract(any1); ORBTest_Basic.StringSequenceHolder arg2 = (new ORBTest_Basic.StringSequenceHolder()); String[] ret = m_ti.opStringSequence(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExStringSequenceHelper.insert(exAny, new ORBTest_Basic.ExStringSequence(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.StringSequenceHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.StringSequenceHelper.insert(any1, arg1.value); ORBTest_Basic.StringSequenceHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrFixedArray")) { NVList list = m_orb.create_list(0); request.arguments(list); short[][][] ret = m_ti.attrFixedArray(); Any any = m_orb.create_any(); ORBTest_Basic.FixedArrayHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrFixedArray")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.FixedArrayHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); short[][][] arg = ORBTest_Basic.FixedArrayHelper.extract(any); m_ti.attrFixedArray(arg); return; } if (name.equals("opFixedArray")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.FixedArrayHelper.type()); any1.type(ORBTest_Basic.FixedArrayHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); short[][][] arg0 = ORBTest_Basic.FixedArrayHelper.extract(any0); ORBTest_Basic.FixedArrayHolder arg1 = (new ORBTest_Basic.FixedArrayHolder()); arg1.value = ORBTest_Basic.FixedArrayHelper.extract(any1); ORBTest_Basic.FixedArrayHolder arg2 = (new ORBTest_Basic.FixedArrayHolder()); short[][][] ret = m_ti.opFixedArray(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExFixedArrayHelper.insert(exAny, new ORBTest_Basic.ExFixedArray(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.FixedArrayHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.FixedArrayHelper.insert(any1, arg1.value); ORBTest_Basic.FixedArrayHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrVariableArray")) { NVList list = m_orb.create_list(0); request.arguments(list); String[][] ret = m_ti.attrVariableArray(); Any any = m_orb.create_any(); ORBTest_Basic.VariableArrayHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrVariableArray")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.VariableArrayHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); String[][] arg = ORBTest_Basic.VariableArrayHelper.extract(any); m_ti.attrVariableArray(arg); return; } if (name.equals("opVariableArray")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.VariableArrayHelper.type()); any1.type(ORBTest_Basic.VariableArrayHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); String[][] arg0 = ORBTest_Basic.VariableArrayHelper.extract(any0); ORBTest_Basic.VariableArrayHolder arg1 = (new ORBTest_Basic.VariableArrayHolder()); arg1.value = ORBTest_Basic.VariableArrayHelper.extract(any1); ORBTest_Basic.VariableArrayHolder arg2 = (new ORBTest_Basic.VariableArrayHolder()); String[][] ret = m_ti.opVariableArray(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExVariableArrayHelper.insert(exAny, new ORBTest_Basic.ExVariableArray(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.VariableArrayHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.VariableArrayHelper.insert(any1, arg1.value); ORBTest_Basic.VariableArrayHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrFixedArraySequence")) { NVList list = m_orb.create_list(0); request.arguments(list); short[][][][] ret = m_ti.attrFixedArraySequence(); Any any = m_orb.create_any(); ORBTest_Basic.FixedArraySequenceHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrFixedArraySequence")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.FixedArraySequenceHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); short[][][][] arg = (ORBTest_Basic.FixedArraySequenceHelper .extract(any)); m_ti.attrFixedArraySequence(arg); return; } if (name.equals("opFixedArraySequence")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.FixedArraySequenceHelper.type()); any1.type(ORBTest_Basic.FixedArraySequenceHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); short[][][][] arg0 = (ORBTest_Basic.FixedArraySequenceHelper .extract(any0)); ORBTest_Basic.FixedArraySequenceHolder arg1 = (new ORBTest_Basic.FixedArraySequenceHolder()); arg1.value = ORBTest_Basic.FixedArraySequenceHelper.extract(any1); ORBTest_Basic.FixedArraySequenceHolder arg2 = (new ORBTest_Basic.FixedArraySequenceHolder()); short[][][][] ret = m_ti.opFixedArraySequence(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExFixedArraySequenceHelper.insert(exAny, new ORBTest_Basic.ExFixedArraySequence(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.FixedArraySequenceHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.FixedArraySequenceHelper.insert(any1, arg1.value); ORBTest_Basic.FixedArraySequenceHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrVariableArraySequence")) { NVList list = m_orb.create_list(0); request.arguments(list); String[][][] ret = m_ti.attrVariableArraySequence(); Any any = m_orb.create_any(); ORBTest_Basic.VariableArraySequenceHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrVariableArraySequence")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.VariableArraySequenceHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); String[][][] arg = (ORBTest_Basic.VariableArraySequenceHelper .extract(any)); m_ti.attrVariableArraySequence(arg); return; } if (name.equals("opVariableArraySequence")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.VariableArraySequenceHelper.type()); any1.type(ORBTest_Basic.VariableArraySequenceHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); String[][][] arg0 = (ORBTest_Basic.VariableArraySequenceHelper .extract(any0)); ORBTest_Basic.VariableArraySequenceHolder arg1 = new ORBTest_Basic.VariableArraySequenceHolder(); arg1.value = (ORBTest_Basic.VariableArraySequenceHelper .extract(any1)); ORBTest_Basic.VariableArraySequenceHolder arg2 = (new ORBTest_Basic.VariableArraySequenceHolder()); String[][][] ret = m_ti.opVariableArraySequence(arg0, arg1, arg2); if (ex) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExVariableArraySequenceHelper.insert(exAny, new ORBTest_Basic.ExVariableArraySequence(ret)); request.set_exception(exAny); } else { Any result = m_orb.create_any(); ORBTest_Basic.VariableArraySequenceHelper.insert(result, ret); request.set_result(result); ORBTest_Basic.VariableArraySequenceHelper.insert(any1, arg1.value); ORBTest_Basic.VariableArraySequenceHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrFixedArrayBoundSequence")) { NVList list = m_orb.create_list(0); request.arguments(list); short[][][][] ret = m_ti.attrFixedArraySequence(); Any any = m_orb.create_any(); ORBTest_Basic.FixedArraySequenceHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrFixedArrayBoundSequence")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.FixedArrayBoundSequenceHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); short[][][][] arg = ORBTest_Basic.FixedArrayBoundSequenceHelper .extract(any); m_ti.attrFixedArrayBoundSequence(arg); return; } if (name.equals("opFixedArrayBoundSequence")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.FixedArrayBoundSequenceHelper.type()); any1.type(ORBTest_Basic.FixedArrayBoundSequenceHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); short[][][][] arg0 = ORBTest_Basic.FixedArrayBoundSequenceHelper .extract(any0); ORBTest_Basic.FixedArrayBoundSequenceHolder arg1 = new ORBTest_Basic.FixedArrayBoundSequenceHolder(); arg1._read(any1.create_input_stream()); ORBTest_Basic.FixedArrayBoundSequenceHolder arg2 = new ORBTest_Basic.FixedArrayBoundSequenceHolder(); short[][][][] ret = m_ti .opFixedArrayBoundSequence(arg0, arg1, arg2); if (ex) { Any any = m_orb.create_any(); ORBTest_Basic.ExFixedArrayBoundSequenceHelper.insert(any, new ORBTest_Basic.ExFixedArrayBoundSequence(ret)); request.set_exception(any); } else { Any any = m_orb.create_any(); ORBTest_Basic.FixedArrayBoundSequenceHelper.insert(any, ret); request.set_result(any); ORBTest_Basic.FixedArrayBoundSequenceHelper.insert(any1, arg1.value); ORBTest_Basic.FixedArrayBoundSequenceHelper.insert(any2, arg2.value); } return; } if (name.equals("_get_attrVariableArrayBoundSequence")) { NVList list = m_orb.create_list(0); request.arguments(list); String[][][] ret = m_ti.attrVariableArrayBoundSequence(); Any any = m_orb.create_any(); ORBTest_Basic.VariableArrayBoundSequenceHelper.insert(any, ret); request.set_result(any); return; } if (name.equals("_set_attrVariableArrayBoundSequence")) { NVList list = m_orb.create_list(0); Any any = m_orb.create_any(); any.type(ORBTest_Basic.VariableArrayBoundSequenceHelper.type()); list.add_value("", any, org.omg.CORBA.ARG_IN.value); request.arguments(list); String[][][] arg = ORBTest_Basic.VariableArrayBoundSequenceHelper .extract(any); m_ti.attrVariableArrayBoundSequence(arg); return; } if (name.equals("opVariableArrayBoundSequence")) { NVList list = m_orb.create_list(0); Any any0 = m_orb.create_any(); Any any1 = m_orb.create_any(); Any any2 = m_orb.create_any(); any0.type(ORBTest_Basic.VariableArrayBoundSequenceHelper.type()); any1.type(ORBTest_Basic.VariableArrayBoundSequenceHelper.type()); list.add_value("", any0, org.omg.CORBA.ARG_IN.value); list.add_value("", any1, org.omg.CORBA.ARG_INOUT.value); list.add_value("", any2, org.omg.CORBA.ARG_OUT.value); request.arguments(list); String[][][] arg0 = ORBTest_Basic.VariableArrayBoundSequenceHelper .extract(any0); ORBTest_Basic.VariableArrayBoundSequenceHolder arg1 = new ORBTest_Basic.VariableArrayBoundSequenceHolder(); arg1._read(any1.create_input_stream()); ORBTest_Basic.VariableArrayBoundSequenceHolder arg2 = new ORBTest_Basic.VariableArrayBoundSequenceHolder(); String[][][] ret = m_ti.opVariableArrayBoundSequence(arg0, arg1, arg2); if (ex) { Any any = m_orb.create_any(); ORBTest_Basic.ExVariableArrayBoundSequenceHelper.insert(any, new ORBTest_Basic.ExVariableArrayBoundSequence(ret)); request.set_exception(any); } else { Any any = m_orb.create_any(); ORBTest_Basic.VariableArrayBoundSequenceHelper.insert(any, ret); request.set_result(any); ORBTest_Basic.VariableArrayBoundSequenceHelper.insert(any1, arg1.value); ORBTest_Basic.VariableArrayBoundSequenceHelper.insert(any2, arg2.value); } return; } if (name.equals("opExRecursiveStruct")) { NVList list = m_orb.create_list(0); request.arguments(list); try { m_ti.opExRecursiveStruct(); } catch (ORBTest_Basic.ExRecursiveStruct ex_recursive_struct) { Any exAny = m_orb.create_any(); ORBTest_Basic.ExRecursiveStructHelper .insert(exAny, new ORBTest_Basic.ExRecursiveStruct( ex_recursive_struct.us, ex_recursive_struct.rs)); request.set_exception(exAny); } return; } System.err.println("DSI implementation: unknown operation: " + name); NVList list = m_orb.create_list(0); request.arguments(list); Any exAny = m_orb.create_any(); BAD_OPERATIONHelper.insert(exAny, new BAD_OPERATION()); request.set_exception(exAny); } }
5,965
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfExceptionsExt_2_3_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; final class TestIntfExceptionsExt_2_3_impl extends ORBTest_ExceptionsExt_2_3.IntfPOA { private POA m_poa; public TestIntfExceptionsExt_2_3_impl(POA poa) { m_poa = poa; } public synchronized void op_CODESET_INCOMPATIBLE_Ex() { throw new CODESET_INCOMPATIBLE(31, CompletionStatus.COMPLETED_NO); } public synchronized void op_REBIND_Ex() { throw new REBIND(32, CompletionStatus.COMPLETED_NO); } public synchronized void op_TIMEOUT_Ex() { throw new TIMEOUT(33, CompletionStatus.COMPLETED_NO); } public synchronized void op_TRANSACTION_UNAVAILABLE_Ex() { throw new TRANSACTION_UNAVAILABLE(34, CompletionStatus.COMPLETED_NO); } public synchronized void op_TRANSACTION_MODE_Ex() { throw new TRANSACTION_MODE(35, CompletionStatus.COMPLETED_NO); } public synchronized void op_BAD_QOS_Ex() { throw new BAD_QOS(36, CompletionStatus.COMPLETED_NO); } public org.omg.PortableServer.POA _default_POA() { return m_poa; } }
5,966
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestCase.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; // // IDL:ORBTest/TestCase:1.0 // /***/ final public class TestCase implements org.omg.CORBA.portable.IDLEntity { private static final String _ob_id = "IDL:ORBTest/TestCase:1.0"; public TestCase() { } public TestCase(String impl_description, org.omg.CORBA.Object impl) { this.impl_description = impl_description; this.impl = impl; } public String impl_description; public org.omg.CORBA.Object impl; }
5,967
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestObjectExceptionsExt_2_0.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import static org.junit.Assert.assertTrue; import org.omg.CORBA.*; public class TestObjectExceptionsExt_2_0 extends test.common.TestBase implements TestObject { private ORB m_orb; ORBTest.Intf m_test_intf; public TestObjectExceptionsExt_2_0(ORB orb, ORBTest.Intf test_intf) { m_orb = orb; m_test_intf = test_intf; } public boolean is_supported(org.omg.CORBA.Object obj) { boolean is_supported = false; if (obj != null) { try { ORBTest_ExceptionsExt_2_0.Intf ti = (ORBTest_ExceptionsExt_2_0.IntfHelper .narrow(obj)); is_supported = true; } catch (BAD_PARAM e) { is_supported = false; } } return is_supported; } public void test_SII(org.omg.CORBA.Object obj) { ORBTest_ExceptionsExt_2_0.Intf ti = (ORBTest_ExceptionsExt_2_0.IntfHelper .narrow(obj)); try { ti.op_PERSIST_STORE_Ex(); assertTrue(false); } catch (PERSIST_STORE ex) { assertTrue(ex.minor == 16); assertTrue(ex.completed == CompletionStatus.COMPLETED_YES); } try { ti.op_FREE_MEM_Ex(); assertTrue(false); } catch (FREE_MEM ex) { assertTrue(ex.minor == 19); assertTrue(ex.completed == CompletionStatus.COMPLETED_YES); } try { ti.op_INV_IDENT_Ex(); assertTrue(false); } catch (INV_IDENT ex) { assertTrue(ex.minor == 20); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_INV_FLAG_Ex(); assertTrue(false); } catch (INV_FLAG ex) { assertTrue(ex.minor == 21); assertTrue(ex.completed == CompletionStatus.COMPLETED_MAYBE); } try { ti.op_INTF_REPOS_Ex(); assertTrue(false); } catch (INTF_REPOS ex) { assertTrue(ex.minor == 22); assertTrue(ex.completed == CompletionStatus.COMPLETED_YES); } try { ti.op_BAD_CONTEXT_Ex(); assertTrue(false); } catch (BAD_CONTEXT ex) { assertTrue(ex.minor == 23); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_TRANSACTION_REQUIRED_Ex(); assertTrue(false); } catch (TRANSACTION_REQUIRED ex) { assertTrue(ex.minor == 27); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_TRANSACTION_ROLLEDBACK_Ex(); assertTrue(false); } catch (TRANSACTION_ROLLEDBACK ex) { assertTrue(ex.minor == 28); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } try { ti.op_INVALID_TRANSACTION_Ex(); assertTrue(false); } catch (INVALID_TRANSACTION ex) { assertTrue(ex.minor == 29); assertTrue(ex.completed == CompletionStatus.COMPLETED_NO); } } public void test_DII(org.omg.CORBA.Object obj) { // REVISIT } }
5,968
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest/TestIntfFixed_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest; import org.omg.CORBA.*; import org.omg.PortableServer.*; final class TestIntfFixed_impl extends ORBTest_Fixed.IntfPOA { private POA m_poa; private java.math.BigDecimal m_aFixed; public TestIntfFixed_impl(POA poa) { m_poa = poa; } public synchronized java.math.BigDecimal attrFixed() { return m_aFixed; } public synchronized void attrFixed(java.math.BigDecimal value) { m_aFixed = value; } public synchronized java.math.BigDecimal opFixed(java.math.BigDecimal a0, FixedHolder a1, FixedHolder a2) { m_aFixed = a0.add(a1.value); a1.value = a2.value = m_aFixed; return m_aFixed; } public synchronized java.math.BigDecimal opFixedEx(java.math.BigDecimal a0, FixedHolder a1, FixedHolder a2) throws ORBTest_Fixed.ExFixed { m_aFixed = a0.add(a1.value); throw new ORBTest_Fixed.ExFixed(m_aFixed); } public org.omg.PortableServer.POA _default_POA() { return m_poa; } }
5,969
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/IntfPOATie.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/Intf:1.0 // public class IntfPOATie extends IntfPOA { private IntfOperations _ob_delegate_; private org.omg.PortableServer.POA _ob_poa_; public IntfPOATie(IntfOperations delegate) { _ob_delegate_ = delegate; } public IntfPOATie(IntfOperations delegate, org.omg.PortableServer.POA poa) { _ob_delegate_ = delegate; _ob_poa_ = poa; } public IntfOperations _delegate() { return _ob_delegate_; } public void _delegate(IntfOperations delegate) { _ob_delegate_ = delegate; } public org.omg.PortableServer.POA _default_POA() { if(_ob_poa_ != null) return _ob_poa_; else return super._default_POA(); } // // IDL:ORBTest_Fixed/Intf/attrFixed:1.0 // public java.math.BigDecimal attrFixed() { return _ob_delegate_.attrFixed(); } public void attrFixed(java.math.BigDecimal val) { _ob_delegate_.attrFixed(val); } // // IDL:ORBTest_Fixed/Intf/opFixed:1.0 // public java.math.BigDecimal opFixed(java.math.BigDecimal a0, org.omg.CORBA.FixedHolder a1, org.omg.CORBA.FixedHolder a2) { return _ob_delegate_.opFixed(a0, a1, a2); } // // IDL:ORBTest_Fixed/Intf/opFixedEx:1.0 // public java.math.BigDecimal opFixedEx(java.math.BigDecimal a0, org.omg.CORBA.FixedHolder a1, org.omg.CORBA.FixedHolder a2) throws ExFixed { return _ob_delegate_.opFixedEx(a0, a1, a2); } }
5,970
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/Intf.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/Intf:1.0 // /***/ public interface Intf extends IntfOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity { }
5,971
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/IntfPOA.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/Intf:1.0 // public abstract class IntfPOA extends org.omg.PortableServer.Servant implements org.omg.CORBA.portable.InvokeHandler, IntfOperations { static final String[] _ob_ids_ = { "IDL:ORBTest_Fixed/Intf:1.0", }; public Intf _this() { return IntfHelper.narrow(super._this_object()); } public Intf _this(org.omg.CORBA.ORB orb) { return IntfHelper.narrow(super._this_object(orb)); } public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectId) { return _ob_ids_; } public org.omg.CORBA.portable.OutputStream _invoke(String opName, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { final String[] _ob_names = { "_get_attrFixed", "_set_attrFixed", "opFixed", "opFixedEx" }; int _ob_left = 0; int _ob_right = _ob_names.length; int _ob_index = -1; while(_ob_left < _ob_right) { int _ob_m = (_ob_left + _ob_right) / 2; int _ob_res = _ob_names[_ob_m].compareTo(opName); if(_ob_res == 0) { _ob_index = _ob_m; break; } else if(_ob_res > 0) _ob_right = _ob_m; else _ob_left = _ob_m + 1; } if(_ob_index == -1 && opName.charAt(0) == '_') { _ob_left = 0; _ob_right = _ob_names.length; String _ob_ami_op = opName.substring(1); while(_ob_left < _ob_right) { int _ob_m = (_ob_left + _ob_right) / 2; int _ob_res = _ob_names[_ob_m].compareTo(_ob_ami_op); if(_ob_res == 0) { _ob_index = _ob_m; break; } else if(_ob_res > 0) _ob_right = _ob_m; else _ob_left = _ob_m + 1; } } switch(_ob_index) { case 0: // _get_attrFixed return _OB_att_get_attrFixed(in, handler); case 1: // _set_attrFixed return _OB_att_set_attrFixed(in, handler); case 2: // opFixed return _OB_op_opFixed(in, handler); case 3: // opFixedEx return _OB_op_opFixedEx(in, handler); } throw new org.omg.CORBA.BAD_OPERATION(); } private org.omg.CORBA.portable.OutputStream _OB_att_get_attrFixed(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { java.math.BigDecimal _ob_r = attrFixed(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); TestFixedHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_set_attrFixed(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { java.math.BigDecimal _ob_a = TestFixedHelper.read(in); attrFixed(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_op_opFixed(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; java.math.BigDecimal _ob_a0 = TestFixedHelper.read(in); org.omg.CORBA.FixedHolder _ob_ah1 = new org.omg.CORBA.FixedHolder(); _ob_ah1.value = TestFixedHelper.read(in); org.omg.CORBA.FixedHolder _ob_ah2 = new org.omg.CORBA.FixedHolder(); java.math.BigDecimal _ob_r = opFixed(_ob_a0, _ob_ah1, _ob_ah2); out = handler.createReply(); TestFixedHelper.write(out, _ob_r); TestFixedHelper.write(out, _ob_ah1.value); TestFixedHelper.write(out, _ob_ah2.value); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_opFixedEx(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { java.math.BigDecimal _ob_a0 = TestFixedHelper.read(in); org.omg.CORBA.FixedHolder _ob_ah1 = new org.omg.CORBA.FixedHolder(); _ob_ah1.value = TestFixedHelper.read(in); org.omg.CORBA.FixedHolder _ob_ah2 = new org.omg.CORBA.FixedHolder(); java.math.BigDecimal _ob_r = opFixedEx(_ob_a0, _ob_ah1, _ob_ah2); out = handler.createReply(); TestFixedHelper.write(out, _ob_r); TestFixedHelper.write(out, _ob_ah1.value); TestFixedHelper.write(out, _ob_ah2.value); } catch(ExFixed _ob_ex) { out = handler.createExceptionReply(); ExFixedHelper.write(out, _ob_ex); } return out; } }
5,972
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/_IntfStub.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/Intf:1.0 // public class _IntfStub extends org.omg.CORBA.portable.ObjectImpl implements Intf { private static final String[] _ob_ids_ = { "IDL:ORBTest_Fixed/Intf:1.0", }; public String[] _ids() { return _ob_ids_; } final public static java.lang.Class _ob_opsClass = IntfOperations.class; // // IDL:ORBTest_Fixed/Intf/attrFixed:1.0 // public java.math.BigDecimal attrFixed() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_attrFixed", true); in = _invoke(out); java.math.BigDecimal _ob_r = TestFixedHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("attrFixed", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.attrFixed(); } finally { _servant_postinvoke(_ob_so); } } } } public void attrFixed(java.math.BigDecimal _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_attrFixed", true); TestFixedHelper.write(out, _ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("attrFixed", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { _ob_self.attrFixed(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_Fixed/Intf/opFixed:1.0 // public java.math.BigDecimal opFixed(java.math.BigDecimal _ob_a0, org.omg.CORBA.FixedHolder _ob_ah1, org.omg.CORBA.FixedHolder _ob_ah2) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("opFixed", true); TestFixedHelper.write(out, _ob_a0); TestFixedHelper.write(out, _ob_ah1.value); in = _invoke(out); java.math.BigDecimal _ob_r = TestFixedHelper.read(in); _ob_ah1.value = TestFixedHelper.read(in); _ob_ah2.value = TestFixedHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("opFixed", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.opFixed(_ob_a0, _ob_ah1, _ob_ah2); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_Fixed/Intf/opFixedEx:1.0 // public java.math.BigDecimal opFixedEx(java.math.BigDecimal _ob_a0, org.omg.CORBA.FixedHolder _ob_ah1, org.omg.CORBA.FixedHolder _ob_ah2) throws ExFixed { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("opFixedEx", true); TestFixedHelper.write(out, _ob_a0); TestFixedHelper.write(out, _ob_ah1.value); in = _invoke(out); java.math.BigDecimal _ob_r = TestFixedHelper.read(in); _ob_ah1.value = TestFixedHelper.read(in); _ob_ah2.value = TestFixedHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(ExFixedHelper.id())) throw ExFixedHelper.read(in); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("opFixedEx", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.opFixedEx(_ob_a0, _ob_ah1, _ob_ah2); } finally { _servant_postinvoke(_ob_so); } } } } }
5,973
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/IntfHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/Intf:1.0 // final public class IntfHelper { public static void insert(org.omg.CORBA.Any any, Intf val) { any.insert_Object(val, type()); } public static Intf extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_Object()); throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); typeCode_ = orb.create_interface_tc(id(), "Intf"); } return typeCode_; } public static String id() { return "IDL:ORBTest_Fixed/Intf:1.0"; } public static Intf read(org.omg.CORBA.portable.InputStream in) { org.omg.CORBA.Object _ob_v = in.read_Object(); try { return (Intf)_ob_v; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ob_impl = (org.omg.CORBA.portable.ObjectImpl)_ob_v; _IntfStub _ob_stub = new _IntfStub(); _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } public static void write(org.omg.CORBA.portable.OutputStream out, Intf val) { out.write_Object(val); } public static Intf narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Intf)val; } catch(ClassCastException ex) { } if(val._is_a(id())) { org.omg.CORBA.portable.ObjectImpl _ob_impl; _IntfStub _ob_stub = new _IntfStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } throw new org.omg.CORBA.BAD_PARAM(); } return null; } public static Intf unchecked_narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Intf)val; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _IntfStub _ob_stub = new _IntfStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } return null; } }
5,974
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/IntfHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/Intf:1.0 // final public class IntfHolder implements org.omg.CORBA.portable.Streamable { public Intf value; public IntfHolder() { } public IntfHolder(Intf initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = IntfHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { IntfHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return IntfHelper.type(); } }
5,975
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/TestFixedHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/TestFixed:1.0 // final public class TestFixedHelper { public static void insert(org.omg.CORBA.Any any, java.math.BigDecimal val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static java.math.BigDecimal extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); typeCode_ = orb.create_alias_tc(id(), "TestFixed", orb.create_fixed_tc((short)24, (short)8)); } return typeCode_; } public static String id() { return "IDL:ORBTest_Fixed/TestFixed:1.0"; } public static java.math.BigDecimal read(org.omg.CORBA.portable.InputStream in) { java.math.BigDecimal _ob_v; _ob_v = in.read_fixed().movePointLeft(8); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, java.math.BigDecimal val) { out.write_fixed(val.movePointRight(8)); } }
5,976
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/IntfOperations.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/Intf:1.0 // /***/ public interface IntfOperations { // // IDL:ORBTest_Fixed/Intf/attrFixed:1.0 // /***/ java.math.BigDecimal attrFixed(); void attrFixed(java.math.BigDecimal val); // // IDL:ORBTest_Fixed/Intf/opFixed:1.0 // /***/ java.math.BigDecimal opFixed(java.math.BigDecimal a0, org.omg.CORBA.FixedHolder a1, org.omg.CORBA.FixedHolder a2); // // IDL:ORBTest_Fixed/Intf/opFixedEx:1.0 // /***/ java.math.BigDecimal opFixedEx(java.math.BigDecimal a0, org.omg.CORBA.FixedHolder a1, org.omg.CORBA.FixedHolder a2) throws ExFixed; }
5,977
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/ExFixedHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/ExFixed:1.0 // final public class ExFixedHolder implements org.omg.CORBA.portable.Streamable { public ExFixed value; public ExFixedHolder() { } public ExFixedHolder(ExFixed initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ExFixedHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ExFixedHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ExFixedHelper.type(); } }
5,978
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/ExFixedHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/ExFixed:1.0 // final public class ExFixedHelper { public static void insert(org.omg.CORBA.Any any, ExFixed val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static ExFixed extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[1]; members[0] = new org.omg.CORBA.StructMember(); members[0].name = "value"; members[0].type = TestFixedHelper.type(); typeCode_ = orb.create_exception_tc(id(), "ExFixed", members); } return typeCode_; } public static String id() { return "IDL:ORBTest_Fixed/ExFixed:1.0"; } public static ExFixed read(org.omg.CORBA.portable.InputStream in) { if(!id().equals(in.read_string())) throw new org.omg.CORBA.MARSHAL(); ExFixed _ob_v = new ExFixed(); _ob_v.value = TestFixedHelper.read(in); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, ExFixed val) { out.write_string(id()); TestFixedHelper.write(out, val.value); } }
5,979
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_Fixed/ExFixed.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_Fixed; // // IDL:ORBTest_Fixed/ExFixed:1.0 // /***/ final public class ExFixed extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:ORBTest_Fixed/ExFixed:1.0"; public ExFixed() { super(_ob_id); } public ExFixed(java.math.BigDecimal value) { super(_ob_id); this.value = value; } public ExFixed(String _reason, java.math.BigDecimal value) { super(_ob_id + " " + _reason); this.value = value; } public java.math.BigDecimal value; }
5,980
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/ExWString.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/ExWString:1.0 // /***/ final public class ExWString extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:ORBTest_WChar/ExWString:1.0"; public ExWString() { super(_ob_id); } public ExWString(String value) { super(_ob_id); this.value = value; } public ExWString(String _reason, String value) { super(_ob_id + " " + _reason); this.value = value; } public String value; }
5,981
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/IntfPOATie.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/Intf:1.0 // public class IntfPOATie extends IntfPOA { private IntfOperations _ob_delegate_; private org.omg.PortableServer.POA _ob_poa_; public IntfPOATie(IntfOperations delegate) { _ob_delegate_ = delegate; } public IntfPOATie(IntfOperations delegate, org.omg.PortableServer.POA poa) { _ob_delegate_ = delegate; _ob_poa_ = poa; } public IntfOperations _delegate() { return _ob_delegate_; } public void _delegate(IntfOperations delegate) { _ob_delegate_ = delegate; } public org.omg.PortableServer.POA _default_POA() { if(_ob_poa_ != null) return _ob_poa_; else return super._default_POA(); } // // IDL:ORBTest_WChar/Intf/attrWChar:1.0 // public char attrWChar() { return _ob_delegate_.attrWChar(); } public void attrWChar(char val) { _ob_delegate_.attrWChar(val); } // // IDL:ORBTest_WChar/Intf/attrWString:1.0 // public String attrWString() { return _ob_delegate_.attrWString(); } public void attrWString(String val) { _ob_delegate_.attrWString(val); } // // IDL:ORBTest_WChar/Intf/opWChar:1.0 // public char opWChar(char a0, org.omg.CORBA.CharHolder a1, org.omg.CORBA.CharHolder a2) { return _ob_delegate_.opWChar(a0, a1, a2); } // // IDL:ORBTest_WChar/Intf/opWCharEx:1.0 // public char opWCharEx(char a0, org.omg.CORBA.CharHolder a1, org.omg.CORBA.CharHolder a2) throws ExWChar { return _ob_delegate_.opWCharEx(a0, a1, a2); } // // IDL:ORBTest_WChar/Intf/opWString:1.0 // public String opWString(String a0, org.omg.CORBA.StringHolder a1, org.omg.CORBA.StringHolder a2) { return _ob_delegate_.opWString(a0, a1, a2); } // // IDL:ORBTest_WChar/Intf/opWStringEx:1.0 // public String opWStringEx(String a0, org.omg.CORBA.StringHolder a1, org.omg.CORBA.StringHolder a2) throws ExWString { return _ob_delegate_.opWStringEx(a0, a1, a2); } }
5,982
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/ExWCharHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/ExWChar:1.0 // final public class ExWCharHolder implements org.omg.CORBA.portable.Streamable { public ExWChar value; public ExWCharHolder() { } public ExWCharHolder(ExWChar initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ExWCharHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ExWCharHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ExWCharHelper.type(); } }
5,983
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/ExWCharHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/ExWChar:1.0 // final public class ExWCharHelper { public static void insert(org.omg.CORBA.Any any, ExWChar val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static ExWChar extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[1]; members[0] = new org.omg.CORBA.StructMember(); members[0].name = "value"; members[0].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_wchar); typeCode_ = orb.create_exception_tc(id(), "ExWChar", members); } return typeCode_; } public static String id() { return "IDL:ORBTest_WChar/ExWChar:1.0"; } public static ExWChar read(org.omg.CORBA.portable.InputStream in) { if(!id().equals(in.read_string())) throw new org.omg.CORBA.MARSHAL(); ExWChar _ob_v = new ExWChar(); _ob_v.value = in.read_wchar(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, ExWChar val) { out.write_string(id()); out.write_wchar(val.value); } }
5,984
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/Intf.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/Intf:1.0 // /***/ public interface Intf extends IntfOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity { }
5,985
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/IntfPOA.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/Intf:1.0 // public abstract class IntfPOA extends org.omg.PortableServer.Servant implements org.omg.CORBA.portable.InvokeHandler, IntfOperations { static final String[] _ob_ids_ = { "IDL:ORBTest_WChar/Intf:1.0", }; public Intf _this() { return IntfHelper.narrow(super._this_object()); } public Intf _this(org.omg.CORBA.ORB orb) { return IntfHelper.narrow(super._this_object(orb)); } public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectId) { return _ob_ids_; } public org.omg.CORBA.portable.OutputStream _invoke(String opName, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { final String[] _ob_names = { "_get_attrWChar", "_get_attrWString", "_set_attrWChar", "_set_attrWString", "opWChar", "opWCharEx", "opWString", "opWStringEx" }; int _ob_left = 0; int _ob_right = _ob_names.length; int _ob_index = -1; while(_ob_left < _ob_right) { int _ob_m = (_ob_left + _ob_right) / 2; int _ob_res = _ob_names[_ob_m].compareTo(opName); if(_ob_res == 0) { _ob_index = _ob_m; break; } else if(_ob_res > 0) _ob_right = _ob_m; else _ob_left = _ob_m + 1; } if(_ob_index == -1 && opName.charAt(0) == '_') { _ob_left = 0; _ob_right = _ob_names.length; String _ob_ami_op = opName.substring(1); while(_ob_left < _ob_right) { int _ob_m = (_ob_left + _ob_right) / 2; int _ob_res = _ob_names[_ob_m].compareTo(_ob_ami_op); if(_ob_res == 0) { _ob_index = _ob_m; break; } else if(_ob_res > 0) _ob_right = _ob_m; else _ob_left = _ob_m + 1; } } switch(_ob_index) { case 0: // _get_attrWChar return _OB_att_get_attrWChar(in, handler); case 1: // _get_attrWString return _OB_att_get_attrWString(in, handler); case 2: // _set_attrWChar return _OB_att_set_attrWChar(in, handler); case 3: // _set_attrWString return _OB_att_set_attrWString(in, handler); case 4: // opWChar return _OB_op_opWChar(in, handler); case 5: // opWCharEx return _OB_op_opWCharEx(in, handler); case 6: // opWString return _OB_op_opWString(in, handler); case 7: // opWStringEx return _OB_op_opWStringEx(in, handler); } throw new org.omg.CORBA.BAD_OPERATION(); } private org.omg.CORBA.portable.OutputStream _OB_att_get_attrWChar(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { char _ob_r = attrWChar(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_wchar(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_attrWString(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String _ob_r = attrWString(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_wstring(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_set_attrWChar(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { char _ob_a = in.read_wchar(); attrWChar(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_attrWString(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String _ob_a = in.read_wstring(); attrWString(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_op_opWChar(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; char _ob_a0 = in.read_wchar(); org.omg.CORBA.CharHolder _ob_ah1 = new org.omg.CORBA.CharHolder(); _ob_ah1.value = in.read_wchar(); org.omg.CORBA.CharHolder _ob_ah2 = new org.omg.CORBA.CharHolder(); char _ob_r = opWChar(_ob_a0, _ob_ah1, _ob_ah2); out = handler.createReply(); out.write_wchar(_ob_r); out.write_wchar(_ob_ah1.value); out.write_wchar(_ob_ah2.value); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_opWCharEx(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { char _ob_a0 = in.read_wchar(); org.omg.CORBA.CharHolder _ob_ah1 = new org.omg.CORBA.CharHolder(); _ob_ah1.value = in.read_wchar(); org.omg.CORBA.CharHolder _ob_ah2 = new org.omg.CORBA.CharHolder(); char _ob_r = opWCharEx(_ob_a0, _ob_ah1, _ob_ah2); out = handler.createReply(); out.write_wchar(_ob_r); out.write_wchar(_ob_ah1.value); out.write_wchar(_ob_ah2.value); } catch(ExWChar _ob_ex) { out = handler.createExceptionReply(); ExWCharHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_opWString(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; String _ob_a0 = in.read_wstring(); org.omg.CORBA.StringHolder _ob_ah1 = new org.omg.CORBA.StringHolder(); _ob_ah1.value = in.read_wstring(); org.omg.CORBA.StringHolder _ob_ah2 = new org.omg.CORBA.StringHolder(); String _ob_r = opWString(_ob_a0, _ob_ah1, _ob_ah2); out = handler.createReply(); out.write_wstring(_ob_r); out.write_wstring(_ob_ah1.value); out.write_wstring(_ob_ah2.value); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_opWStringEx(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String _ob_a0 = in.read_wstring(); org.omg.CORBA.StringHolder _ob_ah1 = new org.omg.CORBA.StringHolder(); _ob_ah1.value = in.read_wstring(); org.omg.CORBA.StringHolder _ob_ah2 = new org.omg.CORBA.StringHolder(); String _ob_r = opWStringEx(_ob_a0, _ob_ah1, _ob_ah2); out = handler.createReply(); out.write_wstring(_ob_r); out.write_wstring(_ob_ah1.value); out.write_wstring(_ob_ah2.value); } catch(ExWString _ob_ex) { out = handler.createExceptionReply(); ExWStringHelper.write(out, _ob_ex); } return out; } }
5,986
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/_IntfStub.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/Intf:1.0 // public class _IntfStub extends org.omg.CORBA.portable.ObjectImpl implements Intf { private static final String[] _ob_ids_ = { "IDL:ORBTest_WChar/Intf:1.0", }; public String[] _ids() { return _ob_ids_; } final public static java.lang.Class _ob_opsClass = IntfOperations.class; // // IDL:ORBTest_WChar/Intf/attrWChar:1.0 // public char attrWChar() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_attrWChar", true); in = _invoke(out); char _ob_r = in.read_wchar(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("attrWChar", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.attrWChar(); } finally { _servant_postinvoke(_ob_so); } } } } public void attrWChar(char _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_attrWChar", true); out.write_wchar(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("attrWChar", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { _ob_self.attrWChar(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_WChar/Intf/attrWString:1.0 // public String attrWString() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_attrWString", true); in = _invoke(out); String _ob_r = in.read_wstring(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("attrWString", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.attrWString(); } finally { _servant_postinvoke(_ob_so); } } } } public void attrWString(String _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_attrWString", true); out.write_wstring(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("attrWString", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { _ob_self.attrWString(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_WChar/Intf/opWChar:1.0 // public char opWChar(char _ob_a0, org.omg.CORBA.CharHolder _ob_ah1, org.omg.CORBA.CharHolder _ob_ah2) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("opWChar", true); out.write_wchar(_ob_a0); out.write_wchar(_ob_ah1.value); in = _invoke(out); char _ob_r = in.read_wchar(); _ob_ah1.value = in.read_wchar(); _ob_ah2.value = in.read_wchar(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("opWChar", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.opWChar(_ob_a0, _ob_ah1, _ob_ah2); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_WChar/Intf/opWCharEx:1.0 // public char opWCharEx(char _ob_a0, org.omg.CORBA.CharHolder _ob_ah1, org.omg.CORBA.CharHolder _ob_ah2) throws ExWChar { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("opWCharEx", true); out.write_wchar(_ob_a0); out.write_wchar(_ob_ah1.value); in = _invoke(out); char _ob_r = in.read_wchar(); _ob_ah1.value = in.read_wchar(); _ob_ah2.value = in.read_wchar(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(ExWCharHelper.id())) throw ExWCharHelper.read(in); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("opWCharEx", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.opWCharEx(_ob_a0, _ob_ah1, _ob_ah2); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_WChar/Intf/opWString:1.0 // public String opWString(String _ob_a0, org.omg.CORBA.StringHolder _ob_ah1, org.omg.CORBA.StringHolder _ob_ah2) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("opWString", true); out.write_wstring(_ob_a0); out.write_wstring(_ob_ah1.value); in = _invoke(out); String _ob_r = in.read_wstring(); _ob_ah1.value = in.read_wstring(); _ob_ah2.value = in.read_wstring(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("opWString", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.opWString(_ob_a0, _ob_ah1, _ob_ah2); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_WChar/Intf/opWStringEx:1.0 // public String opWStringEx(String _ob_a0, org.omg.CORBA.StringHolder _ob_ah1, org.omg.CORBA.StringHolder _ob_ah2) throws ExWString { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("opWStringEx", true); out.write_wstring(_ob_a0); out.write_wstring(_ob_ah1.value); in = _invoke(out); String _ob_r = in.read_wstring(); _ob_ah1.value = in.read_wstring(); _ob_ah2.value = in.read_wstring(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(ExWStringHelper.id())) throw ExWStringHelper.read(in); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("opWStringEx", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.opWStringEx(_ob_a0, _ob_ah1, _ob_ah2); } finally { _servant_postinvoke(_ob_so); } } } } }
5,987
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/ExWStringHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/ExWString:1.0 // final public class ExWStringHelper { public static void insert(org.omg.CORBA.Any any, ExWString val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static ExWString extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[1]; members[0] = new org.omg.CORBA.StructMember(); members[0].name = "value"; members[0].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_wstring); typeCode_ = orb.create_exception_tc(id(), "ExWString", members); } return typeCode_; } public static String id() { return "IDL:ORBTest_WChar/ExWString:1.0"; } public static ExWString read(org.omg.CORBA.portable.InputStream in) { if(!id().equals(in.read_string())) throw new org.omg.CORBA.MARSHAL(); ExWString _ob_v = new ExWString(); _ob_v.value = in.read_wstring(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, ExWString val) { out.write_string(id()); out.write_wstring(val.value); } }
5,988
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/ExWStringHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/ExWString:1.0 // final public class ExWStringHolder implements org.omg.CORBA.portable.Streamable { public ExWString value; public ExWStringHolder() { } public ExWStringHolder(ExWString initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ExWStringHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ExWStringHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ExWStringHelper.type(); } }
5,989
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/IntfHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/Intf:1.0 // final public class IntfHelper { public static void insert(org.omg.CORBA.Any any, Intf val) { any.insert_Object(val, type()); } public static Intf extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_Object()); throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); typeCode_ = orb.create_interface_tc(id(), "Intf"); } return typeCode_; } public static String id() { return "IDL:ORBTest_WChar/Intf:1.0"; } public static Intf read(org.omg.CORBA.portable.InputStream in) { org.omg.CORBA.Object _ob_v = in.read_Object(); try { return (Intf)_ob_v; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ob_impl = (org.omg.CORBA.portable.ObjectImpl)_ob_v; _IntfStub _ob_stub = new _IntfStub(); _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } public static void write(org.omg.CORBA.portable.OutputStream out, Intf val) { out.write_Object(val); } public static Intf narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Intf)val; } catch(ClassCastException ex) { } if(val._is_a(id())) { org.omg.CORBA.portable.ObjectImpl _ob_impl; _IntfStub _ob_stub = new _IntfStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } throw new org.omg.CORBA.BAD_PARAM(); } return null; } public static Intf unchecked_narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Intf)val; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _IntfStub _ob_stub = new _IntfStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } return null; } }
5,990
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/IntfHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/Intf:1.0 // final public class IntfHolder implements org.omg.CORBA.portable.Streamable { public Intf value; public IntfHolder() { } public IntfHolder(Intf initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = IntfHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { IntfHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return IntfHelper.type(); } }
5,991
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/IntfOperations.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/Intf:1.0 // /***/ public interface IntfOperations { // // IDL:ORBTest_WChar/Intf/attrWChar:1.0 // /***/ char attrWChar(); void attrWChar(char val); // // IDL:ORBTest_WChar/Intf/opWChar:1.0 // /***/ char opWChar(char a0, org.omg.CORBA.CharHolder a1, org.omg.CORBA.CharHolder a2); // // IDL:ORBTest_WChar/Intf/opWCharEx:1.0 // /***/ char opWCharEx(char a0, org.omg.CORBA.CharHolder a1, org.omg.CORBA.CharHolder a2) throws ExWChar; // // IDL:ORBTest_WChar/Intf/attrWString:1.0 // /***/ String attrWString(); void attrWString(String val); // // IDL:ORBTest_WChar/Intf/opWString:1.0 // /***/ String opWString(String a0, org.omg.CORBA.StringHolder a1, org.omg.CORBA.StringHolder a2); // // IDL:ORBTest_WChar/Intf/opWStringEx:1.0 // /***/ String opWStringEx(String a0, org.omg.CORBA.StringHolder a1, org.omg.CORBA.StringHolder a2) throws ExWString; }
5,992
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_WChar/ExWChar.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_WChar; // // IDL:ORBTest_WChar/ExWChar:1.0 // /***/ final public class ExWChar extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:ORBTest_WChar/ExWChar:1.0"; public ExWChar() { super(_ob_id); } public ExWChar(char value) { super(_ob_id); this.value = value; } public ExWChar(String _reason, char value) { super(_ob_id + " " + _reason); this.value = value; } public char value; }
5,993
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_LongLong/ExLongLong.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_LongLong; // // IDL:ORBTest_LongLong/ExLongLong:1.0 // /***/ final public class ExLongLong extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:ORBTest_LongLong/ExLongLong:1.0"; public ExLongLong() { super(_ob_id); } public ExLongLong(long value) { super(_ob_id); this.value = value; } public ExLongLong(String _reason, long value) { super(_ob_id + " " + _reason); this.value = value; } public long value; }
5,994
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_LongLong/IntfPOATie.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_LongLong; // // IDL:ORBTest_LongLong/Intf:1.0 // public class IntfPOATie extends IntfPOA { private IntfOperations _ob_delegate_; private org.omg.PortableServer.POA _ob_poa_; public IntfPOATie(IntfOperations delegate) { _ob_delegate_ = delegate; } public IntfPOATie(IntfOperations delegate, org.omg.PortableServer.POA poa) { _ob_delegate_ = delegate; _ob_poa_ = poa; } public IntfOperations _delegate() { return _ob_delegate_; } public void _delegate(IntfOperations delegate) { _ob_delegate_ = delegate; } public org.omg.PortableServer.POA _default_POA() { if(_ob_poa_ != null) return _ob_poa_; else return super._default_POA(); } // // IDL:ORBTest_LongLong/Intf/attrLongLong:1.0 // public long attrLongLong() { return _ob_delegate_.attrLongLong(); } public void attrLongLong(long val) { _ob_delegate_.attrLongLong(val); } // // IDL:ORBTest_LongLong/Intf/attrULongLong:1.0 // public long attrULongLong() { return _ob_delegate_.attrULongLong(); } public void attrULongLong(long val) { _ob_delegate_.attrULongLong(val); } // // IDL:ORBTest_LongLong/Intf/opLongLong:1.0 // public long opLongLong(long a0, org.omg.CORBA.LongHolder a1, org.omg.CORBA.LongHolder a2) { return _ob_delegate_.opLongLong(a0, a1, a2); } // // IDL:ORBTest_LongLong/Intf/opLongLongEx:1.0 // public long opLongLongEx(long a0, org.omg.CORBA.LongHolder a1, org.omg.CORBA.LongHolder a2) throws ExLongLong { return _ob_delegate_.opLongLongEx(a0, a1, a2); } // // IDL:ORBTest_LongLong/Intf/opULongLong:1.0 // public long opULongLong(long a0, org.omg.CORBA.LongHolder a1, org.omg.CORBA.LongHolder a2) { return _ob_delegate_.opULongLong(a0, a1, a2); } // // IDL:ORBTest_LongLong/Intf/opULongLongEx:1.0 // public long opULongLongEx(long a0, org.omg.CORBA.LongHolder a1, org.omg.CORBA.LongHolder a2) throws ExULongLong { return _ob_delegate_.opULongLongEx(a0, a1, a2); } }
5,995
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_LongLong/Intf.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_LongLong; // // IDL:ORBTest_LongLong/Intf:1.0 // /***/ public interface Intf extends IntfOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity { }
5,996
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_LongLong/IntfPOA.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_LongLong; // // IDL:ORBTest_LongLong/Intf:1.0 // public abstract class IntfPOA extends org.omg.PortableServer.Servant implements org.omg.CORBA.portable.InvokeHandler, IntfOperations { static final String[] _ob_ids_ = { "IDL:ORBTest_LongLong/Intf:1.0", }; public Intf _this() { return IntfHelper.narrow(super._this_object()); } public Intf _this(org.omg.CORBA.ORB orb) { return IntfHelper.narrow(super._this_object(orb)); } public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectId) { return _ob_ids_; } public org.omg.CORBA.portable.OutputStream _invoke(String opName, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { final String[] _ob_names = { "_get_attrLongLong", "_get_attrULongLong", "_set_attrLongLong", "_set_attrULongLong", "opLongLong", "opLongLongEx", "opULongLong", "opULongLongEx" }; int _ob_left = 0; int _ob_right = _ob_names.length; int _ob_index = -1; while(_ob_left < _ob_right) { int _ob_m = (_ob_left + _ob_right) / 2; int _ob_res = _ob_names[_ob_m].compareTo(opName); if(_ob_res == 0) { _ob_index = _ob_m; break; } else if(_ob_res > 0) _ob_right = _ob_m; else _ob_left = _ob_m + 1; } if(_ob_index == -1 && opName.charAt(0) == '_') { _ob_left = 0; _ob_right = _ob_names.length; String _ob_ami_op = opName.substring(1); while(_ob_left < _ob_right) { int _ob_m = (_ob_left + _ob_right) / 2; int _ob_res = _ob_names[_ob_m].compareTo(_ob_ami_op); if(_ob_res == 0) { _ob_index = _ob_m; break; } else if(_ob_res > 0) _ob_right = _ob_m; else _ob_left = _ob_m + 1; } } switch(_ob_index) { case 0: // _get_attrLongLong return _OB_att_get_attrLongLong(in, handler); case 1: // _get_attrULongLong return _OB_att_get_attrULongLong(in, handler); case 2: // _set_attrLongLong return _OB_att_set_attrLongLong(in, handler); case 3: // _set_attrULongLong return _OB_att_set_attrULongLong(in, handler); case 4: // opLongLong return _OB_op_opLongLong(in, handler); case 5: // opLongLongEx return _OB_op_opLongLongEx(in, handler); case 6: // opULongLong return _OB_op_opULongLong(in, handler); case 7: // opULongLongEx return _OB_op_opULongLongEx(in, handler); } throw new org.omg.CORBA.BAD_OPERATION(); } private org.omg.CORBA.portable.OutputStream _OB_att_get_attrLongLong(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { long _ob_r = attrLongLong(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_longlong(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_attrULongLong(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { long _ob_r = attrULongLong(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_ulonglong(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_set_attrLongLong(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { long _ob_a = in.read_longlong(); attrLongLong(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_attrULongLong(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { long _ob_a = in.read_ulonglong(); attrULongLong(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_op_opLongLong(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; long _ob_a0 = in.read_longlong(); org.omg.CORBA.LongHolder _ob_ah1 = new org.omg.CORBA.LongHolder(); _ob_ah1.value = in.read_longlong(); org.omg.CORBA.LongHolder _ob_ah2 = new org.omg.CORBA.LongHolder(); long _ob_r = opLongLong(_ob_a0, _ob_ah1, _ob_ah2); out = handler.createReply(); out.write_longlong(_ob_r); out.write_longlong(_ob_ah1.value); out.write_longlong(_ob_ah2.value); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_opLongLongEx(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { long _ob_a0 = in.read_longlong(); org.omg.CORBA.LongHolder _ob_ah1 = new org.omg.CORBA.LongHolder(); _ob_ah1.value = in.read_longlong(); org.omg.CORBA.LongHolder _ob_ah2 = new org.omg.CORBA.LongHolder(); long _ob_r = opLongLongEx(_ob_a0, _ob_ah1, _ob_ah2); out = handler.createReply(); out.write_longlong(_ob_r); out.write_longlong(_ob_ah1.value); out.write_longlong(_ob_ah2.value); } catch(ExLongLong _ob_ex) { out = handler.createExceptionReply(); ExLongLongHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_opULongLong(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; long _ob_a0 = in.read_ulonglong(); org.omg.CORBA.LongHolder _ob_ah1 = new org.omg.CORBA.LongHolder(); _ob_ah1.value = in.read_ulonglong(); org.omg.CORBA.LongHolder _ob_ah2 = new org.omg.CORBA.LongHolder(); long _ob_r = opULongLong(_ob_a0, _ob_ah1, _ob_ah2); out = handler.createReply(); out.write_ulonglong(_ob_r); out.write_ulonglong(_ob_ah1.value); out.write_ulonglong(_ob_ah2.value); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_opULongLongEx(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { long _ob_a0 = in.read_ulonglong(); org.omg.CORBA.LongHolder _ob_ah1 = new org.omg.CORBA.LongHolder(); _ob_ah1.value = in.read_ulonglong(); org.omg.CORBA.LongHolder _ob_ah2 = new org.omg.CORBA.LongHolder(); long _ob_r = opULongLongEx(_ob_a0, _ob_ah1, _ob_ah2); out = handler.createReply(); out.write_ulonglong(_ob_r); out.write_ulonglong(_ob_ah1.value); out.write_ulonglong(_ob_ah2.value); } catch(ExULongLong _ob_ex) { out = handler.createExceptionReply(); ExULongLongHelper.write(out, _ob_ex); } return out; } }
5,997
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_LongLong/_IntfStub.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_LongLong; // // IDL:ORBTest_LongLong/Intf:1.0 // public class _IntfStub extends org.omg.CORBA.portable.ObjectImpl implements Intf { private static final String[] _ob_ids_ = { "IDL:ORBTest_LongLong/Intf:1.0", }; public String[] _ids() { return _ob_ids_; } final public static java.lang.Class _ob_opsClass = IntfOperations.class; // // IDL:ORBTest_LongLong/Intf/attrLongLong:1.0 // public long attrLongLong() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_attrLongLong", true); in = _invoke(out); long _ob_r = in.read_longlong(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("attrLongLong", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.attrLongLong(); } finally { _servant_postinvoke(_ob_so); } } } } public void attrLongLong(long _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_attrLongLong", true); out.write_longlong(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("attrLongLong", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { _ob_self.attrLongLong(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_LongLong/Intf/attrULongLong:1.0 // public long attrULongLong() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_attrULongLong", true); in = _invoke(out); long _ob_r = in.read_ulonglong(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("attrULongLong", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.attrULongLong(); } finally { _servant_postinvoke(_ob_so); } } } } public void attrULongLong(long _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_attrULongLong", true); out.write_ulonglong(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("attrULongLong", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { _ob_self.attrULongLong(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_LongLong/Intf/opLongLong:1.0 // public long opLongLong(long _ob_a0, org.omg.CORBA.LongHolder _ob_ah1, org.omg.CORBA.LongHolder _ob_ah2) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("opLongLong", true); out.write_longlong(_ob_a0); out.write_longlong(_ob_ah1.value); in = _invoke(out); long _ob_r = in.read_longlong(); _ob_ah1.value = in.read_longlong(); _ob_ah2.value = in.read_longlong(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("opLongLong", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.opLongLong(_ob_a0, _ob_ah1, _ob_ah2); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_LongLong/Intf/opLongLongEx:1.0 // public long opLongLongEx(long _ob_a0, org.omg.CORBA.LongHolder _ob_ah1, org.omg.CORBA.LongHolder _ob_ah2) throws ExLongLong { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("opLongLongEx", true); out.write_longlong(_ob_a0); out.write_longlong(_ob_ah1.value); in = _invoke(out); long _ob_r = in.read_longlong(); _ob_ah1.value = in.read_longlong(); _ob_ah2.value = in.read_longlong(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(ExLongLongHelper.id())) throw ExLongLongHelper.read(in); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("opLongLongEx", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.opLongLongEx(_ob_a0, _ob_ah1, _ob_ah2); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_LongLong/Intf/opULongLong:1.0 // public long opULongLong(long _ob_a0, org.omg.CORBA.LongHolder _ob_ah1, org.omg.CORBA.LongHolder _ob_ah2) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("opULongLong", true); out.write_ulonglong(_ob_a0); out.write_ulonglong(_ob_ah1.value); in = _invoke(out); long _ob_r = in.read_ulonglong(); _ob_ah1.value = in.read_ulonglong(); _ob_ah2.value = in.read_ulonglong(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("opULongLong", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.opULongLong(_ob_a0, _ob_ah1, _ob_ah2); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:ORBTest_LongLong/Intf/opULongLongEx:1.0 // public long opULongLongEx(long _ob_a0, org.omg.CORBA.LongHolder _ob_ah1, org.omg.CORBA.LongHolder _ob_ah2) throws ExULongLong { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("opULongLongEx", true); out.write_ulonglong(_ob_a0); out.write_ulonglong(_ob_ah1.value); in = _invoke(out); long _ob_r = in.read_ulonglong(); _ob_ah1.value = in.read_ulonglong(); _ob_ah2.value = in.read_ulonglong(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(ExULongLongHelper.id())) throw ExULongLongHelper.read(in); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("opULongLongEx", _ob_opsClass); if(_ob_so == null) continue; IntfOperations _ob_self = (IntfOperations)_ob_so.servant; try { return _ob_self.opULongLongEx(_ob_a0, _ob_ah1, _ob_ah2); } finally { _servant_postinvoke(_ob_so); } } } } }
5,998
0
Create_ds/geronimo-yoko/yoko-core/src/test/java
Create_ds/geronimo-yoko/yoko-core/src/test/java/ORBTest_LongLong/IntfHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ORBTest_LongLong; // // IDL:ORBTest_LongLong/Intf:1.0 // final public class IntfHelper { public static void insert(org.omg.CORBA.Any any, Intf val) { any.insert_Object(val, type()); } public static Intf extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_Object()); throw new org.omg.CORBA.BAD_OPERATION(); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); typeCode_ = orb.create_interface_tc(id(), "Intf"); } return typeCode_; } public static String id() { return "IDL:ORBTest_LongLong/Intf:1.0"; } public static Intf read(org.omg.CORBA.portable.InputStream in) { org.omg.CORBA.Object _ob_v = in.read_Object(); try { return (Intf)_ob_v; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ob_impl = (org.omg.CORBA.portable.ObjectImpl)_ob_v; _IntfStub _ob_stub = new _IntfStub(); _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } public static void write(org.omg.CORBA.portable.OutputStream out, Intf val) { out.write_Object(val); } public static Intf narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Intf)val; } catch(ClassCastException ex) { } if(val._is_a(id())) { org.omg.CORBA.portable.ObjectImpl _ob_impl; _IntfStub _ob_stub = new _IntfStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } throw new org.omg.CORBA.BAD_PARAM(); } return null; } public static Intf unchecked_narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Intf)val; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _IntfStub _ob_stub = new _IntfStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } return null; } }
5,999