void addTest(String name, String description, String[] idReqs, TestList pSuite, String toWrite) {
    name = getTestName(name, pSuite, 0);
    AutomaticTest pTest = new AutomaticTest(name, description, id_plugin);
    pTest.setConceptorLoginInModel(DataModel.getCurrentUser().getLoginFromModel());
    if (Api.isConnected()) {
      try {
        pSuite.addTestInDBAndModel(pTest);
      } catch (Exception e1) {
        Tools.ihmExceptionView(e1);
        return;
      }
    }
    File file = null;
    try {
      Util.log("[JMeterIntegrationPlugin:AddTest] Create test Script file");
      file = writeJunitFile(null, pTest, toWrite);
    } catch (Exception e2) {
      Tools.ihmExceptionView(e2);
      e2.printStackTrace();
      return;
    }
    Script pScript = new Script(file.getName(), "Junit test script");
    pScript.setLocalisation(file.getAbsolutePath());
    pScript.setTypeInModel(ApiConstants.TEST_SCRIPT);
    pScript.setScriptExtensionInModel(pTest.getExtensionFromModel());
    // pScript.setPlugArg("");

    if (Api.isConnected()) {
      try {
        pTest.addScriptInDBAndModel(pScript, file);
        Util.log(
            "[JMeterIntegrationPlugin:AddTest] Add Script : "
                + pScript.getNameFromModel()
                + " to DB & Model");
      } catch (Exception e3) {
        Tools.ihmExceptionView(e3);
        return;
      }
    }

    // add associated requirements
    Vector<ReqManager> reqManagers = pIPlugObject.getReqManagers();
    for (ReqManager reqManager : reqManagers) {
      for (String idReqString : idReqs) {
        int idReq = new Integer(idReqString).intValue();
        reqManager.addReqLinkWithTest(pTest, idReq);
      }
    }
  }
 File writeJunitFile(
     File pFile, org.objectweb.salome_tmf.data.AutomaticTest pTest, String toWtrite)
     throws Exception {
   String fileName;
   if (pFile == null) {
     Properties sys = System.getProperties();
     String tmpDir = sys.getProperty("java.io.tmpdir");
     String fs = sys.getProperty("file.separator");
     fileName = tmpDir + fs + pTest.getNameFromModel() + ".junit";
     pFile = new File(fileName);
   } else {
     fileName = pFile.getAbsolutePath();
     pFile.delete();
     pFile.createNewFile();
   }
   Util.log("[JMeterIntegrationPlugin:writeJunitFile] write " + toWtrite + ", in " + fileName);
   FileOutputStream fos = new FileOutputStream(pFile);
   BufferedOutputStream bos = new BufferedOutputStream(fos);
   byte[] b = toWtrite.getBytes();
   bos.write(b, 0, b.length);
   bos.flush();
   bos.close();
   // return null;
   return pFile;
 }
  /** Odre d'edition du test */
  public void editTest(
      String testScript,
      org.objectweb.salome_tmf.data.AutomaticTest pTest,
      Hashtable arg,
      String plugParam)
      throws Exception {
    try {
      File pFile = new File(testScript);
      FileInputStream pFileInputStream = new FileInputStream(pFile);
      Properties test_prop = new Properties();
      test_prop.load(pFileInputStream);
      // Utile.getPropertiesFile(testScript);
      String strID = test_prop.getProperty("attachment_id");
      String strAttachment = test_prop.getProperty("attachment_name");
      String strClass = test_prop.getProperty("junit_class");
      String meth = test_prop.getProperty("test_meth");
      String version = test_prop.getProperty("junit_version");
      pFileInputStream.close();

      File script =
          ChoiceOrEdit(pTest, false, pFile, strID, strAttachment, strClass, meth, version);
      if (script != null) {
        Script pScript = pTest.getScriptFromModel();
        pScript.updateInDB(script);
      }

    } catch (Exception e) {
      e.printStackTrace();
      Tools.ihmExceptionView(e);
    }
  }
  public String updateTestScript(
      String testScript, org.objectweb.salome_tmf.data.AutomaticTest pTest) {
    String strNewId = "";
    try {

      File pFile = new File(testScript);
      FileInputStream pFileInputStream = new FileInputStream(pFile);
      Properties test_prop = new Properties();
      test_prop.load(pFileInputStream);
      // Utile.getPropertiesFile(testScript);
      String strID = test_prop.getProperty("attachment_id");
      String strAttachment = test_prop.getProperty("attachment_name");
      String strClass = test_prop.getProperty("junit_class");
      String meth = test_prop.getProperty("test_meth");
      String version = test_prop.getProperty("junit_version");
      pFileInputStream.close();

      Hashtable tabAttach =
          new Hashtable(DataModel.getCurrentProject().getAttachmentMapFromModel());
      Enumeration e = tabAttach.elements();
      boolean trouve = false;
      while (e.hasMoreElements() && !trouve) {
        Attachment pAttach = (Attachment) e.nextElement();
        if (pAttach.getDescriptionFromModel().equals(JMeterTester.jMeterDescAttach)
            && pAttach.getNameFromModel().equals(strAttachment)) {
          strNewId = "" + pAttach.getIdBdd();
          trouve = true;
        }
      }
      // ADD PROJECT PATH

      String toWrite = "attachment_id = " + strNewId + "\n";
      toWrite += "attachment_name = " + strAttachment + "\n";
      toWrite += "junit_class = " + strClass + "\n";
      toWrite += "test_meth = " + meth + "\n";
      toWrite += "junit_version = " + version + "\n";
      File newFile = writeJunitFile(pFile, pTest, toWrite);
      Script pScript = pTest.getScriptFromModel();
      pScript.updateInDB(newFile);

    } catch (Exception e) {

    }
    return strNewId;
  }