Implementation s1Impl = waitForImplByName(null,
"fr.imag.adele.apam.pax.test.impl.S1Impl_tct021");
Instance s1Inst = s1Impl.createInstance(null, null);
S1Impl_tct021 s1 = (S1Impl_tct021) s1Inst.getServiceObject();
String messageTemplace = "for a property type injected='both', the %s";
Assert.assertTrue(
String.format(messageTemplace,
"initial value declared in the xml should NOT be ignored for both"),
s1.getInjectedBoth().equals("default"));
s1Inst.setProperty("injectedBoth", "changedByApamAPI");
Assert.assertTrue(String.format(messageTemplace,
" value should be changeable by ApamInstance.setProperty"), (s1
.getInjectedBoth() == null ? "" : s1.getInjectedBoth())
.equals("changedByApamAPI"));
Assert.assertTrue(
String.format(
messageTemplace,
" value should be changeable by ApamInstance.setProperty, which is not true when checking ApamInstance.getProperty"),
s1Inst.getProperty("injectedBoth").equals("changedByApamAPI"));
Assert.assertTrue(
String.format(
messageTemplace,
" value should be changeable by ApamInstance.setProperty, which is not true when checking ApamInstance.getAllProperties"),
s1Inst.getAllProperties().get("injectedBoth")
.equals("changedByApamAPI"));
s1.setInjectedBoth("changedByJavaInstance");
Assert.assertNotNull(s1.getInjectedBoth());
Assert.assertTrue(
String.format(
messageTemplace,
"value should be changeable by java instance, although the value remains un altered when checking the java instance value"),
s1.getInjectedBoth().equals("changedByJavaInstance"));
Assert.assertTrue(
String.format(
messageTemplace,
"value should be changeable by java instance, although the value remains un altered when checking ApamInstance.getProperty"),
s1Inst.getProperty("injectedBoth").equals(