Trying to execute a run-configuration

Well, I've cheated an dug into the com.intellij.execution package to try
to run an existing run configuration. I can get my hands on the
configuration with no problems (its a JUnitConfiguration class) but I
need to get some data to the actual test class that will be run.

What I want to do is add a -D to the JavaParameters. But I see no way to
do this. Does anybody (jetbrains?) have any advice? Here's my action:



--
Barry Kaplan
bkaplan@integratedtrading.com

6 comments

You may clone existing RunConfiguratation then cast it to
RunJavaConfiguration (if it is instanceof, JUnit and Application
configurations are) then
configuration.getProperty(RunJavaConfiguration.VM_PARAMETERS_PROPERTY) - to
get current JVM parameteres modify returned string and then set with
setProperty().

PS. This way may stop to work at any time.

--

Dmitry Peshehonov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


"Barry Kaplan" <bkaplan@integratedtrading.com> wrote in message
news:c2tkps$br5$1@is.intellij.net...

Well, I've cheated an dug into the com.intellij.execution package to try
to run an existing run configuration. I can get my hands on the
configuration with no problems (its a JUnitConfiguration class) but I
need to get some data to the actual test class that will be run.

>

What I want to do is add a -D to the JavaParameters. But I see no way to
do this. Does anybody (jetbrains?) have any advice? Here's my action:

>

 public void actionPerformed(AnActionEvent event) {
>      Project project =
> (Project)event.getDataContext().getData(DataConstants.PROJECT);
>      VirtualFile selectedFile = getSelectedFile(event);
>
>      RunManager runManager = RunManager.getInstance(project);
>      RuntimeConfiguration config = getCsvConfig(runManager);
>      if (config == null) {
>          Messages.showMessageDialog(project, "Could not find junit
> config '"+ CSV_RUNNER_CONFIG_NAME +"'", "Csv Runner",
> Messages.getErrorIcon());
>          return;
>      }
>
>      DataContext context = new
FilenameDataContext(selectedFile.getPath());
>      runManager.runConfiguration(true, config, context);
> }
> ]]>

>
>

--
Barry Kaplan
bkaplan@integratedtrading.com

>


0

Well, it looks like RunJavaConfiguration is obsficated.


Dmitry Peshehonov (JetBrains) wrote:

You may clone existing RunConfiguratation then cast it to
RunJavaConfiguration (if it is instanceof, JUnit and Application
configurations are) then
configuration.getProperty(RunJavaConfiguration.VM_PARAMETERS_PROPERTY) - to
get current JVM parameteres modify returned string and then set with
setProperty().

PS. This way may stop to work at any time.


--
Barry Kaplan
bkaplan@integratedtrading.com

0

Oops, your are right it is scrambled. You have to wait for Pallada EAP to
use it - shouldn't be scrambled here.

--

Dmitry Peshehonov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


"Barry Kaplan" <bkaplan@integratedtrading.com> wrote in message
news:c35gle$j2$1@is.intellij.net...

Well, it looks like RunJavaConfiguration is obsficated.

>
>

Dmitry Peshehonov (JetBrains) wrote:

>

You may clone existing RunConfiguratation then cast it to
RunJavaConfiguration (if it is instanceof, JUnit and Application
configurations are) then
configuration.getProperty(RunJavaConfiguration.VM_PARAMETERS_PROPERTY) -

to

get current JVM parameteres modify returned string and then set with
setProperty().

>

PS. This way may stop to work at any time.

>

>

--
Barry Kaplan
bkaplan@integratedtrading.com

>
>


0

Ok, I wait.

Dmitry Peshehonov (JetBrains) wrote:

Oops, your are right it is scrambled. You have to wait for Pallada EAP to
use it - shouldn't be scrambled here.


--
Barry Kaplan
bkaplan@integratedtrading.com

0

Will Pallada be for 4.1 or 5.x. I'm trying to build a plugin for our
internal team to make running tests via a our domain-specific harness
easy. Most of my team does not run the eap builds.

Barry Kaplan wrote:

Ok, I wait.

Dmitry Peshehonov (JetBrains) wrote:

>> Oops, your are right it is scrambled. You have to wait for Pallada EAP to
>> use it - shouldn't be scrambled here.
>>


--
Barry Kaplan
bkaplan@integratedtrading.com

0

Pallada is name of 4.1

--

Dmitry Peshehonov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


"Barry Kaplan" <bkaplan@integratedtrading.com> wrote in message
news:c39l3n$emv$3@is.intellij.net...

Will Pallada be for 4.1 or 5.x. I'm trying to build a plugin for our
internal team to make running tests via a our domain-specific harness
easy. Most of my team does not run the eap builds.

>

Barry Kaplan wrote:

>

Ok, I wait.

>

Dmitry Peshehonov (JetBrains) wrote:

>
>> Oops, your are right it is scrambled. You have to wait for Pallada EAP

to

>> use it - shouldn't be scrambled here.
>>
>

>

--
Barry Kaplan
bkaplan@integratedtrading.com

>


0

Please sign in to leave a comment.