import javax.xml.namespace.NamespaceContext;
+import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import fr.gouv.finances.dgfip.utils.Pair;
OutputStream fOut = new FileOutputStream(f);
try {
- byte[] buffer = new byte[1024];
- int len = 0;
- while ((len = confZipIn.read(buffer)) > 0) {
- fOut.write(buffer, 0, len);
- }
+ IOUtils.copy(confZipIn, fOut);
} finally {
fOut.close();
}
@Override
public ControlResult processControl(File xmlIn, File xmlOut, File reportOut, Map<String, Object> parameters) throws IOException, ParameterNeededException {
+ xemeliosControlEngine.reset();
+
// vérification des paramètres obligatoire
DocumentControlModel dc = xemeliosControlEngine.getDocumentControl();
for (ParamModel pm : dc.getParams()) {
saxWriter = new SaxXmlWriter();
}
+ public void reset() {
+ fichierAController = null;
+ rapport = null;
+ inputXmlFile = null;
+ hashParams.clear();
+ datecontrole = null;
+ IDrapport = "";
+ domainesControles = "";
+ hasTech01Error = false;
+ cch = null;
+ fichierEnrichi = null;
+ fichierEnrichiLocation = null;
+ rapportLocation = null;
+ status = STATUS_NOT_CONTROLLED;
+ anomaliesTechniques.clear();
+ textToXmlTransformer = null;
+ }
+
public DocumentControlModel getDcm() {
return dcm;
}
pesosConnector.processControl(null, null, null, pClone);
}
+ @Test
+ public void testDblCheck() throws Exception {
+ testPesValid();
+ testPesValid();
+ }
+
@Test
public void testPesValid() throws Exception {
File fPesIn = new File(testFilePath, "DEPOK.XML");