/*
 * Copyright (c) www.bugull.com
 * 
 * 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.bugull.mongo.split;

import com.bugull.mongo.base.ReplicaSetBaseTest;
import java.util.List;
import org.junit.Test;

/**
 *
 * @author Frank Wen(xbwen@hotmail.com)
 */
public class FriendTest extends ReplicaSetBaseTest {
    
    //@Test
    public void testInsert(){
        connectDB();
        
        FriendDao dao = new FriendDao();
        
        Friend f1 = new Friend();
        f1.setName("Frank");
        f1.setProvince("Zhejiang");
        
        dao.setSplitSuffix(f1.getProvince());
        dao.save(f1);
        
        Friend f2 = new Friend();
        f2.setName("Tom");
        f2.setProvince("Shanghai");
        
        dao.setSplitSuffix(f2.getProvince());
        dao.save(f2);
        
        disconnectDB();
    }
    
    @Test
    public void testQuery(){
        connectDB();
        
        FriendDao dao = new FriendDao();
        dao.setSplitSuffix("Zhejiang");
        
        List<Friend> list = dao.findAll();
        for(Friend f : list){
            System.out.println("name: " + f.getName());
            System.out.println("province: " + f.getProvince());
        }
        
        disconnectDB();
    }

}

@@ -655,30 +655,32 @@
 go.base.
-ReplicaSetBase
+MongosConnection
 Test;%0Aim
@@ -811,22 +811,24 @@
 nds 
-ReplicaSetBase
+MongosConnection
 Test
@@ -839,18 +839,16 @@
    %0A    
-//
 @Test%0A  
@@ -1315,32 +1315,219 @@
 e(f2);%0A        %0A
+        Friend f3 = new Friend();%0A        f3.setName(%22Jessica%22);%0A        f3.setProvince(%22Zhejiang%22);%0A        %0A        dao.setSplitSuffix(f3.getProvince());%0A        dao.save(f3);%0A        %0A
         disconne
@@ -1541,32 +1541,34 @@
 %0A    %7D%0A    %0A    
+//
 @Test%0A    public

change JUnit test