我正在使用log4j来记录我的数据.我希望能够在浏览器中与我的网络应用程序一起实时查看日志文件.像Chainsaw这样的独立工具相当不错,但它们不能满足在浏览器中实时查看日志的目的.
任何人都可以帮我吗?
我是Perl的初学者.我正在尝试使用CPAN接口模块,但我无法使其工作.我按照此页面上的说明安装了模块 .我正在使用EPIC-Eclipse.我正在尝试实现在同一网站上给出的示例.示例如下:这是Bouncable接口.
package Bouncable;
use Class::Interface;
&interface; # this actually declares the interface
sub bounce;
sub getBounceBack;
1;
Run Code Online (Sandbox Code Playgroud)
这是实现Bouncable接口的Ball类.
package Ball;
use Class::Interface;
&implements( 'Bouncable' );
sub bounce {
my $self = shift;
print "The ball is bouncing @ ".$self->getBounceBack." strength"
}
sub getBounceBack {
return 10;
}
1;
Run Code Online (Sandbox Code Playgroud)
代码非常简单直接.但我坚持以下错误,我无法摆脱它.
Ball tries to implement non existing interface Bouncable -- Interface Bouncable does not use the interface module. at D:/Eclipse projects/PerlTrial/Bouncable.pm line 4.
Compilation failed in require …Run Code Online (Sandbox Code Playgroud) 我正在进行UI测试ExtJS网络应用程序,我是初学者.我试图使用CasperJS/PhantomJS工具测试ExtJS小部件.此外,我使用Resurrectio生成所需的CasperJs脚本并对其进行必要的更改.
由于ExtJs为其创建的DOM元素动态生成唯一ID,因此我想知道如何在CasperJs脚本中提供这些ID以进行测试.
例如,以下Casper脚本由Resurrectio生成:
casper.waitForSelector("#ext-gen1142 .x-tree-icon.x-tree-icon-parent",
function success() {
test.assertExists("#ext-gen1142 .x-tree-icon.x-tree-icon-parent");
this.click("#ext-gen1142 .x-tree-icon.x-tree-icon-parent");
},
function fail() {
test.assertExists("#ext-gen1142 .x-tree-icon.x-tree-icon-parent");
});
casper.waitForSelector("#gridview-1038",
function success() {
test.assertExists("#gridview-1038");
this.click("#gridview-1038");
},
function fail() {
test.assertExists("#gridview-1038");
});
Run Code Online (Sandbox Code Playgroud)
#ext-gen1142和#gridview-1038是动态创建的ID.如何在测试中提供数据?是否存在任何与代码中的ExtJ一起使用的存根或模拟工具,以便在测试期间在运行时提供这些ID?
我遇到了SinonJS.是否可以使用或者我是否需要使用此答案中提到的CSS或XPath定位器?使用CSS或Xpath定位器的可靠性如何?
提前致谢!