Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Running Another Java Class Main method from SWTBot Test(Running Another Java Class Main method from SWTBot Test)
Running Another Java Class Main method from SWTBot Test [message #640168] Fri, 19 November 2010 12:32 Go to next message
Leela  is currently offline Leela Friend
Messages: 10
Registered: June 2010
Junior Member
Hi

I want to run a Java program as part of one of the test methods in SWTBot TestCase as shown below:

@RunWith(SWTBotJunit4ClassRunner.class)
public class FirstTest {

public static SWTWorkbenchBot bot;

String projName = "MyFirstProject";
String fileName = "filetest.txt";

@Test
public void testCreationOfProject() {
canCreateAProject();
}

@Test
public void testCreationOfCustomFIle {
String[] argms = new String[] {"C:/temp","reff.html"};
com.ds.vohjk.runner.BFClass.main(argums);
SWTBotShell shell = bot.shell("New Project");
shell.activate();
}
}

Is this possible to do?? Can anyone help me in this??

When I tried SWTBot testCase is getting terminated after calling main method.
Re: Running Another Java Class Main method from SWTBot Test [message #640203 is a reply to message #640168] Fri, 19 November 2010 15:01 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Why is it getting terminated. Do you have any error messages or a stack
trace that might help diagnose this issue?

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr

On 11/19/10 6:02 PM, Leela wrote:
> Hi
>
> I want to run a Java program as part of one of the test methods in
> SWTBot TestCase as shown below:
>
> @RunWith(SWTBotJunit4ClassRunner.class)
> public class FirstTest {
>
> public static SWTWorkbenchBot bot;
>
> String projName = "MyFirstProject";
> String fileName = "filetest.txt";
>
> @Test
> public void testCreationOfProject() {
> canCreateAProject();
> }
>
> @Test
> public void testCreationOfCustomFIle {
> String[] argms = new String[] {"C:/temp","reff.html"};
> com.ds.vohjk.runner.BFClass.main(argums);
> SWTBotShell shell = bot.shell("New Project");
> shell.activate();
> }
> }
>
> Is this possible to do?? Can anyone help me in this??
>
> When I tried SWTBot testCase is getting terminated after calling main
> method.
Previous Topic:Drag and Drop?
Next Topic:Ensuring preconditions before SWTBot test run
Goto Forum:
  


Current Time: Thu Apr 25 03:53:10 GMT 2024

Powered by FUDForum. Page generated in 0.02443 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top