在没有本地Dojo安装的情况下使用DOH测试Dojo [英] Testing Dojo with DOH without local Dojo installation

查看:436
本文介绍了在没有本地Dojo安装的情况下使用DOH测试Dojo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我不在本地安装Dojo到我的项目,我试图解决如何使用DOH测试Dojo模块。我在Eclipse工作,理想情况下,我想要的东西,我可以运行作为Maven构建的一部分最终。 Dojo包是5-20Mb,我不想让它存储在我的源代码控制系统与每个项目,如果可能的话。

I'm trying to work out how to use DOH to test Dojo modules if I don't install Dojo locally to my project. I'm working in Eclipse and ideally, I'd like something that I can run as part of a Maven build eventually. The Dojo package is 5-20Mb and I don't want to have it stashed in my source control system with each project if possible.

我试过几个选项与runner.html测试运行程序,但DOH将需要找到一个Dojo某处,然后看起来将相对于该安装找到模块。

I've tried a few options with the runner.html test runner, but DOH is going to need to find a Dojo somewhere, and then it seems that modules will be found relative to that installation.

有Dojo安装在我的系统上但不在项目中给我一个问题,试图找到相对于dojo.js文件的位置的项目。跨域保护防止我提供任何种类的绝对路径,因为它剥离字符。它还阻止我使用通过http在不同的域上提供的Dojo安装。

Having Dojo installed on my system but not in the project gives me a problem in trying to find the project relative to the location of the dojo.js file. The cross-domain protection prevents me serving up any kind of absolute path as it strips : characters. It also stops me using a Dojo installation served up on a different domain over http.

是否需要将Dojo安装在某处,然后我可以定义从dojo的相对路径.js到我的模块的根?

Is it necessary to have Dojo installed somewhere that I can then define a relative path from dojo.js to the roots of my modules? If not, how do I configure to get around it?

推荐答案

我没有尝试过这个完全跨域,但是没错,你可以定义足够让你去的路径。

I've not tried this completely cross domain, but yes, you can define paths which may be enough to get you going.

我们使用一个有点复杂的部署来运行我们的测试(以确保我们不引入意外的dojo / doh路径依赖项),我们的URL如下所示:

We run our tests using a somewhat complicated deployment (to ensure we don't introduce accidental dojo/doh path dependencies), and our URL looks like this:

http://server/XXX/dev/dohpath/util/doh/runner.html?boot=../../../dojo/dojo.js&dojoUrl=../../../dojo/dojo.js&paths=doh,../dohpath/util/doh;mymodule,../../mymodule&testModule=full.test.module

你启动跑步者,给它'boot'和'dojoUrl'来告诉它Dojo本身居住在哪里,使用'路径'告诉DOH它居住在哪里,以及如何找到你自己的模块。

That is, you fire up the runner, give it both 'boot' and 'dojoUrl' to tell it where Dojo itself lives, use 'paths' to tell DOH where it lives and how to find your own modules.

blech

这些相对路径是否可以绝对成功它会工作跨域是一个完全不同的事情,恐怕。我们将在几个月内自己碰到这个问题。

Whether those relative paths can be made absolute successfuly, and whether it'll work cross-domain is an entirely different matter, I'm afraid. We'll be hitting that problem ourselves in a couple of months.

这篇关于在没有本地Dojo安装的情况下使用DOH测试Dojo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆