-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: better test mechanics for wsimport
- Loading branch information
Showing
7 changed files
with
196 additions
and
207 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
arc-ws/src/test/java/fr/insee/arc/ws/services/importServlet/ExpectedResults.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package fr.insee.arc.ws.services.importServlet; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import fr.insee.arc.ws.services.importServlet.bo.RetrievedTable; | ||
|
||
public class ExpectedResults { | ||
|
||
|
||
public static final List<RetrievedTable> EXPECTED_RETRIEVED_TABLES = Arrays.asList( | ||
new RetrievedTable("ws_info", 1, "ARTEMIS") | ||
,new RetrievedTable("mapping_dsn_test1_ok", 2, "file1_to_retrieve.xml") | ||
,new RetrievedTable("mod_table_metier", 1, "DSN") | ||
,new RetrievedTable("mod_variable_metier", 1, "DSN") | ||
,new RetrievedTable("nmcl_table1", 1, "data1") | ||
,new RetrievedTable("nmcl_table2", 1, "data2") | ||
,new RetrievedTable("ext_mod_famille", 1, "DSN") | ||
,new RetrievedTable("ext_mod_periodicite", 1, "1") | ||
); | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
arc-ws/src/test/java/fr/insee/arc/ws/services/importServlet/ImportOKNoScalabilityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package fr.insee.arc.ws.services.importServlet; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.UnsupportedEncodingException; | ||
import java.nio.charset.StandardCharsets; | ||
import java.sql.SQLException; | ||
import java.util.zip.GZIPInputStream; | ||
|
||
import org.apache.commons.io.IOUtils; | ||
import org.json.JSONObject; | ||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
import fr.insee.arc.core.dataobjects.ArcPreparedStatementBuilder; | ||
import fr.insee.arc.utils.dao.UtilitaireDao; | ||
import fr.insee.arc.utils.exception.ArcException; | ||
import fr.insee.arc.utils.query.InitializeQueryTest; | ||
import fr.insee.arc.utils.utils.ManipString; | ||
import fr.insee.arc.ws.services.importServlet.bo.ExecuteStep; | ||
import fr.insee.arc.ws.services.importServlet.dao.InitializeTestDataNoScalability; | ||
|
||
public class ImportOKNoScalabilityTest { | ||
|
||
@BeforeClass | ||
public static void setup() throws SQLException, ArcException { | ||
InitializeTestDataNoScalability.destroyTestData(); | ||
InitializeTestDataNoScalability.initializeTestData(true); | ||
} | ||
|
||
@AfterClass | ||
public static void tearDown() throws SQLException, ArcException { | ||
InitializeTestDataNoScalability.destroyTestData(); | ||
} | ||
|
||
@Test(expected = ArcException.class) | ||
public void testExecuteFamilyNotValid() throws ArcException, UnsupportedEncodingException { | ||
RunImport.testExecuteFamilyNotValid(); | ||
} | ||
|
||
@Test | ||
public void testExecute() throws ArcException, IOException { | ||
RunImport.testExecute(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.