use of org.pentaho.platform.api.engine.IMimeTypeListener in project pentaho-platform by pentaho.
the class AggregateObjectFactoryTest method testRePublish.
@Test
public void testRePublish() throws Exception {
StandaloneSession session = new StandaloneSession();
StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory();
factory.init("src/test/resources/solution/system/republish.spring.xml", null);
PentahoSystem.registerObjectFactory(factory);
MimeTypeListener republished = PentahoSystem.get(MimeTypeListener.class, session, Collections.singletonMap("republished", "true"));
assertNotNull(republished);
assertEquals("Higher Priority MimeTypeListener", republished.name);
IMimeTypeListener republishedAsInterface = PentahoSystem.get(IMimeTypeListener.class, session, Collections.singletonMap("republishedAsInterface", "true"));
assertNotNull(republishedAsInterface);
assertEquals("Higher Priority MimeTypeListener", ((MimeTypeListener) republishedAsInterface).name);
}
Aggregations