Java 播放框架(2.1.3)不';不要运行任何测试

Java 播放框架(2.1.3)不';不要运行任何测试,java,junit,playframework,Java,Junit,Playframework,我有4个测试类,每个类平均有两个测试函数。第一个测试如下,并且必须正确(来自游戏教程) 其他的都是定制的,在设置之前有一个,如下所示: public class UserTest extends WithApplication { @Before public void setUp() { start(fakeApplication(inMemoryDatabase())); } // creation and retrieval of user @Test public void

我有4个测试类,每个类平均有两个测试函数。第一个测试如下,并且必须正确(来自游戏教程)

其他的都是定制的,在设置之前有一个
,如下所示:

public class UserTest extends WithApplication {

@Before
public void setUp() {
    start(fakeApplication(inMemoryDatabase()));
}

// creation and retrieval of user
@Test
public void createAndRetrieveUser() {
    new User("bob@gmail.com", "Bob", "secret").save();

    User bob = User.find.where().eq("email", "bob@gmail.com").findUnique();

    assertNotNull(bob);                 // successfully retrieved
    assertEquals("Bob", bob.getName()); // correct user retrieved
}
}
现在,当我运行
playtest
时,它完成得更快,并且不执行任何测试

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。我更新了所有参考资料,项目运行良好,除了测试。 我也是,但不可能是这样,因为我没有改变我的测试,所以它们写得很好,只是它们的执行不起作用。与此同时,还有一些问题。 将以下内容添加到val主函数的Build.scala文件中:

val main = play.Project(appName, appVersion, appDependencies).settings(
  // Add your own project settings here      
  testOptions in Test ~= { args =>
    for {
      arg <- args
      val ta: Tests.Argument = arg.asInstanceOf[Tests.Argument]
      val newArg = if(ta.framework == Some(TestFrameworks.JUnit)) ta.copy(args = List.empty[String]) else ta
    } yield newArg
  }
)   
val main=play.Project(appName、appVersion、appDependencies)。设置(
//在此处添加您自己的项目设置
Test~={args=>
为了{

arg您应该添加java标记,以允许格式生效,并对您的问题有更多的看法;)很好的提示,我不知道,完成;)帮了我很多..我是一个玩f/w的新手
val main = play.Project(appName, appVersion, appDependencies).settings(
  // Add your own project settings here      
  testOptions in Test ~= { args =>
    for {
      arg <- args
      val ta: Tests.Argument = arg.asInstanceOf[Tests.Argument]
      val newArg = if(ta.framework == Some(TestFrameworks.JUnit)) ta.copy(args = List.empty[String]) else ta
    } yield newArg
  }
)