"<yf:component id = \"id1\" impl = \"" + impl + "\" spec=\"" + spec + "\" var =\""
+ var + "\" >",
"<yf:component id = \" id1\" impl= \" " + impl + "\" spec=\"" + spec + "\" var=\""
+ var + " \" >", };
YComponentFactory cmpFac = new YComponentFactory();
for (String s : cmps1) {
// System.out.println(count++ + ": " + s);
YComponentInfo cmpInfo = cmpFac.createComponentInfo(s);
assertEquals(spec, cmpInfo.getSpecificationClassName());
assertEquals(impl, cmpInfo.getImplementationClassName());
assertEquals(var, cmpInfo.getVarName());
assertEquals(id, cmpInfo.getId());
assertEquals(0, cmpInfo.getInjectableProperties().size());
}
// test 'injectable' properties (boths styles)
String[] cmps2 = new String[] {
"<yf:component impl=\"" + impl + "\" injectable=\"prop1,prop2,prop3,prop4\">",
"<yf:component impl=\"" + impl + "\" injectable=\" prop1 ,prop2 ,prop3, prop4\">",
"<yf:component impl=\""
+ impl
+ "\" prop1=\"#{prop1}\" prop2=\"#{prop2}\" prop3=\"#{prop3}\" prop4=\"#{prop4}\">",
"<yf:component impl=\""
+ impl
+ "\" prop1=\"#{prop1}\" prop2=\"#{prop1}\" prop3=\"#{prop1}\" prop4=\"#{prop1}\">",
"<yf:component impl=\"" + impl
+ "\" injectable=\"prop1,prop2\" prop3=\"#{prop1}\" prop4=\"#{prop1}\">",
"<yf:component impl=\""
+ impl
+ "\" injectable=\"prop1,prop2,prop3\" prop3=\"#{prop1}\" prop4=\"#{prop1}\">",
"<yf:component impl=\"" + impl
+ "\" injectable=\"prop1,prop2,prop3\" prop4 = \" #{prop4} \">", };
for (String s : cmps2) {
// System.out.println(count++ + ": " + s);
YComponentInfo cmpInfo = cmpFac.createComponentInfo(s);
Collection<String> props = cmpInfo.getInjectableProperties();
assertEquals(4, props.size());
assertTrue("Got properties " + props.toString(), props.containsAll(properties));
}
}