use of org.springframework.context.support.ClassPathXmlApplicationContext in project OpenMEAP by OpenMEAP.
the class ModelTestUtils method main.
/**
* I used this mainly to generate the DDL.
* @param argv
*/
public static void main(String[] argv) {
//getPersistenceBean("modelManager");
if (persistenceBeans == null) {
System.setProperty("hibernate.show_sql", "true");
System.setProperty("hibernate.hbm2ddl.auto", "update");
System.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
System.setProperty("hibernate.connection.driver_class", "com.mysql.jdbc.Driver");
System.setProperty("hibernate.connection.url", "jdbc:mysql://localhost:3306/openmeap");
System.setProperty("hibernate.connection.username", "openmeap");
System.setProperty("hibernate.connection.password", "password");
persistenceBeans = new ClassPathXmlApplicationContext(new String[] { "/META-INF/persistenceContext.xml", "/META-INF/test/persistenceContext.xml" });
}
createModel(null);
}
use of org.springframework.context.support.ClassPathXmlApplicationContext in project jersey by jersey.
the class Aspect4JTest method configure.
@Override
protected Application configure() {
applicationContext = new ClassPathXmlApplicationContext("jersey-spring-aspect4j-applicationContext.xml");
testAspect = applicationContext.getBean(TestAspect.class);
return new Aspect4jJerseyConfig().property("contextConfig", applicationContext);
}
use of org.springframework.context.support.ClassPathXmlApplicationContext in project pinpoint by naver.
the class LambdaIT method test.
@Test
public void test() throws Exception {
ApplicationContext context = new ClassPathXmlApplicationContext("lambda-test.xml");
Maru maru = context.getBean(Maru.class);
Morae morae = context.getBean(Morae.class);
maru.test(morae);
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
verifier.verifyTrace(Expectations.event("SPRING_BEAN", Maru.class.getMethod("test", Morae.class)));
verifier.verifyTrace(Expectations.event("SPRING_BEAN", Morae.class.getMethod("test", Predicate.class)));
verifier.verifyTrace(Expectations.event("SPRING_BEAN", Mozzi.class.getMethod("getAge")));
verifier.verifyTraceCount(0);
}
use of org.springframework.context.support.ClassPathXmlApplicationContext in project cucumber-jvm by cucumber.
the class CucumberTestContextManager method createFallbackContext.
@SuppressWarnings("resource")
private ConfigurableListableBeanFactory createFallbackContext() {
ConfigurableApplicationContext applicationContext;
if (getClass().getClassLoader().getResource("cucumber.xml") != null) {
applicationContext = new ClassPathXmlApplicationContext("cucumber.xml");
} else {
applicationContext = new GenericApplicationContext();
}
applicationContext.registerShutdownHook();
ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
beanFactory.registerScope(GlueCodeScope.NAME, new GlueCodeScope());
for (Class<?> stepClass : stepClasses) {
registerStepClassBeanDefinition(beanFactory, stepClass);
}
return beanFactory;
}
use of org.springframework.context.support.ClassPathXmlApplicationContext in project useful-java-links by Vedenin.
the class XmlFieldAutowired method main.
public static void main(String[] args) throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("fieldAutowired.xml");
Notifier notifier = context.getBean(Notifier.class);
// Print "I send email: Hello world!"
notifier.send("Hello world!");
}
Aggregations