[jboss-cvs] JBossAS SVN: r72744 - in projects/jboss-aspects/trunk/current-invocation/src/test: java/org/jboss/aspects/currentinvocation/test/basic and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Apr 25 19:47:41 EDT 2008
Author: ALRubinger
Date: 2008-04-25 19:47:41 -0400 (Fri, 25 Apr 2008)
New Revision: 72744
Added:
projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/
projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/PojoBean.java
projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/TestException.java
projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/unit/
Removed:
projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/PojoBean.java
projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/TestException.java
projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/unit/
Modified:
projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/unit/CurrentInvocationUnitTestCase.java
projects/jboss-aspects/trunk/current-invocation/src/test/resources/jboss-aop.xml
Log:
[JBASPECT-9] Unified test package names
Copied: projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/PojoBean.java (from rev 72724, projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/PojoBean.java)
===================================================================
--- projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/PojoBean.java (rev 0)
+++ projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/PojoBean.java 2008-04-25 23:47:41 UTC (rev 72744)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.aspects.currentinvocation.test.basic;
+
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aspects.currentinvocation.CurrentInvocation;
+
+/**
+ * PojoBean
+ *
+ * A Simple POJO to act as target for Current Invocation
+ * Interception for use in testing
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class PojoBean
+{
+ /**
+ * Returns whether or not the current invocation can be
+ * obtained from the registry, validating that the Interceptor
+ * worked as expected
+ * @return
+ */
+ public boolean canGetCurrentInvocation()
+ {
+ Invocation invocation = CurrentInvocation.getCurrentInvocation();
+ return invocation != null;
+ }
+
+ /**
+ * Throw an exception
+ */
+ public void throwException() throws TestException
+ {
+ // Ensure current invocation is available
+ this.ensureCurrentInvocationIsAvailable();
+
+ // Throw the expected TestException
+ throw new TestException("ALR : Carlo :: Einstein : Paris Hilton");
+ }
+
+ /**
+ * Define a bind for interception only, and
+ * wait until notified by another Thread
+ *
+ * @param millis
+ */
+ public void suspend()
+ {
+ // Ensure current invocation is available
+ this.ensureCurrentInvocationIsAvailable();
+
+ try
+ {
+ wait();
+ }
+ catch (InterruptedException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ }
+
+ /**
+ * Throw a RuntimeException if no Current Invocation
+ * is in scope
+ */
+ private void ensureCurrentInvocationIsAvailable()
+ {
+ if (CurrentInvocation.getCurrentInvocation() == null)
+ {
+ throw new RuntimeException("Current Invocation not found");
+ }
+ }
+}
Copied: projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/TestException.java (from rev 72724, projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/TestException.java)
===================================================================
--- projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/TestException.java (rev 0)
+++ projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/TestException.java 2008-04-25 23:47:41 UTC (rev 72744)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.aspects.currentinvocation.test.basic;
+
+/**
+ * TestException
+ *
+ * An Exception used for Testing
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class TestException extends Exception
+{
+ private static final long serialVersionUID = 1L;
+
+ public TestException(String message)
+ {
+ super(message);
+ }
+
+}
Copied: projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/unit (from rev 72724, projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/unit)
Modified: projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/unit/CurrentInvocationUnitTestCase.java
===================================================================
--- projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/unit/CurrentInvocationUnitTestCase.java 2008-04-25 13:10:14 UTC (rev 72724)
+++ projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/currentinvocation/test/basic/unit/CurrentInvocationUnitTestCase.java 2008-04-25 23:47:41 UTC (rev 72744)
@@ -19,14 +19,14 @@
* 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.aspects.test.currentinvocation.unit;
+package org.jboss.aspects.currentinvocation.test.basic.unit;
import junit.framework.TestCase;
import org.jboss.aspects.common.AOPDeployer;
import org.jboss.aspects.currentinvocation.CurrentInvocation;
-import org.jboss.aspects.test.currentinvocation.PojoBean;
-import org.jboss.aspects.test.currentinvocation.TestException;
+import org.jboss.aspects.currentinvocation.test.basic.PojoBean;
+import org.jboss.aspects.currentinvocation.test.basic.TestException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Deleted: projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/PojoBean.java
===================================================================
--- projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/PojoBean.java 2008-04-25 23:36:41 UTC (rev 72743)
+++ projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/PojoBean.java 2008-04-25 23:47:41 UTC (rev 72744)
@@ -1,95 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.aspects.test.currentinvocation;
-
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.aspects.currentinvocation.CurrentInvocation;
-
-/**
- * PojoBean
- *
- * A Simple POJO to act as target for Current Invocation
- * Interception for use in testing
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public class PojoBean
-{
- /**
- * Returns whether or not the current invocation can be
- * obtained from the registry, validating that the Interceptor
- * worked as expected
- * @return
- */
- public boolean canGetCurrentInvocation()
- {
- Invocation invocation = CurrentInvocation.getCurrentInvocation();
- return invocation != null;
- }
-
- /**
- * Throw an exception
- */
- public void throwException() throws TestException
- {
- // Ensure current invocation is available
- this.ensureCurrentInvocationIsAvailable();
-
- // Throw the expected TestException
- throw new TestException("ALR : Carlo :: Einstein : Paris Hilton");
- }
-
- /**
- * Define a bind for interception only, and
- * wait until notified by another Thread
- *
- * @param millis
- */
- public void suspend()
- {
- // Ensure current invocation is available
- this.ensureCurrentInvocationIsAvailable();
-
- try
- {
- wait();
- }
- catch (InterruptedException e)
- {
- throw new RuntimeException(e);
- }
-
- }
-
- /**
- * Throw a RuntimeException if no Current Invocation
- * is in scope
- */
- private void ensureCurrentInvocationIsAvailable()
- {
- if (CurrentInvocation.getCurrentInvocation() == null)
- {
- throw new RuntimeException("Current Invocation not found");
- }
- }
-}
Deleted: projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/TestException.java
===================================================================
--- projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/TestException.java 2008-04-25 23:36:41 UTC (rev 72743)
+++ projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/TestException.java 2008-04-25 23:47:41 UTC (rev 72744)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.aspects.test.currentinvocation;
-
-/**
- * TestException
- *
- * An Exception used for Testing
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public class TestException extends Exception
-{
- private static final long serialVersionUID = 1L;
-
- public TestException(String message)
- {
- super(message);
- }
-
-}
Modified: projects/jboss-aspects/trunk/current-invocation/src/test/resources/jboss-aop.xml
===================================================================
--- projects/jboss-aspects/trunk/current-invocation/src/test/resources/jboss-aop.xml 2008-04-25 23:36:41 UTC (rev 72743)
+++ projects/jboss-aspects/trunk/current-invocation/src/test/resources/jboss-aop.xml 2008-04-25 23:47:41 UTC (rev 72744)
@@ -1,14 +1,14 @@
<aop>
- <bind pointcut="execution(public boolean org.jboss.aspects.test.currentinvocation.PojoBean->canGetCurrentInvocation())">
+ <bind pointcut="execution(public boolean org.jboss.aspects.currentinvocation.test.basic.PojoBean->canGetCurrentInvocation())">
<interceptor class="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
</bind>
- <bind pointcut="execution(public void org.jboss.aspects.test.currentinvocation.PojoBean->throwException())">
+ <bind pointcut="execution(public void org.jboss.aspects.currentinvocation.test.basic.PojoBean->throwException())">
<interceptor class="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
</bind>
- <bind pointcut="execution(public void org.jboss.aspects.test.currentinvocation.PojoBean->suspend())">
+ <bind pointcut="execution(public void org.jboss.aspects.currentinvocation.test.basic.PojoBean->suspend())">
<interceptor class="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
</bind>
More information about the jboss-cvs-commits
mailing list