Skip to content
Snippets Groups Projects
Commit d88c02ec authored by felmer's avatar felmer
Browse files

LMS-1707 feature vector stuff: dao and tests fixed

SVN: 17528
parent 60b497c9
No related branches found
No related tags found
No related merge requests found
......@@ -171,7 +171,7 @@ public interface IImagingQueryDAO extends TransactionQuery
public long addSpot(ImgSpotDTO spot);
@Select("insert into FEATURE_DEFS (LABEL, CODE, DESCRIPTION, DS_ID) values "
+ "(?{1.label}, ?{1.label}, ?{1.description}, ?{1.dataSetId}) RETURNING ID")
+ "(?{1.label}, ?{1.code}, ?{1.description}, ?{1.dataSetId}) RETURNING ID")
public long addFeatureDef(ImgFeatureDefDTO featureDef);
@Select(sql = "insert into FEATURE_VALUES (VALUES, Z_in_M, T_in_SEC, FD_ID) values "
......
......@@ -26,6 +26,7 @@ import net.lemnik.eodsql.QueryTool;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import ch.systemsx.cisd.openbis.dss.generic.shared.utils.CodeAndTitle;
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.IImagingQueryDAO;
......@@ -53,7 +54,7 @@ public class FeatureVectorDAOTest extends AbstractDBTest
private static final String DS_PERM_ID = "dsFvId";
private static final String TEST_FEATURE_NAME = "test";
private static final String TEST_FEATURE_LABEL = "test 42";
@BeforeClass(alwaysRun = true)
public void init() throws SQLException
......@@ -104,7 +105,8 @@ public class FeatureVectorDAOTest extends AbstractDBTest
assertEquals(1, featureDefs.size());
ImgFeatureDefDTO featureDef = featureDefs.get(0);
assertEquals(TEST_FEATURE_NAME, featureDef.getLabel());
assertEquals(TEST_FEATURE_LABEL, featureDef.getLabel());
assertEquals(CodeAndTitle.normalize(TEST_FEATURE_LABEL), featureDef.getCode());
createFeatureValues(featureDef);
List<ImgFeatureValuesDTO> featureValuesList = dao.getFeatureValues(featureDef);
......@@ -147,7 +149,8 @@ public class FeatureVectorDAOTest extends AbstractDBTest
{
// Attach a feature def to it
ImgFeatureDefDTO featureDef =
new ImgFeatureDefDTO(TEST_FEATURE_NAME, "Test", dataSet.getId());
new ImgFeatureDefDTO(TEST_FEATURE_LABEL, "Test", dataSet.getId());
featureDef.setCode(CodeAndTitle.normalize(featureDef.getLabel()));
return dao.addFeatureDef(featureDef);
}
}
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