Install the TestNG plugin offline:
Affected by factors such as the network, the online installation method is relatively slow. You can install the TestNG plug-in offline in the following ways.
1. Access the website directly through a browser, http://beust.com/eclipse
2. Click on the bottom link zipped /
3. The page displays the following versions
6.11.0.201703011520/
6.12.0.201709030110/
6.12.0.201709050550/
6.9.10.201512240000/
6.9.11.201604020423/
6.9.12.201607091356/
6.9.13.201609291640/
6.9.5.201505251947/
After testing in eclipse (luna), 6.10 and 6.11 support offline installation, but version 6.12 does not support it, maybe luna does not have the relevant testng library to provide
4. Select the version here: "6.10.0.201612030230/"
5. Click site_assembly.zip to download
6. Unzip the installation file to the dropin directory of eclipse and restart Eclipse to complete the plugin installation
Test code:
package test.testnGg; import org.testng.annotations.*; public class SimpleTest { @BeforeClass public void setUp() { // code that will be invoked when this test is instantiated } @Test(groups = { "fast" }) public void aFastTest() { System.out.println("Fast test"); } @Test(groups = { "slow" }) public void aSlowTest() { System.out.println("Slow test"); } @Test(threadPoolSize = 100, invocationCount = 500, timeOut = 10000) public void testServer(){ System.out.println(Thread.currentThread().getId()+":"+Thread.currentThread().getName()); } }
Right click and select the testServer method of Outline ->debug as ->TestNG test to start the test
Reference: http://www.cnblogs.com/xusweeter/p/6559196.html