我有4个测试类,每个测试类平均有两个测试函数。第一个测试是在下面,并且必须是正确的(它来自Play的教程)。Play Framework(2.1.3)不运行任何测试
public class ApplicationTest {
@Test
public void simpleCheck() {
int a = 1 + 1;
assertThat(a).isEqualTo(2);
}
}
其他的人都是定制的,并有一个@Before
设置,如:
public class UserTest extends WithApplication {
@Before
public void setUp() {
start(fakeApplication(inMemoryDatabase()));
}
// creation and retrieval of user
@Test
public void createAndRetrieveUser() {
new User("[email protected]", "Bob", "secret").save();
User bob = User.find.where().eq("email", "[email protected]").findUnique();
assertNotNull(bob); // successfully retrieved
assertEquals("Bob", bob.getName()); // correct user retrieved
}
}
现在,当我运行play test
它完成快了很多,并且不执行任何测试。
PS C:\wamp\www\dcid> play test
[info] Loading project definition from C:\wamp\www\dcid\project
[info] Set current project to dcid (in build file:/C:/wamp/www/dcid/)
[info] Compiling 4 Java sources to C:\wamp\www\dcid\target\scala-2.10\test-classes...
[info] ApplicationTest
[info]
[info]
[info] Total for test ApplicationTest
[info] Finished in 0.014 seconds
[info] 0 tests, 0 failures, 0 errors
[info] models.UserTest
[info]
[info]
[info] Total for test models.UserTest
[info] Finished in 0.002 seconds
[info] 0 tests, 0 failures, 0 errors
[info] models.ProposalTest
[info]
[info]
[info] Total for test models.ProposalTest
[info] Finished in 0.002 seconds
[info] 0 tests, 0 failures, 0 errors
[info] Passed: : Total 0, Failed 0, Errors 0, Passed 0, Skipped 0
[success] Total time: 5 s, completed 16/Ago/2013 14:52:35
这是为什么?我能做什么? 我最近从游戏2.1.2更新到2.1.3。我更新了所有参考文献,除了测试,项目工作正常。 我也looked at this question,但它不可能是,因为我没有改变我的测试,所以他们写得很好,这只是他们的执行不起作用。
您应该添加Java标记允许格式踢,并有更多一点的看法上你的问题;) –
尼斯小费,我不知道,完成;) – dialex