[jboss-cvs] JBossAS SVN: r109436 - in projects/ejb3/trunk/core: src/test/java/org/jboss/ejb3/core/test and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Nov 23 12:53:34 EST 2010
Author: wolfc
Date: 2010-11-23 12:53:34 -0500 (Tue, 23 Nov 2010)
New Revision: 109436
Added:
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/NoTimerBean.java
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/NoTimerLocal.java
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/unit/
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/unit/InvocationContextTimerTestCase.java
Modified:
projects/ejb3/trunk/core/pom.xml
Log:
EJBTHREE-2202: use ejb3-interceptors 1.1.0
Modified: projects/ejb3/trunk/core/pom.xml
===================================================================
--- projects/ejb3/trunk/core/pom.xml 2010-11-23 17:52:53 UTC (rev 109435)
+++ projects/ejb3/trunk/core/pom.xml 2010-11-23 17:53:34 UTC (rev 109436)
@@ -41,7 +41,7 @@
<!-- Properties -->
<properties>
- <version.org.jboss.ejb3.context>0.1.1</version.org.jboss.ejb3.context>
+ <version.org.jboss.ejb3.context>0.3.0-SNAPSHOT</version.org.jboss.ejb3.context>
<version.org.jboss.jboss-as>5.1.0.GA</version.org.jboss.jboss-as>
<version.org.jboss.security>2.0.3.SP1</version.org.jboss.security>
<version.org.jboss.ejb3_timerservice-naming>1.0.0-alpha-2</version.org.jboss.ejb3_timerservice-naming>
@@ -423,7 +423,7 @@
<dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-interceptors</artifactId>
- <version>1.0.6</version>
+ <version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
@@ -826,4 +826,14 @@
</dependency>
</dependencies>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.ejb3.context</groupId>
+ <artifactId>jboss-ejb3-context-spi</artifactId>
+ <version>${version.org.jboss.ejb3.context}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
</project>
Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/NoTimerBean.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/NoTimerBean.java (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/NoTimerBean.java 2010-11-23 17:53:34 UTC (rev 109436)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ejb3.core.test.ejbthree2202;
+
+import javax.ejb.Stateless;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ */
+ at Stateless
+public class NoTimerBean implements NoTimerLocal
+{
+ // to make assertions hold the parameter must be spec InvocationContext
+ @AroundInvoke
+ public Object aroundInvoke(InvocationContext ctx) throws Exception
+ {
+ // but we know the truth :-)
+ org.jboss.ejb3.context.spi.InvocationContext internalCtx = (org.jboss.ejb3.context.spi.InvocationContext) ctx;
+ Object timer = internalCtx.getTimer();
+ if(timer != null)
+ throw new IllegalStateException("timer must be null");
+ return ctx.proceed();
+ }
+
+ public void doIt()
+ {
+ // done
+ }
+}
Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/NoTimerLocal.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/NoTimerLocal.java (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/NoTimerLocal.java 2010-11-23 17:53:34 UTC (rev 109436)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ejb3.core.test.ejbthree2202;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ */
+public interface NoTimerLocal
+{
+ void doIt();
+}
Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/unit/InvocationContextTimerTestCase.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/unit/InvocationContextTimerTestCase.java (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2202/unit/InvocationContextTimerTestCase.java 2010-11-23 17:53:34 UTC (rev 109436)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ejb3.core.test.ejbthree2202.unit;
+
+import org.jboss.ejb3.core.test.common.AbstractEJB3TestCase;
+import org.jboss.ejb3.core.test.ejbthree2202.NoTimerBean;
+import org.jboss.ejb3.core.test.ejbthree2202.NoTimerLocal;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Do a simple check for the existence of InvocationContext.getTimer.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ */
+public class InvocationContextTimerTestCase extends AbstractEJB3TestCase
+{
+ @BeforeClass
+ public static void beforeClass() throws Exception
+ {
+ AbstractEJB3TestCase.beforeClass();
+
+ deploySessionEjb(NoTimerBean.class);
+ }
+
+ @Test
+ public void test1() throws Exception
+ {
+ NoTimerLocal bean = lookup("NoTimerBean/local", NoTimerLocal.class);
+
+ // the real test is the interceptor method defined in NoTimerBean
+ bean.doIt();
+ }
+}
More information about the jboss-cvs-commits
mailing list