package kr.co.vcnc.haeinsa;

import org.apache.hadoop.hbase.util.Bytes;
import org.testng.Assert;
import org.testng.annotations.Test;

public class HaeinsaMutationTest {
    @Test
    public void testRemove() throws Exception {
        HaeinsaDelete delete = new HaeinsaDelete(Bytes.toBytes("ymkim"));
        delete.deleteFamily(Bytes.toBytes("data2"));
        delete.deleteColumns(Bytes.toBytes("data"), Bytes.toBytes("phoneNumber"));
        HaeinsaPut put = new HaeinsaPut(Bytes.toBytes("ymkim"));
        put.add(Bytes.toBytes("data"), Bytes.toBytes("phoneNumber"), Bytes.toBytes("010-1234-5678"));
        put.add(Bytes.toBytes("data"), Bytes.toBytes("address"), Bytes.toBytes("Seoul"));
        put.add(Bytes.toBytes("data2"), Bytes.toBytes("name"), Bytes.toBytes("ymkim"));

        delete.remove(put);

        HaeinsaDelete expectedDelete = new HaeinsaDelete(Bytes.toBytes("ymkim"));
        expectedDelete.deleteFamily(Bytes.toBytes("data2"));

        Assert.assertEquals(delete.toTMutation(), expectedDelete.toTMutation());
    }
}

@@ -1,8 +1,615 @@
+/**%0A * Copyright (C) 2013-2015 VCNC Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *         http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A
 package 

Add copyright header