public synchronized ILogger init(ILog owner, String loggerName) throws Exception { if (!__inited) { __owner = owner; __loggerName = loggerName; // if (!__logInited) { ConfigurationSource _source = new ConfigurationSource(new FileInputStream(__owner.getModuleCfg().getConfigFile())); Configurator.initialize(null, _source); final Configuration _config = new DefaultConfiguration(); ConfigurationFactory.setConfigurationFactory(new XmlConfigurationFactory() { public Configuration getConfiguration(ConfigurationSource source) { return _config; } }); ConfigurationFactory.getInstance().getConfiguration(_source); __logInited = true; } __logger = LogManager.getLogger(StringUtils.defaultIfBlank(loggerName, __owner.getModuleCfg().getLoggerName())); __inited = true; } return this; }
@BeforeClass public static void init() { System.setProperty("LIGHT_HOME", LIGHT_AGENT_JAR_PATH + File.separator + ".." + File.separator + "install"); System.setProperty("light.config", LIGHT_AGENT_JAR_PATH + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "light.conf"); System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, LIGHT_AGENT_JAR_PATH + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "log4j2.xml"); // System.setProperty("java.class.path", System.getProperty("java.class.path") + File.pathSeparator + getAgentClassPath()); }
public static void load() { System.setProperty("light.config", System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "light.conf"); System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, "log4j2.xml"); System.setProperty("light.db.url", String.format("memory:%s/", Product.NAME.toLowerCase())); // System.setProperty("light.db.url", "remote:localhost/"); // System.setProperty("light.db.url", String.format("plocal:../databases/%s/", Product.NAME.toLowerCase())); }
@BeforeClass public static void init() { System.setProperty("light.config", System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "light.conf"); System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, "log4j2.xml"); System.setProperty("server.database.path", System.getProperty("user.dir") + File.separator + "databases"); System.setProperty("light.repository.config", REPOSITORY_CONFIG); }
@BeforeClass public static void init() { System.setProperty("LIGHT_HOME", System.getProperty("user.dir") + File.separator + ".." + File.separator + "install"); System.setProperty("light.config", System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "light.conf"); System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "log4j2.xml"); }
@BeforeClass public static void init() { System.setProperty("flow.db.path", String.format("plocal:%s%s", System.getProperty("user.dir"), replaceWindowsSeparator(DEFAULT_PATH))); System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, System.getProperty("user.dir") + replaceWindowsSeparator(LOGFILE_PATH)); factory = RepositoryFactory.getInstance("flowtest"); }
@BeforeClass public static void init() { System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, System.getProperty("user.dir") + replaceWindowsSeparator(LOGFILE_PATH)); }