Partage
  • Partager sur Facebook
  • Partager sur Twitter

JAVA

test unitaire pour un plugin eclipse

Sujet résolu
    21 juin 2016 à 16:03:58

    if we had a file that contains all the informations of the configuration and after creating a new instance of ILaunchConfiguration or ILaunch we want to charge the informations of the file in this configuration ,how to do ? I did a try but i didn't khnow how to link between the file and the configuration @Before
    @Before
    public void setUp() throws Exception {
    ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType lct = manager.getLaunchConfigurationType("org.eclipse.trace32tcf.debug.LaunchConfigurationType");
    assertNotNull("no config type", lct); 
            ILaunchConfiguration[] configuration = manager.getLaunchConfigurations(lct);
    try{
    FileInputStream data = new FileInputStream("C:/rh/config.txt" );
    ObjectInputStream lecture = new ObjectInputStream(data);
    int  val = lecture .readInt();
    //.......................................
    lecture .close();
    }catch (Exception e){
    System.out.println(e.toString());
    }
    }
    • Partager sur Facebook
    • Partager sur Twitter
    Anonyme
      21 juin 2016 à 16:37:24

      Hi

      Please add your code with bbcode

      • Partager sur Facebook
      • Partager sur Twitter
        21 juin 2016 à 16:46:22

        <b>

        @Before

        public void setUp() throws Exception {

        Map<String, Object> list =  null;

        ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();

        ILaunchConfigurationType lct = manager.getLaunchConfigurationType("org.eclipse.trace32tcf.debug.LaunchConfigurationType");

        assertNotNull("no config type", lct); 

                ILaunchConfiguration[] configuration = manager.getLaunchConfigurations(lct);

        try{

        FileInputStream data = new FileInputStream("C:/rh/config.txt" );

        ObjectInputStream lecture = new ObjectInputStream(data);

        list=(Map<String, Object>) lecture.readObject();

        //int  val = lecture .readInt();

        //.......................................

        lecture .close();

        }catch (Exception e){

        System.out.println(e.toString());

        }

        </b>

        • Partager sur Facebook
        • Partager sur Twitter
          21 juin 2016 à 16:48:27

          how to do?

          -
          Edité par OmaimaBouaziz2 21 juin 2016 à 16:48:47

          • Partager sur Facebook
          • Partager sur Twitter
          Anonyme
            21 juin 2016 à 16:52:33

            When you write your message you have a button the image of the button is </> you click here and you select your langage and you copy your code :)
            • Partager sur Facebook
            • Partager sur Twitter
              21 juin 2016 à 21:58:12

              @Before
              
              public void setUp() throws Exception {
              
              Map<String, Object> list =  null;
              
              ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
              
              ILaunchConfigurationType lct = manager.getLaunchConfigurationType("org.eclipse.trace32tcf.debug.LaunchConfigurationType");
              
              assertNotNull("no config type", lct); 
              
                      ILaunchConfiguration[] configuration = manager.getLaunchConfigurations(lct);
              
              try{
              
              FileInputStream data = new FileInputStream("C:/rh/config.txt" );
              
              ObjectInputStream lecture = new ObjectInputStream(data);
              
              list=(Map<String, Object>) lecture.readObject();
              
              //int  val = lecture .readInt();
              
              //.......................................
              
              lecture .close();
              
              }catch (Exception e){
              
              System.out.println(e.toString());
              
              }
               
               

              -
              Edité par OmaimaBouaziz2 21 juin 2016 à 21:59:11

              • Partager sur Facebook
              • Partager sur Twitter

              JAVA

              × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
              × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
              • Editeur
              • Markdown