Uploaded image for project: 'Buildr (Retired)'
  1. Buildr (Retired)
  2. BUILDR-261

ScalaSpecs should be run with Scala dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.3
    • 1.3.4
    • Test frameworks
    • None

    Description

      Scala Specs are not currently run with Scala dependencies which make them fail:

      Buildr::Scala::ScalaTest
      Exception in thread "main" java.lang.NoClassDefFoundError: scala/ScalaObject
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      at HelloWorldSpecs.main(HelloWorldSpecs.scala)
      Caused by: java.lang.ClassNotFoundException: scala.ScalaObject
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      ... 13 more
      Failed to execute java HelloWorldSpecs, see errors above- should compile and run specifications with "Specs" suffix (ERROR - 1)

      1)
      RuntimeError in 'Buildr::Scala::ScalaTest should compile and run specifications with "Specs" suffix'
      Tests failed!

      Solution is to add Scala depedencies...

      Index: lib/buildr/scala/tests.rb
      ===================================================================
      — lib/buildr/scala/tests.rb (revision 746743)
      +++ lib/buildr/scala/tests.rb (working copy)
      @@ -129,7 +129,8 @@
      nostacktrace = (options[:nostacktrace]) ? "-ns" : ""
      cmd_options = { :properties => options[:properties],
      :java_args => options[:java_args],

      • :classpath => dependencies}
        + :classpath => dependencies + Scalac.dependencies}
        +
        specs.each do |spec|
        Java.load
        begin

      Attachments

        Activity

          People

            Unassigned Unassigned
            boisvert Alex Boisvert
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: