From 4aeaff45d75c0be9b183d8752c5c8e6258a3126a Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Fri, 10 Nov 2023 21:37:50 +0100 Subject: [PATCH] Detect factories having designate element with both "pid" and "factoryPid" attributes This relates to #1728 --- .../java/com/adobe/acs/commons/it/build/ScrMetadataIT.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bundle/src/test/java/com/adobe/acs/commons/it/build/ScrMetadataIT.java b/bundle/src/test/java/com/adobe/acs/commons/it/build/ScrMetadataIT.java index 9da815aeab..062cb760ee 100644 --- a/bundle/src/test/java/com/adobe/acs/commons/it/build/ScrMetadataIT.java +++ b/bundle/src/test/java/com/adobe/acs/commons/it/build/ScrMetadataIT.java @@ -365,15 +365,16 @@ private Descriptor parseMetatype(InputStream is, String name) throws IOException StartElement start = event.asStartElement(); String elementName = start.getName().getLocalPart(); if (elementName.equals("Designate")) { - Attribute pidAttribute = start.getAttributeByName(new QName("pid")); + // Felix SCR Generator incorrectly generates both attributes "factoryPid" and "pid" for factories + Attribute pidAttribute = start.getAttributeByName(new QName("factoryPid")); if (pidAttribute != null) { result.name = pidAttribute.getValue(); + result.factory = true; } else { - pidAttribute = start.getAttributeByName(new QName("factoryPid")); + pidAttribute = start.getAttributeByName(new QName("pid")); if (pidAttribute != null) { result.name = pidAttribute.getValue(); } - result.factory = true; } } else if (elementName.equals("AD")) { String propName = start.getAttributeByName(new QName("id")).getValue();