首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Coldfusion - Cant查找测试箱

Coldfusion - Cant查找测试箱
EN

Stack Overflow用户
提问于 2018-09-21 14:29:11
回答 1查看 1.1K关注 0票数 3

我有一个coldfusion应用程序,我想开始为它编写单元测试。我找到了testbox,并认为它将是一个很好的测试库。我跟踪了安装说明,但当我尝试运行第一个测试时,我的冷融合应用程序出现了一个错误。我下载了zip文件并放入我的C驱动器中,将映射添加到我的application.cfc中,但是它引发了以下错误(参见下面)。有人能帮我调试一下为什么找不到文本框吗?

错误

代码语言:javascript
复制
Invalid CFML construct found on line 2 at column 1.
ColdFusion was looking at the following text:
testbox


The error occurred in C:/inetpub/wwwroot/tests/main.cfc: line 2
1 : // Create TestBox object
2 : testbox = new testbox.system.TestBox();
3 : ​
4 : // You can add fluent specs via addDirectory(), addDirectories(), addBundles()

Application.cfc

代码语言:javascript
复制
component {
    this.name = "A TestBox Runner Suite " & hash( getCurrentTemplatePath() );
    // any other application.cfc stuff goes below:
    this.sessionManagement = true;

    // any mappings go here, we create one that points to the root called test.
    this.mappings[ "/tests" ] = getDirectoryFromPath( getCurrentTemplatePath() );
    // Map back to its root
    this.mappings[ "/testbox" ] = expandPath( "C:/testbox/" );

    // any orm definitions go here.

    // request start
    public boolean function onRequestStart( String targetPage ){
        return true;
    }
}

main.cfc

代码语言:javascript
复制
// Create TestBox object
testbox = new testbox.system.TestBox();
​
// You can add fluent specs via addDirectory(), addDirectories(), addBundles()
testbox.addDirectory( "specs" );
​
// Run tests and produce reporter results
testbox.run()
​
// Run tests and get raw testbox.system.TestResults object
testbox.runRaw()
​
// Run tests and produce reporter results from SOAP, REST, HTTP
testbox.runRemote()

测试盒目录。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-16 19:47:57

尝试将映射更改为C:\testbox\testbox\,或将\testbox\testbox文件夹的内容移到一个级别上。我想你可能已经解压缩到一个太多的文件夹。第二个system文件夹中有testbox文件夹吗?您希望确保映射指向包含实际TestBox文件的文件夹。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52445888

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档