[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 ...
随机推荐
- NFV网络功能虚拟化 基本概念
NFV基本概念 NFV则由运营商联盟提出,为了加速部署新的网络服务,运营商倾向于放弃笨重昂贵的专用网络设备,转而使用标准的IT虚拟化技术来拆分网络功能模块,如DNS.NAT.Firewall等.于是一 ...
- C++类够做函数初始化列表
构造函数初始化列表以一个冒号开始,接着是以逗号分隔的数据成员列表,每个数据成员后面跟一个放在括号中的初始化式.例如: class CExample{ public: int a; float b; C ...
- UISegmentedControl-iOS
//建立UISegmentedControl的数组 NSArray *segmentedArray = [NSArray arrayWithObjects:@"线下培训",@&qu ...
- PHP环境基础配置
域名访问设置(本地局域网) 用记事本打开 127.0.0.1是本地回环地址 配置完后 通过在本地浏览器输入www.0705.com就可以访问本地站点了 Wamp集成环境多站点配置 配置条件: 一个服务 ...
- 数据结构和算法之:二分法demo
package com.js.ai.modules.pointwall.testxfz; class OrdArray{ private long[] a; private int nElems; p ...
- 04——wepy框架搭建
wepy官方文档:https://tencent.github.io/wepy/document.html#/ 1.项目下载 # .安装wepy-cli npm install wepy-cli -g ...
- Metasploit对安卓手机的攻击
首先要kali进行内网穿透,可参考http://www.cnblogs.com/sch01ar/p/7562954.html 首先生成一个apk木马 命令:msfvenom -p android/me ...
- openstack网络架构(nova-network/neutron)
openstack网络体系中,网络技术没有创新,但用到的技术点非常庞杂,包括bridge.vlan.gre.vxlan.ovs.openflow.sdn.iptables等,当然这里不会做具体技术介绍 ...
- linux中的常用压缩与解压缩命令
linux中常用的压缩格式有 .zip .gz .bz2 .tar.gz .tar.bz2 一..zip 1.命令格式 zip 压缩文件名 源文件名 (压缩文件到当 ...
- mysql注入快速学习基础
前言: sql注入想学好,学通.必须得了解一下基础的SQL 语句.这里我快速理一理 正文: 搭建环境建议下phpsduy快速搭建 select * from kasi select 字段名 from ...