Re: [scalatest-users] How to run a single test (run/debug?) from the UI in the Eclipse plugin?

76 views
Skip to first unread message

Bill Venners

unread,
Apr 10, 2013, 8:57:30 AM4/10/13
to scalate...@googlegroups.com
Hi Dan,

You should be able to right click anywhere in the body of the test.
One of the options that should pop up us to run just that test. If you
click in a scope that encloses, say, three tests, it should give you
an option to just run those three tests, etc. Essentially, whatever
you click on, you should be able to run exclusively if you so choose.

Bill

On Wed, Apr 10, 2013 at 4:14 AM, Dan Gravell
<elstens...@googlemail.com> wrote:
> If I have a large test suite with a number of tests I don't necessarily want
> to run all tests every time.
>
> So how do I run a single test? *After* all the tests have run you can right
> click on the scalatest view and select individual tests, but you can't
> choose to debug instead.
>
> Any ideas?
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "scalatest-users" group.
> To post to this group, send email to scalate...@googlegroups.com
> To unsubscribe from this group, send email to
> scalatest-use...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/scalatest-users?hl=en
> ScalaTest itself, and documentation, is available here:
> http://www.artima.com/scalatest
> ---
> You received this message because you are subscribed to the Google Groups
> "scalatest-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scalatest-use...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Bill Venners
Artima, Inc.
http://www.artima.com

Dan Gravell

unread,
Apr 10, 2013, 12:22:46 PM4/10/13
to scalate...@googlegroups.com
Thanks for the reply Bill. We may have inconsistent terminology. Just to check, this is what I mean by a 'test':

  it must "return certain release matches for 13 by Blur using tags" in {
    val json = Queries.call(Tags("13", "Blur", maxResultCount="20", minCertainty="1"))
    assertResultsExistAndAllCertain((json \ "score") .extract[List[Int]])
   }

If I position the cursor inside that code block and right click and hover over "Run As" I get:

- ScalaTest - File
- ScalaTest - Suite
- ScalaTest - Test

So I click "ScalaTest - Test" but nothing happens. So I check the Error Log and see an interesting error message:

org.eclipse.core.runtime.CoreException: Could not write file: /home/gravelld/eclipse-workspaces/bliss/.metadata/.plugins/org.eclipse.debug.core/.launches/API MethodInvocation(com.onemusicapi.integrationtest.v20130307.FullTestSpec,it,class FullTestSpec extends java.lang.Object with org.scalatest.FlatSpec with ScalaObject {
[snip a lot of text]
},FullTestSpec.this{FullTestSpec.this.type}.it.must{(string- String)FullTestSpec.this.ItVerbString}('return certain release matches for 13 by Blur using tags'{java.lang.String('return certain release matches for 13 by Blur using tags')}){FullTestSpec.this.ItVerbString},must,List(return certain release matches for 13 by Blur using tags)).launch (File name too long)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:209)
at org.eclipse.core.internal.filesystem.local.LocalFile.openOutputStream(LocalFile.java:382)
... 37 more

Is it generating a new Scala class with a [file]name that is too long?

Dan

Bill Venners

unread,
Apr 10, 2013, 3:46:21 PM4/10/13
to scalate...@googlegroups.com
Hi Dan,

You are selecting the correct menu option. And it does seem to be
trying to create a very strangely named file. I'm at a client site
today so don't have time to investigate, but we'll take a look closer
tonight and see if we can figure it out.

Bill

On Wed, Apr 10, 2013 at 11:22 AM, Dan Gravell

Chua Chee Seng

unread,
Apr 11, 2013, 8:37:23 AM4/11/13
to scalate...@googlegroups.com
Hi Dan, 

It looks like the detected test name wasn't correct and eclipse is having problem creating the run configuration with a wrong (and long test name), I'll try to see if I can reproduce the problem.  For a immediate workaround you can try to create ScalaTest run configuration manually and type in the test name, note that the test name of the following:-

behavior of "Something"

it must "return certain release matches for 13 by Blur using tags" in {
  ...
}

The test name will be:
Something must return certain release matches for 13 by Blur using tags

Hope this helps.

Best Regards, 
Chee Seng

Dan Gravell

unread,
Apr 12, 2013, 5:00:02 AM4/12/13
to scalate...@googlegroups.com
Thanks Chee Seng... the workaround... works!

Do you want my project or similar to help reproduce? Let me know where to send it.

Dan

Chee Seng Chua

unread,
Apr 12, 2013, 8:49:26 AM4/12/13
to scalate...@googlegroups.com
Hi Dan, 

Thanks, good news is that I am able to reproduced and fixed that, the bug only affects FlatSpec and only happens if you use 'must' instead of 'should'.  I am going to build and hopefully it will be in scala-ide update site soon.

Thanks for reporting!

Best Regards, 
Chee Seng

Chee Seng Chua

unread,
Apr 14, 2013, 12:06:41 AM4/14/13
to scalate...@googlegroups.com
Hi Dan, 

Just to report that the update has gone into scala-ide update sites, you should be able to install the update now through eclipse's Help->Check Updates.

Thanks!

Best Regards, 
Chee Seng

Dan Gravell

unread,
Apr 15, 2013, 7:23:43 AM4/15/13
to scalate...@googlegroups.com
Thanks!
Reply all
Reply to author
Forward
0 new messages