[jboss-cvs] JBossAS SVN: r63948 - in projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer: support/jndi and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 10 12:28:40 EDT 2007
Author: kabir.khan at jboss.com
Date: 2007-07-10 12:28:40 -0400 (Tue, 10 Jul 2007)
New Revision: 63948
Modified:
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/AnnotatedSimpleBeanImpl.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/jndi/MockJndiProvider.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/MethodHashingTestCase.java
Log:
Get rid of noisy TODO/FIXMEs
Modified: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/AnnotatedSimpleBeanImpl.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/AnnotatedSimpleBeanImpl.java 2007-07-10 16:18:44 UTC (rev 63947)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/AnnotatedSimpleBeanImpl.java 2007-07-10 16:28:40 UTC (rev 63948)
@@ -18,11 +18,11 @@
* 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.microcontainer.support;
/**
- *
+ *
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
* @version $Revision$
*/
@@ -33,7 +33,6 @@
public AnnotatedSimpleBeanImpl()
{
- // FIXME AnnotatedSimpleBeanImpl constructor
super();
}
}
Modified: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/jndi/MockJndiProvider.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/jndi/MockJndiProvider.java 2007-07-10 16:18:44 UTC (rev 63947)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/jndi/MockJndiProvider.java 2007-07-10 16:28:40 UTC (rev 63948)
@@ -49,7 +49,6 @@
}
public Object addToEnvironment(String propName, Object propVal) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public void bind(Name name, Object obj) throws NamingException
@@ -76,33 +75,27 @@
}
public Name composeName(Name name, Name prefix) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public String composeName(String name, String prefix) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public Context createSubcontext(Name name) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public Context createSubcontext(String name) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public void destroySubcontext(Name name) throws NamingException
{
- // TODO Auto-generated method stub
-
+
}
public void destroySubcontext(String name) throws NamingException
{
- // TODO Auto-generated method stub
-
+
}
public Hashtable<?, ?> getEnvironment() throws NamingException
{
@@ -110,37 +103,30 @@
}
public String getNameInNamespace() throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public NameParser getNameParser(Name name) throws NamingException
{
- // TODO Auto-generated method stub
return new MockNameParser();
}
public NameParser getNameParser(String name) throws NamingException
{
- // TODO Auto-generated method stub
return new MockNameParser();
}
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public NamingEnumeration<NameClassPair> list(String name) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public NamingEnumeration<Binding> listBindings(String name) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public Object lookup(Name name) throws NamingException
@@ -169,18 +155,15 @@
}
public Object lookupLink(Name name) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public Object lookupLink(String name) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public void rebind(Name name, Object obj) throws NamingException
{
- // TODO Auto-generated method stub
-
+
}
public void rebind(String name, Object obj) throws NamingException
{
@@ -188,17 +171,15 @@
}
public Object removeFromEnvironment(String propName) throws NamingException
{
- // TODO Auto-generated method stub
return null;
}
public void rename(Name oldName, Name newName) throws NamingException
{
- // TODO Auto-generated method stub
-
+
}
public void rename(String oldName, String newName) throws NamingException
{
-
+
}
public void unbind(Name name) throws NamingException
{
@@ -208,5 +189,5 @@
{
bindings.remove(name);
}
-
+
}
Modified: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/MethodHashingTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/MethodHashingTestCase.java 2007-07-10 16:18:44 UTC (rev 63947)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/MethodHashingTestCase.java 2007-07-10 16:28:40 UTC (rev 63948)
@@ -18,7 +18,7 @@
* 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.microcontainer.test;
import java.lang.reflect.Method;
@@ -41,7 +41,7 @@
/**
* Test to make sure that the different mechanisms of creating method hashes return the same hashes
- *
+ *
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
* @version $Revision: 61752 $
*/
@@ -50,112 +50,109 @@
public MethodHashingTestCase(String arg0)
{
- // FIXME MethodHashingTestCase constructor
super(arg0);
}
-
-//TODO Move these tests into container or aop-mc-int
-
+
public void testDeclaredMethodHashing() throws Exception
{
Class clazz = SubClass.class;
CtClass ctclass = getCtClass(clazz);
ClassInfo classInfoReflect = getIntrospectTypeInfo(clazz);
ClassInfo classInfoJavassist = getJavassistTypeInfo(clazz);
-
+
Map reflectInfoMethods = ClassInfoMethodHashing.getDeclaredMethodMap(classInfoReflect);
Map javassistInfoMethods = ClassInfoMethodHashing.getDeclaredMethodMap(classInfoJavassist);
Map javassistMethods = JavassistMethodHashing.getDeclaredMethodMap(ctclass);
-
+
compareMaps(reflectInfoMethods, javassistInfoMethods, 1);
compareMaps(reflectInfoMethods, javassistMethods, 1);
-
+
for (Iterator it = reflectInfoMethods.keySet().iterator() ; it.hasNext() ; )
{
Long hash = (Long)it.next();
CtMethod ctmethod = (CtMethod)javassistMethods.get(hash);
MethodInfo methodInfo = (MethodInfo)reflectInfoMethods.get(hash);
compareMethods(methodInfo, ctmethod);
-
+
MethodInfo methodInfo2 = (MethodInfo)javassistInfoMethods.get(hash);
compareMethods(methodInfo, methodInfo2);
Method method = MethodHashing.findMethodByHash(clazz, hash.longValue());
assertNotNull(method);
compareMethods(methodInfo, method);
-
+
Method methodB = org.jboss.util.MethodHashing.findMethodByHash(clazz, hash.longValue());
assertNotNull(methodB);
compareMethods(methodInfo, methodB);
}
}
-
+
public void testMethodHashing() throws Exception
{
Class clazz = SubClass.class;
CtClass ctclass = getCtClass(clazz);
ClassInfo classInfoReflect = getIntrospectTypeInfo(clazz);
ClassInfo classInfoJavassist = getJavassistTypeInfo(clazz);
-
+
Map reflectInfoMethods = ClassInfoMethodHashing.getMethodMap(classInfoReflect);
Map javassistInfoMethods = ClassInfoMethodHashing.getMethodMap(classInfoJavassist);
Map javassistMethods = JavassistMethodHashing.getMethodMap(ctclass);
-
+
compareMaps(reflectInfoMethods, javassistInfoMethods, 2);
compareMaps(reflectInfoMethods, javassistMethods, 2);
-
+
for (Iterator it = reflectInfoMethods.keySet().iterator() ; it.hasNext() ; )
{
Long hash = (Long)it.next();
CtMethod ctmethod = (CtMethod)javassistMethods.get(hash);
MethodInfo methodInfo = (MethodInfo)reflectInfoMethods.get(hash);
compareMethods(methodInfo, ctmethod);
-
+
MethodInfo methodInfo2 = (MethodInfo)javassistInfoMethods.get(hash);
compareMethods(methodInfo, methodInfo2);
Method method = MethodHashing.findMethodByHash(clazz, hash.longValue());
assertNotNull(method);
compareMethods(methodInfo, method);
-
+
Method methodB = org.jboss.util.MethodHashing.findMethodByHash(clazz, hash.longValue());
assertNotNull(methodB);
compareMethods(methodInfo, methodB);
}
}
-
+
private CtClass getCtClass(Class clazz) throws Exception
{
return ReflectToJavassist.classToJavassist(clazz);
}
-
+
private ClassInfo getIntrospectTypeInfo(Class clazz)
{
IntrospectionTypeInfoFactory typeInfoFactory = new IntrospectionTypeInfoFactory();
ClassInfo classInfo = (ClassInfo)typeInfoFactory.getTypeInfo(clazz);
return classInfo;
}
-
+
private ClassInfo getJavassistTypeInfo(Class clazz)
{
JavassistTypeInfoFactory typeInfoFactory = new JavassistTypeInfoFactory();
ClassInfo classInfo = (ClassInfo)typeInfoFactory.getTypeInfo(clazz);
return classInfo;
}
-
+
private void compareMaps(Map mapA, Map mapB, int expecedSize)
{
assertEquals(expecedSize, mapA.size());
assertEquals(expecedSize, mapB.size());
-
+
for (Iterator it = mapA.keySet().iterator() ; it.hasNext() ; )
{
Long l = (Long)it.next();
assertNotNull(mapB.get(l));
}
}
-
+
private void compareMethods(MethodInfo methodInfo, CtMethod method) throws Exception
{
System.out.println("-----> method " + method);
More information about the jboss-cvs-commits
mailing list