java.lang.Exception: No runnable methods
目前网上很多的解释都是Test类导错包
这里列出我碰到的其他情况:
1:xml配置文件使用时少加后缀名.xml
public class BookTest {
private ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext");
@Test
public void test01(){
System.out.println("1");
}
}
其中应该为
new ClassPathXmlApplicationContext("applicationContext.xml");
2:在使用util命名空间时,手写xmlns:util导致少配置一项
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation