use of org.pentaho.platform.engine.core.system.PentahoSystem in project pentaho-platform by pentaho.
the class RuntimeContextTest method before.
@Before
public void before() {
mockedRuntimeRepository = mock(IRuntimeRepository.class);
mockedSolutionEngine = mock(ISolutionEngine.class);
mockedPentahoSystem = new MockUp<PentahoSystem>() {
@Mock
public <T> T get(Class<T> type, IPentahoSession session) {
if (type == IRuntimeRepository.class) {
return (T) mockedRuntimeRepository;
} else if (type == ISolutionEngine.class) {
return (T) mockedSolutionEngine;
}
throw new IllegalStateException("Unsupported type: " + type.getSimpleName());
}
@Mock
public void setApplicationContext(final IApplicationContext applicationContext) {
}
@Mock
public IApplicationContext getApplicationContext() {
final String solutionPath = ".";
final String applicationPath = "";
return new StandaloneApplicationContext(solutionPath, applicationPath);
}
};
runtimeCtx = new RuntimeContext("id", mockedSolutionEngine, "solutionName", makeRuntimeData(session), session, null, "processId", urlFactory, makeParameterProviders(session), new ArrayList<String>(), null);
}
use of org.pentaho.platform.engine.core.system.PentahoSystem in project pentaho-platform by pentaho.
the class MessageFormatterTest method before.
@Before
public void before() {
mockedRuntimeRepository = mock(IRuntimeRepository.class);
mockedSolutionEngine = mock(ISolutionEngine.class);
mockedPentahoSystem = new MockUp<PentahoSystem>() {
@Mock
public IApplicationContext getApplicationContext() {
final String solutionPath = ".";
final String applicationPath = "";
return new StandaloneApplicationContext(solutionPath, applicationPath);
}
};
runtimeCtx = spy(new RuntimeContext("id", mockedSolutionEngine, "solutionName", makeRuntimeData(session), session, null, "processId", urlFactory, makeParameterProviders(session), new ArrayList<String>(), null));
}
Aggregations