第四章 Configuration配置
TestDriver提供了多个可以重载的方法,用来改变默认配置,比如下面的例子:
/**
* How long to wait for test results to be returned from the client(s). If goes longer than the
* specified limit, will throw an exception and kill the running test cases. Default value is * RESULTS_TIMEOUT.
* @return
*/
/**
等待结果从客户端返回的时间,如果超过这个时间将会抛出异常并且杀死运行中的test case,默认值是RESULTS_TIMEOUT.
*/
protected long getResultsTimeout()
{
return RESULTS_TIMEOUT;
}
/**
* How long for the server test case to wait for tear down message. If exceeds timeout,
* will throw exception. The default value is TEARDOWN_TIMEOUT.
* @return
*/
/**
服务器test case等待tear down消息的时间,超时也会抛出异常,默认值是TEARDOWN_TIMEOUT常量
*/
protected long getTearDownTimeout()
{
return TEARDOWN_TIMEOUT;
}
/**
* How long to allow each of the test cases to run their tests. If exceeds this timeout
* will throw exception and kill tests. The default value is RUN_TEST_TIMEOUT.
* @return
*/
/**
每个test case运行它们的测试的时间,超时会抛出异常并中止测试,默认值是RUN_TEST_TIMEOUT常量
*/
protected long getRunTestTimeout()
{
return RUN_TEST_TIMEOUT;
}
/**
* Returns the classpath to be added to the classpath used to start the client tests.
* Default return is null, which means no extra classpath will be added.
* @return
*/
/**
返回一个类路径(classpath),这个类路径会加入到系统启动客户端测试时所用的类路径中
默认值是null,也就是说没有额外的类路径加入
*/
protected String getExtendedClientClasspath()
{
return null;
}
/**
* Returns the classpath to be added to the classpath used to start the server tests.
* Default return is null, which means no extra classpath will be added.
* @return
*/
/**
同上,用于服务器端的类路径
*/
protected String getExtendedServerClasspath()
{
return null;
}
Configuration
/**
* Returns the VM arguments to be passed to the vm when creating the client test cases (actually their harness).
* The default value is null.
* @return
*/
/**
返回在创建客户端Test case时(实际上是它们的harness),传递给虚拟机的参数,默认为null
*/
protected String getClientJVMArguments()
{
return null;
}
/**
* Returns the VM arguments to be passed to the vm when creating the server test cases (actually their harness).
* The default value is null.
* @return
*/
/**
同上,这是关于服务器的
*/
protected String getServerJVMArguments()
{
return null;
}
Gotchas(啥意思啊不懂,望高人指点)
If see something werid like that:(werid又是什么意思呢?)
junit.framework.AssertionFailedError: Method "Yourclass.class" not found
检查一下看看你的测试类里面是不是有类似这样一个构造函数
public Yourclass(String name) { super(NAME); // where NAME = "Yourclass.class" }
翻译完了,感觉最后一段不知所云,就这么放上去吧,生平第一次翻译终告结束。去看个电影
TestDriver提供了多个可以重载的方法,用来改变默认配置,比如下面的例子:
/**
* How long to wait for test results to be returned from the client(s). If goes longer than the
* specified limit, will throw an exception and kill the running test cases. Default value is * RESULTS_TIMEOUT.
* @return
*/
/**
等待结果从客户端返回的时间,如果超过这个时间将会抛出异常并且杀死运行中的test case,默认值是RESULTS_TIMEOUT.
*/
protected long getResultsTimeout()
{
return RESULTS_TIMEOUT;
}
/**
* How long for the server test case to wait for tear down message. If exceeds timeout,
* will throw exception. The default value is TEARDOWN_TIMEOUT.
* @return
*/
/**
服务器test case等待tear down消息的时间,超时也会抛出异常,默认值是TEARDOWN_TIMEOUT常量
*/
protected long getTearDownTimeout()
{
return TEARDOWN_TIMEOUT;
}
/**
* How long to allow each of the test cases to run their tests. If exceeds this timeout
* will throw exception and kill tests. The default value is RUN_TEST_TIMEOUT.
* @return
*/
/**
每个test case运行它们的测试的时间,超时会抛出异常并中止测试,默认值是RUN_TEST_TIMEOUT常量
*/
protected long getRunTestTimeout()
{
return RUN_TEST_TIMEOUT;
}
/**
* Returns the classpath to be added to the classpath used to start the client tests.
* Default return is null, which means no extra classpath will be added.
* @return
*/
/**
返回一个类路径(classpath),这个类路径会加入到系统启动客户端测试时所用的类路径中
默认值是null,也就是说没有额外的类路径加入
*/
protected String getExtendedClientClasspath()
{
return null;
}
/**
* Returns the classpath to be added to the classpath used to start the server tests.
* Default return is null, which means no extra classpath will be added.
* @return
*/
/**
同上,用于服务器端的类路径
*/
protected String getExtendedServerClasspath()
{
return null;
}
Configuration
/**
* Returns the VM arguments to be passed to the vm when creating the client test cases (actually their harness).
* The default value is null.
* @return
*/
/**
返回在创建客户端Test case时(实际上是它们的harness),传递给虚拟机的参数,默认为null
*/
protected String getClientJVMArguments()
{
return null;
}
/**
* Returns the VM arguments to be passed to the vm when creating the server test cases (actually their harness).
* The default value is null.
* @return
*/
/**
同上,这是关于服务器的
*/
protected String getServerJVMArguments()
{
return null;
}
Gotchas(啥意思啊不懂,望高人指点)
If see something werid like that:(werid又是什么意思呢?)
junit.framework.AssertionFailedError: Method "Yourclass.class" not found
检查一下看看你的测试类里面是不是有类似这样一个构造函数
public Yourclass(String name) { super(NAME); // where NAME = "Yourclass.class" }
翻译完了,感觉最后一段不知所云,就这么放上去吧,生平第一次翻译终告结束。去看个电影