-
Bug
-
Resolution: Done
-
Critical
-
jboss-fuse-6.2.1
-
None
-
%
-
-
6.3 Sprint 1 (4-Jan->29-Jan)
A new method has been added into CamelBlueprintTestSupport called - expectBlueprintContainerReloadOnConfigAdminUpdate.
It expects that the getBlueprintDescriptor is a single string, where as it supports multiples via commas.
Fixed upstream in
https://github.com/apache/camel/blob/master/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java#L249
To fix this issue, override the code with the below:
@Override protected boolean expectBlueprintContainerReloadOnConfigAdminUpdate() { boolean expectedReload = false; Iterator<Object> it = ObjectHelper.createIterator(getBlueprintDescriptor()); while (it.hasNext()) { String s = (String) it.next(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); try { // cm-1.0 doesn't define update-strategy attribute Set<String> cmNamesaces = new HashSet<>(Arrays.asList( CmNamespaceHandler.BLUEPRINT_CM_NAMESPACE_1_1, CmNamespaceHandler.BLUEPRINT_CM_NAMESPACE_1_2, CmNamespaceHandler.BLUEPRINT_CM_NAMESPACE_1_3 )); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(ResourceHelper.resolveResourceAsInputStream(RESOLVER, s)); NodeList nl = doc.getDocumentElement().getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); if (node instanceof Element) { Element pp = (Element) node; if (cmNamesaces.contains(pp.getNamespaceURI())) { String us = pp.getAttribute("update-strategy"); if (us != null && us.equals("reload")) { expectedReload = true; break; } } } } if (expectedReload) { break; } } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } } return expectedReload; }
Notice that in the above, i am using 'Iterator<Object> it = ObjectHelper.createIterator(getBlueprintDescriptor());' to loop over the list of descriptors and also 'ResourceHelper.resolveResourceAsInputStream(RESOLVER, s)' to resolve the file to a stream.
- is duplicated by
-
ENTESB-4707 CamelBlueprintTestSupport fails with Nullpointer exceptions
- Closed
- is related to
-
ENTESB-7688 getBlueprintDescriptor not consistently honored in CamelBlueprintTestSupport
- Closed
-
CAMEL-9142 Loading...