PentahoSystem { private static void initXMLFactories() { if ( PentahoSystem.systemSettingsService != null ) { String xpathToXMLFactoryNodes = "xml-factories/factory-impl"; List nds = PentahoSystem.systemSettingsService.getSystemSettings( xpathToXMLFactoryNodes ); if ( null != nds && !nds.isEmpty() ) { Logger.warn( PentahoSystem.class.getName(), Messages.getInstance() .getErrorString( "PentahoSystem.WARN_XML_FACTORIES_LOCATION_CHANGED", JAVA_SYSTEM_PROPERTIES ) ); for ( Iterator it = nds.iterator(); it.hasNext(); ) { Node nd = (Node) it.next(); Node nameAttr = nd.selectSingleNode( "@name" ); Node implAttr = nd.selectSingleNode( "@implementation" ); if ( ( null != nameAttr ) && ( null != implAttr ) ) { String name = nameAttr.getText(); String impl = implAttr.getText(); System.setProperty( name, impl ); } else { Logger.error( PentahoSystem.class.getName(), Messages.getInstance() .getErrorString( "PentahoSystem.ERROR_0025_LOAD_XML_FACTORY_PROPERTIES_FAILED", xpathToXMLFactoryNodes ) ); } } } } }  static void setBundleContext( BundleContext context ); static boolean init(); static boolean init( final IApplicationContext pApplicationContext ); static boolean init( final IApplicationContext pApplicationContext, final Map listenerMap ); static boolean getInitializedOK(); static int getInitializedStatus(); static List<String> getInitializationFailureMessages(); static void addInitializationFailureMessage( final int failureBit, final String message ); static IContentOutputHandler getOutputDestinationFromContentRef( final String contentTag,
      final IPentahoSession session ); static T get( Class<T> interfaceClass ); static T get( Class<T> interfaceClass, final IPentahoSession session, final Map<String, String> properties ); static List<T> getAll( Class<T> interfaceClass ); static List<T> getAll( Class<T> interfaceClass, IPentahoSession session ); static List<T> getAll( Class<T> interfaceClass, IPentahoSession session, Map<String, String> props ); static T get( Class<T> interfaceClass, final IPentahoSession session ); static T get( Class<T> interfaceClass, String key, final IPentahoSession session ); static IPentahoObjectReference<T> getObjectReference( Class<T> interfaceClass, IPentahoSession curSession ); static IPentahoObjectReference<T> getObjectReference( Class<T> interfaceClass, IPentahoSession curSession,
      Map<String, String> properties ); static List<IPentahoObjectReference<T>> getObjectReferences( Class<T> interfaceClass,
      IPentahoSession curSession ); static List<IPentahoObjectReference<T>> getObjectReferences( Class<T> interfaceClass,
      IPentahoSession curSession, Map<String, String> properties ); static String getSystemName(); static IParameterProvider getGlobalParameters(); static void sessionStartup( final IPentahoSession session ); static void clearGlobals(); static Object putInGlobalAttributesMap( final Object key, final Object value ); static Object removeFromGlobalAttributesMap( final Object key ); static void sessionStartup( final IPentahoSession session, IParameterProvider sessionParameters ); static void globalStartup(); static void globalStartup( final IPentahoSession session ); static void shutdown(); static IApplicationContext getApplicationContext(); static void setApplicationContext( IApplicationContext pApplicationContext ); @Deprecated static Object createObject( final String className, final ILogger logger ); @Deprecated static Object createObject( final String className ); static String getSystemSetting( final String path, final String settingName, final String defaultValue ); static String getSystemSetting( final String settingName, final String defaultValue ); static ISystemSettings getSystemSettings(); static void refreshSettings(); static boolean isCsrfProtectionEnabled(); static String publish( final IPentahoSession session, final String className ); static List getPublisherList(); static Document getPublishersDocument(); static void systemEntryPoint(); static void systemExitPoint(); static ICacheManager getCacheManager( IPentahoSession session ); static List getACLFileExtensionList(); static List getDownloadRolesList(); static void addLogoutListener( final ILogoutListener listener ); static ILogoutListener remove( final ILogoutListener listener ); static void invokeLogoutListeners( final IPentahoSession session ); static IPentahoObjectFactory getObjectFactory(); static void registerObjectFactory( IPentahoObjectFactory pentahoObjectFactory ); static boolean deregisterObjectFactory( IPentahoObjectFactory factory ); static void registerPrimaryObjectFactory( IPentahoObjectFactory pentahoObjectFactory ); static void setAdministrationPlugins( List<IPentahoPublisher> administrationPlugins ); static void setSystemListeners( List<IPentahoSystemListener> systemListeners ); static void setSessionStartupActions( List<ISessionStartupAction> actions ); static void setSystemSettingsService( ISystemSettings systemSettingsService ); static void clearObjectFactory(); static IPentahoObjectRegistration registerReference( IPentahoObjectReference<T> reference,
      IPentahoRegistrableObjectFactory.Types types ); static IPentahoObjectRegistration registerObject( Object obj ); static IPentahoObjectRegistration registerObject( Object obj, IPentahoRegistrableObjectFactory.Types types ); static IPentahoObjectRegistration registerReference( IPentahoObjectReference<T> reference ); static IPentahoObjectRegistration registerObject( T obj, Class<?>... classes ); static IPentahoObjectRegistration registerReference( IPentahoObjectReference<T> reference,
      Class<?>... classes ); static final boolean debug; static final boolean trace; static final boolean ignored; static final String JAVA_SYSTEM_PROPERTIES; static int loggingLevel; static final String BACKGROUND_EXECUTION; static final String CONDITIONAL_EXECUTION; static String DEFAULT_CONDITIONAL_EXECUTION_PROVIDER; static String DEFAULT_MESSAGE_FORMATTER; static final String SCHEDULER; static final String MESSAGE_FORMATTER; static final String SCOPE_GLOBAL; static final String SCOPE_SESSION; static final String SCOPE_LOCAL; static final String SCOPE; static final String PENTAHO_SESSION_KEY; static final String WAIT_SECONDS; static final String CORS_REQUESTS_ALLOWED; static final String CORS_REQUESTS_ALLOWED_DOMAINS; static final String CSRF_PROTECTION_ENABLED; static final int SYSTEM_NOT_INITIALIZED; static final int SYSTEM_INITIALIZED_OK; static final int SYSTEM_LISTENERS_FAILED; static final int SYSTEM_OBJECTS_FAILED; static final int SYSTEM_PUBLISHERS_FAILED; static final int SYSTEM_AUDIT_FAILED; static final int SYSTEM_PENTAHOXML_FAILED; static final int SYSTEM_SETTINGS_FAILED; static final int SYSTEM_OTHER_FAILED; static final String HIDE_USER_HOME_FOLDER_ON_CREATION_PROPERTY; }
@Test public void testInitXMLFactoriesXMLTest() throws Exception { initXMLFactories( true ); assertEquals( testXMLValue, System.getProperty( testSystemPropertyName ) ); }
@Test public void testInitXMLFactoriesPropertiesTest() throws Exception { initXMLFactories( false ); assertEquals( testPropertyValue, System.getProperty( testSystemPropertyName ) ); }