出现junit.framework.AssertionFailedError: No tests found in hill.vo.CustomerDAO 
不知出了什么问题, 测试的类的应该是CustomerDAOTest 而不是 CustomerDAO public static void main(String[] args) 
    { 
       TestRunner.run(CustomerDAO.class); 
    } 
修改下
你用junit3的话还应该取消
// @Test 
这个注释

解决方案 »

  1.   

    你用junit3的话还应该取消 
    // @Test  
    这个注释如果注释掉会有错误提示 
      

  2.   

    TestRunner.run(CustomerDAO.class); 这里错了在CustomerDao里没有test@@@方法你搞错文件了
      

  3.   

    改成这个了
    TestRunner.run(CustomerDAOTest.class); 运行方式为java应用程序 
    出现以下错误提示
    junit.framework.AssertionFailedError: Exception in constructor: testConfig (org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.))

    han one version of 'org.apache.commons.logging.Log' visible, which is not allowed.)
    at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
    ... 21 more
    Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.
    at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385)
    ... 22 more
    )
      

  4.   

    applicationContext.xml
    .......
    <bean id="customerDAO" class="hill.vo.CustomerDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    ....................
      

  5.   

    你用junit3的话还应该取消  
    // @Test   
    这个注释 如果注释掉会有错误提示  import it先排除其他问题
    你跑个空Test 先跑起来再说
      

  6.   

    Invalid class loader hierarchy.  You have more than one version of  'org.apache.commons.logging.Log ' visible, which is not allowed.你的Log存在多个版本的jar包删除掉多余的,只留一个