私はそれぞれ平均2つのテスト関数を持つ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