diff --git a/arc-core/src/test/java/fr/insee/arc/core/service/global/dao/TableNamingTest.java b/arc-core/src/test/java/fr/insee/arc/core/service/global/dao/TableNamingTest.java index 8fe5b9510..ff4a9ba5c 100644 --- a/arc-core/src/test/java/fr/insee/arc/core/service/global/dao/TableNamingTest.java +++ b/arc-core/src/test/java/fr/insee/arc/core/service/global/dao/TableNamingTest.java @@ -15,10 +15,10 @@ public void buildTableNameTokensSuffix() { String client = "ARTEMIS"; long timestamp = System.currentTimeMillis(); - assertEquals("arc_bas2.artemis_"+timestamp+"_pilotage_fichier", TableNaming.buildTableNameWithTokens("arc_bas2", ViewEnum.PILOTAGE_FICHIER, client, timestamp)); - assertEquals("arc_bas2.artemis_"+timestamp+"_id_source", TableNaming.buildTableNameWithTokens("arc_bas2", ColumnEnum.ID_SOURCE, client, timestamp)); + assertEquals("arc_bas2.ARTEMIS_"+timestamp+"_pilotage_fichier", TableNaming.buildTableNameWithTokens("arc_bas2", ViewEnum.PILOTAGE_FICHIER, client, timestamp)); + assertEquals("arc_bas2.ARTEMIS_"+timestamp+"_id_source", TableNaming.buildTableNameWithTokens("arc_bas2", ColumnEnum.ID_SOURCE, client, timestamp)); assertEquals(null, TableNaming.buildTableNameWithTokens("arc_bas2", ColumnEnum.ID_SOURCE, null, timestamp)); - assertEquals("arc_bas2.artemis_"+timestamp+"_test", TableNaming.buildTableNameWithTokens("arc_bas2", "test", client, timestamp)); + assertEquals("arc_bas2.ARTEMIS_"+timestamp+"_test", TableNaming.buildTableNameWithTokens("arc_bas2", "test", client, timestamp)); assertEquals("arc_bas2.test", TableNaming.buildTableNameWithTokens("arc_bas2", "TEST")); } diff --git a/arc-ws/src/main/java/fr/insee/arc/ws/services/importServlet/dao/ClientDao.java b/arc-ws/src/main/java/fr/insee/arc/ws/services/importServlet/dao/ClientDao.java index e538406aa..1aeed1314 100644 --- a/arc-ws/src/main/java/fr/insee/arc/ws/services/importServlet/dao/ClientDao.java +++ b/arc-ws/src/main/java/fr/insee/arc/ws/services/importServlet/dao/ClientDao.java @@ -80,7 +80,8 @@ public boolean verificationClientFamille() throws ArcException { ArcPreparedStatementBuilder request = new ArcPreparedStatementBuilder(); request.append("SELECT EXISTS (SELECT 1 FROM arc.ihm_client") .append(" WHERE id_application=" + request.quoteText(client)) - .append(" AND id_famille=" + request.quoteText(famille)).append(" LIMIT 1);"); + .append(" AND id_famille=" + request.quoteText(famille)) + .append(" LIMIT 1);"); String bool = UtilitaireDao.get(0).executeRequestWithoutMetadata(connection, request).get(0).get(0); diff --git a/arc-ws/src/test/java/fr/insee/arc/ws/services/importServlet/dao/ClientDaoTest.java b/arc-ws/src/test/java/fr/insee/arc/ws/services/importServlet/dao/ClientDaoTest.java index 50aea94ab..b76d56414 100644 --- a/arc-ws/src/test/java/fr/insee/arc/ws/services/importServlet/dao/ClientDaoTest.java +++ b/arc-ws/src/test/java/fr/insee/arc/ws/services/importServlet/dao/ClientDaoTest.java @@ -23,16 +23,18 @@ public class ClientDaoTest extends InitializeQueryTest { @Test public void clientDaoTest() throws ArcException, SQLException { - InitializeQueryTest.buildPropertiesWithoutScalability("any"); + InitializeQueryTest.buildPropertiesWithoutScalability(null); + + PropertiesHandler p = PropertiesHandler.getInstance(); initializeTestData(); - + testVerificationFamilleOK(); testVerificationFamilleKO(); testSelectBusinessDataTables(); - destroyTestData(); +// destroyTestData(); } private void testSelectBusinessDataTables() throws ArcException { @@ -47,7 +49,6 @@ private void testSelectBusinessDataTables() throws ArcException { assertEquals(2,clientTables.size()); } - @Test public void testVerificationFamilleOK() throws ArcException { JSONObject json = new JSONObject( "{\"client\":\"ARTEMIS\",\"environnement\":\"arc.bas1\",\"familleNorme\":\"DSN\",\"format\":\"csv_gzip\"}"); @@ -56,7 +57,6 @@ public void testVerificationFamilleOK() throws ArcException { assertTrue(clientDao.verificationClientFamille()); } - @Test public void testVerificationFamilleKO() throws ArcException { JSONObject json = new JSONObject( "{\"client\":\"ARTEMIS\",\"environnement\":\"arc.bas1\",\"familleNorme\":\"BATI\",\"format\":\"csv_gzip\"}"); @@ -80,7 +80,7 @@ private void initializeTestData() throws SQLException, ArcException { query.append("SELECT 'DSN' as id_famille,'DSNFLASH' as id_application"); query.append(SQL.END_QUERY); - query.append("CREATE TABLE arc_bas1.ihm_mod_table_metier AS "); + query.append("CREATE TABLE arc_bas1.mod_table_metier AS "); query.append("SELECT 'DSN' as id_famille,'mapping_dsn_test1_ok' as nom_table_metier UNION ALL "); query.append("SELECT 'DSN' as id_famille,'mapping_dsn_test2_ok' as nom_table_metier UNION ALL "); query.append("SELECT 'PASRAU' as id_famille,'mapping_pasrau_test_ok' as nom_table_metier");