JBossWS SVN: r16927 - in container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices: deployers and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-10-19 06:02:32 -0400 (Fri, 19 Oct 2012)
New Revision: 16927
Modified:
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/DotNames.java
Log:
[JBPAPP-8545][AS7-5784] Fixing 711 ASIL
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2012-10-19 09:36:49 UTC (rev 16926)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2012-10-19 10:02:32 UTC (rev 16927)
@@ -253,4 +253,9 @@
@LogMessage(level = ERROR)
@Message(id = 15592, value = "Cannot unregister record processor with JMX server")
void cannotUnregisterRecordProcessor();
-}
+
+ @LogMessage(level = WARN)
+ @Message(id = 15596, value = "Multiple EJB3 endpoints in the same deployment with different declared security roles; be aware this might be a security risk if you're not controlling allowed roles (@RolesAllowed) on each ws endpoint method.")
+ void multipleEndpointsWithDifferentDeclaredSecurityRoles();
+
+}
\ No newline at end of file
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java 2012-10-19 09:36:49 UTC (rev 16926)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java 2012-10-19 10:02:32 UTC (rev 16927)
@@ -25,6 +25,8 @@
import static org.jboss.as.webservices.util.ASHelper.getAnnotations;
import static org.jboss.as.webservices.util.ASHelper.getJaxwsDeployment;
import static org.jboss.as.webservices.util.ASHelper.getRequiredAttachment;
+import static org.jboss.as.webservices.util.DotNames.DECLARE_ROLES_ANNOTATION;
+import static org.jboss.as.webservices.util.DotNames.PERMIT_ALL_ANNOTATION;
import static org.jboss.as.webservices.util.DotNames.ROLES_ALLOWED_ANNOTATION;
import static org.jboss.as.webservices.util.DotNames.WEB_CONTEXT_ANNOTATION;
import static org.jboss.as.webservices.util.DotNames.WEB_SERVICE_ANNOTATION;
@@ -85,7 +87,7 @@
final String webServiceClassName = webServiceClassInfo.name().toString();
final List<ComponentDescription> componentDescriptions = moduleDescription.getComponentsByClassName(webServiceClassName);
final List<SessionBeanComponentDescription> sessionBeans = getSessionBeans(componentDescriptions);
- final Set<String> securityRoles = getSecurityRoles(unit, webServiceClassInfo); // TODO: assembly processed for each endpoint!
+ final Set<String> securityRoles = getDeclaredSecurityRoles(unit, webServiceClassInfo); // TODO: assembly processed for each endpoint!
final WebContextAnnotationWrapper webCtx = getWebContextWrapper(webServiceClassInfo);
final String authMethod = webCtx.getAuthMethod();
final boolean isSecureWsdlAccess = webCtx.isSecureWsdlAccess();
@@ -118,7 +120,7 @@
return sessionBeans;
}
- private static Set<String> getSecurityRoles(final DeploymentUnit unit, final ClassInfo webServiceClassInfo) {
+ private static Set<String> getDeclaredSecurityRoles(final DeploymentUnit unit, final ClassInfo webServiceClassInfo) {
final Set<String> securityRoles = new HashSet<String>();
// process assembly-descriptor DD section
@@ -140,12 +142,36 @@
// process @RolesAllowed annotation
if (webServiceClassInfo.annotations().containsKey(ROLES_ALLOWED_ANNOTATION)) {
- final AnnotationInstance allowedRoles = webServiceClassInfo.annotations().get(ROLES_ALLOWED_ANNOTATION).get(0);
- for (final String roleName : allowedRoles.value().asStringArray()) {
- securityRoles.add(roleName);
+ final List<AnnotationInstance> allowedRoles = webServiceClassInfo.annotations().get(ROLES_ALLOWED_ANNOTATION);
+ for (final AnnotationInstance allowedRole : allowedRoles) {
+ if (allowedRole.target().equals(webServiceClassInfo)) {
+ for (final String roleName : allowedRole.value().asStringArray()) {
+ securityRoles.add(roleName);
+ }
+ }
}
}
+ // process @DeclareRoles annotation
+ if (webServiceClassInfo.annotations().containsKey(DECLARE_ROLES_ANNOTATION)) {
+ final List<AnnotationInstance> declareRoles = webServiceClassInfo.annotations().get(DECLARE_ROLES_ANNOTATION);
+ for (final AnnotationInstance declareRole : declareRoles) {
+ if (declareRole.target().equals(webServiceClassInfo)) {
+ for (final String roleName : declareRole.value().asStringArray()) {
+ securityRoles.add(roleName);
+ }
+ }
+ }
+ }
+
+ // process @PermitAll annotation
+ if (webServiceClassInfo.annotations().containsKey(PERMIT_ALL_ANNOTATION)) {
+ final AnnotationInstance permitAll = webServiceClassInfo.annotations().get(PERMIT_ALL_ANNOTATION).iterator().next();
+ if (permitAll.target().equals(webServiceClassInfo)) {
+ securityRoles.add("*");
+ }
+ }
+
return (securityRoles.size() > 0) ? Collections.unmodifiableSet(securityRoles) : Collections.<String>emptySet();
}
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java 2012-10-19 09:36:49 UTC (rev 16926)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java 2012-10-19 10:02:32 UTC (rev 16927)
@@ -35,16 +35,16 @@
public static final String EJB_COMPONENT_VIEW_NAME = EJBEndpoint.class.getPackage().getName() + "EjbComponentViewName";
private final SessionBeanComponentDescription ejbMD;
private final ServiceName viewName;
- private final Set<String> securityRoles;
+ private final Set<String> declaredSecurityRoles;
private final String authMethod;
private final boolean secureWsdlAccess;
private final String transportGuarantee;
- public EJBEndpoint(final SessionBeanComponentDescription ejbMD, final ServiceName viewName, final Set<String> securityRoles, final String authMethod, final boolean secureWsdlAccess, final String transportGuarantee) {
+ public EJBEndpoint(final SessionBeanComponentDescription ejbMD, final ServiceName viewName, final Set<String> declaredSecurityRoles, final String authMethod, final boolean secureWsdlAccess, final String transportGuarantee) {
super(ejbMD.getComponentName(), ejbMD.getComponentClassName());
this.ejbMD = ejbMD;
this.viewName = viewName;
- this.securityRoles = securityRoles;
+ this.declaredSecurityRoles = declaredSecurityRoles;
this.authMethod = authMethod;
this.secureWsdlAccess = secureWsdlAccess;
this.transportGuarantee = transportGuarantee;
@@ -66,8 +66,8 @@
return ejbMD.getSecurityDomain();
}
- public Set<String> getSecurityRoles() {
- return securityRoles;
+ public Set<String> getDeclaredSecurityRoles() {
+ return declaredSecurityRoles;
}
public String getAuthMethod() {
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java 2012-10-19 09:36:49 UTC (rev 16926)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java 2012-10-19 10:02:32 UTC (rev 16927)
@@ -24,9 +24,11 @@
import static org.jboss.as.webservices.WSMessages.MESSAGES;
import java.util.List;
+import java.util.Set;
import org.jboss.as.ee.structure.Attachments;
import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.webservices.WSLogger;
import org.jboss.as.webservices.metadata.model.EJBEndpoint;
import org.jboss.metadata.ear.jboss.JBossAppMetaData;
import org.jboss.metadata.ear.spec.EarMetaData;
@@ -75,8 +77,16 @@
public SecurityRolesMetaData getSecurityRoles(final Deployment dep) {
final SecurityRolesMetaData securityRolesMD = new SecurityRolesMetaData();
+ Set<String> firstEndpointDeclaredSecurityRoles = null;
for (final EJBEndpoint ejbEndpoint : getEjbEndpoints(dep)) {
- for (final String roleName : ejbEndpoint.getSecurityRoles()) {
+ final Set<String> declaredSecurityRoles = ejbEndpoint.getDeclaredSecurityRoles();
+ if (firstEndpointDeclaredSecurityRoles == null) {
+ firstEndpointDeclaredSecurityRoles = declaredSecurityRoles;
+ } else if (!firstEndpointDeclaredSecurityRoles.equals(declaredSecurityRoles)) {
+ WSLogger.ROOT_LOGGER.multipleEndpointsWithDifferentDeclaredSecurityRoles();
+ }
+ // union of declared security roles from all endpoints...
+ for (final String roleName : declaredSecurityRoles) {
final SecurityRoleMetaData securityRoleMD = new SecurityRoleMetaData();
securityRoleMD.setRoleName(roleName);
securityRolesMD.add(securityRoleMD);
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java 2012-10-19 09:36:49 UTC (rev 16926)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java 2012-10-19 10:02:32 UTC (rev 16927)
@@ -302,7 +302,7 @@
if (hasAuthMethod) {
final SecurityMetaDataAccessorEJB ejbMDAccessor = getEjbSecurityMetaDataAccessor(dep);
final SecurityRolesMetaData securityRolesMD = ejbMDAccessor.getSecurityRoles(dep);
- final boolean hasSecurityRolesMD = securityRolesMD != null;
+ final boolean hasSecurityRolesMD = securityRolesMD != null && !securityRolesMD.isEmpty();
if (hasSecurityRolesMD) {
ROOT_LOGGER.creatingSecurityRoles();
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/DotNames.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/DotNames.java 2012-10-19 09:36:49 UTC (rev 16926)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/DotNames.java 2012-10-19 10:02:32 UTC (rev 16927)
@@ -22,6 +22,8 @@
package org.jboss.as.webservices.util;
+import javax.annotation.security.DeclareRoles;
+import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;
import javax.ejb.Singleton;
import javax.ejb.Stateless;
@@ -51,6 +53,8 @@
public static final DotName JAXWS_SERVICE_CLASS = DotName.createSimple(Service.class.getName());
public static final DotName OBJECT_CLASS = DotName.createSimple(Object.class.getName());
public static final DotName ROLES_ALLOWED_ANNOTATION = DotName.createSimple(RolesAllowed.class.getName());
+ public static final DotName PERMIT_ALL_ANNOTATION = DotName.createSimple(PermitAll.class.getName());
+ public static final DotName DECLARE_ROLES_ANNOTATION = DotName.createSimple(DeclareRoles.class.getName());
public static final DotName SERVLET_CLASS = DotName.createSimple(Servlet.class.getName());
public static final DotName SINGLETON_ANNOTATION = DotName.createSimple(Singleton.class.getName());
public static final DotName STATELESS_ANNOTATION = DotName.createSimple(Stateless.class.getName());
12 years, 4 months
JBossWS SVN: r16926 - in container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices: service and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-10-19 05:36:49 -0400 (Fri, 19 Oct 2012)
New Revision: 16926
Modified:
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java
Log:
Minor synch
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java 2012-10-19 09:34:22 UTC (rev 16925)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java 2012-10-19 09:36:49 UTC (rev 16926)
@@ -83,6 +83,7 @@
return publish(null, context, loader, urlPatternToClassNameMap, null);
}
+ @Override
public Context publish(String context, ClassLoader loader, Map<String, String> urlPatternToClassNameMap, WebservicesMetaData metadata) throws Exception {
return publish(null, context, loader, urlPatternToClassNameMap, metadata);
}
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java 2012-10-19 09:34:22 UTC (rev 16925)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java 2012-10-19 09:36:49 UTC (rev 16926)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -31,7 +31,6 @@
import org.jboss.as.security.plugins.SecurityDomainContext;
import org.jboss.as.security.service.SecurityDomainService;
import org.jboss.as.server.deployment.DeploymentUnit;
-import org.jboss.as.webservices.WSMessages;
import org.jboss.as.webservices.security.SecurityDomainContextAdaptor;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.as.webservices.util.WebAppController;
12 years, 4 months
JBossWS SVN: r16925 - in container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices: deployers and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-10-19 05:34:22 -0400 (Fri, 19 Oct 2012)
New Revision: 16925
Modified:
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/DotNames.java
Log:
[AS7-5784] Porting fix to AS712 ASIL
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2012-10-19 08:28:13 UTC (rev 16924)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2012-10-19 09:34:22 UTC (rev 16925)
@@ -257,4 +257,9 @@
@LogMessage(level = INFO)
@Message(id = 15593, value = "MBeanServer not available, skipping registration/unregistration of %s")
void mBeanServerNotAvailable(Object bean);
-}
+
+ @LogMessage(level = WARN)
+ @Message(id = 15596, value = "Multiple EJB3 endpoints in the same deployment with different declared security roles; be aware this might be a security risk if you're not controlling allowed roles (@RolesAllowed) on each ws endpoint method.")
+ void multipleEndpointsWithDifferentDeclaredSecurityRoles();
+
+}
\ No newline at end of file
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java 2012-10-19 08:28:13 UTC (rev 16924)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java 2012-10-19 09:34:22 UTC (rev 16925)
@@ -26,6 +26,7 @@
import static org.jboss.as.webservices.util.ASHelper.getJaxwsDeployment;
import static org.jboss.as.webservices.util.ASHelper.getRequiredAttachment;
import static org.jboss.as.webservices.util.DotNames.DECLARE_ROLES_ANNOTATION;
+import static org.jboss.as.webservices.util.DotNames.PERMIT_ALL_ANNOTATION;
import static org.jboss.as.webservices.util.DotNames.ROLES_ALLOWED_ANNOTATION;
import static org.jboss.as.webservices.util.DotNames.WEB_CONTEXT_ANNOTATION;
import static org.jboss.as.webservices.util.DotNames.WEB_SERVICE_ANNOTATION;
@@ -86,7 +87,7 @@
final String webServiceClassName = webServiceClassInfo.name().toString();
final List<ComponentDescription> componentDescriptions = moduleDescription.getComponentsByClassName(webServiceClassName);
final List<SessionBeanComponentDescription> sessionBeans = getSessionBeans(componentDescriptions);
- final Set<String> securityRoles = getSecurityRoles(unit, webServiceClassInfo); // TODO: assembly processed for each endpoint!
+ final Set<String> securityRoles = getDeclaredSecurityRoles(unit, webServiceClassInfo); // TODO: assembly processed for each endpoint!
final WebContextAnnotationWrapper webCtx = getWebContextWrapper(webServiceClassInfo);
final String authMethod = webCtx.getAuthMethod();
final boolean isSecureWsdlAccess = webCtx.isSecureWsdlAccess();
@@ -119,7 +120,7 @@
return sessionBeans;
}
- private static Set<String> getSecurityRoles(final DeploymentUnit unit, final ClassInfo webServiceClassInfo) {
+ private static Set<String> getDeclaredSecurityRoles(final DeploymentUnit unit, final ClassInfo webServiceClassInfo) {
final Set<String> securityRoles = new HashSet<String>();
// process assembly-descriptor DD section
@@ -143,9 +144,11 @@
if (webServiceClassInfo.annotations().containsKey(ROLES_ALLOWED_ANNOTATION)) {
final List<AnnotationInstance> allowedRoles = webServiceClassInfo.annotations().get(ROLES_ALLOWED_ANNOTATION);
for (final AnnotationInstance allowedRole : allowedRoles) {
- for (final String roleName : allowedRole.value().asStringArray()) {
- securityRoles.add(roleName);
- }
+ if (allowedRole.target().equals(webServiceClassInfo)) {
+ for (final String roleName : allowedRole.value().asStringArray()) {
+ securityRoles.add(roleName);
+ }
+ }
}
}
@@ -153,12 +156,22 @@
if (webServiceClassInfo.annotations().containsKey(DECLARE_ROLES_ANNOTATION)) {
final List<AnnotationInstance> declareRoles = webServiceClassInfo.annotations().get(DECLARE_ROLES_ANNOTATION);
for (final AnnotationInstance declareRole : declareRoles) {
- for (final String roleName : declareRole.value().asStringArray()) {
- securityRoles.add(roleName);
- }
+ if (declareRole.target().equals(webServiceClassInfo)) {
+ for (final String roleName : declareRole.value().asStringArray()) {
+ securityRoles.add(roleName);
+ }
+ }
}
}
+ // process @PermitAll annotation
+ if (webServiceClassInfo.annotations().containsKey(PERMIT_ALL_ANNOTATION)) {
+ final AnnotationInstance permitAll = webServiceClassInfo.annotations().get(PERMIT_ALL_ANNOTATION).iterator().next();
+ if (permitAll.target().equals(webServiceClassInfo)) {
+ securityRoles.add("*");
+ }
+ }
+
return (securityRoles.size() > 0) ? Collections.unmodifiableSet(securityRoles) : Collections.<String>emptySet();
}
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java 2012-10-19 08:28:13 UTC (rev 16924)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java 2012-10-19 09:34:22 UTC (rev 16925)
@@ -35,16 +35,16 @@
public static final String EJB_COMPONENT_VIEW_NAME = EJBEndpoint.class.getPackage().getName() + "EjbComponentViewName";
private final SessionBeanComponentDescription ejbMD;
private final ServiceName viewName;
- private final Set<String> securityRoles;
+ private final Set<String> declaredSecurityRoles;
private final String authMethod;
private final boolean secureWsdlAccess;
private final String transportGuarantee;
- public EJBEndpoint(final SessionBeanComponentDescription ejbMD, final ServiceName viewName, final Set<String> securityRoles, final String authMethod, final boolean secureWsdlAccess, final String transportGuarantee) {
+ public EJBEndpoint(final SessionBeanComponentDescription ejbMD, final ServiceName viewName, final Set<String> declaredSecurityRoles, final String authMethod, final boolean secureWsdlAccess, final String transportGuarantee) {
super(ejbMD.getComponentName(), ejbMD.getComponentClassName());
this.ejbMD = ejbMD;
this.viewName = viewName;
- this.securityRoles = securityRoles;
+ this.declaredSecurityRoles = declaredSecurityRoles;
this.authMethod = authMethod;
this.secureWsdlAccess = secureWsdlAccess;
this.transportGuarantee = transportGuarantee;
@@ -66,8 +66,8 @@
return ejbMD.getSecurityDomain();
}
- public Set<String> getSecurityRoles() {
- return securityRoles;
+ public Set<String> getDeclaredSecurityRoles() {
+ return declaredSecurityRoles;
}
public String getAuthMethod() {
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java 2012-10-19 08:28:13 UTC (rev 16924)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java 2012-10-19 09:34:22 UTC (rev 16925)
@@ -24,9 +24,11 @@
import static org.jboss.as.webservices.WSMessages.MESSAGES;
import java.util.List;
+import java.util.Set;
import org.jboss.as.ee.structure.Attachments;
import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.webservices.WSLogger;
import org.jboss.as.webservices.metadata.model.EJBEndpoint;
import org.jboss.metadata.ear.jboss.JBossAppMetaData;
import org.jboss.metadata.ear.spec.EarMetaData;
@@ -75,8 +77,16 @@
public SecurityRolesMetaData getSecurityRoles(final Deployment dep) {
final SecurityRolesMetaData securityRolesMD = new SecurityRolesMetaData();
+ Set<String> firstEndpointDeclaredSecurityRoles = null;
for (final EJBEndpoint ejbEndpoint : getEjbEndpoints(dep)) {
- for (final String roleName : ejbEndpoint.getSecurityRoles()) {
+ final Set<String> declaredSecurityRoles = ejbEndpoint.getDeclaredSecurityRoles();
+ if (firstEndpointDeclaredSecurityRoles == null) {
+ firstEndpointDeclaredSecurityRoles = declaredSecurityRoles;
+ } else if (!firstEndpointDeclaredSecurityRoles.equals(declaredSecurityRoles)) {
+ WSLogger.ROOT_LOGGER.multipleEndpointsWithDifferentDeclaredSecurityRoles();
+ }
+ // union of declared security roles from all endpoints...
+ for (final String roleName : declaredSecurityRoles) {
final SecurityRoleMetaData securityRoleMD = new SecurityRoleMetaData();
securityRoleMD.setRoleName(roleName);
securityRolesMD.add(securityRoleMD);
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java 2012-10-19 08:28:13 UTC (rev 16924)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java 2012-10-19 09:34:22 UTC (rev 16925)
@@ -302,7 +302,7 @@
if (hasAuthMethod) {
final SecurityMetaDataAccessorEJB ejbMDAccessor = getEjbSecurityMetaDataAccessor(dep);
final SecurityRolesMetaData securityRolesMD = ejbMDAccessor.getSecurityRoles(dep);
- final boolean hasSecurityRolesMD = securityRolesMD != null;
+ final boolean hasSecurityRolesMD = securityRolesMD != null && !securityRolesMD.isEmpty();
if (hasSecurityRolesMD) {
ROOT_LOGGER.creatingSecurityRoles();
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/DotNames.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/DotNames.java 2012-10-19 08:28:13 UTC (rev 16924)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/DotNames.java 2012-10-19 09:34:22 UTC (rev 16925)
@@ -23,6 +23,7 @@
package org.jboss.as.webservices.util;
import javax.annotation.security.DeclareRoles;
+import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;
import javax.ejb.Singleton;
import javax.ejb.Stateless;
@@ -52,6 +53,7 @@
public static final DotName JAXWS_SERVICE_CLASS = DotName.createSimple(Service.class.getName());
public static final DotName OBJECT_CLASS = DotName.createSimple(Object.class.getName());
public static final DotName ROLES_ALLOWED_ANNOTATION = DotName.createSimple(RolesAllowed.class.getName());
+ public static final DotName PERMIT_ALL_ANNOTATION = DotName.createSimple(PermitAll.class.getName());
public static final DotName DECLARE_ROLES_ANNOTATION = DotName.createSimple(DeclareRoles.class.getName());
public static final DotName SERVLET_CLASS = DotName.createSimple(Servlet.class.getName());
public static final DotName SINGLETON_ANNOTATION = DotName.createSimple(Singleton.class.getName());
12 years, 4 months
JBossWS SVN: r16924 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-10-19 04:28:13 -0400 (Fri, 19 Oct 2012)
New Revision: 16924
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3552] excluding test for now - until fixes are available in Apache CXF
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2012-10-19 08:06:39 UTC (rev 16923)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2012-10-19 08:28:13 UTC (rev 16924)
@@ -693,6 +693,9 @@
<!--# [AS7-5784] WSIntegrationProcessorJAXWS_EJB does not process @PermitAll, @DeclareRoles and @RolesAllowed properly -->
<exclude>org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase*</exclude>
+
+ <!--# [JBWS-3552] @XmlJavaTypeAdapter ignored on exception classes -->
+ <exclude>org/jboss/test/ws/jaxws/jbws3552/**</exclude>
</excludes>
</configuration>
</plugin>
@@ -755,6 +758,9 @@
<!--# [AS7-5784] WSIntegrationProcessorJAXWS_EJB does not process @PermitAll, @DeclareRoles and @RolesAllowed properly -->
<exclude>org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase*</exclude>
+
+ <!--# [JBWS-3552] @XmlJavaTypeAdapter ignored on exception classes -->
+ <exclude>org/jboss/test/ws/jaxws/jbws3552/**</exclude>
</excludes>
</configuration>
</plugin>
@@ -816,6 +822,9 @@
<!--# [AS7-5784] WSIntegrationProcessorJAXWS_EJB does not process @PermitAll, @DeclareRoles and @RolesAllowed properly -->
<exclude>org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase*</exclude>
+
+ <!--# [JBWS-3552] @XmlJavaTypeAdapter ignored on exception classes -->
+ <exclude>org/jboss/test/ws/jaxws/jbws3552/**</exclude>
</excludes>
</configuration>
</plugin>
@@ -875,6 +884,9 @@
<!--# [AS7-5784] WSIntegrationProcessorJAXWS_EJB does not process @PermitAll, @DeclareRoles and @RolesAllowed properly -->
<exclude>org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase*</exclude>
+
+ <!--# [JBWS-3552] @XmlJavaTypeAdapter ignored on exception classes -->
+ <exclude>org/jboss/test/ws/jaxws/jbws3552/**</exclude>
</excludes>
</configuration>
</plugin>
12 years, 4 months
JBossWS SVN: r16923 - shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-10-19 04:06:39 -0400 (Fri, 19 Oct 2012)
New Revision: 16923
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectCA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectFA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectGA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectMA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionCA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionFA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionGA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionMA.java
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionCA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionFA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionGA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionMA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectCA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectFA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectGA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectMA.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/EndpointIface.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/EndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/JBWS3552TestCase.java
Log:
[JBWS-3552] enhancing test case to take inheritance into account
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectCA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectCA.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectCA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3552;
+
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+@XmlTransient
+public class AbstractObjectCA {
+ private String message;
+ private String description;
+ private int code;
+ private ComplexObjectCA complexObject;
+
+ public AbstractObjectCA() {
+ super();
+ }
+
+ public AbstractObjectCA(String message, String description, int code, ComplexObjectCA complexObject) {
+ this.message = message;
+ this.description = description;
+ this.code = code;
+ this.complexObject = complexObject;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public ComplexObjectCA getComplexObject() {
+ return complexObject;
+ }
+
+ public String toString() {
+ return message + "," + description + "," + code + "," + complexObject;
+ }
+}
\ No newline at end of file
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectFA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectFA.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectFA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3552;
+
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+@XmlTransient
+public class AbstractObjectFA {
+ private String message;
+ private String description;
+ private int code;
+ @XmlJavaTypeAdapter(value = ComplexObjectFAAdapter.class)
+ private ComplexObjectFA complexObject;
+
+ public AbstractObjectFA() {
+ super();
+ }
+
+ public AbstractObjectFA(String message, String description, int code, ComplexObjectFA complexObject) {
+ this.message = message;
+ this.description = description;
+ this.code = code;
+ this.complexObject = complexObject;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public ComplexObjectFA getComplexObject() {
+ return complexObject;
+ }
+
+ public String toString() {
+ return message + "," + description + "," + code + "," + complexObject;
+ }
+}
\ No newline at end of file
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectGA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectGA.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectGA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3552;
+
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+@XmlTransient
+public class AbstractObjectGA {
+ private String message;
+ private String description;
+ private int code;
+ private ComplexObjectGA complexObject;
+
+ public AbstractObjectGA() {
+ super();
+ }
+
+ public AbstractObjectGA(String message, String description, int code, ComplexObjectGA complexObject) {
+ this.message = message;
+ this.description = description;
+ this.code = code;
+ this.complexObject = complexObject;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public ComplexObjectGA getComplexObject() {
+ return complexObject;
+ }
+
+ public String toString() {
+ return message + "," + description + "," + code + "," + complexObject;
+ }
+}
\ No newline at end of file
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectMA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectMA.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AbstractObjectMA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3552;
+
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+@XmlTransient
+public class AbstractObjectMA {
+ private String message;
+ private String description;
+ private int code;
+ private ComplexObjectMA complexObject;
+
+ public AbstractObjectMA() {
+ super();
+ }
+
+ public AbstractObjectMA(String message, String description, int code, ComplexObjectMA complexObject) {
+ this.message = message;
+ this.description = description;
+ this.code = code;
+ this.complexObject = complexObject;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setComplexObject(ComplexObjectMA complexObject) {
+ this.complexObject = complexObject;
+ }
+
+ @XmlJavaTypeAdapter(value = ComplexObjectMAAdapter.class)
+ public ComplexObjectMA getComplexObject() {
+ return complexObject;
+ }
+
+ public String toString() {
+ return message + "," + description + "," + code + "," + complexObject;
+ }
+}
\ No newline at end of file
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionCA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionCA.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionCA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -21,11 +21,10 @@
*/
package org.jboss.test.ws.jaxws.jbws3552;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlTransient
public class AdaptedExceptionCA extends Exception {
private String message;
private String description;
@@ -33,6 +32,7 @@
private ComplexObjectCA complexObject;
public AdaptedExceptionCA() {
+ super();
}
public AdaptedExceptionCA(String message, String description, int code, ComplexObjectCA complexObject) {
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionFA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionFA.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionFA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -21,11 +21,10 @@
*/
package org.jboss.test.ws.jaxws.jbws3552;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlTransient
public class AdaptedExceptionFA extends Exception {
private String message;
private String description;
@@ -34,6 +33,7 @@
private ComplexObjectFA complexObject;
public AdaptedExceptionFA() {
+ super();
}
public AdaptedExceptionFA(String message, String description, int code, ComplexObjectFA complexObject) {
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionGA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionGA.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionGA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -21,11 +21,10 @@
*/
package org.jboss.test.ws.jaxws.jbws3552;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlTransient
public class AdaptedExceptionGA extends Exception {
private String message;
private String description;
@@ -33,6 +32,7 @@
private ComplexObjectGA complexObject;
public AdaptedExceptionGA() {
+ super();
}
public AdaptedExceptionGA(String message, String description, int code, ComplexObjectGA complexObject) {
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionMA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionMA.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedExceptionMA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -21,11 +21,10 @@
*/
package org.jboss.test.ws.jaxws.jbws3552;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-(a)XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+@XmlTransient
public class AdaptedExceptionMA extends Exception {
private String message;
private String description;
@@ -33,6 +32,7 @@
private ComplexObjectMA complexObject;
public AdaptedExceptionMA() {
+ super();
}
public AdaptedExceptionMA(String message, String description, int code, ComplexObjectMA complexObject) {
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectCA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectCA.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectCA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -23,42 +23,15 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@XmlAccessorType(XmlAccessType.FIELD)
-public class AdaptedObjectCA {
- private String message;
- private String description;
- private int code;
- private ComplexObjectCA complexObject;
+public class AdaptedObjectCA extends AbstractObjectCA {
public AdaptedObjectCA() {
+ super();
}
public AdaptedObjectCA(String message, String description, int code, ComplexObjectCA complexObject) {
- this.message = message;
- this.description = description;
- this.code = code;
- this.complexObject = complexObject;
+ super(message, description, code, complexObject);
}
-
- public String getMessage() {
- return message;
- }
-
- public String getDescription() {
- return description;
- }
-
- public int getCode() {
- return code;
- }
-
- public ComplexObjectCA getComplexObject() {
- return complexObject;
- }
-
- public String toString() {
- return message + "," + description + "," + code + "," + complexObject;
- }
}
\ No newline at end of file
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectFA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectFA.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectFA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -23,43 +23,15 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@XmlAccessorType(XmlAccessType.FIELD)
-public class AdaptedObjectFA {
- private String message;
- private String description;
- private int code;
- @XmlJavaTypeAdapter(value = ComplexObjectFAAdapter.class)
- private ComplexObjectFA complexObject;
+public class AdaptedObjectFA extends AbstractObjectFA {
public AdaptedObjectFA() {
+ super();
}
public AdaptedObjectFA(String message, String description, int code, ComplexObjectFA complexObject) {
- this.message = message;
- this.description = description;
- this.code = code;
- this.complexObject = complexObject;
+ super(message, description, code, complexObject);
}
-
- public String getMessage() {
- return message;
- }
-
- public String getDescription() {
- return description;
- }
-
- public int getCode() {
- return code;
- }
-
- public ComplexObjectFA getComplexObject() {
- return complexObject;
- }
-
- public String toString() {
- return message + "," + description + "," + code + "," + complexObject;
- }
}
\ No newline at end of file
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectGA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectGA.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectGA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -25,39 +25,13 @@
import javax.xml.bind.annotation.XmlAccessorType;
@XmlAccessorType(XmlAccessType.FIELD)
-public class AdaptedObjectGA {
- private String message;
- private String description;
- private int code;
- private ComplexObjectGA complexObject;
+public class AdaptedObjectGA extends AbstractObjectGA {
public AdaptedObjectGA() {
+ super();
}
public AdaptedObjectGA(String message, String description, int code, ComplexObjectGA complexObject) {
- this.message = message;
- this.description = description;
- this.code = code;
- this.complexObject = complexObject;
+ super(message, description, code, complexObject);
}
-
- public String getMessage() {
- return message;
- }
-
- public String getDescription() {
- return description;
- }
-
- public int getCode() {
- return code;
- }
-
- public ComplexObjectGA getComplexObject() {
- return complexObject;
- }
-
- public String toString() {
- return message + "," + description + "," + code + "," + complexObject;
- }
}
\ No newline at end of file
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectMA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectMA.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/AdaptedObjectMA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -23,59 +23,15 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
-public class AdaptedObjectMA {
- private String message;
- private String description;
- private int code;
- private ComplexObjectMA complexObject;
+public class AdaptedObjectMA extends AbstractObjectMA {
public AdaptedObjectMA() {
+ super();
}
public AdaptedObjectMA(String message, String description, int code, ComplexObjectMA complexObject) {
- this.message = message;
- this.description = description;
- this.code = code;
- this.complexObject = complexObject;
+ super(message, description, code, complexObject);
}
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setCode(int code) {
- this.code = code;
- }
-
- public int getCode() {
- return code;
- }
-
- public void setComplexObject(ComplexObjectMA complexObject) {
- this.complexObject = complexObject;
- }
-
- @XmlJavaTypeAdapter(value = ComplexObjectMAAdapter.class)
- public ComplexObjectMA getComplexObject() {
- return complexObject;
- }
-
- public String toString() {
- return message + "," + description + "," + code + "," + complexObject;
- }
}
\ No newline at end of file
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/EndpointIface.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/EndpointIface.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/EndpointIface.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -27,17 +27,33 @@
public interface EndpointIface {
AdaptedObjectCA echoCA(AdaptedObjectCA ao);
+ AbstractObjectCA echoAbstractCA(AbstractObjectCA ao);
+
AdaptedObjectFA echoFA(AdaptedObjectFA ao);
+ AbstractObjectFA echoAbstractFA(AbstractObjectFA ao);
+
AdaptedObjectGA echoGA(AdaptedObjectGA ao);
+ AbstractObjectGA echoAbstractGA(AbstractObjectGA ao);
+
AdaptedObjectMA echoMA(AdaptedObjectMA ao);
+ AbstractObjectMA echoAbstractMA(AbstractObjectMA ao);
+
void throwExceptionCA() throws AdaptedExceptionCA;
+ void throwExtendedExceptionCA() throws ExtendedAdaptedExceptionCA;
+
void throwExceptionFA() throws AdaptedExceptionFA;
+
+ void throwExtendedExceptionFA() throws ExtendedAdaptedExceptionFA;
void throwExceptionGA() throws AdaptedExceptionGA;
+ void throwExtendedExceptionGA() throws ExtendedAdaptedExceptionGA;
+
void throwExceptionMA() throws AdaptedExceptionMA;
+
+ void throwExtendedExceptionMA() throws ExtendedAdaptedExceptionMA;
}
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/EndpointImpl.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/EndpointImpl.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/EndpointImpl.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -29,31 +29,63 @@
return ao;
}
+ public AbstractObjectCA echoAbstractCA(AbstractObjectCA ao) {
+ return ao;
+ }
+
public AdaptedObjectFA echoFA(AdaptedObjectFA ao) {
return ao;
}
+ public AbstractObjectFA echoAbstractFA(AbstractObjectFA ao) {
+ return ao;
+ }
+
public AdaptedObjectGA echoGA(AdaptedObjectGA ao) {
return ao;
}
+ public AbstractObjectGA echoAbstractGA(AbstractObjectGA ao) {
+ return ao;
+ }
+
public AdaptedObjectMA echoMA(AdaptedObjectMA ao) {
return ao;
}
+ public AbstractObjectMA echoAbstractMA(AbstractObjectMA ao) {
+ return ao;
+ }
+
public void throwExceptionCA() throws AdaptedExceptionCA {
- throw new AdaptedExceptionCA("exception message", "exception description", 666, new ComplexObjectCA("c", "d"));
+ throw new ExtendedAdaptedExceptionCA("exception message", "exception description", 666, new ComplexObjectCA("c", "d"));
}
+ public void throwExtendedExceptionCA() throws AdaptedExceptionCA {
+ throw new ExtendedAdaptedExceptionCA("exception message", "exception description", 666, new ComplexObjectCA("c", "d"));
+ }
+
public void throwExceptionFA() throws AdaptedExceptionFA {
- throw new AdaptedExceptionFA("exception message", "exception description", 666, new ComplexObjectFA("c", "d"));
+ throw new ExtendedAdaptedExceptionFA("exception message", "exception description", 666, new ComplexObjectFA("c", "d"));
}
+ public void throwExtendedExceptionFA() throws ExtendedAdaptedExceptionFA {
+ throw new ExtendedAdaptedExceptionFA("exception message", "exception description", 666, new ComplexObjectFA("c", "d"));
+ }
+
public void throwExceptionGA() throws AdaptedExceptionGA {
- throw new AdaptedExceptionGA("exception message", "exception description", 666, new ComplexObjectGA("c", "d"));
+ throw new ExtendedAdaptedExceptionGA("exception message", "exception description", 666, new ComplexObjectGA("c", "d"));
}
+ public void throwExtendedExceptionGA() throws AdaptedExceptionGA {
+ throw new ExtendedAdaptedExceptionGA("exception message", "exception description", 666, new ComplexObjectGA("c", "d"));
+ }
+
public void throwExceptionMA() throws AdaptedExceptionMA {
- throw new AdaptedExceptionMA("exception message", "exception description", 666, new ComplexObjectMA("c", "d"));
+ throw new ExtendedAdaptedExceptionMA("exception message", "exception description", 666, new ComplexObjectMA("c", "d"));
}
+
+ public void throwExtendedExceptionMA() throws AdaptedExceptionMA {
+ throw new ExtendedAdaptedExceptionMA("exception message", "exception description", 666, new ComplexObjectMA("c", "d"));
+ }
}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionCA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionCA.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionCA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3552;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class ExtendedAdaptedExceptionCA extends AdaptedExceptionCA {
+
+ public ExtendedAdaptedExceptionCA() {
+ }
+
+ public ExtendedAdaptedExceptionCA(String message, String description, int code, ComplexObjectCA complexObject) {
+ super(message, description, code, complexObject);
+ }
+}
\ No newline at end of file
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionFA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionFA.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionFA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3552;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class ExtendedAdaptedExceptionFA extends AdaptedExceptionFA {
+ public ExtendedAdaptedExceptionFA() {
+ super();
+ }
+
+ public ExtendedAdaptedExceptionFA(String message, String description, int code, ComplexObjectFA complexObject) {
+ super(message, description, code, complexObject);
+ }
+}
\ No newline at end of file
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionGA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionGA.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionGA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3552;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class ExtendedAdaptedExceptionGA extends AdaptedExceptionGA {
+
+ public ExtendedAdaptedExceptionGA() {
+ }
+
+ public ExtendedAdaptedExceptionGA(String message, String description, int code, ComplexObjectGA complexObject) {
+ super(message, description, code, complexObject);
+ }
+}
\ No newline at end of file
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionMA.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionMA.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/ExtendedAdaptedExceptionMA.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3552;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+(a)XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+public class ExtendedAdaptedExceptionMA extends AdaptedExceptionMA {
+
+ public ExtendedAdaptedExceptionMA() {
+ }
+
+ public ExtendedAdaptedExceptionMA(String message, String description, int code, ComplexObjectMA complexObject) {
+ super(message, description, code, complexObject);
+ }
+}
\ No newline at end of file
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/JBWS3552TestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/JBWS3552TestCase.java 2012-10-19 07:37:43 UTC (rev 16922)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552/JBWS3552TestCase.java 2012-10-19 08:06:39 UTC (rev 16923)
@@ -61,24 +61,48 @@
assertEquals("object message,object description,444,a b", endpoint.echoCA(aoCA).toString());
}
+ public void testEchoAbstractCA() throws Exception {
+ EndpointIface endpoint = getProxy();
+ AdaptedObjectCA aoCA = new AdaptedObjectCA("object message", "object description", 444, new ComplexObjectCA("a", "b"));
+ assertEquals("object message,object description,444,a b", endpoint.echoAbstractCA(aoCA).toString());
+ }
+
public void testEchoFA() throws Exception {
EndpointIface endpoint = getProxy();
AdaptedObjectFA aoFA = new AdaptedObjectFA("object message", "object description", 444, new ComplexObjectFA("a", "b"));
assertEquals("object message,object description,444,a b", endpoint.echoFA(aoFA).toString());
}
+ public void testEchoAbstractFA() throws Exception {
+ EndpointIface endpoint = getProxy();
+ AdaptedObjectFA aoFA = new AdaptedObjectFA("object message", "object description", 444, new ComplexObjectFA("a", "b"));
+ assertEquals("object message,object description,444,a b", endpoint.echoAbstractFA(aoFA).toString());
+ }
+
public void testEchoGA() throws Exception {
EndpointIface endpoint = getProxy();
AdaptedObjectGA aoGA = new AdaptedObjectGA("object message", "object description", 444, new ComplexObjectGA("a", "b"));
assertEquals("object message,object description,444,a b", endpoint.echoGA(aoGA).toString());
}
+ public void testEchoAbstractGA() throws Exception {
+ EndpointIface endpoint = getProxy();
+ AdaptedObjectGA aoGA = new AdaptedObjectGA("object message", "object description", 444, new ComplexObjectGA("a", "b"));
+ assertEquals("object message,object description,444,a b", endpoint.echoAbstractGA(aoGA).toString());
+ }
+
public void testEchoMA() throws Exception {
EndpointIface endpoint = getProxy();
AdaptedObjectMA aoMA = new AdaptedObjectMA("object message", "object description", 444, new ComplexObjectMA("a", "b"));
assertEquals("object message,object description,444,a b", endpoint.echoMA(aoMA).toString());
}
+ public void testEchoAbstractMA() throws Exception {
+ EndpointIface endpoint = getProxy();
+ AdaptedObjectMA aoMA = new AdaptedObjectMA("object message", "object description", 444, new ComplexObjectMA("a", "b"));
+ assertEquals("object message,object description,444,a b", endpoint.echoAbstractMA(aoMA).toString());
+ }
+
public void testExceptionCA() throws Exception {
EndpointIface endpoint = getProxy();
try {
@@ -89,6 +113,16 @@
}
}
+ public void testExtendedExceptionCA() throws Exception {
+ EndpointIface endpoint = getProxy();
+ try {
+ endpoint.throwExtendedExceptionCA();
+ fail("Expected exception not thrown");
+ } catch (ExtendedAdaptedExceptionCA e) {
+ assertEquals("exception message,exception description,666,c d", e.toString());
+ }
+ }
+
public void testExceptionFA() throws Exception {
EndpointIface endpoint = getProxy();
try {
@@ -99,6 +133,16 @@
}
}
+ public void testExtendedExceptionFA() throws Exception {
+ EndpointIface endpoint = getProxy();
+ try {
+ endpoint.throwExtendedExceptionFA();
+ fail("Expected exception not thrown");
+ } catch (ExtendedAdaptedExceptionFA e) {
+ assertEquals("exception message,exception description,666,c d", e.toString());
+ }
+ }
+
public void testExceptionGA() throws Exception {
EndpointIface endpoint = getProxy();
try {
@@ -109,6 +153,16 @@
}
}
+ public void testExtendedExceptionGA() throws Exception {
+ EndpointIface endpoint = getProxy();
+ try {
+ endpoint.throwExtendedExceptionGA();
+ fail("Expected exception not thrown");
+ } catch (ExtendedAdaptedExceptionGA e) {
+ assertEquals("exception message,exception description,666,c d", e.toString());
+ }
+ }
+
public void testExceptionMA() throws Exception {
EndpointIface endpoint = getProxy();
try {
@@ -118,4 +172,14 @@
assertEquals("exception message,exception description,666,c d", e.toString());
}
}
+
+ public void testExtendedExceptionMA() throws Exception {
+ EndpointIface endpoint = getProxy();
+ try {
+ endpoint.throwExtendedExceptionMA();
+ fail("Expected exception not thrown");
+ } catch (ExtendedAdaptedExceptionMA e) {
+ assertEquals("exception message,exception description,666,c d", e.toString());
+ }
+ }
}
12 years, 4 months
JBossWS SVN: r16922 - shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-10-19 03:37:43 -0400 (Fri, 19 Oct 2012)
New Revision: 16922
Modified:
shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java
Log:
[AS7-5784] Fixing old testcase
Modified: shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java
===================================================================
--- shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java 2012-10-18 20:08:58 UTC (rev 16921)
+++ shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java 2012-10-19 07:37:43 UTC (rev 16922)
@@ -33,6 +33,7 @@
import org.jboss.ws.api.annotation.WebContext;
import javax.annotation.security.RolesAllowed;
+import javax.annotation.security.PermitAll;
import javax.ejb.Stateless;
@WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://org.jboss.ws/wsref")
@@ -47,6 +48,7 @@
secureWSDLAccess = false
)
@SecurityDomain("JBossWS")
+@PermitAll
public class EndpointImpl
{
// Provide logging
12 years, 4 months
JBossWS SVN: r16921 - shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-10-18 16:08:58 -0400 (Thu, 18 Oct 2012)
New Revision: 16921
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java
Log:
[AS7-5784] Fixing old testcase
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java 2012-10-18 16:43:04 UTC (rev 16920)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java 2012-10-18 20:08:58 UTC (rev 16921)
@@ -33,6 +33,7 @@
import org.jboss.ws.api.annotation.WebContext;
import javax.annotation.security.RolesAllowed;
+import javax.annotation.security.PermitAll;
import javax.ejb.Stateless;
@WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://org.jboss.ws/wsref")
@@ -47,6 +48,7 @@
secureWSDLAccess = false
)
@SecurityDomain("JBossWS")
+@PermitAll
public class EndpointImpl
{
// Provide logging
12 years, 4 months
JBossWS SVN: r16920 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-10-18 12:43:04 -0400 (Thu, 18 Oct 2012)
New Revision: 16920
Modified:
stack/cxf/trunk/pom.xml
Log:
Moving to shared testsuite snapshot
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2012-10-18 16:42:45 UTC (rev 16919)
+++ stack/cxf/trunk/pom.xml 2012-10-18 16:43:04 UTC (rev 16920)
@@ -63,7 +63,7 @@
<jbossws.spi.version>2.1.0.Final</jbossws.spi.version>
<jbossws.common.version>2.1.0.Final</jbossws.common.version>
<jbossws.common.tools.version>1.1.0.Final</jbossws.common.tools.version>
- <jbossws.shared.testsuite.version>4.1.0.Final</jbossws.shared.testsuite.version>
+ <jbossws.shared.testsuite.version>4.1.1-SNAPSHOT</jbossws.shared.testsuite.version>
<jbossws.jboss710.version>4.1.0.Final</jbossws.jboss710.version>
<jbossws.jboss711.version>4.1.0.Final</jbossws.jboss711.version>
<jbossws.jboss712.version>4.1.0.Final</jbossws.jboss712.version>
12 years, 4 months
JBossWS SVN: r16919 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-10-18 12:42:45 -0400 (Thu, 18 Oct 2012)
New Revision: 16919
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[AS7-5784] Excluding test
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2012-10-18 16:36:30 UTC (rev 16918)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2012-10-18 16:42:45 UTC (rev 16919)
@@ -690,6 +690,9 @@
<!--# [JBWS-3441] Support CDI interceptors for POJO JAX-WS services -->
<exclude>org/jboss/test/ws/jaxws/jbws3441/**</exclude>
+
+ <!--# [AS7-5784] WSIntegrationProcessorJAXWS_EJB does not process @PermitAll, @DeclareRoles and @RolesAllowed properly -->
+ <exclude>org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase*</exclude>
</excludes>
</configuration>
</plugin>
@@ -749,6 +752,9 @@
<!--# [JBWS-3441] Support CDI interceptors for POJO JAX-WS services -->
<exclude>org/jboss/test/ws/jaxws/jbws3441/**</exclude>
+
+ <!--# [AS7-5784] WSIntegrationProcessorJAXWS_EJB does not process @PermitAll, @DeclareRoles and @RolesAllowed properly -->
+ <exclude>org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase*</exclude>
</excludes>
</configuration>
</plugin>
@@ -807,6 +813,9 @@
<!--# [JBWS-3441] Support CDI interceptors for POJO JAX-WS services -->
<exclude>org/jboss/test/ws/jaxws/jbws3441/**</exclude>
+
+ <!--# [AS7-5784] WSIntegrationProcessorJAXWS_EJB does not process @PermitAll, @DeclareRoles and @RolesAllowed properly -->
+ <exclude>org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase*</exclude>
</excludes>
</configuration>
</plugin>
@@ -863,6 +872,9 @@
<!--# [JBWS-3441] Support CDI interceptors for POJO JAX-WS services -->
<exclude>org/jboss/test/ws/jaxws/jbws3441/**</exclude>
+
+ <!--# [AS7-5784] WSIntegrationProcessorJAXWS_EJB does not process @PermitAll, @DeclareRoles and @RolesAllowed properly -->
+ <exclude>org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase*</exclude>
</excludes>
</configuration>
</plugin>
12 years, 4 months
JBossWS SVN: r16918 - in shared-testsuite/trunk/testsuite/src/test: java/org/jboss/test/ws/jaxws/samples/securityDomain and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-10-18 12:36:30 -0400 (Thu, 18 Oct 2012)
New Revision: 16918
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint1Impl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint2Impl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/securityDomain/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/securityDomain/jbossws-roles.properties
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/securityDomain/jbossws-users.properties
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpoint.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java
Log:
* Improving @SecurityDomain testcase
* [AS7-5784] Adding testcase (PermitAllTestCase)
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml 2012-10-16 18:37:47 UTC (rev 16917)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml 2012-10-18 16:36:30 UTC (rev 16918)
@@ -273,6 +273,13 @@
</fileset>
</jar>
+ <!-- jaxws-samples-securityDomain-permitall -->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-samples-securityDomain-permitall.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint*Impl.class"/>
+ </fileset>
+ </jar>
+
<!-- jaxws-samples-serviceref -->
<war warfile="${tests.output.dir}/test-libs/jaxws-samples-serviceref.war" webxml="${tests.output.dir}/test-resources/jaxws/samples/serviceref/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint.java 2012-10-18 16:36:30 UTC (rev 16918)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.securityDomain;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+@WebService(name = "PermitAllSecureEndpoint", targetNamespace = "http://org.jboss.ws/securityDomain")
+@SOAPBinding(style = Style.RPC)
+public interface PermitAllSecureEndpoint
+{
+
+ @WebMethod
+ @WebResult(targetNamespace = "http://org.jboss.ws/securityDomain", partName = "return")
+ public String echo(@WebParam(name = "arg0", partName = "arg0") String arg0);
+}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint1Impl.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint1Impl.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint1Impl.java 2012-10-18 16:36:30 UTC (rev 16918)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.securityDomain;
+
+import javax.annotation.security.PermitAll;
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+import org.jboss.ejb3.annotation.SecurityDomain;
+import org.jboss.logging.Logger;
+import org.jboss.ws.api.annotation.AuthMethod;
+import org.jboss.ws.api.annotation.TransportGuarantee;
+import org.jboss.ws.api.annotation.WebContext;
+
+@Stateless(name = "PermitAllSecureEndpoint1")
+@SOAPBinding(style = Style.RPC)
+@WebService
+(
+ name = "PermitAllSecureEndpoint1",
+ serviceName = "PermitAllSecureEndpoint1Service",
+ targetNamespace = "http://org.jboss.ws/securityDomain"
+)
+@WebContext
+(
+ contextRoot="/jaxws-securityDomain-permitall",
+ urlPattern="/one",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
+@PermitAll
+@SecurityDomain("JBossWSSecurityDomainPermitAllTest")
+public class PermitAllSecureEndpoint1Impl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(PermitAllSecureEndpoint1Impl.class);
+
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info(input);
+ return input;
+ }
+}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint2Impl.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint2Impl.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllSecureEndpoint2Impl.java 2012-10-18 16:36:30 UTC (rev 16918)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.securityDomain;
+
+import javax.annotation.security.PermitAll;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+import org.jboss.ejb3.annotation.SecurityDomain;
+import org.jboss.logging.Logger;
+import org.jboss.ws.api.annotation.AuthMethod;
+import org.jboss.ws.api.annotation.TransportGuarantee;
+import org.jboss.ws.api.annotation.WebContext;
+
+@Stateless(name = "PermitAllSecureEndpoint2")
+@SOAPBinding(style = Style.RPC)
+@WebService
+(
+ name = "PermitAllSecureEndpoint2",
+ serviceName = "PermitAllSecureEndpoint2Service",
+ targetNamespace = "http://org.jboss.ws/securityDomain"
+)
+@WebContext
+(
+ contextRoot="/jaxws-securityDomain-permitall",
+ urlPattern="/two",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
+@PermitAll
+@SecurityDomain("JBossWSSecurityDomainPermitAllTest")
+public class PermitAllSecureEndpoint2Impl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(PermitAllSecureEndpoint2Impl.class);
+
+ @WebMethod
+ @RolesAllowed("friend")
+ public String echo(String input)
+ {
+ log.info(input);
+ return input;
+ }
+}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java 2012-10-18 16:36:30 UTC (rev 16918)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.securityDomain;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test secure EJB3 endpoints using @SecurityDomain and @PermitAll, @RolesAllowed annotations.
+ *
+ * The security domain the application is associated with comes with a UsersRolesLoginModule and has the following users:
+ *
+ * username password roles
+ * --------- ----------- -----------------
+ * bob foo user
+ * john bar user,friend
+ * kate theprincess user,friend,royal
+ *
+ *
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class PermitAllTestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS_1 = "http://" + getServerHost() + ":8080/jaxws-securityDomain-permitall/one";
+ public final String TARGET_ENDPOINT_ADDRESS_2 = "http://" + getServerHost() + ":8080/jaxws-securityDomain-permitall/two";
+
+ public static Test suite()
+ {
+ JBossWSTestSetup testSetup = new JBossWSTestSetup(PermitAllTestCase.class, "jaxws-samples-securityDomain-permitall.jar");
+ Map<String, String> authenticationOptions = new HashMap<String, String>();
+ authenticationOptions.put("usersProperties",
+ getResourceFile("jaxws/samples/securityDomain/jbossws-users.properties").getAbsolutePath());
+ authenticationOptions.put("rolesProperties",
+ getResourceFile("jaxws/samples/securityDomain/jbossws-roles.properties").getAbsolutePath());
+ testSetup.addSecurityDomainRequirement("JBossWSSecurityDomainPermitAllTest", authenticationOptions);
+ return testSetup;
+ }
+
+ public void testPortOne() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS_1 + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/securityDomain", "PermitAllSecureEndpoint1Service");
+ QName portName = new QName("http://org.jboss.ws/securityDomain", "PermitAllSecureEndpoint1Port");
+ PermitAllSecureEndpoint port = Service.create(wsdlURL, serviceName).getPort(portName, PermitAllSecureEndpoint.class);
+
+ try {
+ port.echo("Hello");
+ fail("Authentication exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue(e.getCause().getMessage().contains("401: Unauthorized"));
+ }
+
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "bob");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "foo");
+ assertEquals("Hello", port.echo("Hello"));
+
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "john");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "bar");
+ assertEquals("Hello", port.echo("Hello"));
+ }
+
+ public void testPortTwo() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS_2 + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/securityDomain", "PermitAllSecureEndpoint2Service");
+ QName portName = new QName("http://org.jboss.ws/securityDomain", "PermitAllSecureEndpoint2Port");
+ PermitAllSecureEndpoint port = Service.create(wsdlURL, serviceName).getPort(portName, PermitAllSecureEndpoint.class);
+
+ try {
+ port.echo("Hello");
+ fail("Authentication exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue(e.getCause().getMessage().contains("401: Unauthorized"));
+ }
+
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "bob");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "foo");
+ try {
+ port.echo("Hello");
+ fail("Authorization exception expected!");
+ } catch (Exception e) {
+ //expected EJB3 layer authorization exception
+ assertTrue(e.getMessage().contains("not allowed"));
+ }
+
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "john");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "bar");
+ assertEquals("Hello", port.echo("Hello"));
+ }
+}
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpoint.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpoint.java 2012-10-16 18:37:47 UTC (rev 16917)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpoint.java 2012-10-18 16:36:30 UTC (rev 16918)
@@ -35,6 +35,14 @@
@WebMethod
@WebResult(targetNamespace = "http://org.jboss.ws/securityDomain", partName = "return")
+ public String echoForAll(@WebParam(name = "arg0", partName = "arg0") String arg0);
+
+ @WebMethod
+ @WebResult(targetNamespace = "http://org.jboss.ws/securityDomain", partName = "return")
public String echo(@WebParam(name = "arg0", partName = "arg0") String arg0);
+ @WebMethod
+ @WebResult(targetNamespace = "http://org.jboss.ws/securityDomain", partName = "return")
+ public String restrictedEcho(@WebParam(name = "arg0", partName = "arg0") String arg0);
+
}
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl.java 2012-10-16 18:37:47 UTC (rev 16917)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl.java 2012-10-18 16:36:30 UTC (rev 16918)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -21,7 +21,9 @@
*/
package org.jboss.test.ws.jaxws.samples.securityDomain;
+import javax.annotation.security.DeclareRoles;
import javax.annotation.security.RolesAllowed;
+import javax.annotation.security.PermitAll;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebService;
@@ -45,22 +47,39 @@
@WebContext
(
contextRoot="/jaxws-securityDomain",
- urlPattern="/*",
+ urlPattern="/authz",
authMethod = AuthMethod.BASIC,
transportGuarantee = TransportGuarantee.NONE,
secureWSDLAccess = false
)
-@SecurityDomain("JBossWS")
-@RolesAllowed("friend")
+@DeclareRoles({"friend", "royal"})
+@SecurityDomain("JBossWSSecurityDomainTest")
public class SecureEndpointImpl
{
// Provide logging
private static Logger log = Logger.getLogger(SecureEndpointImpl.class);
+ @PermitAll
@WebMethod
+ public String echoForAll(String input)
+ {
+ log.info(input);
+ return input;
+ }
+
+ @RolesAllowed("friend")
+ @WebMethod
public String echo(String input)
{
log.info(input);
return input;
}
+
+ @RolesAllowed("royal")
+ @WebMethod
+ public String restrictedEcho(String input)
+ {
+ log.info(input);
+ return input;
+ }
}
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java 2012-10-16 18:37:47 UTC (rev 16917)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java 2012-10-18 16:36:30 UTC (rev 16918)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -22,12 +22,12 @@
package org.jboss.test.ws.jaxws.samples.securityDomain;
import java.net.URL;
+import java.util.HashMap;
import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceException;
import junit.framework.Test;
@@ -35,53 +35,134 @@
import org.jboss.wsf.test.JBossWSTestSetup;
/**
- * Secure endpoint using
+ * Test secure EJB3 endpoints using @SecurityDomain and @RolesAllowed, @DeclaredRoles annotations.
*
- * @SecurityDomain
+ * The security domain the application is associated with comes with a UsersRolesLoginModule and has the following users:
*
+ * username password roles
+ * --------- ----------- -----------------
+ * bob foo user
+ * john bar user,friend
+ * kate theprincess user,friend,royal
+ *
+ *
* @author alessio.soldano(a)jboss.com
* @author <a href="mailto:richard.opalka@jboss.org">Richard Opalka</a>
*/
public class SecurityDomainTestCase extends JBossWSTest
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-securityDomain";
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-securityDomain/authz";
public static Test suite()
{
- return new JBossWSTestSetup(SecurityDomainTestCase.class, "jaxws-samples-securityDomain.jar", true);
+ JBossWSTestSetup testSetup = new JBossWSTestSetup(SecurityDomainTestCase.class, "jaxws-samples-securityDomain.jar");
+ Map<String, String> authenticationOptions = new HashMap<String, String>();
+ authenticationOptions.put("usersProperties",
+ getResourceFile("jaxws/samples/securityDomain/jbossws-users.properties").getAbsolutePath());
+ authenticationOptions.put("rolesProperties",
+ getResourceFile("jaxws/samples/securityDomain/jbossws-roles.properties").getAbsolutePath());
+ testSetup.addSecurityDomainRequirement("JBossWSSecurityDomainTest", authenticationOptions);
+ return testSetup;
}
- private SecureEndpoint getPort() throws Exception
+ private SecureEndpoint getAuthzPort() throws Exception
{
URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
QName serviceName = new QName("http://org.jboss.ws/securityDomain", "SecureEndpointService");
- SecureEndpoint port = Service.create(wsdlURL, serviceName).getPort(SecureEndpoint.class);
- return port;
+ return Service.create(wsdlURL, serviceName).getPort(SecureEndpoint.class);
}
- public void testNegative() throws Exception
+ public void testAuthorizedAccess() throws Exception
{
- SecureEndpoint port = getPort();
- try
- {
+ SecureEndpoint port = getAuthzPort();
+
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "john");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "bar");
+ assertEquals("Hello", port.echoForAll("Hello"));
+ assertEquals("Hello", port.echo("Hello"));
+
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kate");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "theprincess");
+ assertEquals("Greetings", port.echoForAll("Greetings"));
+ assertEquals("Greetings", port.echo("Greetings"));
+ assertEquals("Greetings", port.restrictedEcho("Greetings"));
+ }
+
+ public void testUndeclaredRole() throws Exception
+ {
+ SecureEndpoint port = getAuthzPort();
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "bob");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "foo");
+ try {
+ port.echoForAll("Hello");
+ fail("Authorization exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue(e.getCause().getMessage().contains("403: Forbidden"));
+ }
+ try {
port.echo("Hello");
- fail("Expected: Invalid HTTP server response [401] - Unauthorized");
+ fail("Authorization exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue(e.getCause().getMessage().contains("403: Forbidden"));
}
- catch (WebServiceException ex)
- {
- // all good
+ try {
+ port.restrictedEcho("Hello");
+ fail("Authorization exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue(e.getCause().getMessage().contains("403: Forbidden"));
}
}
-
- public void testPositive() throws Exception
+
+ public void testUnauthenticated() throws Exception
{
- SecureEndpoint port = getPort();
-
- Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
- reqContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- reqContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
-
- String retObj = port.echo("Hello");
- assertEquals("Hello", retObj);
+ SecureEndpoint port = getAuthzPort();
+
+ try {
+ port.echoForAll("Hello");
+ fail("Authentication exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue(e.getCause().getMessage().contains("401: Unauthorized"));
+ }
+
+ try {
+ port.echo("Hello");
+ fail("Authentication exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue(e.getCause().getMessage().contains("401: Unauthorized"));
+ }
+
+ try {
+ port.restrictedEcho("Hello");
+ fail("Authentication exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue(e.getCause().getMessage().contains("401: Unauthorized"));
+ }
}
+
+ public void testUnauthorized() throws Exception
+ {
+ SecureEndpoint port = getAuthzPort();
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "john");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "bar");
+ try {
+ port.restrictedEcho("Hello");
+ fail("Authorization exception expected!");
+ } catch (Exception e) {
+ //expected EJB3 layer authorization exception
+ assertTrue(e.getMessage().contains("not allowed"));
+ }
+ }
+
}
Added: shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/securityDomain/jbossws-roles.properties
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/securityDomain/jbossws-roles.properties (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/securityDomain/jbossws-roles.properties 2012-10-18 16:36:30 UTC (rev 16918)
@@ -0,0 +1,4 @@
+# A sample roles.properties file for use with the UsersRolesLoginModule
+bob=user
+john=user,friend
+kate=user,friend,royal
\ No newline at end of file
Added: shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/securityDomain/jbossws-users.properties
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/securityDomain/jbossws-users.properties (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/securityDomain/jbossws-users.properties 2012-10-18 16:36:30 UTC (rev 16918)
@@ -0,0 +1,4 @@
+# A sample users.properties file for use with the UsersRolesLoginModule
+bob=foo
+john=bar
+kate=theprincess
\ No newline at end of file
12 years, 4 months