Groups
Groups
Sign in
Groups
Groups
WATF Forum
Conversations
About
Send feedback
Help
[GlobalSight]为什么每次测试时,Job的Word Count都不一样?
5 views
Skip to first unread message
Bear Wu
unread,
Aug 11, 2011, 11:35:03 PM
8/11/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WATF Forum
Hi, 大家好。
在运行gs.smoketest中的VerifyWordCounts和VerifyJobWordCounts时,我发现了一个问题:每次测
试时,word counts的数据都不一致,于是这两个case总是失败。至于为什么word counts会不停滴变化,我百思不得其解。直到昨
天,才算是找到了原因。
原来,在运行setup的createJobs.java时,脚本先要将一些测试用的文件(如demo_company.html)上传到服务
器的welocalize共享文件夹。这个上传是通过Global Sight的一个API实现的,而这个API在写入文件的时候,采用的是追加写入的
方式!也就是说,每执行一次setup,服务器上文件的原有内容不会被删除,并且将在结尾处追加写入本次上传的文件的内容。所以,服务器上的文件的内容
在"不停滴"变长,用这些文件创建出来的job,其word counts自然也会不停滴变化了。关于这个现象,大家可以到各自的服务器上,看看
welocalize\docs\wl3\en_US\webservice\VerifyJob\%BASE_PATH%\Test Files
\gs\JobCreate下的demo_company.html文件中的内容,应该是和本地WATF目录下的demo_company.html的
内容不一致的,而且前者是后者的N次重复。
要解决这个问题,我想到的,有两个方法:
1. 修改setup的createJobs.java,在每次上传文件前,先将服务器上welocalize\docs目录下的内容删除。这个可以由
Java代码实现?
2. 在每次清空Global Sight服务器的时候,顺便手动把welocalize\docs\目录下的内容删除。不过在这以后,如果多次运行
setup中的createJobs.java,仍然会出现文件内容不断加长的现象。
大家想想是不是还有别的解决方法?或者这两个方法哪个好些?期盼你们的回帖。
蔡硕
unread,
Aug 11, 2011, 11:55:06 PM
8/11/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WATF Forum
可以创建一个空的文件,例如:demo_company_null.html。 在上传文件之前先去服务器的路径下查看是否已经有文件存在,如果没有,
正常上传demo_company.html;如果已经有文件存在,则上传空文件demo_company_null.html。这样应该可以解决不断
累加的问题。
Bear Wu
unread,
Aug 12, 2011, 2:41:41 AM
8/12/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WATF Forum
嗯,不错。其实用不到空文件demo_company_null.html。如果判断到服务器上已经有文件存在,就不用再上传了。
不过,“在上传文件之前先去服务器的路径下查看是否已经有文件存在” -- 不知道这一步怎么实现?
Reply all
Reply to author
Forward
0 new messages