Index: AbstractTestComputedAttributes.java
===================================================================
--- AbstractTestComputedAttributes.java	(revision 46104)
+++ AbstractTestComputedAttributes.java	(revision 46105)
@@ -19,7 +19,7 @@
 import org.slf4j.LoggerFactory;
 
 public abstract class AbstractTestComputedAttributes extends TestCase {
-    
+
     protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractTestComputedAttributes.class);
 
     protected AbstractTestUtils utils;
@@ -27,18 +27,18 @@
     public AbstractTestComputedAttributes(String testName) {
         super(testName);
     }
-    
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
         new DefaultLibrariesInitializer().fullInitialize();
     }
-    
+
     @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
-    
+
     public AbstractTestUtils utils() {
         if (this.utils == null) {
             this.utils = this.createUtils();
@@ -47,157 +47,166 @@
     }
 
     protected abstract AbstractTestUtils createUtils();
-    
+
     // TODO add test methods here. The name must begin with 'test'. For example:
     // public void testHello() {}
-    
     public void testComputed1() throws Exception {
-        if( !utils().isTheDatabaseAvailable() ) {
-            return;
-        }
-        FeatureStore sourceStore = utils().openSourceStore2();
-        JDBCServerExplorer explorer = utils().openServerExplorer("testCreate");
+        try {
+            if (!utils().isTheDatabaseAvailable()) {
+                return;
+            }
+            FeatureStore sourceStore = utils().openSourceStore2();
+            JDBCServerExplorer explorer = utils().openServerExplorer("testCreate");
+            utils().initWorkspace("testCreate");
+            
+            utils().info_jdbc(explorer);
 
-        utils().info_jdbc(explorer);
+            utils().drop_tables(explorer, "testCreateTarget2");
+            utils().create_table_from(explorer, "testCreateTarget2", sourceStore);
+            utils().insert_into_from(explorer, "testCreateTarget2", sourceStore, FeatureStore.MODE_APPEND);
 
-        utils().drop_tables(explorer, "testCreateTarget2");
-        utils().create_table_from(explorer, "testCreateTarget2", sourceStore);
-        utils().insert_into_from(explorer, "testCreateTarget2", sourceStore, FeatureStore.MODE_APPEND);
-      
-        FeatureStore dbstore = utils().openStore(explorer,"testCreateTarget2");
-        dbstore.edit();
-        FeatureType featureType = dbstore.getDefaultFeatureType();
-        EditableFeatureType eFeatureType = featureType.getEditable();
-        eFeatureType.add("Compu1", 
-                DataTypes.INTEGER, 
-                new DefaultFeatureAttributeEmulatorExpression(
-                        eFeatureType, 
-                        ExpressionUtils.createExpression("ID*2")
-                ));
-        eFeatureType.add("Compu2", 
-                DataTypes.INTEGER, 
-                new DefaultFeatureAttributeEmulatorExpression(
-                        eFeatureType, 
-                        ExpressionUtils.createExpression("Poblacion+10000+Compu1")
-                ));
-        dbstore.update(eFeatureType);
-        dbstore.finishEditing();
-        List<Feature> features = dbstore.getFeatures();
-        for (int i = 0; i < features.size(); i++) {
-            Feature feature = features.get(i);
-            assertEquals("Compu1 "+i, feature.getInt("ID") * 2, feature.getInt("Compu1"));
-            if(feature.get("Poblacion")==null) {
-                assertEquals("Compu2 "+i, null, feature.get("Compu2"));
-            } else {
-                assertEquals("Compu2 "+i, feature.getInt("Poblacion") + 10000 + feature.getInt("Compu1"), feature.getInt("Compu2"));
+            FeatureStore dbstore = utils().openStore(explorer, "testCreateTarget2");
+            dbstore.edit();
+            FeatureType featureType = dbstore.getDefaultFeatureType();
+            EditableFeatureType eFeatureType = featureType.getEditable();
+            eFeatureType.add("Compu1",
+                    DataTypes.INTEGER,
+                    new DefaultFeatureAttributeEmulatorExpression(
+                            eFeatureType,
+                            ExpressionUtils.createExpression("ID*2")
+                    ));
+            eFeatureType.add("Compu2",
+                    DataTypes.INTEGER,
+                    new DefaultFeatureAttributeEmulatorExpression(
+                            eFeatureType,
+                            ExpressionUtils.createExpression("Poblacion+10000+Compu1")
+                    ));
+            dbstore.update(eFeatureType);
+            dbstore.finishEditing();
+            List<Feature> features = dbstore.getFeatures();
+            for (int i = 0; i < features.size(); i++) {
+                Feature feature = features.get(i);
+                assertEquals("Compu1 " + i, feature.getInt("ID") * 2, feature.getInt("Compu1"));
+                if (feature.get("Poblacion") == null) {
+                    assertEquals("Compu2 " + i, null, feature.get("Compu2"));
+                } else {
+                    assertEquals("Compu2 " + i, feature.getInt("Poblacion") + 10000 + feature.getInt("Compu1"), feature.getInt("Compu2"));
+                }
             }
+            DisposeUtils.dispose(dbstore);
+        } catch (Throwable th) {
+            LOGGER.warn("", th);
+            throw th;
         }
-        DisposeUtils.dispose(dbstore);
     }
-    
+
     @SuppressWarnings("UnusedAssignment")
     public void testComputed2() throws Exception {
-        if( !utils().isTheDatabaseAvailable() ) {
-            return;
-        }
-        String testTableName = "testComputedAttributes2";
-        JDBCServerExplorer explorer = utils().openServerExplorer("computedAttr");
+        try {
+            if (!utils().isTheDatabaseAvailable()) {
+                return;
+            }
+            String testTableName = "testComputedAttributes2";
+            JDBCServerExplorer explorer = utils().openServerExplorer("computedAttr");
 
-        utils().info_jdbc(explorer);
-        utils().drop_tables(explorer, testTableName);
-        
-        FeatureStore sourceStore = utils().openSourceStore2();
-        
-        utils().create_table_from(explorer, testTableName, sourceStore);
-        utils().insert_into_from(explorer, testTableName, sourceStore, FeatureStore.MODE_APPEND);
-      
-        FeatureStore dbstore = utils().openStore(explorer,testTableName);
-        
-        dbstore.edit();
-        FeatureType featureType = dbstore.getDefaultFeatureType();
-        EditableFeatureType eFeatureType = featureType.getEditable();
-        FeatureQuery query = sourceStore.createFeatureQuery();
-        eFeatureType.add("CompuID", 
-                DataTypes.INTEGER, 
-                new DefaultFeatureAttributeEmulatorExpression(
-                        eFeatureType, 
-                        ExpressionUtils.createExpression("MOD(ID,10)")
-                ));
-        eFeatureType.add("CompuPob", 
-                DataTypes.INTEGER, 
-                new DefaultFeatureAttributeEmulatorExpression(
-                        eFeatureType, 
-                        ExpressionUtils.createExpression("Poblacion+1")
-                ));
-        eFeatureType.add("CompuProv", 
-                DataTypes.STRING, 
-                new DefaultFeatureAttributeEmulatorExpression(
-                        eFeatureType, 
-                        ExpressionUtils.createExpression("UPPER(Provincia)")
-                ));
-        EditableFeatureAttributeDescriptor extraColumn1 = 
-                query.getExtraColumn().add("ExtraID900", DataTypes.INTEGER);
-        EditableFeatureAttributeDescriptor extraColumn2 = 
-                query.getExtraColumn().add("ExtraPobDen", DataTypes.INTEGER);
-        EditableFeatureAttributeDescriptor extraColumn3 = 
-                query.getExtraColumn().add("ExtraAno", DataTypes.INTEGER);
+            utils().info_jdbc(explorer);
+            utils().drop_tables(explorer, testTableName);
 
-        extraColumn1.setFeatureAttributeEmulator(
-                new DefaultFeatureAttributeEmulatorExpression(
-                        eFeatureType, 
-                        ExpressionUtils.createExpression("CompuID+900")));
-        extraColumn2.setFeatureAttributeEmulator(
-                new DefaultFeatureAttributeEmulatorExpression(
-                        eFeatureType, 
-                        ExpressionUtils.createExpression("CompuPob+Densidad")));
-        extraColumn3.setFeatureAttributeEmulator(
-                new DefaultFeatureAttributeEmulatorExpression(
-                        eFeatureType, 
-                        ExpressionUtils.createExpression("EXTRACT(YEAR FROM Fecha)")));
-	
-        query.getGroupByColumns().add("Comunidad");
-        query.getGroupByColumns().add("CompuProv");
-        query.getGroupByColumns().add("ExtraAno");
-        query.getAggregateFunctions().put("ID", "MIN");
-        query.getAggregateFunctions().put("Poblacion", "MIN");
-        query.getAggregateFunctions().put("CompuID", "MIN");
-        query.getAggregateFunctions().put("CompuPob", "SUM");
-        query.getAggregateFunctions().put("ExtraID900", "SUM");
-        query.getAggregateFunctions().put("ExtraPobDen", "SUM");
-        dbstore.update(eFeatureType);
-        dbstore.finishEditing();
-        
-        
-        List<Feature> features0 = dbstore.getFeatures(query);
-        ArrayList<Feature> features = new ArrayList<>();
-        
-        System.out.println("ID,Comunidad,Provincia,Ciudad,Poblacion,Densidad,Fecha,CompuID,CompuPob,CompuProv,ExtraID900,ExtraPobDen,ExtraAno");
-        for (int i = 0; i < features0.size(); i++) {
-            Feature feature = features0.get(i);
-            features.add(feature.getCopy());
-	    System.out.print(feature.toString());
-	    System.out.print(","+feature.get("ExtraID900"));
-	    System.out.print(","+feature.get("ExtraPobDen"));
-	    System.out.println(","+feature.get("ExtraAno"));
+            FeatureStore sourceStore = utils().openSourceStore2();
+
+            utils().create_table_from(explorer, testTableName, sourceStore);
+            utils().insert_into_from(explorer, testTableName, sourceStore, FeatureStore.MODE_APPEND);
+
+            FeatureStore dbstore = utils().openStore(explorer, testTableName);
+
+            dbstore.edit();
+            FeatureType featureType = dbstore.getDefaultFeatureType();
+            EditableFeatureType eFeatureType = featureType.getEditable();
+            FeatureQuery query = sourceStore.createFeatureQuery();
+            eFeatureType.add("CompuID",
+                    DataTypes.INTEGER,
+                    new DefaultFeatureAttributeEmulatorExpression(
+                            eFeatureType,
+                            ExpressionUtils.createExpression("MOD(ID,10)")
+                    ));
+            eFeatureType.add("CompuPob",
+                    DataTypes.INTEGER,
+                    new DefaultFeatureAttributeEmulatorExpression(
+                            eFeatureType,
+                            ExpressionUtils.createExpression("Poblacion+1")
+                    ));
+            eFeatureType.add("CompuProv",
+                    DataTypes.STRING,
+                    new DefaultFeatureAttributeEmulatorExpression(
+                            eFeatureType,
+                            ExpressionUtils.createExpression("UPPER(Provincia)")
+                    ));
+            EditableFeatureAttributeDescriptor extraColumn1
+                    = query.getExtraColumn().add("ExtraID900", DataTypes.INTEGER);
+            EditableFeatureAttributeDescriptor extraColumn2
+                    = query.getExtraColumn().add("ExtraPobDen", DataTypes.INTEGER);
+            EditableFeatureAttributeDescriptor extraColumn3
+                    = query.getExtraColumn().add("ExtraAno", DataTypes.INTEGER);
+
+            extraColumn1.setFeatureAttributeEmulator(
+                    new DefaultFeatureAttributeEmulatorExpression(
+                            eFeatureType,
+                            ExpressionUtils.createExpression("CompuID+900")));
+            extraColumn2.setFeatureAttributeEmulator(
+                    new DefaultFeatureAttributeEmulatorExpression(
+                            eFeatureType,
+                            ExpressionUtils.createExpression("CompuPob+Densidad")));
+            extraColumn3.setFeatureAttributeEmulator(
+                    new DefaultFeatureAttributeEmulatorExpression(
+                            eFeatureType,
+                            ExpressionUtils.createExpression("EXTRACT(YEAR FROM Fecha)")));
+
+            query.getGroupByColumns().add("Comunidad");
+            query.getGroupByColumns().add("CompuProv");
+            query.getGroupByColumns().add("ExtraAno");
+            query.getAggregateFunctions().put("ID", "MIN");
+            query.getAggregateFunctions().put("Poblacion", "MIN");
+            query.getAggregateFunctions().put("CompuID", "MIN");
+            query.getAggregateFunctions().put("CompuPob", "SUM");
+            query.getAggregateFunctions().put("ExtraID900", "SUM");
+            query.getAggregateFunctions().put("ExtraPobDen", "SUM");
+            dbstore.update(eFeatureType);
+            dbstore.finishEditing();
+
+            List<Feature> features0 = dbstore.getFeatures(query);
+            ArrayList<Feature> features = new ArrayList<>();
+
+            System.out.println("ID,Comunidad,Provincia,Ciudad,Poblacion,Densidad,Fecha,CompuID,CompuPob,CompuProv,ExtraID900,ExtraPobDen,ExtraAno");
+            for (int i = 0; i < features0.size(); i++) {
+                Feature feature = features0.get(i);
+                features.add(feature.getCopy());
+                System.out.print(feature.toString());
+                System.out.print("," + feature.get("ExtraID900"));
+                System.out.print("," + feature.get("ExtraPobDen"));
+                System.out.println("," + feature.get("ExtraAno"));
+            }
+            System.out.println("ID,Comunidad,Provincia,Ciudad,Poblacion,Densidad,Fecha,CompuID,CompuPob,CompuProv,ExtraID900,ExtraPobDen,ExtraAno");
+
+            features0 = null;
+            String[] header = new String[]{"ID", "Comunidad", "Provincia", "Ciudad", "Poblacion", "Densidad", "Fecha", "CompuID", "CompuPob", "CompuProv", "ExtraID900", "ExtraPobDen", "ExtraAno"};
+            ArrayList<Object[]> values = new ArrayList<>();
+            values.add(new Object[]{0, null, null, null, null, null, null, 0, null, "", 900, null, null});
+            values.add(new Object[]{5, "GVA", null, null, 200, null, null, 5, 201, "ALICANTE", 905, 206, 2019});
+            values.add(new Object[]{6, "GVA", null, null, 20, null, null, 6, 422, "ALICANTE", 1813, 1135, 2020});
+            values.add(new Object[]{8, "GVA", null, null, 100, null, null, 8, 702, "CASTELLON", 1817, 719, 2019});
+            values.add(new Object[]{1, "GVA", null, null, 500, null, null, 1, 1502, "VALENCIA", 1803, 1505, 2019});
+            values.add(new Object[]{3, "GVA", null, null, 50, null, null, 3, 352, "VALENCIA", 1807, 359, 2020});
+            for (int i = 0; i < features.size(); i++) {
+                for (int j = 0; j < header.length; j++) {
+                    assertEquals("feature[" + i + "][" + header[j] + "]:", values.get(i)[j], features.get(i).get(header[j]));
+                }
+            }
+
+            DisposeUtils.dispose(dbstore);
+        } catch (Throwable th) {
+            LOGGER.warn("", th);
+            throw th;
         }
-        System.out.println("ID,Comunidad,Provincia,Ciudad,Poblacion,Densidad,Fecha,CompuID,CompuPob,CompuProv,ExtraID900,ExtraPobDen,ExtraAno");
-	
-        features0 = null;
-	String[] header = new String[]{"ID","Comunidad","Provincia","Ciudad","Poblacion","Densidad","Fecha","CompuID","CompuPob","CompuProv","ExtraID900","ExtraPobDen","ExtraAno"};
-	ArrayList<Object[]> values = new ArrayList<>();
-	values.add(new Object[]{0, null, null, null, null, null, null, 0, null,"",900,null,null});
-	values.add(new Object[]{1, "GVA", null, null, 500, null, null, 1, 1502, "VALENCIA",1803,1505,2019});
-	values.add(new Object[]{3, "GVA", null, null, 50, null, null, 3, 352, "VALENCIA",1807,359,2020});
-	values.add(new Object[]{5, "GVA", null, null, 200, null, null, 5, 201, "ALICANTE",905,206,2019});
-	values.add(new Object[]{6, "GVA", null, null, 20, null, null, 6, 422, "ALICANTE",1813,1135,2020});
-	values.add(new Object[]{8, "GVA", null, null, 100, null, null, 8, 702, "CASTELLON",1817,719,2019});
-	for (int i = 0; i < features.size(); i++) {
-		for (int j = 0; j < header.length; j++) {
-			assertEquals("feature["+i+"]["+header[j]+"]:", values.get(i)[j],features.get(i).get(header[j]));
-		}
-	}
-
-        DisposeUtils.dispose(dbstore);
     }
 
 }
