List of usage examples for java.lang System setProperty
public static String setProperty(String key, String value)
From source file:com.littlehotspot.hadoop.mr.nginx.module.cdf.TestCDFScheduler.java
@Test public void run() { System.setProperty("hadoop.home.dir", "D:\\GreenProfram\\hadoop-2.7.3"); String[] args = { "hdfsCluster=hdfs://devpd1:8020", "hdfsIn=file:///F:\\\\Hadoop\\nginx_log", "inRegex=^(\\d{0,3}\\.\\d{0,3}\\.\\d{0,3}\\.\\d{0,3}) - [^ ]+ \\[(.+)\\] ([A-Z]+) ([^ ]+) HTTP/[^ ]+ \"(\\d{3})\" \\d+ \"(.+)\" \"(.*deviceid.*)\" \"(.+)\" \"(.+)\"$", "hdfsOut=/home/data/hadoop/flume/test-mr/2017-05-15" }; Configuration conf = new Configuration(); // distributedCache try {//from www . j a v a 2 s. c o m ToolRunner.run(conf, new CDFScheduler(), args); } catch (Exception e) { e.printStackTrace(); } }
From source file:com.erinors.hpb.tests.integration.HpbIntegrationTestCase.java
@Before public void beforeTest() { System.setProperty("persistenceXmlLocation", getClass().getPackage().getName().replace('.', '/') + "/persistence.xml"); applicationContext = new ClassPathXmlApplicationContext(new String[] { getSpringConfig() }); SqlAppender.get().clearSql();/*from ww w.ja v a 2 s.c om*/ }
From source file:edu.uci.ics.asterix.test.metadata.MetadataTest.java
@BeforeClass public static void setUp() throws Exception { System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME); File outdir = new File(PATH_ACTUAL); outdir.mkdirs();/*from w w w . j ava2s. c o m*/ AsterixPropertiesAccessor apa = new AsterixPropertiesAccessor(); txnProperties = new AsterixTransactionProperties(apa); deleteTransactionLogs(); AsterixHyracksIntegrationUtil.init(); }
From source file:net.sf.zekr.engine.template.TemplateEngine.java
private TemplateEngine() { try {/* www . j a v a 2 s . co m*/ System.setProperty("zekr.home", Naming.getWorkspace()); Velocity.setExtendedProperties(new ExtendedProperties("res/config/lib/velocity.properties")); Velocity.init(); context = new VelocityContext(); } catch (Exception e) { Logger.getLogger(this.getClass()).log(e); } }
From source file:com.kylinolap.query.test.KylinQueryTest.java
private static void setUpEnv() { if (System.getProperty(KylinConfig.KYLIN_CONF) == null && System.getenv(KylinConfig.KYLIN_CONF) == null) System.setProperty(KylinConfig.KYLIN_CONF, "../examples/test_case_data"); config = KylinConfig.getInstanceFromEnv(); }
From source file:org.jolokia.jvmagent.spring.JolokiaServerIntegrationTest.java
@Test public void simple() throws Exception { System.setProperty("jolokia.port", "" + EnvTestUtil.getFreePort()); System.out.println("Port selected: " + System.getProperty("jolokia.port")); ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/spring-jolokia-context.xml"); SpringJolokiaAgent server = (SpringJolokiaAgent) ctx.getBean("jolokia"); JolokiaServerConfig cfg = server.getServerConfig(); assertEquals(cfg.getContextPath(), "/j4p/"); MBeanServer mbeanServer = (MBeanServer) ctx.getBean("jolokiaMBeanServer"); assertNotNull(mbeanServer);/*from www. j a v a2 s . com*/ checkServerAndStop(server); }
From source file:org.jolokia.support.spring.JolokiaServerIntegrationTest.java
@Test public void simple() throws Exception { System.setProperty("jolokia.port", "" + EnvTestUtil.getFreePort()); System.out.println("Port selected: " + System.getProperty("jolokia.port")); ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/spring-jolokia-context.xml"); SpringJolokiaAgent server = (SpringJolokiaAgent) ctx.getBean("jolokia"); JolokiaServerConfig cfg = server.getServerConfig(); assertEquals(cfg.getContextPath(), "/j4p/"); MBeanServer mbeanServer = (MBeanServer) ctx.getBean("jolokiaMBeanServer"); assertNotNull(mbeanServer);/*from ww w .j av a 2 s .co m*/ //Thread.sleep(1000 * 3600); checkServerAndStop(server); }
From source file:org.greencheek.utils.environment.propertyplaceholder.spring.TestEnvironmentalPropertyPlaceholderConfigurerViaCompositeBuilderInXml.java
@Test public void testPropertyResolved() { System.setProperty("ENVIRONMENT", "dev"); System.setProperty("ENV", "dev"); ctx = new ClassPathXmlApplicationContext(new String[] { "classpath:SpringPropertyPlaceholderConfigurer-composite-config-withstringlocations.xml" }); String value = (String) ctx.getBean("string"); String valueSys = (String) ctx.getBean("string-sys"); String valueEnv = (String) ctx.getBean("string-env"); String valuePath = (String) ctx.getBean("string-path"); assertEquals("devproperties", value); assertEquals("dev", valueSys); assertEquals(System.getenv("PATH"), valueEnv); assertEquals(System.getenv("PATH"), valuePath); }
From source file:Main.java
public static void getStringFromXML(Node node, String dtdFilename, String outputFileName) throws TransformerException, IOException { File file = new File(outputFileName); if (!file.isFile()) file.createNewFile();//from w w w. j a va 2 s .c o m BufferedWriter out = new BufferedWriter(new FileWriter(file)); String workingPath = System.setProperty("user.dir", file.getAbsoluteFile().getParent()); try { getStringFromXML(node, dtdFilename, out); } finally { System.setProperty("user.dir", workingPath); } out.flush(); out.close(); }
From source file:org.greencheek.utils.environment.propertyplaceholder.spring.TestEnvironmentalPropertySourcesPlaceholderConfigurerViaCompositeBuilderInXml.java
@Test public void testPropertyResolved() { System.setProperty("ENVIRONMENT", "dev"); System.setProperty("ENV", "dev"); ctx = new ClassPathXmlApplicationContext( new String[] { "classpath:SpringPropertySourcesPlaceholderConfigurer-composite-config.xml" }); String value = (String) ctx.getBean("string"); String valueSys = (String) ctx.getBean("string-sys"); String valueEnv = (String) ctx.getBean("string-env"); String valuePath = (String) ctx.getBean("string-path"); assertEquals("devproperties", value); assertEquals("dev", valueSys); assertEquals(System.getenv("PATH"), valueEnv); assertEquals(System.getenv("PATH"), valuePath); }