Re: [scalatest-users] Installing ScalaTest in Eclipse

1,081 views
Skip to first unread message

Bill Venners

unread,
Nov 12, 2012, 10:31:35 AM11/12/12
to scalate...@googlegroups.com
Hi Graham,

Sorry, the Scala IDE for Eclipse powers that be did recently change
this. I'm working on scalatest.org for 2.0.M5 right now and will try
and dig up the new instructions, post them here and also update the
site.

Bill

On Mon, Nov 12, 2012 at 4:23 PM, Graham Seed <gms...@gmail.com> wrote:
> Hi
>
> Instructions for installing ScalaTest in Eclipse are given at:
>
> http://scalatest.org/user_guide/using_scalatest_with_eclipse
>
> In the following section a link is provided but it is invalid:
>
> "
>
> Installing the ScalaTest Eclipse Plugin
>
> So, how do you get the plugin? Select Help -> Install New Software in
> Eclipse, and enter as your update site one of the "Scala IDE Ecosystem
> update site" URLs on this page:
>
> http://scala-ide.org/download/ecosystem.html
>
> "
>
> Is there an alternative link or alternative set of installation instructions
> for Eclipse Indigo 3.7.2?
>
> Graham
>
> --
> 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



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

Bill Venners

unread,
Nov 12, 2012, 10:52:24 AM11/12/12
to scalate...@googlegroups.com
Hi Graham,

I believe Chee Seng updated the instructions on the github readme document:

https://github.com/scalatest/scalatest-eclipse-plugin

At least he said he updated those instructions for "nightly builds"
six days ago.

Can you try those instructions? Sorry I've been out of the detailed
loop on the latest changes around the Scala IDE for Eclipse ecosystem.
As soon as I touch base with Chee Seng, who has been taking care of
this, I will update the scalatest.org site with proper instructions.

Thanks.

Bill

Graham Seed

unread,
Nov 12, 2012, 3:06:46 PM11/12/12
to scalate...@googlegroups.com
Hi

Thanks for your reply.

I read the instructions at:


but to be honest they are geared more for building using maven.

I installed the recommended Scala IDE at:

http://scala-ide.org/download/current.html

namely; 2.0.2 Release and the recommended Scala IDE version 2.02 for Scala version 2.9.x via the link on the webpage:


Having installed Scala IDE already if I reopen this link in Help|Install New Software then I see that Scala Test is one of the available nodes to install. This is the bit of info I was looking for.

Thanks.

Graham

PS. Incidentally, I keep well clear of the Scala IDE nightly builds as I previously installed this with Juno 4.2 and had a lot of problems and had to ultimately start all over again.

Bill Venners

unread,
Nov 12, 2012, 4:39:58 PM11/12/12
to scalate...@googlegroups.com
Hi Graham,

Ah, great you figured it out. Thanks for posting here. I'll confirm
with Chee Seng and update the scalatest.org page as well.

Bill

Graham Seed

unread,
Nov 13, 2012, 5:47:24 AM11/13/12
to scalate...@googlegroups.com
Hi

It still appears NOT to be working.

I pasted "the first test code" into a .scala file in Eclipse, as suggested at:


namely:

import org.scalatest.FlatSpec

class FirstSpec extends FlatSpec { // tests go here... }


and get a compiler error that that org.scalatest import cannot be found.

To confirm that the plugin is installed I revisited Help|Install New Software and tried reinstalling, which gives:

Cannot complete the request.  See the error log for details.
"ScalaTest for Scala IDE" will be ignored because it is already installed.

thus verifying that the ScalaTest plugin for Scala IDE is already installed.

Thus, why can't it find "org.scalatest"?

Are there additional setup options to be set?

Thanks.

Graham

Chee Seng Chua

unread,
Nov 13, 2012, 9:19:25 AM11/13/12
to scalate...@googlegroups.com
Hi Graham, 

You need to add scalatest.jar (downloaded manually, or just point it to your local maven repo) to your build path, the plugin will detect from the jar file if it is version 1.x, it will use the Swing UI from the scalatest.jar itself.  If you are using scalatest.jar of version 2.x, it will use the built-in ScalaTest view instead.  The reason we are doing that is to provide a fallback mechanism for user that is still using ScalaTest 1.x.  We added Location API in 2.x which provides information to hop from built-in ScalaTest view to source code, but that is not available in 1.x.

We did have a user suggested to include ScalaTest jar as bundle directly, e.g. to include both latest ScalaTest 1.8.1 and ScalaTest 2.0, just like JUnit that includes JUnit 3 or JUnit 4 bundle.  Do you think that would be better?

Thanks!

Best Regards, 
Chee Seng 


--

Chee Seng Chua

unread,
Nov 13, 2012, 9:29:52 PM11/13/12
to scalate...@googlegroups.com
Hi Steve, 

Yeah it looks like the problem was with your scalatest_2.9.0-2.0.M4.jar, which is built for scala 2.9 and not 2.10.  That's give me +1 reason to think having ScalaTest 1.x/2.x as osgi bundle with correct dependency to scala 2.9/2.10 could help minimize the confusion.

Thanks!

Chee Seng


On Wed, Nov 14, 2012 at 5:08 AM, Steve Upton <upto...@yahoo.com> wrote:
Chee Seng,

Never mind my previous post - I just ran across Bill Venners' post on 2.10.0-RC2 and that build works!

Sorry for the wasted bandwidth.


steve

Graham Seed

unread,
Nov 14, 2012, 6:15:46 AM11/14/12
to scalate...@googlegroups.com
Hi

Thanks for your emails.

I do agree with bundling the scalatest.jar with the Eclipse ScataTest plugin simply for the reason of being consistent with the Scala IDE, which has a "Scala Library" as part of the Eclipse plugin; eg:

.../eclipse/configuration/org.eclipse.osgi/bundles/211/1/.cp/lib

When I got a compile error on the import "import org.scalatest._" I assumed something was wrong since I assumed a "ScalaTest Library" would  be bundled with the plugin.

As suggested I then downloaded the separate scalatest.jar and associated scaladoc.jar and added them to the claspath but this is probably not expected [and certainly not documented] and a source of error for a newbie to ScalaTest, such as myself.

Graham

Chee Seng Chua

unread,
Nov 14, 2012, 7:42:25 AM11/14/12
to scalate...@googlegroups.com
Hi Graham, 

Thanks for the feedback.  I just updated the documentation at:-


which now says:-

To use ScalaTest in your Scala project, you must download ScalaTest and include it in Build path of your project.

We'll looking into the bundling option, and hopefully the above amendment can help other users.

Thanks!

Chee Seng

Graham Seed

unread,
Nov 14, 2012, 9:25:07 AM11/14/12
to scalate...@googlegroups.com
Hi

I notice that the link:


on page:


is still giving a 404 error.

This is the first page I went to when trying to install the Eclipse plugin.

Bill Venners

unread,
Nov 14, 2012, 11:21:04 AM11/14/12
to scalate...@googlegroups.com
Hi Graham,

That ball is in my court. I haven't swung at it yet because I'm busy
at a conference this week. Should have it fixed soon.

Bill
> --
> 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



--

Graham Seed

unread,
Nov 14, 2012, 5:12:06 PM11/14/12
to scalate...@googlegroups.com
Hi

I've downloaded the scalatest.jar and scaladoc.jar from the download page. Is there a source jar [2.9.x-1.8] so I can attach it to my scalatest library so that I have source lookup in the Eclipde IDE?

Thanks

Bill Venners

unread,
Nov 14, 2012, 5:35:26 PM11/14/12
to scalate...@googlegroups.com
Hi Graham,

The sources jar for Scala 2.9.x/ScalaTest 1.8 is here:

https://oss.sonatype.org/content/groups/public/org/scalatest/scalatest_2.9.0/1.8/scalatest_2.9.0-1.8-sources.jar

There are copies of it under other 2.9.x versions, but they are all the same.

Bill
Reply all
Reply to author
Forward
0 new messages