Search in sources :

Example 1 with DefaultRegistry

use of org.mule.runtime.core.internal.registry.DefaultRegistry in project mule by mulesoft.

the class DefaultMuleApplicationStatusTestCase method doSetUp.

@Override
protected void doSetUp() throws Exception {
    MuleApplicationClassLoader parentArtifactClassLoader = mock(MuleApplicationClassLoader.class);
    mockArtifactContext = mock(ArtifactContext.class);
    when(mockArtifactContext.getMuleContext()).thenReturn(muleContext);
    when(mockArtifactContext.getRegistry()).thenReturn(new DefaultRegistry(muleContext));
    application = new DefaultMuleApplication(null, parentArtifactClassLoader, emptyList(), null, mock(ServiceRepository.class), mock(ExtensionModelLoaderRepository.class), appLocation, null, null);
    application.setArtifactContext(mockArtifactContext);
    muleContext.getInjector().inject(this);
}
Also used : DefaultRegistry(org.mule.runtime.core.internal.registry.DefaultRegistry) ArtifactContext(org.mule.runtime.deployment.model.api.artifact.ArtifactContext) MuleApplicationClassLoader(org.mule.runtime.deployment.model.internal.application.MuleApplicationClassLoader)

Example 2 with DefaultRegistry

use of org.mule.runtime.core.internal.registry.DefaultRegistry in project mule by mulesoft.

the class AbstractDeploymentTestCase method assertConditionOnRegistry.

protected void assertConditionOnRegistry(TestDeploymentListener listener, Function<DefaultRegistry, Boolean> verifier) {
    Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
    prober.check(new JUnitProbe() {

        @Override
        public boolean test() {
            DefaultRegistry registry = (DefaultRegistry) listener.getRegistry();
            if (registry == null) {
                return false;
            }
            return verifier.apply(registry);
        }

        @Override
        public String describeFailure() {
            return "Properties were not overriden by the deployment properties";
        }
    });
}
Also used : JUnitProbe(org.mule.tck.probe.JUnitProbe) PollingProber(org.mule.tck.probe.PollingProber) DefaultRegistry(org.mule.runtime.core.internal.registry.DefaultRegistry) PollingProber(org.mule.tck.probe.PollingProber) Prober(org.mule.tck.probe.Prober)

Aggregations

DefaultRegistry (org.mule.runtime.core.internal.registry.DefaultRegistry)2 ArtifactContext (org.mule.runtime.deployment.model.api.artifact.ArtifactContext)1 MuleApplicationClassLoader (org.mule.runtime.deployment.model.internal.application.MuleApplicationClassLoader)1 JUnitProbe (org.mule.tck.probe.JUnitProbe)1 PollingProber (org.mule.tck.probe.PollingProber)1 Prober (org.mule.tck.probe.Prober)1