Skip to content
Snippets Groups Projects
Commit 3b7a8d60 authored by tpylak's avatar tpylak
Browse files

minor: remove unnecessary classes

SVN: 17474
parent 8dece9ea
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
/*
* 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();
}
}
}
......@@ -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()
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment