Package com.alibaba.druid.bvt.filter.wall

Source Code of com.alibaba.druid.bvt.filter.wall.BooleanXorTest

package com.alibaba.druid.bvt.filter.wall;

import junit.framework.TestCase;

import org.junit.Assert;

import com.alibaba.druid.wall.WallConfig;
import com.alibaba.druid.wall.WallUtils;

public class BooleanXorTest extends TestCase {

    public void test_false() throws Exception {
        Assert.assertFalse(WallUtils.isValidateMySql(//
        "SELECT * from t where id = 1 XOR id = 2")); //
    }

    public void test_true() throws Exception {
        WallConfig config = new WallConfig();
        config.setConditionOpXorAllow(true);
        Assert.assertTrue(WallUtils.isValidateMySql(//
        "SELECT * from t where id = 1 XOR id = 2", config)); //
    }
}
TOP

Related Classes of com.alibaba.druid.bvt.filter.wall.BooleanXorTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.