Skip to content

Instantly share code, notes, and snippets.

@yongchun
yongchun / delete_remove.sh
Created December 26, 2013 04:55
shell脚本,删除和移动文件
#!/bin/bash
#可以修改为工程所在的目录
user=yourhome
apphome=virtualinterface
appdir=/root/${user}/${apphome}
appdir_back=/root/${user}/${apphome}_back
@yongchun
yongchun / Restrictions.java
Created December 26, 2013 05:41
使用DetachedCriteria和Restrictions构建hibernate的动态sql语句(2)
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@yongchun
yongchun / DetachedCriteria.java
Created December 26, 2013 05:42
使用DetachedCriteria和Restrictions构建hibernate的动态sql语句(1)
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@yongchun
yongchun / cankaowendang.txt
Created December 26, 2013 07:03
git和gerrit push配置
http://qt-project.org/wiki/Gerrit-Introduction
@yongchun
yongchun / BaseTest.java
Last active January 1, 2016 12:49
tentng+jmock的单元测试
import org.mockito.MockitoAnnotations;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;
import org.testng.annotations.BeforeClass;
@ContextConfiguration({
@yongchun
yongchun / IdcServiceTest.java
Last active January 1, 2016 12:49
service层
import com.XXX.sysdev.virtualsys.BaseTest;
import com.XXX.sysdev.virtualsys.dao.IdcDao;
import com.XXX.sysdev.virtualsys.model.Idc;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@yongchun
yongchun / pom.xml
Created December 27, 2013 13:20
testng+jmock单元测试pom配置
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.5</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
@yongchun
yongchun / ClassProperty2KeyUtil.java
Created January 8, 2014 02:00
自动化测试原型
package com.snda.sysdev.util;
import com.snda.sysdev.template.bean.InterfaceFuncParam;
import org.springframework.beans.BeanUtils;
import sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl;
import java.beans.PropertyDescriptor;
import java.lang.reflect.*;
import java.util.ArrayList;
import java.util.Collection;
@yongchun
yongchun / gist:8936244
Created February 11, 2014 14:51
java正则简单用列
package com.simple.example;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* java正则工作中的使用
* ==========================================
* ^A匹配以A开头
* $A匹配以A结尾
{method}
- klass: {other class}
- this oop: 0x00000000bc925718
- method holder: 'StopThread$1'
- constants: 0x00000000bc925430 constant pool [29] for 'StopThread$1' cache=0x00000000bc925a90
- access: 0xc1000001 public
- name: 'run'
- signature: '()V'
- max stack: 1
- max locals: 2