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的更多相关文章

  1. [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() ...

  2. [Training Video - 2] [Groovy Introduction]

    Building test suites, Test cases and Test steps in SOAP UI Levels : test step level test case level ...

  3. [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 ...

  4. [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() ...

  5. [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 ...

  6. [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 ...

  7. [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" ...

  8. [Training Video - 4] [Groovy] String Functions

    def x="I like to read books before bed" def temp = x.split(" ") log.info "S ...

  9. [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 ...

随机推荐

  1. cordova 安装使用

    前人总结: Cordova是Apache软件基金会的一个产品.其前身是PhoneGap,由Nitobi开发,2011年10月,Adobe收够了Nitobi,并且PhoneGap项目也被贡献给Apach ...

  2. Hibernate学习4—关联关系一对多映射2

    第四节:班级学生一对多映射实现(双向) 查询班级的时候能够获取所有的学生:   在上一节的基础之上:我们在Class端也保存学生的关系: com.cy.model.Class: public clas ...

  3. TCP之三:TCP/IP协议中backlog参数(队列参数)

    目录: <TCP洪水攻击(SYN Flood)的诊断和处理> <TCP/IP协议中backlog参数> TCP建立连接是要进行三次握手,但是否完成三次握手后,服务器就处理(ac ...

  4. 阻塞队列之三:SynchronousQueue同步队列 阻塞算法的3种实现

    一.SynchronousQueue简介 Java 6的并发编程包中的SynchronousQueue是一个没有数据缓冲的BlockingQueue,生产者线程对其的插入操作put必须等待消费者的移除 ...

  5. ORA-01146: cannot start online backup - file 1 is already in backup ORA-01110: data file 1: 'C:\ORACLE\ORADATA\ORCL8\SYSTEM01.DBF'

    问题: Error: [1146] ORA-01146: cannot start online backup - file 1 is already in backup ORA-01110: dat ...

  6. WebApi 返值的实体值前缀加了个下划线

    发现MODEL类中加了个可以被序列化的标记,把它去除即可. [Serializable]

  7. 十五.jQuery源码解析之Sizzle总体结构.htm

    Sizzle是一款纯javascript实现的css选择器引擎,它具有完全独立,无库依赖;小;易于扩展和兼容性好等特点. W3C Selectors API规范定义了方法querySelector() ...

  8. oracle startup mount nomount 区别

    看oracle入门书,其中一句话说,使用startup nomount 命令启动例程,不可以和mount open 和exclusive一起使用,这个命令适用于建立数据库或是维护数据库时使用. 于是查 ...

  9. [Python] IMG to Char

    Change image into character from PIL import Image import argparse #输入 #命令行输入参数处理 parser = argparse.A ...

  10. 将自己数据转化为cifar10支持的lmdb

    大家都知道,在caffe里面,要运行cifar10的例子就得先由cifar10的数据库.由于caffe为了提高运行效率,减少磁盘寻道时间等,统一了数据接口(lmdb,leveldb). 首先,看一下c ...