File tree Expand file tree Collapse file tree 9 files changed +57
-19
lines changed
Expand file tree Collapse file tree 9 files changed +57
-19
lines changed Original file line number Diff line number Diff line change 126126 <include>src/test/parallel_distribute/*</include>
127127 </includes-->
128128 <parallel >classes</parallel >
129- <threadCount >2 </threadCount >
129+ <threadCount >3 </threadCount >
130130 <skipTests >${skipTests} </skipTests >
131131 </configuration >
132132 </plugin >
Original file line number Diff line number Diff line change 1+ package base ;
2+
3+ import java .text .SimpleDateFormat ;
4+ import java .util .Date ;
5+
6+ public class Utility {
7+
8+ public void printCurrentDateTime (){
9+ SimpleDateFormat formatter = new SimpleDateFormat ("dd/MM/yyyy HH:mm:ss" );
10+ Date date = new Date ();
11+ System .out .println (formatter .format (date ));
12+ }
13+ }
Original file line number Diff line number Diff line change 1+ package parallel_distribute ;
2+
3+ import base .Utility ;
4+ import org .testng .annotations .AfterSuite ;
5+ import org .testng .annotations .BeforeSuite ;
6+
7+ public class BaseTestNG {
8+ @ BeforeSuite
9+ public void setUp (){
10+ new Utility ().printCurrentDateTime ();
11+ }
12+ @ AfterSuite
13+ public void tearDown (){
14+ new Utility ().printCurrentDateTime ();
15+ }
16+ }
Original file line number Diff line number Diff line change 11package parallel_distribute ;
22
3+ import base .Utility ;
34import org .testng .annotations .Test ;
45
5- public class TestNG1 {
6- //@Test
6+ import java .text .SimpleDateFormat ;
7+ import java .util .Date ;
8+
9+ public class TestNG1 extends BaseTestNG {
10+ @ Test
711 public void TestNG1_Test1 (){
812 System .out .println ("TestNG1_Test1" );
913 System .out .println (Thread .currentThread ().getId ());
1014 }
1115
12- // @Test
13- public void TestNG1_Test2 (){
16+ @ Test
17+ public void TestNG1_Test2 () throws InterruptedException {
1418 System .out .println ("TestNG1_Test2" );
19+ Thread .sleep (2000 );
1520 System .out .println (Thread .currentThread ().getId ());
1621 }
1722
18- // @Test
23+ @ Test
1924 public void TestNG1_Test3 (){
2025 System .out .println ("TestNG1_Test3" );
2126 System .out .println (Thread .currentThread ().getId ());
Original file line number Diff line number Diff line change 22
33import org .testng .annotations .Test ;
44
5- public class TestNG2 {
6- // @Test
5+ public class TestNG2 extends BaseTestNG {
6+ @ Test
77 public void TestNG2_Test1 (){
88 System .out .println ("TestNG2_Test1" );
99 System .out .println (Thread .currentThread ().getId ());
1010 }
11- // @Test
12- public void TestNG2_Test2 (){
11+ @ Test
12+ public void TestNG2_Test2 () throws InterruptedException {
1313 System .out .println ("TestNG2_Test2" );
14+ Thread .sleep (2000 );
1415 System .out .println (Thread .currentThread ().getId ());
1516 }
16- // @Test
17+ @ Test
1718 public void TestNG2_Test3 (){
1819 System .out .println ("TestNG2_Test3" );
1920 System .out .println (Thread .currentThread ().getId ());
Original file line number Diff line number Diff line change 11package parallel_distribute ;
22
3+ import base .Utility ;
34import org .testng .annotations .Test ;
45
5- public class TestNG3 {
6- // @Test
6+ public class TestNG3 extends BaseTestNG {
7+ @ Test
78 public void TestNG2_Test1 (){
89 System .out .println ("TestNG2_Test1" );
910 System .out .println (Thread .currentThread ().getId ());
1011 }
11- // @Test
12- public void TestNG2_Test2 (){
12+ @ Test
13+ public void TestNG2_Test2 () throws InterruptedException {
1314 System .out .println ("TestNG2_Test2" );
15+ Thread .sleep (2000 );
1416 System .out .println (Thread .currentThread ().getId ());
1517 }
16- // @Test
18+ @ Test
1719 public void TestNG2_Test3 (){
1820 System .out .println ("TestNG2_Test3" );
1921 System .out .println (Thread .currentThread ().getId ());
22+ new Utility ().printCurrentDateTime ();
2023 }
2124}
Original file line number Diff line number Diff line change 1818public class TestLogin extends BaseTest {
1919 WebDriverWait wait ;
2020
21- @ Test
21+ // @Test
2222 public void MavenParamTest () throws InterruptedException {
2323 System .out .println (Thread .currentThread ().getId ());
2424 //WebDriver driver = PageDriver.getCurrentDriver();
Original file line number Diff line number Diff line change 1515public class TestLogin_invalid extends BaseTest {
1616 WebDriverWait wait ;
1717
18- @ Test
18+ // @Test
1919 public void MavenParamTest () throws InterruptedException {
2020 System .out .println (Thread .currentThread ().getId ());
2121
Original file line number Diff line number Diff line change 1414public class TestProductItems extends BaseTest {
1515 WebDriverWait wait ;
1616
17- @ Test
17+ // @Test
1818 public void Test_TestProductItems () throws Exception {
1919 System .out .println (Thread .currentThread ().getId ());
2020
You can’t perform that action at this time.
0 commit comments