[jboss-cvs] JBossAS SVN: r63892 - projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jul 6 20:31:23 EDT 2007
Author: flavia.rainone at jboss.com
Date: 2007-07-06 20:31:23 -0400 (Fri, 06 Jul 2007)
New Revision: 63892
Added:
projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/FromVariableAlgorithmTest.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/VariableTargetAlgorithmTest.java
Removed:
projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/AssignabilityAlgorithmTest.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/FromVariableTest.java
Modified:
projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/ClassTypeTest.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/GenericArrayTypeTest.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/ParameterizedTypeTest.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/TypeVariableTest.java
Log:
[JBAOP-420] Renaming of classes.
Deleted: projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/AssignabilityAlgorithmTest.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/AssignabilityAlgorithmTest.java 2007-07-07 00:27:29 UTC (rev 63891)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/AssignabilityAlgorithmTest.java 2007-07-07 00:31:23 UTC (rev 63892)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.test.aop.unit.assignability;
-
-import junit.framework.TestCase;
-
-import org.jboss.aop.advice.annotation.assignability.Algorithm;
-import org.jboss.aop.advice.annotation.assignability.VariableHierarchy;
-
-/**
- *
- *
- * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
- */
-public abstract class AssignabilityAlgorithmTest extends TestCase
-{
-
- protected Algorithm algorithm;
- protected VariableHierarchy hierarchy;
-
- /**
- *
- */
- public AssignabilityAlgorithmTest()
- {
- super();
- }
-
- public void setUp()
- {
- algorithm = Algorithm.VARIABLE_TARGET;
- hierarchy = new VariableHierarchy();
- }
-}
\ No newline at end of file
Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/ClassTypeTest.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/ClassTypeTest.java 2007-07-07 00:27:29 UTC (rev 63891)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/ClassTypeTest.java 2007-07-07 00:31:23 UTC (rev 63892)
@@ -33,7 +33,7 @@
*
* @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
*/
-public class ClassTypeTest extends AssignabilityAlgorithmTest
+public class ClassTypeTest extends VariableTargetAlgorithmTest
{
public void test1()
{
Copied: projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/FromVariableAlgorithmTest.java (from rev 63891, projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/FromVariableTest.java)
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/FromVariableAlgorithmTest.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/FromVariableAlgorithmTest.java 2007-07-07 00:31:23 UTC (rev 63892)
@@ -0,0 +1,224 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.test.aop.unit.assignability;
+
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.aop.advice.annotation.assignability.Algorithm;
+import org.jboss.aop.advice.annotation.assignability.VariableHierarchy;
+
+/**
+ *
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class FromVariableAlgorithmTest extends TestCase
+{
+ Algorithm algorithm;
+ VariableHierarchy hierarchy;
+ private static Class[] NO_ARGS = new Class[0];
+
+ public void setUp()
+ {
+ this.algorithm = Algorithm.FROM_VARIABLE;
+ hierarchy = new VariableHierarchy();
+ }
+
+ private boolean runAlgorithm(int callerNumber, int calledNumber) throws Exception
+ {
+ Method caller = this.getClass().getDeclaredMethod("caller" + callerNumber, NO_ARGS);
+ Method called = this.getClass().getDeclaredMethod("called" + calledNumber, NO_ARGS);
+ return algorithm.isAssignable(caller.getGenericReturnType(),
+ called.getGenericReturnType(), hierarchy);
+ }
+
+ // Scenario 1
+
+ Collection<String> caller1()
+ {
+ return called1();
+ }
+
+ <A> Collection<A> called1(){ return null;}
+
+ public void test1() throws Exception
+ {
+ assertTrue(runAlgorithm(1, 1));
+ }
+
+ // Scenario 2
+
+ Collection<String> caller2()
+ {
+ return called2();
+ }
+
+ <A extends String> Collection<A> called2(){ return null;}
+
+ public void test2() throws Exception
+ {
+ assertTrue(runAlgorithm(2, 2));
+ }
+
+ // Scenario 3
+
+ Collection<Runnable> caller3()
+ {
+ //return called2();
+ return null;
+ }
+
+ public void test3() throws Exception
+ {
+ assertFalse(runAlgorithm(3, 2));
+ }
+
+ // Scenario 4
+
+ Collection<?> caller4()
+ {
+ return called4();
+ }
+
+ <A extends String> Collection<A> called4(){ return null;}
+
+ public void test4() throws Exception
+ {
+ assertTrue(runAlgorithm(4, 4));
+ }
+
+ // Scenario 5
+
+ Collection<? extends Runnable> caller5()
+ {
+ //return called4();
+ return null;
+ }
+
+ public void test5() throws Exception
+ {
+ assertFalse(runAlgorithm(5, 4));
+ }
+
+ // Scenario 6
+
+ Collection<?> caller6()
+ {
+ return called6();
+ }
+
+ <A> Collection<A> called6(){ return null;}
+
+ public void test6() throws Exception
+ {
+ assertTrue(runAlgorithm(6, 6));
+ }
+
+ // Scenario 7
+
+ Collection<? extends Runnable> caller7()
+ {
+ return called6();
+ }
+
+ public void test7() throws Exception
+ {
+ assertTrue(runAlgorithm(7, 6));
+ }
+
+ // Scenario 8
+
+ Collection<?> caller8(Collection<Runnable> arg)
+ {
+ return called8(arg);
+ }
+
+ <A> Collection<A> called8(Collection<A> arg)
+ {
+ return null;
+ }
+
+ public void test8() throws Exception
+ {
+ Method caller = this.getClass().getDeclaredMethod("caller8", new Class[]{Collection.class});
+ Method called = this.getClass().getDeclaredMethod("called8", new Class[]{Collection.class});
+ assertTrue(Algorithm.VARIABLE_TARGET.isAssignable(called.getGenericParameterTypes()[0],
+ caller.getGenericParameterTypes()[0], hierarchy));
+ assertTrue(algorithm.isAssignable(caller.getGenericReturnType(),
+ called.getGenericReturnType(), hierarchy));
+ }
+
+ // Scenario 9
+
+ Collection<? extends Runnable> caller9(Collection<Runnable> arg)
+ {
+ return called8(arg);
+ }
+
+ public void test9() throws Exception
+ {
+ Method caller = this.getClass().getDeclaredMethod("caller9", new Class[]{Collection.class});
+ Method called = this.getClass().getDeclaredMethod("called8", new Class[]{Collection.class});
+ assertTrue(Algorithm.VARIABLE_TARGET.isAssignable(called.getGenericParameterTypes()[0],
+ caller.getGenericParameterTypes()[0], hierarchy));
+ assertTrue(algorithm.isAssignable(caller.getGenericReturnType(),
+ called.getGenericReturnType(), hierarchy));
+ }
+
+ // Scenario 10
+
+ Collection<Runnable> caller10(Collection<Runnable> arg)
+ {
+ return called8(arg);
+ }
+
+ public void test10() throws Exception
+ {
+ Method caller = this.getClass().getDeclaredMethod("caller10", new Class[]{Collection.class});
+ Method called = this.getClass().getDeclaredMethod("called8", new Class[]{Collection.class});
+ assertTrue(Algorithm.VARIABLE_TARGET.isAssignable(called.getGenericParameterTypes()[0],
+ caller.getGenericParameterTypes()[0], hierarchy));
+ assertTrue(algorithm.isAssignable(caller.getGenericReturnType(),
+ called.getGenericReturnType(), hierarchy));
+ }
+
+ // Scenario 11
+
+ Collection<? extends List> caller11(Collection<Runnable> arg)
+ {
+ //return called8(arg);
+ return null;
+ }
+
+ public void test11() throws Exception
+ {
+ Method caller = this.getClass().getDeclaredMethod("caller11", new Class[]{Collection.class});
+ Method called = this.getClass().getDeclaredMethod("called8", new Class[]{Collection.class});
+ assertTrue(Algorithm.VARIABLE_TARGET.isAssignable(called.getGenericParameterTypes()[0],
+ caller.getGenericParameterTypes()[0], hierarchy));
+ assertFalse(algorithm.isAssignable(caller.getGenericReturnType(),
+ called.getGenericReturnType(), hierarchy));
+ }
+}
\ No newline at end of file
Deleted: projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/FromVariableTest.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/FromVariableTest.java 2007-07-07 00:27:29 UTC (rev 63891)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/FromVariableTest.java 2007-07-07 00:31:23 UTC (rev 63892)
@@ -1,224 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.test.aop.unit.assignability;
-
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.aop.advice.annotation.assignability.Algorithm;
-import org.jboss.aop.advice.annotation.assignability.VariableHierarchy;
-
-/**
- *
- * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
- */
-public class FromVariableTest extends TestCase
-{
- Algorithm algorithm;
- VariableHierarchy hierarchy;
- private static Class[] NO_ARGS = new Class[0];
-
- public void setUp()
- {
- this.algorithm = Algorithm.FROM_VARIABLE;
- hierarchy = new VariableHierarchy();
- }
-
- private boolean runAlgorithm(int callerNumber, int calledNumber) throws Exception
- {
- Method caller = this.getClass().getDeclaredMethod("caller" + callerNumber, NO_ARGS);
- Method called = this.getClass().getDeclaredMethod("called" + calledNumber, NO_ARGS);
- return algorithm.isAssignable(caller.getGenericReturnType(),
- called.getGenericReturnType(), hierarchy);
- }
-
- // Scenario 1
-
- Collection<String> caller1()
- {
- return called1();
- }
-
- <A> Collection<A> called1(){ return null;}
-
- public void test1() throws Exception
- {
- assertTrue(runAlgorithm(1, 1));
- }
-
- // Scenario 2
-
- Collection<String> caller2()
- {
- return called2();
- }
-
- <A extends String> Collection<A> called2(){ return null;}
-
- public void test2() throws Exception
- {
- assertTrue(runAlgorithm(2, 2));
- }
-
- // Scenario 3
-
- Collection<Runnable> caller3()
- {
- //return called2();
- return null;
- }
-
- public void test3() throws Exception
- {
- assertFalse(runAlgorithm(3, 2));
- }
-
- // Scenario 4
-
- Collection<?> caller4()
- {
- return called4();
- }
-
- <A extends String> Collection<A> called4(){ return null;}
-
- public void test4() throws Exception
- {
- assertTrue(runAlgorithm(4, 4));
- }
-
- // Scenario 5
-
- Collection<? extends Runnable> caller5()
- {
- //return called4();
- return null;
- }
-
- public void test5() throws Exception
- {
- assertFalse(runAlgorithm(5, 4));
- }
-
- // Scenario 6
-
- Collection<?> caller6()
- {
- return called6();
- }
-
- <A> Collection<A> called6(){ return null;}
-
- public void test6() throws Exception
- {
- assertTrue(runAlgorithm(6, 6));
- }
-
- // Scenario 7
-
- Collection<? extends Runnable> caller7()
- {
- return called6();
- }
-
- public void test7() throws Exception
- {
- assertTrue(runAlgorithm(7, 6));
- }
-
- // Scenario 8
-
- Collection<?> caller8(Collection<Runnable> arg)
- {
- return called8(arg);
- }
-
- <A> Collection<A> called8(Collection<A> arg)
- {
- return null;
- }
-
- public void test8() throws Exception
- {
- Method caller = this.getClass().getDeclaredMethod("caller8", new Class[]{Collection.class});
- Method called = this.getClass().getDeclaredMethod("called8", new Class[]{Collection.class});
- assertTrue(Algorithm.VARIABLE_TARGET.isAssignable(called.getGenericParameterTypes()[0],
- caller.getGenericParameterTypes()[0], hierarchy));
- assertTrue(algorithm.isAssignable(caller.getGenericReturnType(),
- called.getGenericReturnType(), hierarchy));
- }
-
- // Scenario 9
-
- Collection<? extends Runnable> caller9(Collection<Runnable> arg)
- {
- return called8(arg);
- }
-
- public void test9() throws Exception
- {
- Method caller = this.getClass().getDeclaredMethod("caller9", new Class[]{Collection.class});
- Method called = this.getClass().getDeclaredMethod("called8", new Class[]{Collection.class});
- assertTrue(Algorithm.VARIABLE_TARGET.isAssignable(called.getGenericParameterTypes()[0],
- caller.getGenericParameterTypes()[0], hierarchy));
- assertTrue(algorithm.isAssignable(caller.getGenericReturnType(),
- called.getGenericReturnType(), hierarchy));
- }
-
- // Scenario 10
-
- Collection<Runnable> caller10(Collection<Runnable> arg)
- {
- return called8(arg);
- }
-
- public void test10() throws Exception
- {
- Method caller = this.getClass().getDeclaredMethod("caller10", new Class[]{Collection.class});
- Method called = this.getClass().getDeclaredMethod("called8", new Class[]{Collection.class});
- assertTrue(Algorithm.VARIABLE_TARGET.isAssignable(called.getGenericParameterTypes()[0],
- caller.getGenericParameterTypes()[0], hierarchy));
- assertTrue(algorithm.isAssignable(caller.getGenericReturnType(),
- called.getGenericReturnType(), hierarchy));
- }
-
- // Scenario 11
-
- Collection<? extends List> caller11(Collection<Runnable> arg)
- {
- //return called8(arg);
- return null;
- }
-
- public void test11() throws Exception
- {
- Method caller = this.getClass().getDeclaredMethod("caller11", new Class[]{Collection.class});
- Method called = this.getClass().getDeclaredMethod("called8", new Class[]{Collection.class});
- assertTrue(Algorithm.VARIABLE_TARGET.isAssignable(called.getGenericParameterTypes()[0],
- caller.getGenericParameterTypes()[0], hierarchy));
- assertFalse(algorithm.isAssignable(caller.getGenericReturnType(),
- called.getGenericReturnType(), hierarchy));
- }
-}
\ No newline at end of file
Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/GenericArrayTypeTest.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/GenericArrayTypeTest.java 2007-07-07 00:27:29 UTC (rev 63891)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/GenericArrayTypeTest.java 2007-07-07 00:31:23 UTC (rev 63892)
@@ -30,7 +30,7 @@
* @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
*
*/
-public class GenericArrayTypeTest extends AssignabilityAlgorithmTest
+public class GenericArrayTypeTest extends VariableTargetAlgorithmTest
{
// Scenario 1
Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/ParameterizedTypeTest.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/ParameterizedTypeTest.java 2007-07-07 00:27:29 UTC (rev 63891)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/ParameterizedTypeTest.java 2007-07-07 00:31:23 UTC (rev 63892)
@@ -30,7 +30,7 @@
* @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
*
*/
-public class ParameterizedTypeTest extends AssignabilityAlgorithmTest
+public class ParameterizedTypeTest extends VariableTargetAlgorithmTest
{
protected <A> void called1(ArrayList<A> arg) {}
protected void called2(ArrayList<?> arg) {}
Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/TypeVariableTest.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/TypeVariableTest.java 2007-07-07 00:27:29 UTC (rev 63891)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/TypeVariableTest.java 2007-07-07 00:31:23 UTC (rev 63892)
@@ -32,7 +32,7 @@
*
* @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
*/
-public class TypeVariableTest extends AssignabilityAlgorithmTest
+public class TypeVariableTest extends VariableTargetAlgorithmTest
{
// Scenario 1
Copied: projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/VariableTargetAlgorithmTest.java (from rev 63891, projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/AssignabilityAlgorithmTest.java)
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/VariableTargetAlgorithmTest.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/unit/assignability/VariableTargetAlgorithmTest.java 2007-07-07 00:31:23 UTC (rev 63892)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.test.aop.unit.assignability;
+
+import junit.framework.TestCase;
+
+import org.jboss.aop.advice.annotation.assignability.Algorithm;
+import org.jboss.aop.advice.annotation.assignability.VariableHierarchy;
+
+/**
+ *
+ *
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public abstract class VariableTargetAlgorithmTest extends TestCase
+{
+
+ protected Algorithm algorithm;
+ protected VariableHierarchy hierarchy;
+
+ /**
+ *
+ */
+ public VariableTargetAlgorithmTest()
+ {
+ super();
+ }
+
+ public void setUp()
+ {
+ algorithm = Algorithm.VARIABLE_TARGET;
+ hierarchy = new VariableHierarchy();
+ }
+}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list