use of org.eclipse.persistence.sessions.remote.corba.sun.CORBAConnection in project eclipselink by eclipse-ee4j.
the class CORBAConnectionExceptionsTest method setup.
@Override
public void setup() throws Exception {
Session session = new DatabaseSessionImpl();
session.setProperty("TransporterGenerator", generator);
CORBAServerManagerController.start(session, getNameToBind(), "org.eclipse.persistence.testing.tests.remote.suncorba.CORBARemoteSessionControllerDispatcherForTestingExceptions", false);
// Initialize the ORB.
ORB orb = ORB.init(new String[0], new Properties());
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow(objRef);
NameComponent nc = new NameComponent(getNameToBind(), "");
NameComponent[] path = { nc };
CORBAServerManager manager = CORBAServerManagerHelper.narrow(ncRef.resolve(path));
CORBAConnection corbaConnection = new CORBAConnection(manager.createRemoteSessionController());
setRemoteConnection(corbaConnection);
}
use of org.eclipse.persistence.sessions.remote.corba.sun.CORBAConnection in project eclipselink by eclipse-ee4j.
the class SunCORBARemoteModel method createConnection.
public CORBAConnection createConnection() {
System.out.println("The following environment properties must be set to run this test.");
System.out.println("-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory -Djava.naming.provider.url=iiop://localhost:900");
System.out.println("The follwing corba naming server must also be started on the computer.");
System.out.println("<java_home>/bin/tnameserv.exe");
CORBAServerManager manager = null;
try {
// Initialize the ORB.
ORB orb = ORB.init(new String[0], new Properties());
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow(objRef);
NameComponent nc = new NameComponent("CORBAServer", "");
NameComponent[] path = { nc };
manager = CORBAServerManagerHelper.narrow(ncRef.resolve(path));
} catch (Exception exception) {
throw new TestErrorException("Corba not configured correctly, see system.out.", exception);
}
return new CORBAConnection(manager.createRemoteSessionController());
}
use of org.eclipse.persistence.sessions.remote.corba.sun.CORBAConnection in project eclipselink by eclipse-ee4j.
the class SunCORBARemoteModel method setup.
@Override
public void setup() {
RemoteModel.originalSession = getSession();
new CORBAServerRunner(buildServerSession()).start();
// Must delay to let the stupid server start
try {
Thread.sleep(10000);
} catch (Exception e) {
System.out.println(e.toString());
}
CORBAConnection connection = createConnection();
Session remoteSession = connection.createRemoteSession();
remoteSession.setLog(RemoteModel.originalSession.getLog());
remoteSession.setLogLevel(RemoteModel.originalSession.getLogLevel());
getExecutor().setSession(remoteSession);
}
use of org.eclipse.persistence.sessions.remote.corba.sun.CORBAConnection in project eclipselink by eclipse-ee4j.
the class SecurityWhileConvertingToMethodTest method test.
@Override
public void test() {
boolean orig = TestSecurityManager.TRIGGER_EX;
TestSecurityManager.TRIGGER_EX = false;
try {
// need to use the remote Initialization as the normal one would product TL-084 before check this test
CORBARemoteSessionControllerDispatcher dispatcher = new CORBARemoteSessionControllerDispatcher(getSession());
CORBAConnection connection = new CORBAConnection(dispatcher);
DistributedSession ds = (DistributedSession) (connection).createRemoteSession();
TestSecurityManager.TRIGGER_EX = true;
mapping.remoteInitialization(ds);
} catch (EclipseLinkException exception) {
caughtException = exception;
} finally {
TestSecurityManager.TRIGGER_EX = orig;
}
}
Aggregations