InstanceProducer<PortletArchiveMetadata> portletMetadata;
public void parsePortletXml(@Observes BeforeDeploy event) {
boolean processed = false;
Archive applicationArchive = event.getDeployment().getArchive();
TestClass testClass = testClassInstance.get();
for (Field field : testClass.getJavaClass().getDeclaredFields()) {
if (field.isAnnotationPresent(PortalURL.class)) {
processed = processPortletXml(applicationArchive);
if (processed) {
break;
}
}
}
if (!processed) {
for (Method method : testClass.getJavaClass().getDeclaredMethods()) {
Annotation[][] methodParameterAnnotations = method.getParameterAnnotations();
for (Annotation[] parameterAnnotations : methodParameterAnnotations) {
for (Annotation annotation : parameterAnnotations) {
if (annotation instanceof PortalURL) {
processed = processPortletXml(applicationArchive);