我可以使用“包含”吗?键入生成器“测试”工作?
我正在尝试为我的 Qooxdoo 应用程序编写一些测试用例,并且我认为我需要类似于“测试”作业中的“include”键的东西,但它似乎对我不起作用。
该应用程序是一个客户端/服务器系统,其中服务器将 json 对象传递给本地构建的客户端。例如,服务器可能会发送:
{
"object": "foo.Window"
}
然后客户端将在本地构造一个新的 foo.Window。为了使其正常工作,而无需在客户端代码中的其他位置创建 foo.Window,我需要将其放在 config.json 的 jobs 部分中:
"source":{
"extend":[
"common"
],
"include":[
"foo.Window",
"foo.etc.*"
]
},
"build":{
"extend":[
"common"
],
"include":[
"foo.Window",
"foo.etc.*"
]
}
这指示生成器将 foo.Window 类包含到 qx 中加载器,无论它是否出现在客户端源代码中。当我尝试为此场景创建测试用例时,出现错误:在 testrunner 应用程序中找不到 foo.Window 的类。我尝试按照上面列出的示例为测试和测试源作业添加包含键,但出现相同的错误。如果我在测试用例中手动创建 foo.Window ,它就可以工作,但在我的实际应用程序中,需要包含许多不同的类。有没有办法指示测试运行程序在我的测试套件中包含“foo.*”?
I'm trying to write some test cases for my Qooxdoo application, and I think I need something similar to the "include" key in the "test" job, but it does not seem to be working for me.
The application is a client/server system where the server passes json objects to the client that are built locally. For example, the server might send:
{
"object": "foo.Window"
}
The client would then construct a new foo.Window locally. In order to get this to work without having a foo.Window created somewhere else in the client code, I need to have this in the jobs section of my config.json:
"source":{
"extend":[
"common"
],
"include":[
"foo.Window",
"foo.etc.*"
]
},
"build":{
"extend":[
"common"
],
"include":[
"foo.Window",
"foo.etc.*"
]
}
This instructs the generator to include the foo.Window class into the qx loader regardless of if it appears in the client source code. When I tried to create a test case for this scenario, I get an error that the class for foo.Window cannot be found in the testrunner application. I have tried to add an include key for both the test and test-source jobs following the examples listed above, but I get the same error. It works if I manually create a foo.Window in the test case, but in my real world application there are lots of different classes that need to be included. Is there a way to instruct the testrunner to include "foo.*" for my test suite?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
测试应用程序的包含列表是在从 testrunner.json 导入的“tests-common”作业中定义的。您可以在应用程序的 config.json 中扩展它,如下所示:
The include list for the test application is defined in the "tests-common" job imported from testrunner.json. You can extend it in your application's config.json like so: