From 3b7a8d604d1d56cf49a54b96e27cd2ecc0ae4ce5 Mon Sep 17 00:00:00 2001
From: tpylak <tpylak>
Date: Tue, 17 Aug 2010 10:54:28 +0000
Subject: [PATCH] minor: remove unnecessary classes

SVN: 17474
---
 .../FeatureVectorUploaderTest.java            |  5 +-
 .../shared/imaging/dataaccess/DBUtils.java    | 69 -------------------
 .../dataaccess/FeatureVectorDAOTest.java      |  4 +-
 .../dataaccess/ImagingQueryDAOTest.java       |  4 +-
 4 files changed, 9 insertions(+), 73 deletions(-)
 delete mode 100644 screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/DBUtils.java

diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureVectorUploaderTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureVectorUploaderTest.java
index c7e07ce0950..c6bf246977a 100644
--- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureVectorUploaderTest.java
+++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureVectorUploaderTest.java
@@ -23,6 +23,8 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import net.lemnik.eodsql.QueryTool;
+
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
@@ -30,7 +32,6 @@ import ch.systemsx.cisd.openbis.dss.etl.ScreeningContainerDatasetInfo;
 import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.Geometry;
 import ch.systemsx.cisd.openbis.plugin.screening.shared.dto.PlateFeatureValues;
 import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.AbstractDBTest;
-import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.DBUtils;
 import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.IImagingQueryDAO;
 import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.ImgFeatureDefDTO;
 import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.ImgFeatureValuesDTO;
@@ -53,7 +54,7 @@ public class FeatureVectorUploaderTest extends AbstractDBTest
     @BeforeClass(alwaysRun = true)
     public void init() throws SQLException
     {
-        dao = DBUtils.getQuery(datasource, IImagingQueryDAO.class);
+        dao = QueryTool.getQuery(datasource, IImagingQueryDAO.class);
     }
 
     @Test
diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/DBUtils.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/DBUtils.java
deleted file mode 100644
index 1206b6ee82e..00000000000
--- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/DBUtils.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2009 ETH Zuerich, CISD
- *
- * 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 ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess;
-
-import javax.sql.DataSource;
-
-import net.lemnik.eodsql.BaseQuery;
-import net.lemnik.eodsql.InvalidDataTypeException;
-import net.lemnik.eodsql.InvalidQueryException;
-import net.lemnik.eodsql.QueryTool;
-import net.lemnik.eodsql.TransactionQuery;
-
-/**
- * Database utilities.
- * 
- * @author Bernd Rinn
- */
-public class DBUtils
-{
-
-    /**
-     * Use this method instead of {@link QueryTool#getQuery(DataSource, Class)}. Only in this way
-     * you make sure that the rigth query mappers will be registered.
-     */
-    public static <T extends BaseQuery> T getQuery(final DataSource dataSource, final Class<T> query)
-            throws InvalidDataTypeException, InvalidQueryException
-    {
-        return QueryTool.getQuery(dataSource, query);
-    }
-
-    /**
-     * Rolls backs and closes the given <var>transactionOrNull</var>, if it is not <code>null</code>
-     * .
-     */
-    public static void rollbackAndClose(TransactionQuery transactionOrNull)
-    {
-        if (transactionOrNull != null)
-        {
-            transactionOrNull.rollback();
-            transactionOrNull.close();
-        }
-    }
-
-    /**
-     * Closes the given <var>transactionOrNull</var>, if it is not <code>null</code> .
-     */
-    public static void close(TransactionQuery transactionOrNull)
-    {
-        if (transactionOrNull != null)
-        {
-            transactionOrNull.close();
-        }
-    }
-
-}
diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/FeatureVectorDAOTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/FeatureVectorDAOTest.java
index eafbf6a7be6..e12e0316b4c 100644
--- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/FeatureVectorDAOTest.java
+++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/FeatureVectorDAOTest.java
@@ -21,6 +21,8 @@ import static org.testng.AssertJUnit.assertEquals;
 import java.sql.SQLException;
 import java.util.List;
 
+import net.lemnik.eodsql.QueryTool;
+
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
@@ -56,7 +58,7 @@ public class FeatureVectorDAOTest extends AbstractDBTest
     @BeforeClass(alwaysRun = true)
     public void init() throws SQLException
     {
-        dao = DBUtils.getQuery(datasource, IImagingQueryDAO.class);
+        dao = QueryTool.getQuery(datasource, IImagingQueryDAO.class);
     }
 
     private ImgDatasetDTO createDataSet()
diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImagingQueryDAOTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImagingQueryDAOTest.java
index 2ffc31f81b0..e18be73f2b9 100644
--- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImagingQueryDAOTest.java
+++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImagingQueryDAOTest.java
@@ -24,6 +24,8 @@ import java.sql.SQLException;
 import java.util.Arrays;
 import java.util.List;
 
+import net.lemnik.eodsql.QueryTool;
+
 import org.testng.AssertJUnit;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
@@ -79,7 +81,7 @@ public class ImagingQueryDAOTest extends AbstractDBTest
     @BeforeClass(alwaysRun = true)
     public void init() throws SQLException
     {
-        dao = DBUtils.getQuery(datasource, IImagingQueryDAO.class);
+        dao = QueryTool.getQuery(datasource, IImagingQueryDAO.class);
     }
 
     @Test
-- 
GitLab