/*
 * 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.performance;

import com.bugull.mongo.BuguDao;
import com.bugull.mongo.base.ReplicaSetBaseTest;
import com.bugull.mongo.cache.DaoCache;
import com.bugull.mongo.entity.Order;
import java.util.List;
import org.junit.Test;

/**
 *
 * @author Frank Wen(xbwen@hotmail.com)
 */
public class PerformanceTest extends ReplicaSetBaseTest{
    
    @Test
    public void testForProfile() {
        connectDB();
        
        BuguDao<Order> dao = DaoCache.getInstance().get(Order.class);
        for(int i=0; i<60; i++){
            List<Order> list = dao.findAll();
            try{
                Thread.sleep(1000);
            }catch(Exception ex){
                
            }
        }
        
        disconnectDB();
    }
    
}

@@ -791,16 +791,76 @@
 .Order;%0A
+import com.bugull.mongo.entity.User;%0Aimport java.util.Date;%0A
 import j
@@ -870,24 +870,24 @@
 .util.List;%0A
-
 import org.j
@@ -1015,16 +1015,18 @@
    %0A    
+//
 @Test%0A  
@@ -1347,32 +1347,32 @@
  %0A            %7D%0A
-
         %7D%0A      
@@ -1409,10 +1409,899 @@
  %7D%0A    %0A
+    /**%0A     * update operation use currentDate() and set() with new Date have no difference.%0A     */%0A    @Test%0A    public void testCurrentDate()%7B%0A        connectDB();%0A        %0A        BuguDao%3CUser%3E dao = DaoCache.getInstance().get(User.class);%0A        %0A        long begin1 = System.currentTimeMillis();%0A        for(int i=0; i%3C10000; i++)%7B%0A            dao.update().currentDate(%22registerTime%22).execute(%225d7216f9661c3c6c1f83b943%22);%0A        %7D%0A        long end1 = System.currentTimeMillis();%0A        System.out.println(%22use: %22 + (end1 - begin1));%0A        %0A        long begin2 = System.currentTimeMillis();%0A        for(int i=0; i%3C10000; i++)%7B%0A            dao.update().set(%22registerTime%22, new Date()).execute(%225d7216f9661c3c6c1f83b943%22);%0A        %7D%0A        long end2 = System.currentTimeMillis();%0A        System.out.println(%22use: %22 + (end2 - begin2));%0A        %0A        disconnectDB();%0A    %7D%0A    %0A
 %7D%0A

add junit test