[jboss-cvs] JBossAS SVN: r106779 - in projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo: test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jul 16 04:44:13 EDT 2010
Author: kabir.khan at jboss.com
Date: 2010-07-16 04:44:12 -0400 (Fri, 16 Jul 2010)
New Revision: 106779
Modified:
projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericIntegerImpl.java
projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericInterface.java
projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericStringImpl.java
projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/TestImpl.java
projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/TestInterface.java
projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/AbstractTypeInfoTest.java
projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/BytecodeTypeInfoTestCase.java
projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/IntrospectionTypeInfoTestCase.java
projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/JavassistTypeInfoTestCase.java
projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/TypeInfoTestSuite.java
Log:
Replace CRLF with LF
Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericIntegerImpl.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericIntegerImpl.java 2010-07-16 05:06:12 UTC (rev 106778)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericIntegerImpl.java 2010-07-16 08:44:12 UTC (rev 106779)
@@ -1,29 +1,29 @@
-/*
- * 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.test.typeinfo.support;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class GenericIntegerImpl implements GenericInterface<Integer>
-{
+/*
+ * 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.test.typeinfo.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class GenericIntegerImpl implements GenericInterface<Integer>
+{
}
\ No newline at end of file
Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericInterface.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericInterface.java 2010-07-16 05:06:12 UTC (rev 106778)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericInterface.java 2010-07-16 08:44:12 UTC (rev 106779)
@@ -1,30 +1,30 @@
-/*
- * 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.test.typeinfo.support;
-
-/**
- * @param <T> generic type
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public interface GenericInterface<T>
-{
+/*
+ * 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.test.typeinfo.support;
+
+/**
+ * @param <T> generic type
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface GenericInterface<T>
+{
}
\ No newline at end of file
Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericStringImpl.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericStringImpl.java 2010-07-16 05:06:12 UTC (rev 106778)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/GenericStringImpl.java 2010-07-16 08:44:12 UTC (rev 106779)
@@ -1,29 +1,29 @@
-/*
- * 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.test.typeinfo.support;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class GenericStringImpl implements GenericInterface<String>
-{
+/*
+ * 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.test.typeinfo.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class GenericStringImpl implements GenericInterface<String>
+{
}
\ No newline at end of file
Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/TestImpl.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/TestImpl.java 2010-07-16 05:06:12 UTC (rev 106778)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/TestImpl.java 2010-07-16 08:44:12 UTC (rev 106779)
@@ -1,29 +1,29 @@
-/*
- * 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.test.typeinfo.support;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class TestImpl implements TestInterface
-{
+/*
+ * 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.test.typeinfo.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class TestImpl implements TestInterface
+{
}
\ No newline at end of file
Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/TestInterface.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/TestInterface.java 2010-07-16 05:06:12 UTC (rev 106778)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/support/TestInterface.java 2010-07-16 08:44:12 UTC (rev 106779)
@@ -1,29 +1,29 @@
-/*
- * 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.test.typeinfo.support;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public interface TestInterface
-{
-}
+/*
+ * 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.test.typeinfo.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface TestInterface
+{
+}
Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/AbstractTypeInfoTest.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/AbstractTypeInfoTest.java 2010-07-16 05:06:12 UTC (rev 106778)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/AbstractTypeInfoTest.java 2010-07-16 08:44:12 UTC (rev 106779)
@@ -1,137 +1,137 @@
-/*
- * 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.test.typeinfo.test;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.Date;
-
-import org.jboss.reflect.spi.TypeInfo;
-import org.jboss.reflect.spi.TypeInfoFactory;
-import org.jboss.test.ContainerTest;
-import org.jboss.test.typeinfo.support.GenericIntegerImpl;
-import org.jboss.test.typeinfo.support.GenericInterface;
-import org.jboss.test.typeinfo.support.GenericStringImpl;
-import org.jboss.test.typeinfo.support.TestImpl;
-import org.jboss.test.typeinfo.support.TestInterface;
-
-/**
- * Type info test.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public abstract class AbstractTypeInfoTest extends ContainerTest
-{
- protected AbstractTypeInfoTest(String name)
- {
- super(name);
- }
-
- protected abstract TypeInfoFactory getTypeInfoFactory();
-
- // TODO - remove this after JBREFLECT-5 is done
- protected abstract boolean isTypeSupported();
-
- protected TypeInfo getTypeInfo(Type type) throws Exception
- {
- return getTypeInfoFactory().getTypeInfo(type);
- }
-
- public void testIsAssignableFrom() throws Throwable
- {
- TypeInfo first = getTypeInfo(int.class);
- TypeInfo second = getTypeInfo(double.class);
-
- assertIsAssignableFrom(first, second, true);
- second = getTypeInfo(Date.class);
- assertIsAssignableFrom(first, second, false);
-
- first = getTypeInfo(TestInterface.class);
- assertIsAssignableFrom(first, second, false);
-
- second = getTypeInfo(TestInterface.class);
- assertIsAssignableFrom(first, second, true);
- second = getTypeInfo(TestImpl.class);
- assertIsAssignableFrom(first, second, true);
-
- if (isTypeSupported())
- {
- first = getTypeInfo(getType("getGenericStringInterface"));
- second = getTypeInfo(GenericStringImpl.class);
- assertIsAssignableFrom(first, second, true);
-
- second = getTypeInfo(GenericIntegerImpl.class);
- // TODO - better impl could return false?
- assertIsAssignableFrom(first, second, true);
- }
- }
-
- public void testIsInstance() throws Throwable
- {
- TypeInfo first = getTypeInfo(int.class);
- Object second = 123d;
-
- assertIsInstance(first, second, true);
- second = (byte)123;
- assertIsInstance(first, second, true);
- second = new Date();
- assertIsInstance(first, second, false);
-
- first = getTypeInfo(TestInterface.class);
- assertIsInstance(first, second, false);
-
- second = new TestImpl();
- assertIsInstance(first, second, true);
-
- if (isTypeSupported())
- {
- first = getTypeInfo(getType("getGenericStringInterface"));
- second = new GenericStringImpl();
- assertIsInstance(first, second, true);
-
- second = new GenericIntegerImpl();
- // TODO - better impl could return false?
- assertIsInstance(first, second, true);
- }
- }
-
- protected void assertIsAssignableFrom(TypeInfo first, TypeInfo second, boolean expected) throws Throwable
- {
- assertEquals(expected, first.isAssignableFrom(second));
- }
-
- protected void assertIsInstance(TypeInfo typeInfo, Object object, boolean expected) throws Throwable
- {
- assertEquals(expected, typeInfo.isInstance(object));
- }
-
- protected Type getType(String methodName, Class<?>... parameters) throws Exception
- {
- Method method = getClass().getMethod(methodName, parameters);
- return method.getGenericReturnType();
- }
-
- public GenericInterface<String> getGenericStringInterface()
- {
- return null;
- }
+/*
+ * 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.test.typeinfo.test;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.Date;
+
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.reflect.spi.TypeInfoFactory;
+import org.jboss.test.ContainerTest;
+import org.jboss.test.typeinfo.support.GenericIntegerImpl;
+import org.jboss.test.typeinfo.support.GenericInterface;
+import org.jboss.test.typeinfo.support.GenericStringImpl;
+import org.jboss.test.typeinfo.support.TestImpl;
+import org.jboss.test.typeinfo.support.TestInterface;
+
+/**
+ * Type info test.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public abstract class AbstractTypeInfoTest extends ContainerTest
+{
+ protected AbstractTypeInfoTest(String name)
+ {
+ super(name);
+ }
+
+ protected abstract TypeInfoFactory getTypeInfoFactory();
+
+ // TODO - remove this after JBREFLECT-5 is done
+ protected abstract boolean isTypeSupported();
+
+ protected TypeInfo getTypeInfo(Type type) throws Exception
+ {
+ return getTypeInfoFactory().getTypeInfo(type);
+ }
+
+ public void testIsAssignableFrom() throws Throwable
+ {
+ TypeInfo first = getTypeInfo(int.class);
+ TypeInfo second = getTypeInfo(double.class);
+
+ assertIsAssignableFrom(first, second, true);
+ second = getTypeInfo(Date.class);
+ assertIsAssignableFrom(first, second, false);
+
+ first = getTypeInfo(TestInterface.class);
+ assertIsAssignableFrom(first, second, false);
+
+ second = getTypeInfo(TestInterface.class);
+ assertIsAssignableFrom(first, second, true);
+ second = getTypeInfo(TestImpl.class);
+ assertIsAssignableFrom(first, second, true);
+
+ if (isTypeSupported())
+ {
+ first = getTypeInfo(getType("getGenericStringInterface"));
+ second = getTypeInfo(GenericStringImpl.class);
+ assertIsAssignableFrom(first, second, true);
+
+ second = getTypeInfo(GenericIntegerImpl.class);
+ // TODO - better impl could return false?
+ assertIsAssignableFrom(first, second, true);
+ }
+ }
+
+ public void testIsInstance() throws Throwable
+ {
+ TypeInfo first = getTypeInfo(int.class);
+ Object second = 123d;
+
+ assertIsInstance(first, second, true);
+ second = (byte)123;
+ assertIsInstance(first, second, true);
+ second = new Date();
+ assertIsInstance(first, second, false);
+
+ first = getTypeInfo(TestInterface.class);
+ assertIsInstance(first, second, false);
+
+ second = new TestImpl();
+ assertIsInstance(first, second, true);
+
+ if (isTypeSupported())
+ {
+ first = getTypeInfo(getType("getGenericStringInterface"));
+ second = new GenericStringImpl();
+ assertIsInstance(first, second, true);
+
+ second = new GenericIntegerImpl();
+ // TODO - better impl could return false?
+ assertIsInstance(first, second, true);
+ }
+ }
+
+ protected void assertIsAssignableFrom(TypeInfo first, TypeInfo second, boolean expected) throws Throwable
+ {
+ assertEquals(expected, first.isAssignableFrom(second));
+ }
+
+ protected void assertIsInstance(TypeInfo typeInfo, Object object, boolean expected) throws Throwable
+ {
+ assertEquals(expected, typeInfo.isInstance(object));
+ }
+
+ protected Type getType(String methodName, Class<?>... parameters) throws Exception
+ {
+ Method method = getClass().getMethod(methodName, parameters);
+ return method.getGenericReturnType();
+ }
+
+ public GenericInterface<String> getGenericStringInterface()
+ {
+ return null;
+ }
}
\ No newline at end of file
Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/BytecodeTypeInfoTestCase.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/BytecodeTypeInfoTestCase.java 2010-07-16 05:06:12 UTC (rev 106778)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/BytecodeTypeInfoTestCase.java 2010-07-16 08:44:12 UTC (rev 106779)
@@ -1,57 +1,57 @@
-/*
- * 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.test.typeinfo.test;
-
-import junit.framework.Test;
-
-import org.jboss.reflect.plugins.bytecode.BytecodeTypeInfoFactory;
-import org.jboss.reflect.spi.TypeInfoFactory;
-
-/**
- * Javassist type info tests.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class BytecodeTypeInfoTestCase extends AbstractTypeInfoTest
-{
- private TypeInfoFactory factory = new BytecodeTypeInfoFactory();
-
- public BytecodeTypeInfoTestCase(String name)
- {
- super(name);
- }
-
- public static Test suite()
- {
- return suite(BytecodeTypeInfoTestCase.class);
- }
-
- protected TypeInfoFactory getTypeInfoFactory()
- {
- return factory;
- }
-
- protected boolean isTypeSupported()
- {
- return false;
- }
+/*
+ * 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.test.typeinfo.test;
+
+import junit.framework.Test;
+
+import org.jboss.reflect.plugins.bytecode.BytecodeTypeInfoFactory;
+import org.jboss.reflect.spi.TypeInfoFactory;
+
+/**
+ * Javassist type info tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class BytecodeTypeInfoTestCase extends AbstractTypeInfoTest
+{
+ private TypeInfoFactory factory = new BytecodeTypeInfoFactory();
+
+ public BytecodeTypeInfoTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(BytecodeTypeInfoTestCase.class);
+ }
+
+ protected TypeInfoFactory getTypeInfoFactory()
+ {
+ return factory;
+ }
+
+ protected boolean isTypeSupported()
+ {
+ return false;
+ }
}
\ No newline at end of file
Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/IntrospectionTypeInfoTestCase.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/IntrospectionTypeInfoTestCase.java 2010-07-16 05:06:12 UTC (rev 106778)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/IntrospectionTypeInfoTestCase.java 2010-07-16 08:44:12 UTC (rev 106779)
@@ -1,57 +1,57 @@
-/*
- * 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.test.typeinfo.test;
-
-import junit.framework.Test;
-
-import org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory;
-import org.jboss.reflect.spi.TypeInfoFactory;
-
-/**
- * Introspection test info tests.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class IntrospectionTypeInfoTestCase extends AbstractTypeInfoTest
-{
- private TypeInfoFactory factory = new IntrospectionTypeInfoFactory();
-
- public IntrospectionTypeInfoTestCase(String name)
- {
- super(name);
- }
-
- public static Test suite()
- {
- return suite(IntrospectionTypeInfoTestCase.class);
- }
-
- protected TypeInfoFactory getTypeInfoFactory()
- {
- return factory;
- }
-
- protected boolean isTypeSupported()
- {
- return true;
- }
+/*
+ * 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.test.typeinfo.test;
+
+import junit.framework.Test;
+
+import org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory;
+import org.jboss.reflect.spi.TypeInfoFactory;
+
+/**
+ * Introspection test info tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class IntrospectionTypeInfoTestCase extends AbstractTypeInfoTest
+{
+ private TypeInfoFactory factory = new IntrospectionTypeInfoFactory();
+
+ public IntrospectionTypeInfoTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(IntrospectionTypeInfoTestCase.class);
+ }
+
+ protected TypeInfoFactory getTypeInfoFactory()
+ {
+ return factory;
+ }
+
+ protected boolean isTypeSupported()
+ {
+ return true;
+ }
}
\ No newline at end of file
Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/JavassistTypeInfoTestCase.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/JavassistTypeInfoTestCase.java 2010-07-16 05:06:12 UTC (rev 106778)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/JavassistTypeInfoTestCase.java 2010-07-16 08:44:12 UTC (rev 106779)
@@ -1,57 +1,57 @@
-/*
- * 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.test.typeinfo.test;
-
-import junit.framework.Test;
-
-import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactory;
-import org.jboss.reflect.spi.TypeInfoFactory;
-
-/**
- * Javassist type info tests.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class JavassistTypeInfoTestCase extends AbstractTypeInfoTest
-{
- private TypeInfoFactory factory = new JavassistTypeInfoFactory();
-
- public JavassistTypeInfoTestCase(String name)
- {
- super(name);
- }
-
- public static Test suite()
- {
- return suite(JavassistTypeInfoTestCase.class);
- }
-
- protected TypeInfoFactory getTypeInfoFactory()
- {
- return factory;
- }
-
- protected boolean isTypeSupported()
- {
- return false;
- }
+/*
+ * 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.test.typeinfo.test;
+
+import junit.framework.Test;
+
+import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactory;
+import org.jboss.reflect.spi.TypeInfoFactory;
+
+/**
+ * Javassist type info tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class JavassistTypeInfoTestCase extends AbstractTypeInfoTest
+{
+ private TypeInfoFactory factory = new JavassistTypeInfoFactory();
+
+ public JavassistTypeInfoTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(JavassistTypeInfoTestCase.class);
+ }
+
+ protected TypeInfoFactory getTypeInfoFactory()
+ {
+ return factory;
+ }
+
+ protected boolean isTypeSupported()
+ {
+ return false;
+ }
}
\ No newline at end of file
Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/TypeInfoTestSuite.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/TypeInfoTestSuite.java 2010-07-16 05:06:12 UTC (rev 106778)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/typeinfo/test/TypeInfoTestSuite.java 2010-07-16 08:44:12 UTC (rev 106779)
@@ -1,50 +1,50 @@
-/*
- * 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.test.typeinfo.test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * TypeInfo test suite.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class TypeInfoTestSuite extends TestSuite
-{
- public static void main(String[] args)
- {
- TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("TypeInfo Tests");
-
- suite.addTest(IntrospectionTypeInfoTestCase.suite());
- suite.addTest(JavassistTypeInfoTestCase.suite());
- suite.addTest(BytecodeTypeInfoTestCase.suite());
-
- return suite;
- }
-}
+/*
+ * 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.test.typeinfo.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * TypeInfo test suite.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class TypeInfoTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("TypeInfo Tests");
+
+ suite.addTest(IntrospectionTypeInfoTestCase.suite());
+ suite.addTest(JavassistTypeInfoTestCase.suite());
+ suite.addTest(BytecodeTypeInfoTestCase.suite());
+
+ return suite;
+ }
+}
More information about the jboss-cvs-commits
mailing list