XComponentContext xInitialContext = Bootstrap.createInitialComponentContext( table );
table = new Hashtable();
table.put( "bla2", new ComponentContextEntry( new Integer( 2 ) ) );
table.put( "bla3", new Integer( 3 ) );
XComponentContext xContext = new ComponentContext( table, xInitialContext );
XMultiComponentFactory xSMgr = xContext.getServiceManager();
Object o = xSMgr.createInstanceWithContext( "com.sun.star.loader.Java", xContext );
if (o == null)
System.err.println( "### failed raising service: 1!" );
o = xSMgr.createInstanceWithContext( "com.sun.star.bridge.BridgeFactory", xContext );
if (o == null)
System.err.println( "### failed raising service: 2!" );
o = xSMgr.createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver", xContext );
if (o == null)
System.err.println( "### failed raising service: 3!" );
o = xSMgr.createInstanceWithContext( "com.sun.star.connection.Connector", xContext );
if (o == null)
System.err.println( "### failed raising service: 4!" );
o = xSMgr.createInstanceWithContext( "com.sun.star.connection.Acceptor", xContext );
if (o == null)
System.err.println( "### failed raising service: 5!" );
o = xSMgr.createInstanceWithContext( "com.sun.star.lang.ServiceManager", xContext );
if (o == null)
System.err.println( "### failed raising service: 6!" );
if (xContext.getValueByName( "bla1" ) == null ||
xContext.getValueByName( "bla2" ) == null ||
xContext.getValueByName( "bla3" ) == null ||
xInitialContext.getValueByName( "bla2" ) != null ||
xInitialContext.getValueByName( "bla3" ) != null)
{
System.err.println( "### bootstrap context test failed: 1!" );
}
if (((Integer)xContext.getValueByName( "bla1" )).intValue() != 1 ||
((Integer)xContext.getValueByName( "bla2" )).intValue() != 2 ||
((Integer)xContext.getValueByName( "bla3" )).intValue() != 3 ||
((Integer)xInitialContext.getValueByName( "bla1" )).intValue() != 1)
{
System.err.println( "### bootstrap context test failed: 2!" );
}