source.setUsername(properties.getProperty("jdbc.username"));
source.setPassword(properties.getProperty("jdbc.password"));
source.setUrl(properties.getProperty("jdbc.url"));
source.setDriverClassName(properties.getProperty("jdbc.driver"));
jdbcTemplate = new JdbcTemplate(source);
executeScript("classpath:data/h2/create-table.sql","classpath:data/h2/insert-data.sql");
source.close();
}
//如果jetty没启动,启动jetty
if (jettyServer == null) {
// 设定Spring的profile
System.setProperty(LaunchJetty.ACTIVE_PROFILE, "test");
jettyServer = JettyFactory.createServerInSource(LaunchJetty.PORT, LaunchJetty.CONTEXT);
//JettyFactory.setTldJarNames(jettyServer, LaunchJetty.TLD_JAR_NAMES);
System.out.println("[HINT] Don't forget to set -XX:MaxPermSize=128m");
jettyServer.start();
}
//如果当前dataSource没初始化,初始化dataSource
if (dataSource == null) {
dataSource = SpringContextHolder.getBean(DataSource.class);
jdbcTemplate = new JdbcTemplate(dataSource);
}
//如果selenium没初始化,初始化selenium
if (s == null) {
//System.setProperty ( "webdriver.firefox.bin" , "E:/Firefox/firefox.exe" );