[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" // print out not equal
} TestService s1 = new TestService()
TestService s2 = new TestService()
log.info s1.is(s2) // false
s1=s2
log.info s1.is(s2) // true class TestService{ }
Run result:
Tue Oct 06 21:04:38 CST 2015:INFO:not equal
Tue Oct 06 21:04:38 CST 2015:INFO:false
Tue Oct 06 21:04:38 CST 2015:INFO:true
[Training Video - 4] [Groovy] Object equality and variable equality check的更多相关文章
- [Training Video - 3] [Groovy in Detail] Non-static and Static variables, objects and object referances
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] 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 - 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 - 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] Initializing log inside class with constructor
TestService s = new TestService(log,context,testRunner) s.xyz() class TestService{ def log def conte ...
随机推荐
- laravel验证器例子
直接贴测试代码 Route::get('/', function() { $name = "rico"; $validateData = array('name1' => $ ...
- 生产者-消费者问题:介绍POSIX线程的互斥量和条件变量的使用
全局初始化互斥量和条件变量(不全局也行,但至少要对线程启动函数可见,这样才能使用.) static pthread_cont_t cond = PTHREAD_COND_INITIALIZER; st ...
- nginx基于TCP的反向代理
一.4层的负载均衡 Nginx Plus的商业授权版开始具有TCP负载均衡的功能.从Nginx 1.7.7版本开始加入的,现在变成了一个商业收费版本,想要试用,需要在官网申请.也就是说,Nginx除了 ...
- PyQt 5控件
PyQt 5控件包括:按钮.复选框.滑动条.列表框等 复选框QCheckBox QCheckBox复选框控件,它有两个状态:打开和关闭,他是一个带有文本标签(Label)的控件.复选框常用于表示程序中 ...
- 查看Unix/Linux的CPU个数和内存大小,系统位数(转载)
一.AIX 1.查看CPU数: (1) smtctl 从AIX5.3起,对于power5的机器,系统引入了SMT(Simultaneousmulti-threading)的功能,其允许两个处理线程在同 ...
- sqlserver并发处理,锁和事务
本文系转载,谢谢:http://www.cnblogs.com/cxd4321/archive/2008/12/10/1351792.html 另外这个也不错 http://www.cnb ...
- 转载 cglib代理和java代理
Java动态代理之JDK实现和CGlib实现(简单易懂) 转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6542259.html 一:代理模式(静态代理) ...
- linux grep日志查询
ll access.2018-09-*.gz zcat access.2018-09-*.gz |grep --color '1073011900' | head -n 100 匹配字符由于管道h ...
- 在C#中控制ListBox某一行的字体颜色
例1 private void Form1_Load(object sender, EventArgs e) { listBox1.Items.Add("红色"); listBox ...
- OrderedDict 有序字典以及读取json串时如何保持原有顺序
1. OrderedDict 有序字典 OrderedDict是dict的子类,它记住了内容添加的顺序.比较时,OrderedDict要内容和顺序完全相同才会视为相等 import collectio ...