You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2014/07/15 23:55:19 UTC
svn commit: r1610862 [43/44] - in /tomee/tomee/trunk/itests: ./ failover-ejb/
failover-ejb/src/main/java/org/apache/openejb/itest/failover/ejb/ failover/
failover/src/main/java/org/apache/openejb/itest/failover/
failover/src/main/java/org/apache/openej...
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessSetterInjectionTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessSetterInjectionTests.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessSetterInjectionTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessSetterInjectionTests.java Tue Jul 15 21:55:09 2014
@@ -22,21 +22,20 @@ import org.apache.openejb.test.TestFailu
/**
* [4] Should be run as the fourth test suite of the StatefulTestClients
- *
*/
public class StatelessSetterInjectionTests extends StatefulTestClient {
- protected EncStatelessHome ejbHome;
+ protected EncStatelessHome ejbHome;
protected EncStatelessObject ejbObject;
- public StatelessSetterInjectionTests(){
+ public StatelessSetterInjectionTests() {
super("SetterInjection.");
}
- protected void setUp() throws Exception{
+ protected void setUp() throws Exception {
super.setUp();
- Object obj = initialContext.lookup("client/tests/stateless/SetterInjectionStatelessBean");
- ejbHome = (EncStatelessHome)javax.rmi.PortableRemoteObject.narrow( obj, EncStatelessHome.class);
+ final Object obj = initialContext.lookup("client/tests/stateless/SetterInjectionStatelessBean");
+ ejbHome = (EncStatelessHome) javax.rmi.PortableRemoteObject.narrow(obj, EncStatelessHome.class);
ejbObject = ejbHome.create();
/*[2] Create database table */
@@ -51,7 +50,7 @@ public class StatelessSetterInjectionTes
try {
/*[1] Drop database table */
TestManager.getDatabase().dropEntityTable();
- } catch (Exception e){
+ } catch (final Exception e) {
throw e;
} finally {
super.tearDown();
@@ -59,232 +58,232 @@ public class StatelessSetterInjectionTes
}
public void test01_lookupStringEntry() {
- try{
+ try {
ejbObject.lookupStringEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test02_lookupDoubleEntry() {
- try{
+ try {
ejbObject.lookupDoubleEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test03_lookupLongEntry() {
- try{
+ try {
ejbObject.lookupLongEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test04_lookupFloatEntry() {
- try{
+ try {
ejbObject.lookupFloatEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test05_lookupIntegerEntry() {
- try{
+ try {
ejbObject.lookupIntegerEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test06_lookupShortEntry() {
- try{
+ try {
ejbObject.lookupShortEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test07_lookupBooleanEntry() {
- try{
+ try {
ejbObject.lookupBooleanEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test08_lookupByteEntry() {
- try{
+ try {
ejbObject.lookupByteEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test09_lookupCharacterEntry() {
- try{
+ try {
ejbObject.lookupCharacterEntry();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test10_lookupEntityBean() {
- try{
+ try {
ejbObject.lookupEntityBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test11_lookupStatefulBean() {
- try{
+ try {
ejbObject.lookupStatefulBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test12_lookupStatelessBean() {
- try{
+ try {
ejbObject.lookupStatelessBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test13_lookupResource() {
- try{
+ try {
ejbObject.lookupResource();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test14_lookupPersistenceUnit() {
- try{
+ try {
ejbObject.lookupPersistenceUnit();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test15_lookupPersistenceContext() {
- try{
+ try {
ejbObject.lookupPersistenceContext();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test18_lookupSessionContext() {
- try{
+ try {
ejbObject.lookupSessionContext();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test19_lookupStatelessBusinessLocal() {
- try{
+ try {
ejbObject.lookupStatelessBusinessLocal();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test20_lookupStatelessBusinessRemote() {
- try{
+ try {
ejbObject.lookupStatelessBusinessRemote();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test21_lookupStatefulBusinessLocal() {
- try{
+ try {
ejbObject.lookupStatefulBusinessLocal();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test22_lookupStatefulBusinessRemote() {
- try{
+ try {
ejbObject.lookupStatefulBusinessRemote();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test23_lookupJMSConnectionFactory() {
- try{
+ try {
ejbObject.lookupJMSConnectionFactory();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test24_lookupStatelessLocalBean() {
- try{
+ try {
ejbObject.lookupStatelessBusinessLocalBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
public void test25_lookupStatefulLocalBean() {
- try{
+ try {
ejbObject.lookupStatelessBusinessLocalBean();
- } catch (TestFailureException e){
+ } catch (final TestFailureException e) {
throw e.error;
- } catch (Exception e){
- fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ } catch (final Exception e) {
+ fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
}
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestClient.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestClient.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestClient.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestClient.java Tue Jul 15 21:55:09 2014
@@ -24,7 +24,7 @@ import java.util.Properties;
public abstract class StatelessTestClient extends TestClient {
- public StatelessTestClient(String name) {
+ public StatelessTestClient(final String name) {
super("Stateless." + name);
}
@@ -34,7 +34,7 @@ public abstract class StatelessTestClien
*/
protected void setUp() throws Exception {
- Properties properties = TestManager.getServer().getContextEnvironment();
+ final Properties properties = TestManager.getServer().getContextEnvironment();
//properties.put(Context.SECURITY_PRINCIPAL, "STATELESS_test00_CLIENT");
//properties.put(Context.SECURITY_CREDENTIALS, toString() );
initialContext = new InitialContext(properties);
Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestSuite.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestSuite.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestSuite.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessTestSuite.java Tue Jul 15 21:55:09 2014
@@ -24,13 +24,13 @@ import org.apache.openejb.test.FilteredT
*/
public class StatelessTestSuite extends junit.framework.TestCase {
- public StatelessTestSuite(String name) {
+ public StatelessTestSuite(final String name) {
super(name);
}
public static junit.framework.Test suite() {
- TestSuite suite = new FilteredTestSuite();
+ final TestSuite suite = new FilteredTestSuite();
suite.addTest(new StatelessJndiTests());
suite.addTest(new StatelessPojoRemoteJndiTests());
Modified: tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/pom.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/pom.xml?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/pom.xml (original)
+++ tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/pom.xml Tue Jul 15 21:55:09 2014
@@ -19,7 +19,8 @@
<!-- $Rev$ $Date$ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.openejb</groupId>
Modified: tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/SecondStatefulInterceptedBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/SecondStatefulInterceptedBean.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/SecondStatefulInterceptedBean.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/SecondStatefulInterceptedBean.java Tue Jul 15 21:55:09 2014
@@ -38,17 +38,17 @@ import org.apache.openejb.test.intercept
/**
* @version $Rev$ $Date$
*/
-@Stateful(name="SecondStatefulIntercepted")
+@Stateful(name = "SecondStatefulIntercepted")
@Interceptors({ClassInterceptor.class, SecondClassInterceptor.class})
-public class SecondStatefulInterceptedBean extends SuperInterceptedBean
- implements BasicStatefulInterceptedLocal, BasicStatefulInterceptedRemote {
-
- private static Map<String, Object> contextData = new HashMap<String, Object>();
+public class SecondStatefulInterceptedBean extends SuperInterceptedBean
+ implements BasicStatefulInterceptedLocal, BasicStatefulInterceptedRemote {
+
+ private static Map<String, Object> contextData = new HashMap<String, Object>();
/**
* A simple dummy business method to concat 2 strings
*/
- public String concat(String str1, String str2) {
+ public String concat(final String str1, final String str2) {
return str1.concat(str2);
}
@@ -56,14 +56,14 @@ public class SecondStatefulInterceptedBe
* A simple dummy busines method to reverse a string
*/
@Interceptors({MethodInterceptor.class})
- public String reverse(String str) {
- StringBuffer b = new StringBuffer(str);
+ public String reverse(final String str) {
+ final StringBuffer b = new StringBuffer(str);
return b.reverse().toString();
}
-
+
/**
* <code>ClassInterceptor</code> should not intercept this.
- *
+ *
* @return the contextData
*/
@ExcludeClassInterceptors
@@ -74,80 +74,77 @@ public class SecondStatefulInterceptedBe
/**
* @param ctxData the contextData to set
*/
- private void setContextData(Map<String, Object> ctxData) {
+ private void setContextData(final Map<String, Object> ctxData) {
SecondStatefulInterceptedBean.contextData.putAll(ctxData);
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept all business methods in this bean class.
* It cannot exclude even those annotated with <code>@ExcludeClassInterceptors</code>
- *
+ *
* @param ctx - InvocationContext
- *
- * @return - the result of the next method invoked. If a method returns void, proceed returns null.
- * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
- * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
+ * @return - the result of the next method invoked. If a method returns void, proceed returns null.
+ * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
+ * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
* If there is more than one such interceptor method, the invocation of proceed causes the container to execute those methods in order.
- *
* @throws Exception runtime exceptions or application exceptions that are allowed in the throws clause of the business method.
*/
@AroundInvoke
- public Object inBeanInterceptor(InvocationContext ctx) throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
+ public Object inBeanInterceptor(final InvocationContext ctx) throws Exception {
+ final Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
setContextData(ctxData);
return ctx.proceed();
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postConstruct of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostConstruct
public void inBeanInterceptorPostConstruct() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
setContextData(ctxData);
}
-
-
+
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postActivate of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostActivate
public void inBeanInterceptorPostActivate() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostActivate");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostActivate");
setContextData(ctxData);
}
-
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept prePassivate of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PrePassivate
public void inBeanInterceptorPrePassivate() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, Thread.currentThread().getStackTrace()[4].getMethodName());
+ final Map<String, Object> ctxData = Interceptor.profile(this, Thread.currentThread().getStackTrace()[4].getMethodName());
setContextData(ctxData);
}
-
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept preDestroy of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PreDestroy
public void inBeanInterceptorPreDestroy() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, Thread.currentThread().getStackTrace()[4].getMethodName());
+ final Map<String, Object> ctxData = Interceptor.profile(this, Thread.currentThread().getStackTrace()[4].getMethodName());
setContextData(ctxData);
}
-
-
+
}
Modified: tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/StatefulInterceptedBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/StatefulInterceptedBean.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/StatefulInterceptedBean.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/StatefulInterceptedBean.java Tue Jul 15 21:55:09 2014
@@ -38,17 +38,17 @@ import org.apache.openejb.test.intercept
/**
* @version $Rev$ $Date$
*/
-@Stateful(name="StatefulIntercepted")
+@Stateful(name = "StatefulIntercepted")
@Interceptors({ClassInterceptor.class})
-public class StatefulInterceptedBean extends SuperInterceptedBean
- implements BasicStatefulInterceptedLocal, BasicStatefulInterceptedRemote {
-
- private static Map<String, Object> contextData = new HashMap<String, Object>();
+public class StatefulInterceptedBean extends SuperInterceptedBean
+ implements BasicStatefulInterceptedLocal, BasicStatefulInterceptedRemote {
+
+ private static Map<String, Object> contextData = new HashMap<String, Object>();
/**
* A simple dummy business method to concat 2 strings
*/
- public String concat(String str1, String str2) {
+ public String concat(final String str1, final String str2) {
return str1.concat(str2);
}
@@ -56,14 +56,14 @@ public class StatefulInterceptedBean ext
* A simple dummy busines method to reverse a string
*/
@Interceptors({MethodInterceptor.class})
- public String reverse(String str) {
- StringBuffer b = new StringBuffer(str);
+ public String reverse(final String str) {
+ final StringBuffer b = new StringBuffer(str);
return b.reverse().toString();
}
-
+
/**
* <code>ClassInterceptor</code> should not intercept this.
- *
+ *
* @return the contextData
*/
@ExcludeDefaultInterceptors
@@ -75,81 +75,78 @@ public class StatefulInterceptedBean ext
/**
* @param ctxData the contextData to set
*/
- private void setContextData(Map<String, Object> ctxData) {
+ private void setContextData(final Map<String, Object> ctxData) {
StatefulInterceptedBean.contextData.putAll(ctxData);
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept all business methods in this bean class.
* It cannot exclude even those annotated with <code>@ExcludeClassInterceptors</code>
- *
+ *
* @param ctx - InvocationContext
- *
- * @return - the result of the next method invoked. If a method returns void, proceed returns null.
- * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
- * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
+ * @return - the result of the next method invoked. If a method returns void, proceed returns null.
+ * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
+ * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
* If there is more than one such interceptor method, the invocation of proceed causes the container to execute those methods in order.
- *
* @throws Exception runtime exceptions or application exceptions that are allowed in the throws clause of the business method.
*/
@AroundInvoke
- public Object inBeanInterceptor(InvocationContext ctx) throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
+ public Object inBeanInterceptor(final InvocationContext ctx) throws Exception {
+ final Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
setContextData(ctxData);
-
+
return ctx.proceed();
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postConstruct of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostConstruct
public void inBeanInterceptorPostConstruct() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
setContextData(ctxData);
}
-
-
+
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postActivate of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostActivate
public void inBeanInterceptorPostActivate() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostActivate");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostActivate");
setContextData(ctxData);
}
-
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept prePassivate of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PrePassivate
public void inBeanInterceptorPrePassivate() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPrePassivate");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPrePassivate");
setContextData(ctxData);
}
-
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept preDestroy of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PreDestroy
public void inBeanInterceptorPreDestroy() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
setContextData(ctxData);
}
-
-
+
}
Modified: tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/ThirdStatefulInterceptedBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/ThirdStatefulInterceptedBean.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/ThirdStatefulInterceptedBean.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateful/ThirdStatefulInterceptedBean.java Tue Jul 15 21:55:09 2014
@@ -38,17 +38,17 @@ import org.apache.openejb.test.intercept
/**
* @version $Rev$ $Date$
*/
-@Stateful(name="ThirdStatefulIntercepted")
+@Stateful(name = "ThirdStatefulIntercepted")
@Interceptors({ClassInterceptor.class, SecondClassInterceptor.class})
-public class ThirdStatefulInterceptedBean extends SuperInterceptedBean
- implements BasicStatefulInterceptedLocal, BasicStatefulInterceptedRemote {
-
- private static Map<String, Object> contextData = new HashMap<String, Object>();
+public class ThirdStatefulInterceptedBean extends SuperInterceptedBean
+ implements BasicStatefulInterceptedLocal, BasicStatefulInterceptedRemote {
+
+ private static Map<String, Object> contextData = new HashMap<String, Object>();
/**
* A simple dummy business method to concat 2 strings
*/
- public String concat(String str1, String str2) {
+ public String concat(final String str1, final String str2) {
return str1.concat(str2);
}
@@ -56,14 +56,14 @@ public class ThirdStatefulInterceptedBea
* A simple dummy busines method to reverse a string
*/
@Interceptors({MethodInterceptor.class})
- public String reverse(String str) {
- StringBuffer b = new StringBuffer(str);
+ public String reverse(final String str) {
+ final StringBuffer b = new StringBuffer(str);
return b.reverse().toString();
}
-
+
/**
* <code>ClassInterceptor</code> should not intercept this.
- *
+ *
* @return the contextData
*/
@ExcludeClassInterceptors
@@ -74,80 +74,77 @@ public class ThirdStatefulInterceptedBea
/**
* @param ctxData the contextData to set
*/
- private void setContextData(Map<String, Object> ctxData) {
+ private void setContextData(final Map<String, Object> ctxData) {
ThirdStatefulInterceptedBean.contextData.putAll(ctxData);
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept all business methods in this bean class.
* It cannot exclude even those annotated with <code>@ExcludeClassInterceptors</code>
- *
+ *
* @param ctx - InvocationContext
- *
- * @return - the result of the next method invoked. If a method returns void, proceed returns null.
- * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
- * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
+ * @return - the result of the next method invoked. If a method returns void, proceed returns null.
+ * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
+ * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
* If there is more than one such interceptor method, the invocation of proceed causes the container to execute those methods in order.
- *
* @throws Exception runtime exceptions or application exceptions that are allowed in the throws clause of the business method.
*/
@AroundInvoke
- public Object inBeanInterceptor(InvocationContext ctx) throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
+ public Object inBeanInterceptor(final InvocationContext ctx) throws Exception {
+ final Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
setContextData(ctxData);
return ctx.proceed();
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postConstruct of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostConstruct
public void inBeanInterceptorPostConstruct() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
setContextData(ctxData);
}
-
-
+
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postActivate of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostActivate
public void inBeanInterceptorPostActivate() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostActivate");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostActivate");
setContextData(ctxData);
}
-
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept prePassivate of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PrePassivate
public void inBeanInterceptorPrePassivate() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPrePassivate");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPrePassivate");
setContextData(ctxData);
}
-
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept preDestroy of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PreDestroy
public void inBeanInterceptorPreDestroy() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
setContextData(ctxData);
}
-
-
+
}
Modified: tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/SecondStatelessInterceptedBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/SecondStatelessInterceptedBean.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/SecondStatelessInterceptedBean.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/SecondStatelessInterceptedBean.java Tue Jul 15 21:55:09 2014
@@ -37,18 +37,18 @@ import org.apache.openejb.test.intercept
/**
* @version $Rev$ $Date$
*/
-@Stateless(name="SecondStatelessIntercepted")
+@Stateless(name = "SecondStatelessIntercepted")
@Interceptors({ClassInterceptor.class, SecondClassInterceptor.class})
@ExcludeDefaultInterceptors
-public class SecondStatelessInterceptedBean extends SuperInterceptedBean
- implements BasicStatelessInterceptedLocal, BasicStatelessInterceptedRemote {
-
+public class SecondStatelessInterceptedBean extends SuperInterceptedBean
+ implements BasicStatelessInterceptedLocal, BasicStatelessInterceptedRemote {
+
private static Map<String, Object> contextData = new LinkedHashMap<String, Object>();
/**
* A simple dummy business method to concat 2 strings
*/
- public String concat(String str1, String str2) {
+ public String concat(final String str1, final String str2) {
return str1.concat(str2);
}
@@ -56,21 +56,21 @@ public class SecondStatelessInterceptedB
* A simple dummy busines method to reverse a string
*/
@Interceptors({MethodInterceptor.class})
- public String reverse(String str) {
- StringBuffer b = new StringBuffer(str);
+ public String reverse(final String str) {
+ final StringBuffer b = new StringBuffer(str);
return b.reverse().toString();
}
-
+
/**
* @param ctxData the contextData to set
*/
- private void setContextData(Map<String, Object> ctxData) {
+ private void setContextData(final Map<String, Object> ctxData) {
SecondStatelessInterceptedBean.contextData.putAll(ctxData);
}
/**
* <code>ClassInterceptor</code> should not intercept this.
- *
+ *
* @return the contextData
*/
@ExcludeClassInterceptors
@@ -79,49 +79,47 @@ public class SecondStatelessInterceptedB
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept all business methods in this bean class.
* It cannot exclude even those annotated with <code>@ExcludeClassInterceptors</code>
- *
+ *
* @param ctx - InvocationContext
- *
- * @return - the result of the next method invoked. If a method returns void, proceed returns null.
- * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
- * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
+ * @return - the result of the next method invoked. If a method returns void, proceed returns null.
+ * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
+ * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
* If there is more than one such interceptor method, the invocation of proceed causes the container to execute those methods in order.
- *
* @throws Exception runtime exceptions or application exceptions that are allowed in the throws clause of the business method.
*/
@AroundInvoke
- public Object inBeanInterceptor(InvocationContext ctx) throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
+ public Object inBeanInterceptor(final InvocationContext ctx) throws Exception {
+ final Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
setContextData(ctxData);
-
+
return ctx.proceed();
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postConstruct of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostConstruct
public void inBeanInterceptorPostConstruct() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
setContextData(ctxData);
}
-
-
+
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept preDestroy of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PreDestroy
public void inBeanInterceptorPreDestroy() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
setContextData(ctxData);
}
Modified: tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/StatelessInterceptedBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/StatelessInterceptedBean.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/StatelessInterceptedBean.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/StatelessInterceptedBean.java Tue Jul 15 21:55:09 2014
@@ -36,44 +36,46 @@ import org.apache.openejb.test.intercept
/**
* @version $Rev$ $Date$
*/
-@Stateless(name="StatelessIntercepted")
+@Stateless(name = "StatelessIntercepted")
@Interceptors({ClassInterceptor.class})
-public class StatelessInterceptedBean extends SuperInterceptedBean
- implements BasicStatelessInterceptedLocal, BasicStatelessInterceptedRemote {
-
+public class StatelessInterceptedBean extends SuperInterceptedBean
+ implements BasicStatelessInterceptedLocal, BasicStatelessInterceptedRemote {
+
private static Map<String, Object> contextData = new LinkedHashMap<String, Object>();
/**
* A simple dummy business method to concat 2 strings
+ *
* @see org.apache.openejb.test.stateless.BasicStatelessInterceptedLocal#concat(java.lang.String, java.lang.String)
*/
- public String concat(String str1, String str2) {
+ public String concat(final String str1, final String str2) {
return str1.concat(str2);
}
/**
* A simple dummy busines method to reverse a string
+ *
* @see org.apache.openejb.test.stateless.BasicStatelessInterceptedLocal#reverse(java.lang.String)
*/
@Interceptors({MethodInterceptor.class})
- public String reverse(String str) {
+ public String reverse(final String str) {
if (str.length() > 0) {
throw new NullPointerException();
}
- StringBuffer b = new StringBuffer(str);
+ final StringBuffer b = new StringBuffer(str);
return b.reverse().toString();
}
-
+
/**
* @param ctxData the contextData to set
*/
- private void setContextData(Map<String, Object> ctxData) {
+ private void setContextData(final Map<String, Object> ctxData) {
StatelessInterceptedBean.contextData.putAll(ctxData);
}
/**
* <code>ClassInterceptor</code> should not intercept this.
- *
+ *
* @return the contextData
*/
@ExcludeDefaultInterceptors
@@ -83,49 +85,47 @@ public class StatelessInterceptedBean ex
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept all business methods in this bean class.
* It cannot exclude even those annotated with <code>@ExcludeClassInterceptors</code>
- *
+ *
* @param ctx - InvocationContext
- *
- * @return - the result of the next method invoked. If a method returns void, proceed returns null.
- * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
- * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
+ * @return - the result of the next method invoked. If a method returns void, proceed returns null.
+ * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
+ * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
* If there is more than one such interceptor method, the invocation of proceed causes the container to execute those methods in order.
- *
* @throws Exception runtime exceptions or application exceptions that are allowed in the throws clause of the business method.
*/
@AroundInvoke
- public Object inBeanInterceptor(InvocationContext ctx) throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
+ public Object inBeanInterceptor(final InvocationContext ctx) throws Exception {
+ final Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
setContextData(ctxData);
-
+
return ctx.proceed();
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postConstruct of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostConstruct
public void inBeanInterceptorPostConstruct() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
setContextData(ctxData);
}
-
-
+
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept preDestroy of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PreDestroy
public void inBeanInterceptorPreDestroy() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
setContextData(ctxData);
}
Modified: tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/ThirdStatelessInterceptedBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/ThirdStatelessInterceptedBean.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/ThirdStatelessInterceptedBean.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/java/org/apache/openejb/test/stateless/ThirdStatelessInterceptedBean.java Tue Jul 15 21:55:09 2014
@@ -36,41 +36,43 @@ import org.apache.openejb.test.intercept
/**
* @version $Rev$ $Date$
*/
-@Stateless(name="ThirdStatelessIntercepted")
+@Stateless(name = "ThirdStatelessIntercepted")
@Interceptors({ClassInterceptor.class, SecondClassInterceptor.class})
-public class ThirdStatelessInterceptedBean extends SuperInterceptedBean
- implements BasicStatelessInterceptedLocal, BasicStatelessInterceptedRemote {
-
+public class ThirdStatelessInterceptedBean extends SuperInterceptedBean
+ implements BasicStatelessInterceptedLocal, BasicStatelessInterceptedRemote {
+
private static Map<String, Object> contextData = new LinkedHashMap<String, Object>();
/**
* A simple dummy business method to concat 2 strings
+ *
* @see org.apache.openejb.test.stateless.BasicStatelessInterceptedLocal#concat(java.lang.String, java.lang.String)
*/
- public String concat(String str1, String str2) {
+ public String concat(final String str1, final String str2) {
return str1.concat(str2);
}
/**
* A simple dummy busines method to reverse a string
+ *
* @see org.apache.openejb.test.stateless.BasicStatelessInterceptedLocal#reverse(java.lang.String)
*/
@Interceptors({MethodInterceptor.class})
- public String reverse(String str) {
- StringBuffer b = new StringBuffer(str);
+ public String reverse(final String str) {
+ final StringBuffer b = new StringBuffer(str);
return b.reverse().toString();
}
-
+
/**
* @param ctxData the contextData to set
*/
- private void setContextData(Map<String, Object> ctxData) {
+ private void setContextData(final Map<String, Object> ctxData) {
ThirdStatelessInterceptedBean.contextData.putAll(ctxData);
}
/**
* <code>ClassInterceptor</code> should not intercept this.
- *
+ *
* @return the contextData
*/
@ExcludeClassInterceptors
@@ -79,49 +81,47 @@ public class ThirdStatelessInterceptedBe
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept all business methods in this bean class.
* It cannot exclude even those annotated with <code>@ExcludeClassInterceptors</code>
- *
+ *
* @param ctx - InvocationContext
- *
- * @return - the result of the next method invoked. If a method returns void, proceed returns null.
- * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
- * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
+ * @return - the result of the next method invoked. If a method returns void, proceed returns null.
+ * For lifecycle callback interceptor methods, if there is no callback method defined on the bean class,
+ * the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.
* If there is more than one such interceptor method, the invocation of proceed causes the container to execute those methods in order.
- *
* @throws Exception runtime exceptions or application exceptions that are allowed in the throws clause of the business method.
*/
@AroundInvoke
- public Object inBeanInterceptor(InvocationContext ctx) throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
+ public Object inBeanInterceptor(final InvocationContext ctx) throws Exception {
+ final Map<String, Object> ctxData = Interceptor.profile(ctx, "inBeanInterceptor");
setContextData(ctxData);
-
+
return ctx.proceed();
}
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept postConstruct of the bean
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PostConstruct
public void inBeanInterceptorPostConstruct() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPostConstruct");
setContextData(ctxData);
}
-
-
+
+
/**
- * The interceptor method.
+ * The interceptor method.
* This should intercept preDestroy of the bean.
- *
+ *
* @throws Exception runtime exceptions.
- */
+ */
@PreDestroy
public void inBeanInterceptorPreDestroy() throws Exception {
- Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
+ final Map<String, Object> ctxData = Interceptor.profile(this, "inBeanInterceptorPreDestroy");
setContextData(ctxData);
}
Modified: tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/resources/META-INF/ejb-jar.xml?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/resources/META-INF/ejb-jar.xml (original)
+++ tomee/tomee/trunk/itests/openejb-itests-interceptor-beans/src/main/resources/META-INF/ejb-jar.xml Tue Jul 15 21:55:09 2014
@@ -30,20 +30,20 @@
part of employee self-service application.
</description>
<interceptors>
- <interceptor>
- <interceptor-class>
- org.apache.openejb.test.interceptor.DefaultInterceptor
- </interceptor-class>
- </interceptor>
- </interceptors>
+ <interceptor>
+ <interceptor-class>
+ org.apache.openejb.test.interceptor.DefaultInterceptor
+ </interceptor-class>
+ </interceptor>
+ </interceptors>
<assembly-descriptor>
<interceptor-binding>
- <ejb-name>*</ejb-name>
- <interceptor-class>
- org.apache.openejb.test.interceptor.DefaultInterceptor
- </interceptor-class>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>
+ org.apache.openejb.test.interceptor.DefaultInterceptor
+ </interceptor-class>
</interceptor-binding>
-
+
<!--<interceptor-binding>
<ejb-name>SecondStatelessIntercepted</ejb-name>
<exclude-default-interceptors>
@@ -82,6 +82,6 @@
</method>
</interceptor-binding>
-->
-
+
</assembly-descriptor>
</ejb-jar>
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/pom.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/pom.xml?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/pom.xml (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/pom.xml Tue Jul 15 21:55:09 2014
@@ -16,7 +16,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>itests</artifactId>
<groupId>org.apache.openejb</groupId>
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/AnnotatedServlet.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/AnnotatedServlet.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/AnnotatedServlet.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/AnnotatedServlet.java Tue Jul 15 21:55:09 2014
@@ -95,19 +95,19 @@ public class AnnotatedServlet extends Ht
@EJB
private BasicStatefulBusinessRemote statefulBusinessRemote;
- protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/plain");
- ServletOutputStream out = response.getOutputStream();
- PrintStream printStream = new PrintStream(out);
+ final ServletOutputStream out = response.getOutputStream();
+ final PrintStream printStream = new PrintStream(out);
- String methodName = request.getParameter("method");
+ final String methodName = request.getParameter("method");
if (methodName == null) {
testAll(printStream);
} else {
try {
- Method method = getClass().getMethod(methodName);
+ final Method method = getClass().getMethod(methodName);
method.invoke(this);
- } catch (Throwable e) {
+ } catch (final Throwable e) {
// response.setStatus(580);
printStream.println("FAILED");
e.printStackTrace(printStream);
@@ -116,12 +116,12 @@ public class AnnotatedServlet extends Ht
printStream.flush();
}
- public void testAll(PrintStream printStream) {
- for (Method method : JndiTestServlet.class.getMethods()) {
+ public void testAll(final PrintStream printStream) {
+ for (final Method method : JndiTestServlet.class.getMethods()) {
try {
method.invoke(this);
printStream.println(method.getName() + " PASSED");
- } catch (Throwable e) {
+ } catch (final Throwable e) {
printStream.println(method.getName() + " FAILED");
e.printStackTrace(printStream);
printStream.flush();
@@ -159,62 +159,62 @@ public class AnnotatedServlet extends Ht
}
public void lookupStringEntry() {
- String expected = "1";
+ final String expected = "1";
Assert.assertNotNull("The String looked up is null", striing);
Assert.assertEquals(expected, striing);
}
public void lookupDoubleEntry() {
- Double expected = 1.0D;
+ final Double expected = 1.0D;
Assert.assertNotNull("The Double looked up is null", doouble);
Assert.assertEquals(expected, doouble);
}
public void lookupLongEntry() {
- Long expected = 1L;
+ final Long expected = 1L;
Assert.assertNotNull("The Long looked up is null", loong);
Assert.assertEquals(expected, loong);
}
public void lookupFloatEntry() {
- Float expected = 1.0F;
+ final Float expected = 1.0F;
Assert.assertNotNull("The Float looked up is null", flooat);
Assert.assertEquals(expected, flooat);
}
public void lookupIntegerEntry() {
- Integer expected = 1;
+ final Integer expected = 1;
Assert.assertNotNull("The Integer looked up is null", inteeger);
Assert.assertEquals(expected, inteeger);
}
public void lookupShortEntry() {
- Short expected = (short) 1;
+ final Short expected = (short) 1;
Assert.assertNotNull("The Short looked up is null", shoort);
Assert.assertEquals(expected, shoort);
}
public void lookupBooleanEntry() {
- Boolean expected = true;
+ final Boolean expected = true;
Assert.assertNotNull("The Boolean looked up is null", booolean);
Assert.assertEquals(expected, booolean);
}
public void lookupByteEntry() {
- Byte expected = (byte) 1;
+ final Byte expected = (byte) 1;
Assert.assertNotNull("The Byte looked up is null", byyte);
Assert.assertEquals(expected, byyte);
}
public void lookupCharacterEntry() {
- Character expected = 'D';
+ final Character expected = 'D';
Assert.assertNotNull("The Character looked up is null", chaaracter);
Assert.assertEquals(expected, chaaracter);
@@ -225,20 +225,20 @@ public class AnnotatedServlet extends Ht
}
public void lookupJMSConnectionFactory() {
- try{
+ try {
testJmsConnection(coonnectionFactory.createConnection());
testJmsConnection(queueCoonnectionFactory.createConnection());
testJmsConnection(topicCoonnectionFactory.createConnection());
- } catch (Exception e){
+ } catch (final Exception e) {
e.printStackTrace();
- Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
- private void testJmsConnection(javax.jms.Connection connection) throws JMSException {
- Session session = connection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
- Topic topic = session.createTopic("test");
- MessageProducer producer = session.createProducer(topic);
+ private void testJmsConnection(final javax.jms.Connection connection) throws JMSException {
+ final Session session = connection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
+ final Topic topic = session.createTopic("test");
+ final MessageProducer producer = session.createProducer(topic);
producer.send(session.createMessage());
producer.close();
session.close();
@@ -255,7 +255,7 @@ public class AnnotatedServlet extends Ht
try {
// call a do nothing method to assure entity manager actually exists
em.getFlushMode();
- } catch (Exception e) {
+ } catch (final Exception e) {
Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/EjbServlet.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/EjbServlet.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/EjbServlet.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/EjbServlet.java Tue Jul 15 21:55:09 2014
@@ -34,19 +34,19 @@ public class EjbServlet extends HttpServ
@EJB
private BasicStatelessBusinessLocal statelessBusinessLocal;
- protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/plain");
- ServletOutputStream out = response.getOutputStream();
- PrintStream printStream = new PrintStream(out);
+ final ServletOutputStream out = response.getOutputStream();
+ final PrintStream printStream = new PrintStream(out);
- String methodName = request.getParameter("method");
+ final String methodName = request.getParameter("method");
if (methodName == null) {
testAll(printStream);
} else {
try {
- Method method = getClass().getMethod(methodName);
+ final Method method = getClass().getMethod(methodName);
method.invoke(this);
- } catch (Throwable e) {
+ } catch (final Throwable e) {
// response.setStatus(580);
printStream.println("FAILED");
e.printStackTrace(printStream);
@@ -55,14 +55,14 @@ public class EjbServlet extends HttpServ
printStream.flush();
}
- public void testAll(PrintStream printStream) {
- for (Method method : EjbServlet.class.getMethods()) {
+ public void testAll(final PrintStream printStream) {
+ for (final Method method : EjbServlet.class.getMethods()) {
if (!method.getName().startsWith("invoke")) continue;
-
+
try {
method.invoke(this);
printStream.println(method.getName() + " PASSED");
- } catch (Throwable e) {
+ } catch (final Throwable e) {
printStream.println(method.getName() + " FAILED");
e.printStackTrace(printStream);
printStream.flush();
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloEjb.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloEjb.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloEjb.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloEjb.java Tue Jul 15 21:55:09 2014
@@ -19,7 +19,7 @@ package org.apache.openejb.test.servlet;
import javax.jws.WebService;
-@WebService(targetNamespace="http://examples.org/wsdl")
+@WebService(targetNamespace = "http://examples.org/wsdl")
public interface HelloEjb {
String hello(String name);
}
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloEjbService.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloEjbService.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloEjbService.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloEjbService.java Tue Jul 15 21:55:09 2014
@@ -21,12 +21,12 @@ import javax.ejb.Stateless;
import javax.jws.WebService;
@WebService(
- portName="HelloEjbPort",
- serviceName="HelloEjbService",
- targetNamespace="http://examples.org/wsdl",
- endpointInterface="org.apache.openejb.test.servlet.HelloEjb"
+ portName = "HelloEjbPort",
+ serviceName = "HelloEjbService",
+ targetNamespace = "http://examples.org/wsdl",
+ endpointInterface = "org.apache.openejb.test.servlet.HelloEjb"
)
-@Stateless (name = "TestHelloEjbService")
+@Stateless(name = "TestHelloEjbService")
public class HelloEjbService implements HelloEjb {
public String hello(String name) {
if (name == null) name = "World";
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloPojo.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloPojo.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloPojo.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloPojo.java Tue Jul 15 21:55:09 2014
@@ -19,7 +19,7 @@ package org.apache.openejb.test.servlet;
import javax.jws.WebService;
-@WebService(targetNamespace="http://examples.org/wsdl")
+@WebService(targetNamespace = "http://examples.org/wsdl")
public interface HelloPojo {
String hello(String name);
}
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloPojoService.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloPojoService.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloPojoService.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/HelloPojoService.java Tue Jul 15 21:55:09 2014
@@ -20,10 +20,10 @@ package org.apache.openejb.test.servlet;
import javax.jws.WebService;
@WebService(
- portName="HelloPojoPort",
- serviceName="HelloPojoService",
- targetNamespace="http://examples.org/wsdl",
- endpointInterface="org.apache.openejb.test.servlet.HelloPojo"
+ portName = "HelloPojoPort",
+ serviceName = "HelloPojoService",
+ targetNamespace = "http://examples.org/wsdl",
+ endpointInterface = "org.apache.openejb.test.servlet.HelloPojo"
)
public class HelloPojoService implements HelloPojo {
public String hello(String name) {
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/JndiServlet.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/JndiServlet.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/JndiServlet.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/JndiServlet.java Tue Jul 15 21:55:09 2014
@@ -32,20 +32,20 @@ import java.util.Map;
import java.util.TreeMap;
public class JndiServlet extends HttpServlet {
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/plain");
- ServletOutputStream out = response.getOutputStream();
+ final ServletOutputStream out = response.getOutputStream();
- Map<String, Object> bindings = new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER);
+ final Map<String, Object> bindings = new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER);
try {
- Context context = (Context) new InitialContext().lookup("java:comp/");
+ final Context context = (Context) new InitialContext().lookup("java:comp/");
addBindings("", bindings, context);
- } catch (NamingException e) {
+ } catch (final NamingException e) {
throw new ServletException(e);
}
out.println("JNDI Context:");
- for (Map.Entry<String, Object> entry : bindings.entrySet()) {
+ for (final Map.Entry<String, Object> entry : bindings.entrySet()) {
if (entry.getValue() != null) {
out.println(" " + entry.getKey() + "=" + entry.getValue());
} else {
@@ -54,30 +54,30 @@ public class JndiServlet extends HttpSer
}
}
- private void addBindings(String path, Map<String, Object> bindings, Context context) {
+ private void addBindings(final String path, final Map<String, Object> bindings, final Context context) {
try {
- for (NameClassPair pair : Collections.list(context.list(""))) {
- String name = pair.getName();
- String className = pair.getClassName();
+ for (final NameClassPair pair : Collections.list(context.list(""))) {
+ final String name = pair.getName();
+ final String className = pair.getClassName();
if ("org.apache.naming.resources.FileDirContext$FileResource".equals(className)) {
bindings.put(path + name, "<file>");
} else {
try {
- Object value = context.lookup(name);
+ final Object value = context.lookup(name);
if (value instanceof Context) {
- Context nextedContext = (Context) value;
+ final Context nextedContext = (Context) value;
bindings.put(path + name, "");
addBindings(path + name + "/", bindings, nextedContext);
} else {
bindings.put(path + name, value);
}
- } catch (NamingException e) {
+ } catch (final NamingException e) {
// lookup failed
bindings.put(path + name, "ERROR: " + e.getMessage());
}
}
}
- } catch (NamingException e) {
+ } catch (final NamingException e) {
bindings.put(path, "ERROR: list bindings threw an exception: " + e.getMessage());
}
}
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/JndiTestServlet.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/JndiTestServlet.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/JndiTestServlet.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/JndiTestServlet.java Tue Jul 15 21:55:09 2014
@@ -19,27 +19,42 @@ package org.apache.openejb.test.servlet;
public interface JndiTestServlet {
public void lookupStatelessBean();
+
public void lookupStatelessBusinessLocal();
+
public void lookupStatelessBusinessRemote();
public void lookupStatefulBean();
+
public void lookupStatefulBusinessLocal();
+
public void lookupStatefulBusinessRemote();
public void lookupEntityBean();
public void lookupResource();
+
public void lookupJMSConnectionFactory();
+
public void lookupPersistenceUnit();
+
public void lookupPersistenceContext();
public void lookupStringEntry();
+
public void lookupDoubleEntry();
+
public void lookupLongEntry();
+
public void lookupFloatEntry();
+
public void lookupIntegerEntry();
+
public void lookupShortEntry();
+
public void lookupBooleanEntry();
+
public void lookupByteEntry();
+
public void lookupCharacterEntry();
}
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/RunAsServlet.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/RunAsServlet.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/RunAsServlet.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/RunAsServlet.java Tue Jul 15 21:55:09 2014
@@ -35,19 +35,19 @@ public class RunAsServlet extends HttpSe
@EJB
private SecureEJBLocal secureEJBLocal;
- protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/plain");
- ServletOutputStream out = response.getOutputStream();
- PrintStream printStream = new PrintStream(out);
+ final ServletOutputStream out = response.getOutputStream();
+ final PrintStream printStream = new PrintStream(out);
- String methodName = request.getParameter("method");
+ final String methodName = request.getParameter("method");
if (methodName == null) {
testAll(request, printStream);
} else {
try {
- Method method = getClass().getMethod(methodName, HttpServletRequest.class);
+ final Method method = getClass().getMethod(methodName, HttpServletRequest.class);
method.invoke(this, request);
- } catch (Throwable e) {
+ } catch (final Throwable e) {
// response.setStatus(580);
printStream.println("FAILED");
e.printStackTrace(printStream);
@@ -56,14 +56,14 @@ public class RunAsServlet extends HttpSe
printStream.flush();
}
- public void testAll(HttpServletRequest request, PrintStream printStream) {
- for (Method method : EjbServlet.class.getMethods()) {
+ public void testAll(final HttpServletRequest request, final PrintStream printStream) {
+ for (final Method method : EjbServlet.class.getMethods()) {
if (!method.getName().startsWith("invoke")) continue;
try {
method.invoke(this);
printStream.println(method.getName() + " PASSED");
- } catch (Throwable e) {
+ } catch (final Throwable e) {
printStream.println(method.getName() + " FAILED");
e.printStackTrace(printStream);
printStream.flush();
@@ -72,7 +72,7 @@ public class RunAsServlet extends HttpSe
}
}
- public void invokeGetCallerPrincipal(HttpServletRequest request) {
+ public void invokeGetCallerPrincipal(final HttpServletRequest request) {
// Servlet environment - running as "user"
Principal principal = request.getUserPrincipal();
Assert.assertNotNull(principal);
@@ -84,7 +84,7 @@ public class RunAsServlet extends HttpSe
Assert.assertEquals("runas", principal.getName());
}
- public void invokeIsCallerInRole(HttpServletRequest request) {
+ public void invokeIsCallerInRole(final HttpServletRequest request) {
// Servlet environment - running as "user"
Assert.assertTrue(request.isUserInRole("user"));
Assert.assertFalse(request.isUserInRole("manager"));
@@ -98,35 +98,35 @@ public class RunAsServlet extends HttpSe
Assert.assertTrue(secureEJBLocal.isCallerInRole("runas"));
}
- public void invokeIsAllowed(HttpServletRequest request) {
+ public void invokeIsAllowed(final HttpServletRequest request) {
try {
secureEJBLocal.allowUserMethod();
Assert.fail("Method allowUserMethod() ALLOWED");
- } catch(EJBAccessException expected) {
+ } catch (final EJBAccessException expected) {
}
try {
secureEJBLocal.allowManagerMethod();
Assert.fail("Method allowManagerMethod() ALLOWED");
- } catch(EJBAccessException expected) {
+ } catch (final EJBAccessException expected) {
}
try {
secureEJBLocal.allowUnknownMethod();
Assert.fail("Method allowUnknownMethod() ALLOWED");
- } catch(EJBAccessException expected) {
+ } catch (final EJBAccessException expected) {
}
try {
secureEJBLocal.allowRunasMethod();
- } catch(EJBAccessException e) {
+ } catch (final EJBAccessException e) {
Assert.fail("Method allowRunasMethod() NOT ALLOWED");
}
try {
secureEJBLocal.denyAllMethod();
Assert.fail("Method denyAllMethod() ALLOWED");
- } catch(EJBAccessException expected) {
+ } catch (final EJBAccessException expected) {
}
}
}
\ No newline at end of file
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/SecureEJB.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/SecureEJB.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/SecureEJB.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/SecureEJB.java Tue Jul 15 21:55:09 2014
@@ -35,7 +35,7 @@ public class SecureEJB implements Secure
return context.getCallerPrincipal();
}
- public boolean isCallerInRole(String role) {
+ public boolean isCallerInRole(final String role) {
return context.isCallerInRole(role);
}
Modified: tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/SecureServlet.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/SecureServlet.java?rev=1610862&r1=1610861&r2=1610862&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/SecureServlet.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-servlets/src/main/java/org/apache/openejb/test/servlet/SecureServlet.java Tue Jul 15 21:55:09 2014
@@ -35,19 +35,19 @@ public class SecureServlet extends HttpS
@EJB
private SecureEJBLocal secureEJBLocal;
- protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/plain");
- ServletOutputStream out = response.getOutputStream();
- PrintStream printStream = new PrintStream(out);
+ final ServletOutputStream out = response.getOutputStream();
+ final PrintStream printStream = new PrintStream(out);
- String methodName = request.getParameter("method");
+ final String methodName = request.getParameter("method");
if (methodName == null) {
testAll(request, printStream);
} else {
try {
- Method method = getClass().getMethod(methodName, HttpServletRequest.class);
+ final Method method = getClass().getMethod(methodName, HttpServletRequest.class);
method.invoke(this, request);
- } catch (Throwable e) {
+ } catch (final Throwable e) {
// response.setStatus(580);
printStream.println("FAILED");
e.printStackTrace(printStream);
@@ -56,14 +56,14 @@ public class SecureServlet extends HttpS
printStream.flush();
}
- public void testAll(HttpServletRequest request, PrintStream printStream) {
- for (Method method : EjbServlet.class.getMethods()) {
+ public void testAll(final HttpServletRequest request, final PrintStream printStream) {
+ for (final Method method : EjbServlet.class.getMethods()) {
if (!method.getName().startsWith("invoke")) continue;
try {
method.invoke(this);
printStream.println(method.getName() + " PASSED");
- } catch (Throwable e) {
+ } catch (final Throwable e) {
printStream.println(method.getName() + " FAILED");
e.printStackTrace(printStream);
printStream.flush();
@@ -72,7 +72,7 @@ public class SecureServlet extends HttpS
}
}
- public void invokeGetCallerPrincipal(HttpServletRequest request) {
+ public void invokeGetCallerPrincipal(final HttpServletRequest request) {
// Servlet environment
Principal principal = request.getUserPrincipal();
Assert.assertNotNull(principal);
@@ -84,7 +84,7 @@ public class SecureServlet extends HttpS
Assert.assertEquals("user", principal.getName());
}
- public void invokeIsCallerInRole(HttpServletRequest request) {
+ public void invokeIsCallerInRole(final HttpServletRequest request) {
// Servlet environment
Assert.assertTrue(request.isUserInRole("user"));
Assert.assertFalse(request.isUserInRole("manager"));
@@ -98,35 +98,35 @@ public class SecureServlet extends HttpS
Assert.assertFalse(secureEJBLocal.isCallerInRole("runas"));
}
- public void invokeIsAllowed(HttpServletRequest request) {
+ public void invokeIsAllowed(final HttpServletRequest request) {
try {
secureEJBLocal.allowUserMethod();
- } catch(EJBAccessException e) {
+ } catch (final EJBAccessException e) {
Assert.fail("Method allowUserMethod() NOT ALLOWED");
}
try {
secureEJBLocal.allowManagerMethod();
Assert.fail("Method allowManagerMethod() ALLOWED");
- } catch(EJBAccessException expected) {
+ } catch (final EJBAccessException expected) {
}
try {
secureEJBLocal.allowUnknownMethod();
Assert.fail("Method allowUnknownMethod() ALLOWED");
- } catch(EJBAccessException expected) {
+ } catch (final EJBAccessException expected) {
}
try {
secureEJBLocal.allowRunasMethod();
Assert.fail("Method allowRunasMethod() ALLOWED");
- } catch(EJBAccessException expected) {
+ } catch (final EJBAccessException expected) {
}
try {
secureEJBLocal.denyAllMethod();
Assert.fail("Method denyAllMethod() ALLOWED");
- } catch(EJBAccessException expected) {
+ } catch (final EJBAccessException expected) {
}
}
}
\ No newline at end of file