package org.seasar.dao.pager;

import junit.framework.TestCase;

/**
 * @author Toshitaka Agata
 */
public class PagerResultSetFactoryLimitOffsetWapperTest extends TestCase {
    
    MockResultSetFactory original;
    PagerResultSetFactoryLimitOffsetWrapper wrapper;
    
    protected void setUp() throws Exception {
        original = new MockResultSetFactory();
        wrapper = new PagerResultSetFactoryLimitOffsetWrapper(original);
    }
    
    public void testMakeBaseSql() throws Exception {
        try {
            PagerContext.getContext().pushArgs(createNormalArgs());
            assertEquals(
            		"SELECT̑ÕlCeBuSQL",
            		"SELECT * FROM DEPARTMENT", 
            		wrapper.makeBaseSql("native sql ... SELECT * FROM DEPARTMENT"));
            assertEquals(
            		"lCeBuSQL݂ȂꍇASQLωȂ",
            		"SELECT * FROM DEPARTMENT", 
            		wrapper.makeBaseSql("SELECT * FROM DEPARTMENT"));
        } finally {
            PagerContext.getContext().popArgs();
        }

    }
    public void testLimitOffsetSql() throws Exception {
        try {
            PagerContext.getContext().pushArgs(createNormalArgs());
            assertEquals(
            		"w肳ꂽlimit offsettꂽSQL𐶐",
            		"SELECT * FROM DEPARTMENT LIMIT 10 OFFSET 55", 
            		wrapper.makeLimitOffsetSql("SELECT * FROM DEPARTMENT", 10, 55));
        } finally {
            PagerContext.getContext().popArgs();
        }

    }
    private Object[] createNormalArgs() {
        return new Object[] {};
    }
}

@@ -443,16 +443,25 @@
 original
+, %22MySQL%22
 );%0D%0A    
@@ -463,24 +463,26 @@
 %0A    %7D%0D%0A    
+/*
 %0D%0A    public
@@ -1055,24 +1055,32 @@
 %7D%0D%0A%0D%0A    %7D%0D%0A
+    */%0D%0A
     public v

change comment out testMakeBaseSql