### Question:
CorbaConduit implements Conduit { public void prepare(Message message) throws IOException { try { prepareOrb(); String address = null; if (target != null) { address = target.getAddress().getValue(); } if (address == null) { AddressType ad = endpointInfo.getExtensor(AddressType.class); if (ad != null) { address = ad.getLocation(); } } String ref = (String)message.get(Message.ENDPOINT_ADDRESS); if (ref != null) { address = ref; } if (address == null) { LOG.log(Level.SEVERE, "Unable to locate a valid CORBA address"); throw new CorbaBindingException("Unable to locate a valid CORBA address"); } org.omg.CORBA.Object targetObject; targetObject = CorbaUtils.importObjectReference(orb, address); message.put(CorbaConstants.ORB, orb); message.put(CorbaConstants.CORBA_ENDPOINT_OBJECT, targetObject); message.setContent(OutputStream.class, new CorbaOutputStream(message)); if (message instanceof CorbaMessage) { ((CorbaMessage)message).setCorbaTypeMap(typeMap); } } catch (java.lang.Exception ex) { LOG.log(Level.SEVERE, "Could not resolve target object"); throw new CorbaBindingException(ex); } } CorbaConduit(EndpointInfo ei, EndpointReferenceType ref, OrbConfig config); OrbConfig getOrbConfig(); synchronized void prepareOrb(); void prepare(Message message); void close(Message message); EndpointReferenceType getTarget(); void close(); void setMessageObserver(MessageObserver observer); final EndpointReferenceType getTargetReference(EndpointReferenceType t); final String getAddress(); void buildRequest(CorbaMessage message, OperationType opType); NVList getArguments(CorbaMessage message); NamedValue getReturn(CorbaMessage message); ExceptionList getExceptionList(Map<TypeCode, RaisesType> exceptions,
                                             CorbaMessage message,
                                             OperationType opType); Request getRequest(CorbaMessage message,
                                 String opName,
                                 org.omg.CORBA.NVList nvlist,
                                 org.omg.CORBA.NamedValue ret,
                                 org.omg.CORBA.ExceptionList exList); Map<TypeCode, RaisesType> getOperationExceptions(
                                         OperationType operation,
                                         CorbaTypeMap map); MessageObserver getMessageObserver();  }### Answer:
@Test public void testPrepare() throws Exception { setupServiceInfo("http: "/wsdl_corbabinding/simpleIdl.wsdl", "SimpleCORBAService", "SimpleCORBAPort"); CorbaDestination destination = new CorbaDestination(endpointInfo, orbConfig); if (System.getProperty("java.vendor").contains("IBM")) { destination.activate(); } CorbaConduit conduit = new CorbaConduit(endpointInfo, destination.getAddress(), orbConfig); CorbaMessage message = new CorbaMessage(new MessageImpl()); try { conduit.prepare(message); } catch (Exception ex) { ex.printStackTrace(); } OutputStream os = message.getContent(OutputStream.class); assertNotNull("OutputStream should not be null", os); ORB orb2 = (ORB)message.get("orb"); assertNotNull("Orb should not be null", orb2); Object obj = message.get("endpoint"); assertNotNull("EndpointReferenceType should not be null", obj); }