fixed encoding

This commit is contained in:
wenshao
2012-08-24 22:57:46 +08:00
parent 0ea966def3
commit eb67fca46e
13 changed files with 159 additions and 238 deletions
@@ -1,18 +1,3 @@
/*
* Copyright 1999-2011 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.druid;
import java.beans.PropertyVetoException;
@@ -86,14 +71,14 @@ public class TestRollBack {
@Before
public void before() {
// 清空æ‰?œ‰æ•°æ�®
// 清空所有数据
dao_c3p0.clear("msg");
}
@Test
public void test_c3p0() {
try {
// 将两æ�¡æ�’入语å�¥åŒ…裹在ä¸?¸ªäº‹åŠ¡å†…æ‰§è¡?第一æ�¡å�¯ä»¥æ­£å¸¸æ�’å…?第二æ�¡è¶…过字段长åº?会抛异常,事务会回æ»?
// 将两条插入语句包裹在一个事务内执行,第一条可以正常插入,第二条超过字段长度,会抛异常,事务会回滚
Trans.exec(new Atom() {
@Override
public void run() {
@@ -104,7 +89,7 @@ public class TestRollBack {
} catch (Exception e) {
}
// abc也跟ç�?›žæ»šäº†
// abc也跟着回滚了
Assert.assertNull(dao_c3p0.fetch("msg", Cnd.where("message", "=", "abc")));
}