[Training Video - 4] [Groovy] Initializing log inside class with constructor
TestService s = new TestService(log,context,testRunner)
s.xyz() class TestService{
def log
def context
def testRunner public TestService(log,context,testRunner){
this.log=log
this.context=context
this.testRunner=testRunner
} public void xyz(){
log.info "hello"
}
}
Run result:
Tue Oct 06 20:54:29 CST 2015:INFO:hello
[Training Video - 4] [Groovy] Initializing log inside class with constructor的更多相关文章
- [Training Video - 3] [Groovy in Detail] Non-static and Static functions, initializing log inside class
log.info "starting" // we use class to create objects of a class Planet p1 = new Planet() ...
- [Training Video - 2] [Groovy Introduction]
Building test suites, Test cases and Test steps in SOAP UI Levels : test step level test case level ...
- [Training Video - 4] [Groovy] Constructors in groovy, this keyword
Bank.log = log Bank b1 = new Bank() b1.name = "BOA" b1.minbalance = 100 b1.city="Lond ...
- [Training Video - 4] [Groovy] Optional parameter in groovy
Employee.log=log Employee e1 = new Employee() log.info e1.add(1,2,3,4) // optional parameters in gro ...
- [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] Exception Handling in groovy
def x = new String[3] x[0] = "A" x[1] = "B" x[2] = "C" log.info"X ...
- [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] HashSet and Hashtable
Hashset: HashSet set = new HashSet() set.add("India") set.add("USA") set.add(&qu ...
- [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] Array and ArrayList
Array: def x = new String[5] x[0] = "India" x[1] = "USA" x[2] = "Korea" ...
- [Training Video - 4] [Groovy] String Functions
def x="I like to read books before bed" def temp = x.split(" ") log.info "S ...
- [Training Video - 4] [Groovy] Object equality and variable equality check
def x=2 def y=3 if(x == y){ log.info "equal" }else{ log.info "not equal" // prin ...
随机推荐
- STM32学习笔记之__attribute__ ((at())绝对定位分析
STM32也会遇到这样的绝对定位的问题如下: uint8_t UART_RX_BUF[1024] __attribute__ ((at(0X20001000))); //就是将串口接收的数 ...
- NKOJ1236 a^b
题目描述 对于任意两个正整数a,b(0<=a,b<10000)计算a^b各位数字的和的各位数字的和的各位数字的和的各位数字的和. Input 输入有多组数据,每组只有一行,包含两个正整数a ...
- bzoj 1023: [SHOI2008]cactus仙人掌图 2125: 最短路 4728: 挪威的森林 静态仙人掌上路径长度的维护系列
%%% http://immortalco.blog.uoj.ac/blog/1955 一个通用的写法是建树,对每个环建一个新点,去掉环上的边,原先环上每个点到新点连边,边权为点到环根的最短/长路长度 ...
- Android软键盘弹出将底部栏顶上去并不会挤压界面
界面需要,找到了一种不需要去设置android:windowSoftInputMode属性的解决keyboard和layout不适问题 有关设置android:windowSoftInputMode的 ...
- PHP中实现函数重载
转载自:http://cnn237111.blog.51cto.com/2359144/1284085 由于PHP是弱类型语言,因此函数的输入参数类型无法确定(可以使用类型暗示,但是类型暗示无法用在诸 ...
- CentOS7 tar打包工具 打包,解包,打包压缩,打包解压缩
tar命令 選項與參數: -c :建立打包檔案,可搭配 -v 來察看過程中被打包的檔名(filename) -t :察看打包檔案的內容含有哪些檔名,重點在察看『檔名』就是了: -x :解打包或解壓縮的 ...
- URL传参时中文参数乱码的解决方法
URL传参时,中文参数乱码的解决: 今天在工作中遇到了这样的一个问题,在页面之间跳转时,我将中文的参数放入到url中,使用location进行跳转传参,但是发现接收到的参数值是乱码.我的代码是这样写的 ...
- Redis实战——Redis的pub/Sub(订阅与发布)在java中的实现
借鉴:https://blog.csdn.net/canot/article/details/51938955 1.什么是pub/sub Pub/Sub功能(means Publish, Subscr ...
- web.xml执行顺序
出自:http://blog.csdn.net/u010833154/article/details/50697987 引言:启动java web程序的时候,java web会读取配置文件web.xm ...
- 【转】arm和x86的区别
来自: https://blog.csdn.net/u012513972/article/details/78349192/ 信不信,随便逮住一个人问他知不知道CPU,我想他的答案一定会是肯定的,但是 ...