public void testInitFromXml() throws Exception {
StandaloneSession session = new StandaloneSession();
StandaloneSession session2 = new StandaloneSession();
StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory();
factory.init( "test-res/solution/system/pentahoObjects.spring.xml", null );
GoodObject goodObject = factory.get( GoodObject.class, session );
assertNotNull( goodObject );
try {
factory.get( BadObject.class, null );
assertFalse( true );
} catch ( ObjectFactoryException e ) {
// ignored
}
GoodObject goodObject1 = factory.get( GoodObject.class, session );
GoodObject goodObject2 = factory.get( GoodObject.class, session );
assertEquals( goodObject1, goodObject2 );
assertEquals( session, goodObject1.initSession );
GoodObject goodObject3 = factory.get( GoodObject.class, session2 );
assertNotSame( goodObject1, goodObject3 );
assertEquals( session2, goodObject3.initSession );
}