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 07:32 Go to next message
Leela  is currently offline Leela
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 10:01 Go to previous message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
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: Sat Aug 30 12:36:14 EDT 2014

Powered by FUDForum. Page generated in 0.02076 seconds