Search Results

Search found 8 results on 1 pages for 'scalatest'.

Page 1/1 | 1 

  • scalacheck/scalatest not found: how to add it in sbt/scala?

    - by Pavel Reich
    I've installed typesafe-stack from http://typesafe.com/stack/download on my ubuntu12, than I created a play project (g8 typesafehub/play-scala) and now I want to add scalatest or scalacheck to my project. So my_app/project/plugins.sbt has the following lines: // The Typesafe repository resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" // Use the Play sbt plugin for Play projects addSbtPlugin("play" % "sbt-plugin" % "2.0.1") Then I added scalatest using addSbtPlugin: addSbtPlugin("org.scalatest" %% "scalatest" % "2.0.M1" % "test") and now it fails with the following message when I run 'sbt test' [info] Resolving org.scalatest#scalatest;2.0.M1 ... [warn] module not found: org.scalatest#scalatest;2.0.M1 [warn] ==== typesafe-ivy-releases: tried [warn] http://repo.typesafe.com/typesafe/ivy-releases/org.scalatest/scalatest/scala_2.9.1/sbt_0.11.3/2.0.M1/ivys/ivy.xml [warn] ==== local: tried [warn] ~/.ivy2/local/org.scalatest/scalatest/scala_2.9.1/sbt_0.11.3/2.0.M1/ivys/ivy.xml [warn] ==== Typesafe repository: tried [warn] http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest_2.9.1_0.11.3/2.0.M1/scalatest-2.0.M1.pom [warn] ==== typesafe-ivy-releases: tried [warn] http://repo.typesafe.com/typesafe/ivy- releases/org.scalatest/scalatest/scala_2.9.1/sbt_0.11.3/2.0.M1/ivys/ivy.xml [warn] ==== public: tried [warn] http://repo1.maven.org/maven2/org/scalatest/scalatest_2.9.1_0.11.3/2.0.M1/scalatest-2.0.M1.pom What I don't understand: why does it use this http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest_2.9.1_0.11.3/2.0.M1/scalatest-2.0.M1.pom URL instead of the real one http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest_2.9.1/2.0.M1/scalatest_2.9.1-2.0.M1.pom? Quite the same problem I have with scalacheck: it also tries to download using sbt-version specific artifactId whereas the repository has only scala-version specific. What am I doing wrong? I understand there must be a switch in sbt somewhere, not to use sbt-version as part of the artifact URL? I also tried using this in my plugins.sbt libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M1" % "test" but looks like it is completely ignored by sbt and scalatest.jar hasn't appeared in the classpath: my_app/test/AppTest.scala:1: object scalatest is not a member of package org [error] import org.scalatest.FunSuite because the output of sbt clean && sbt test has lots of Resolving org.easytesting#fest-util;1.1.6 or just another library, but nothing about scalatest. I use scala 2.9.1 and sbt 0.11.3, trying to use scalatest 2.0.M1 and 1.8; scalacheck: resolvers ++= Seq( "snapshots" at "http://oss.sonatype.org/content/repositories/snapshots", "releases" at "http://oss.sonatype.org/content/repositories/releases" ) libraryDependencies ++= Seq( "org.scalacheck" %% "scalacheck" % "1.9" % "test" ) With the same outcome, i.e. it uses the sbtVersion specific POM URL, which doesn't exist. What am I doing wrong? Thanks.

    Read the article

  • Can ScalaCheck/Specs warnings safely be ignored when using SBT with ScalaTest?

    - by pdbartlett
    I have a simple FunSuite-based ScalaTest: package pdbartlett.hello_sbt import org.scalatest.FunSuite class SanityTest extends FunSuite { test("a simple test") { assert(true) } test("a very slightly more complicated test - purposely fails") { assert(42 === (6 * 9)) } } Which I'm running with the following SBT project config: import sbt._ class HelloSbtProject(info: ProjectInfo) extends DefaultProject(info) { // Dummy action, just to show config working OK. lazy val solveQ = task { println("42"); None } // Managed dependencies val scalatest = "org.scalatest" % "scalatest" % "1.0" % "test" } However, when I runsbt test I get the following warnings: ... [info] == test-compile == [info] Source analysis: 0 new/modified, 0 indirectly invalidated, 0 removed. [info] Compiling test sources... [info] Nothing to compile. [warn] Could not load superclass 'org.scalacheck.Properties' : java.lang.ClassNotFoundException: org.scalacheck.Properties [warn] Could not load superclass 'org.specs.Specification' : java.lang.ClassNotFoundException: org.specs.Specification [warn] Could not load superclass 'org.specs.Specification' : java.lang.ClassNotFoundException: org.specs.Specification [info] Post-analysis: 3 classes. [info] == test-compile == For the moment I'm assuming these are just "noise" (caused by the unified test interface?) and that I can safely ignore them. But it is slightly annoying to some inner OCD part of me (though not so annoying that I'm prepared to add dependencies for the other frameworks). Is this a correct assumption, or are there subtle errors in my test/config code? If it is safe to ignore, is there any other way to suppress these errors, or do people routinely include all three frameworks so they can pick and choose the best approach for different tests? TIA, Paul. (ADDED: scala v2.7.7 and sbt v0.7.4)

    Read the article

  • Is it possible to use the ScalaTest BDD syntax in a JUnit environment?

    - by ebruchez
    I would like to describe tests in BDD style e.g. with FlatSpec but keep JUnit as a test runner. The ScalaTest Quick Start does not seem to show any example of this: http://www.scalatest.org/getting_started_with_junit_4 I first tried naively to write tests within @Test methods, but that doesn't work and the assertion is never tested: @Test def foobarBDDStyle { "The first name control" must "be valid" in { assert(isValid("name·1")) } // etc. } Is there any way to achieve this? It would be even better if regular tests can be mixed and matched with BDD-style tests.

    Read the article

  • JVM segmentation faults due to "Invalid memory access of location"

    - by Dan
    I have a small project written in Scala 2.9.2 with unit tests written using ScalaTest. I use SBT for compiling and running my tests. Running sbt test on my project makes the JVM segfault regularly, but just compiling and running my project from SBT works fine. Here is the exact error message: Invalid memory access of location 0x8 rip=0x10959f3c9 [1] 11925 segmentation fault sbt I cannot locate a core dump anywhere, but would be happy to provide it if it can be obtained. Running java -version results in this: java version "1.6.0_37" Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode) But I've also got Java 7 installed (though I was never able to actually run a Java program with it, afaik). Another issue that may be related: some of my test cases contain titles including parentheses like ( and ). SBT or ScalaTest (not sure) will consequently insert square parens in the middle of the output. For example, a test case with the name (..)..(..) might suddenly look like (..[)..](..). Any help resolving these issues is much appreciated :-) EDIT: I installed the Java 7 JDK, so now java -version shows the right thing: java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode) This also means that I now get a more detailed segfault error and a core dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x000000010a71a3e3, pid=16830, tid=19459 # # JRE version: 7.0_07-b10 # Java VM: Java HotSpot(TM) 64-Bit Server VM (23.3-b01 mixed mode bsd-amd64 compressed oops) # Problematic frame: # V [libjvm.dylib+0x3cd3e3] And the dump.

    Read the article

  • Unit testing several implementation of the same trait/interface

    - by paradigmatic
    I program mostly in scala and java, using scalatest in scala and junit for unit testing. I would like to apply the very same tests to several implementations of the same interface/trait. The idea is to verify that the interface contract is enforced and to check Liskov substitution principle. For instance, when testing implementations of lists, tests could include: An instance should be empty, if and only if and only if it has zero size. After calling clear, the size sould be zero. Adding an element in the middle of a list, will increment by one the index of rhs elements. etc. What are the best practices ?

    Read the article

  • Scala libraries and frameworks

    - by folone
    Each technology is powerful with libraries and frameworks, written for it. I understand, that Scala is able to use libraries and frameworks, written for Java. But there are already some frameworks, written for Scala in Scala. Like, for example: Lift Framework ScalaTest Scalaz Do you know any more great libraries and frameworks for Scala, written in Scala?

    Read the article

  • How do you unit test Scala in Eclipse?

    - by Jørgen Fogh
    I am learning Scala and would like to set up integrated unit testing in Eclipse. As far as I can tell from googling, ScalaTest is the way to go, possibly in combination with JUnit. What are your experiences with unit testing Scala in Eclipse? Should I use the JUnit runner or something else?

    Read the article

  • What is the best way to test using grails using IDEA?

    - by egervari
    I am seriously having a very non-pleasant time testing using Grails. I will describe my experience, and I'd like to know if there's a better way. The first problem I have with testing is that Grails doesn't give immediate feedback to the developer when .save() fails inside of an integration test. So let's say you have a domain class with 12 fields, and 1 of them is violating a constraint and you don't know it when you create the instance... it just doesn't save. Naturally, the test code afterward is going to fail. This is most troublesome because the thingy under test is probably fine... and the real risk and pain is the setup code for the test itself. So, I've tried to develop the habit of using .save(failOnError: true) to avoid this problem, but that's not something that can be easily enforced by everyone working on the project... and it's kind of bloaty. It'd be nice to turn this on for code that is running as part of a unit test automatically. Integration Tests run slow. I cannot understand how 1 integration test that saves 1 object takes 15-20 seconds to run. With some careful test planning, I've been able to get 1000 tests talking to an actual database and doing dbunit dumps after every test to happen in about the same time! This is dumb. It is hard to run all the unit tests and not integration tests in IDEA. Integration tests are a massive pain. Idea actually shows a GREEN BAR when integration tests fail. The output given by grails indicates that something failed, but it doesn't say what it was. It says to look in the test reports... which forces the developer to launch up their file system to hunt the stupid html file down. What a pain. Then once you got the html file and click to the failing test, it'll tell you a line number. Since these reports are not in the IDE, you can't just click the stack trace to go to that line of code... you gotta go back and find it yourself. ARGGH!@!@! Maybe people put up with this, but I refuse. Testing should not be this painful. It should be fast and painless, or people won't do it. Please help. What is the solution? Rails instead of Grails? Something else entirely? I love the Grails framework, but they never demo their testing for a reason. They have a snazzy framework, but the testing is painful. After having used Scala for the last 1.5 months, and being totally spoiled by ScalaTest... I can't go back to this.

    Read the article

1