use of test.Ensure in project felix by apache.
the class ConfigurationDependencyImplTest method testInvokeFancyUpdatedMethodOk.
@Test
public void testInvokeFancyUpdatedMethodOk() throws Exception {
Ensure ensure = createEnsure();
FancyService service = new FancyService(ensure);
ConfigurationDependencyImpl cdi = createConfigurationDependency(service);
cdi.setCallback(service, "updated", MyConfiguration.class);
cdi.updated(createDictionary());
ensure.waitForStep(1, 1000);
cdi.updated(null);
ensure.waitForStep(2, 1000);
}
use of test.Ensure in project felix by apache.
the class ConfigurationDependencyImplTest method testInvokePlainUpdatedMethodOk.
@Test
public void testInvokePlainUpdatedMethodOk() throws Exception {
Ensure ensure = createEnsure();
PlainService service = new PlainService(ensure);
ConfigurationDependencyImpl cdi = createConfigurationDependency(service);
cdi.updated(createDictionary());
ensure.waitForStep(1, 1000);
cdi.updated(null);
ensure.waitForStep(2, 1000);
}
use of test.Ensure in project felix by apache.
the class ConfigurationDependencyImplTest method testDoNotInvokeFancyUpdatedMethodWithWrongSignatureOk.
@Test
public void testDoNotInvokeFancyUpdatedMethodWithWrongSignatureOk() throws Exception {
Ensure ensure = createEnsure();
FancyService service = new FancyService(ensure);
ConfigurationDependencyImpl cdi = createConfigurationDependency(service);
cdi.setCallback(service, "updated", Dictionary.class);
ensure.step(1);
cdi.updated(createDictionary());
TimeUnit.SECONDS.sleep(1L);
// Our step shouldn't be changed...
ensure.waitForStep(1, 1000);
}
use of test.Ensure in project felix by apache.
the class ConfigurationDependencyImplTest method testInvokeManagedServiceUpdatedMethodOk.
@Test
public void testInvokeManagedServiceUpdatedMethodOk() throws Exception {
Ensure ensure = createEnsure();
AManagedService service = new AManagedService(ensure);
ConfigurationDependencyImpl cdi = createConfigurationDependency(service);
cdi.updated(createDictionary());
ensure.waitForStep(1, 1000);
cdi.updated(null);
ensure.waitForStep(2, 1000);
}
use of test.Ensure in project felix by apache.
the class FactoryConfigurationAdapterImplTest method testInvokePlainUpdatedMethodOk.
@Test
public void testInvokePlainUpdatedMethodOk() throws Exception {
Ensure ensure = createEnsure();
PlainService service = new PlainService(ensure);
FactoryConfigurationAdapterImpl cdi = createConfigurationDependency(service);
((ManagedServiceFactory) cdi.m_component.getInstance()).updated(CONF_PID, (Dictionary<String, ?>) createDictionary());
ensure.waitForStep(1, 1000);
((ManagedServiceFactory) cdi.m_component.getInstance()).deleted(CONF_PID);
ensure.waitForStep(2, 1000);
}
Aggregations