Index: TestCount.java
===================================================================
--- TestCount.java	(revision 46101)
+++ TestCount.java	(revision 46102)
@@ -1,102 +1,28 @@
 package org.gvsig.fmap.dal.store.h2.operations.sql;
 
-import java.util.List;
-import junit.framework.TestCase;
-import static junit.framework.TestCase.assertEquals;
-import org.gvsig.fmap.dal.feature.FeatureQuery;
-import org.gvsig.fmap.dal.feature.FeatureStore;
-import org.gvsig.fmap.dal.feature.FeatureType;
-import org.gvsig.fmap.dal.store.h2.TestUtils;
-import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper;
-import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory;
-import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference;
-import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase;
-import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CountOperation;
-import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ResultSetForSetProviderOperation;
-import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.gvsig.fmap.dal.store.h2.TestUtilsH2Spatial;
+import org.gvsig.fmap.dal.store.jdbc2.AbstractTestUtils;
+import org.gvsig.fmap.dal.store.jdbc2.operations.sql.AbstractTestCount;
 
-public class TestCount extends TestCase {
+public class TestCount extends AbstractTestCount {
 
-  private static final Logger LOGGER = LoggerFactory.getLogger(TestCount.class);
+    public TestCount(String testName) {
+        super(testName);
+    }
 
-  public TestCount(String testName) {
-    super(testName);
-  }
+    @Override
+    protected AbstractTestUtils createUtils() {
+        return new TestUtilsH2Spatial();
+    }
 
-  @Override
-  protected void setUp() throws Exception {
-    super.setUp();
-    new DefaultLibrariesInitializer().fullInitialize();
-  }
+    @Override
+    public void testCount() throws Exception {
+        super.testCount();
+    }
 
-  @Override
-  protected void tearDown() throws Exception {
-    super.tearDown();
-  }
-  
-  public void testCount() throws Exception {
-    JDBCHelper helper = TestUtils.createJDBCHelper();
-    JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder();
-    OperationsFactory operations = helper.getOperations();
+    @Override
+    public void testSimpleGroup() throws Exception {
+        super.testSimpleGroup();
+    }
 
-    List<String> expectedSQLs = TestUtils.getSQLs("count.sql");
-    
-    FeatureStore sourceStore = TestUtils.openSourceStore1();
-
-    TableReference table = operations.createTableReference(
-            "dbtest", 
-            sqlbuilder.default_schema(), 
-            "test", 
-            null
-    );
-    FeatureType featureType = sourceStore.getDefaultFeatureType();
-    CountOperation count = operations.createCount(
-            featureType,
-            table, 
-            null, 
-            null
-    );
-    
-    String sql = count.getSQL();
-    assertEquals("Count SQL", expectedSQLs.get(0), sql);
-  }
-
-  public void testSimpleGroup() throws Exception {
-    JDBCHelper helper = TestUtils.createJDBCHelper();
-    JDBCSQLBuilderBase sqlbuilder = helper.createSQLBuilder();
-    OperationsFactory operations = helper.getOperations();
-
-    List<String> expectedSQLs = TestUtils.getSQLs("count.sql");
-    
-    FeatureStore sourceStore = TestUtils.openSourceStore1();
-
-    TableReference table = operations.createTableReference(
-            "dbtest", 
-            sqlbuilder.default_schema(), 
-            "test", 
-            null
-    );
-    FeatureType featureType = sourceStore.getDefaultFeatureType();
-    FeatureQuery query = sourceStore.createFeatureQuery();
-    query.getGroupByColumns().add("Long");
-    query.getAggregateFunctions().put("ID", "MIN");
-    query.getAggregateFunctions().put("Byte", "MAX");
-    query.getAggregateFunctions().put("Double", "SUM");
-    query.getOrder().add("Long");
-    CountOperation count = operations.createCount(
-            featureType,
-            table, 
-            null, 
-            query
-    );
-    String sql = count.getSQL();
-    System.out.println("###### SQL:"+sql);
-    System.out.println("###### EXP:"+expectedSQLs.get(1));
-    
-    assertEquals("Count with group SQL", expectedSQLs.get(1), sql);
-  }
-
-  // TODO: añadir un test con where, group y order.
 }
