Basic summary of MYECLIPSE usage of development tools (breakpoint test, Accelerator, JUnit test) _junit

Source: Internet
Author: User
Tags assert
Breakpoint debugging F5:step into a method to jump into a reference f6:step over this step, start the next step f7:step the current method where the return step is f8:resume skip to the next breakpoint, and if there is no next breakpoint, execute the program
Drop to Frame: Jumps to the first line of the current method
Watch: To observe the value of a variable or expression (select the variable or expression you want to observe, right-click--"Watch")
Breakpoints to note: 1, after the breakpoint debugging is complete, to clear all breakpoints in the Breakpoints view, or click Run to select Remove All breakpoints in the menu bar. 2, after the breakpoint debugging, be sure to perform all the breakpoints know the program is over, or directly close the program, restart, do not residue breakpoint program, so as not to consume CPU resources (you know)
Shortcut key Configuration shortcuts: Menu bar window-->preferences, select the keys in the general, you can configure. (Do not match, lest the shortcut key conflict) Shortcut key Introduction: 1, Content tips: alt+/2, Content repair: ctrl+1 3, Guide package: Ctrl+shift+o 4, Format code block: Ctrl+shift+f 5, view the method/class of the specific implementation: ALT + Left-right ARROW key to jump 6, move the code up and down: ALT + up and down direction key 7, add multiline comment to the selected code: ctrl+shift+/8, delete multiline comment for selected code: ctrl+shift+\ 9, delete one line: Ctrl+d 10, view method Description: F2 11, Reset the Perspective: Menu Bar-->window-->reset Perspective 12, convert the selected code to uppercase: Ctrl+shilt+x 13, and change the selected code to lowercase: ctrl+shift+y 14, copy the current mouse cursor in the row: ctrl+alt+ up and down the key 15, view the inheritance of the class: Ctrl+t 16, view source code: Mode One: Ctrl + mouse click; way two: Ctrl+shift+t, want to see the source code of that class, directly write which class can
17, see all the shortcuts in the MyEclipse ctrl+shift+l that appears all the shortcut key tables, you can view
JUnit tests Before,after and Beforeclass,afterclass in two ways, the former more commonly
[java]  View plain copy print? package com.heima.wjw;   import org.junit.after;   import  org.junit.afterclass;   import org.junit.before;   import org.junit.beforeclass;    import org.junit.test;   public class hello{        /* @BeforeClass       public static void beforeclass () {           system.out.println ("----------");      }        @AfterClass       public static void  Afterclass () {          system.out.println ("=========");      }*/              person  p;       /*       *  before,afThe location of the TER method does not matter,       *      befoer method represents execution before the specified test method runs. Can be used as an initialization resource        *      after method represents execution after the specified test method runs. Can be used as a shutdown resource        *   another annotation: Beforeclass,afterclass, the same as the above before,after effect,        *   But the difference is:       *       beforeclass is run before the beginning of the entire class, afterclass after the entire class has been executed        */         @Before        public void aaa () {            p=new person ();            system.out.println ("before");       }         @After        public void bbb () {            p=null;           system.out.println (" After ");       }        @Test         public void method1 () {  //      person p= New person ();           p.run ();        }        @Test        public void  METHOD2 () {  //      person p=new person ();           p.eat ();       }  }    class person{       public void eat () {           system.out.println ("Eat");        }       public void run () {            system.out.println ("Run");       }  }   assertion [Java]   View plain copy print? package com.heima.wjw;      import junit.framework.assert;      import org.junit.test;      public class test_junit {         @Test        public void method () {            //assert for assertions that there are a lot of methods             assert.asserttrue (true);            Assert.asserttrue ("This is Information", true);       }  }  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.