Here is a full stack trace:
-------------------------------------------------------------------------------
Test set: org.specs.util.interpreterSpec
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.016
sec <<< FAILURE!
initializationError0(org.specs.util.interpreterSpec) Time elapsed: 0
sec <<< ERROR!
scala.tools.nsc.FatalError: object scala not found.
at scala.tools.nsc.symtab.Definitions$definitions$.getModuleOrClass
(Definitions.scala:355)
at scala.tools.nsc.symtab.Definitions$definitions$.getModule
(Definitions.scala:326)
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackage
(Definitions.scala:34)
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackageClass
(Definitions.scala:35)
at scala.tools.nsc.symtab.Definitions$definitions$.init
(Definitions.scala:663)
at scala.tools.nsc.Global$Run.<init>(Global.scala:476)
at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:477)
at org.specs.util.interpreterSpec.<init>(interpreterSpec.scala:11)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.specs.runner.JUnitSuiteRunner.<init>(JUnitSuiteRunner.scala:
20)
at sun.reflect.GeneratedConstructorAccessor3.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.junit.internal.requests.ClassRequest.buildRunner
(ClassRequest.java:33)
at org.junit.internal.requests.ClassRequest.getRunner
(ClassRequest.java:28)
at org.apache.maven.surefire.junit4.JUnit4TestSet.<init>
(JUnit4TestSet.java:45)
at
org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite.createTestSet
(JUnit4DirectoryTestSuite.java:56)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets
(AbstractDirectoryTestSuite.java:96)
at org.apache.maven.surefire.Surefire.createSuiteFromDefinition
(Surefire.java:209)
at org.apache.maven.surefire.Surefire.run(Surefire.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess
(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main
(SurefireBooter.java:997)
And the pom file:
<project xmlns="
http://maven.apache.org/POM/4.0.0"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.scala-tools.testing</groupId>
<artifactId>specs</artifactId>
<version>1.4.4-SNAPSHOT</version>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>specs is a Behaviour-Driven-Design
framework</description>
<url>
http://code.google.com/p/specs/</url>
<inceptionYear>2007</inceptionYear>
<licenses>
<license>
<name>MIT License</name>
<url>
http://www.opensource.org/licenses/mit-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>
scm:svn:
http://specs.googlecode.com/svn/trunk</connection>
<developerConnection>
scm:svn:
https://specs.googlecode.com/svn/trunk</
developerConnection>
<url>
http://specs.googlecode.com/svn/trunk</url>
</scm>
<issueManagement>
<system>
code.google</system>
<url>
http://code.google.com/p/specs/issues/</url>
</issueManagement>
<developers>
<developer>
<id>etorreborre</id>
<name>Eric Torreborre</name>
<timezone>+8</timezone>
</developer>
</developers>
<properties>
<scala.version>2.7.3</scala.version>
<java.src.version>1.5</java.src.version>
</properties>
<repositories>
<repository>
<id>
scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>
http://scala-tools.org/repo-releases</url>
</repository>
<repository>
<id>
scala-tools.org - snapshots</id>
<name>Scala-Tools Maven2 Repository - snapshots</name>
<url>
http://scala-tools.org/repo-snapshots</url>
</repository>
<repository>
<id>
maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>
http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
<repository>
<id>powermock-repo</id>
<url>
http://powermock.googlecode.com/svn/repo/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>
scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>
http://scala-tools.org/repo-releases</url>
</pluginRepository>
<pluginRepository>
<id>scala-tools.org.snapshots</id>
<name>Scala-Tools Maven2 Repository - snapshots</name>
<url>
http://scala-tools.org/repo-snapshots</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>net.java</groupId>
<artifactId>textile-j</artifactId>
<version>2.2</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.scala-tools.testing</groupId>
<artifactId>scalatest</artifactId>
<version>0.9.5</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.scalacheck</groupId>
<artifactId>scalacheck</artifactId>
<version>1.5</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock</artifactId>
<version>2.4.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.7</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.powermock.api</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.2</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.1_3</version>
<scope>test</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
<version>1.0</version>
<scope>test</scope>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav</artifactId>
<version>1.0-beta-2</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<jvmArgs>
<jvmArg>-Xmx512m</jvmArg>
<jvmArg>-Xms64m</jvmArg>
</jvmArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.src.version}</source>
<target>${java.src.version}</target>
<optimise>true</optimise>
<debug>true</debug>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Unit.java</include>
<include>**/*Spec.java</include>
</includes>
<excludes>
<exclude>**/*Test.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<configuration></configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.8</version>
<configuration>
<jvmArgs>
<jvmArg>-Xmx512m</jvmArg>
</jvmArgs>
<vscaladocVersion>1.2-SNAPSHOT</vscaladocVersion>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
</plugin>
</plugins>
</reporting>
<distributionManagement>
<repository>
<id>
scala-tools.org</id>
<url>
http://scala-tools.org:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>
scala-tools.org</id>
<url>
http://scala-tools.org:8081/nexus/content/repositories/snapshots</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<id>release</id>
<distributionManagement>
<repository>
<id>
scala-tools.org</id>
<url>dav:
http://dav.scala-tools.org/repo-releases</url>
</repository>
<site>
<id>
scala-tools.org</id>
<url>
dav:
http://dav.scala-tools.org/mvnsites/specs/$
{project.version}</url>
</site>
</distributionManagement>
</profile>
</profiles>
</project>
And finally, the unit test:
package org.specs.util
import org.specs._
import scala.tools.nsc.{Interpreter, Settings, InterpreterResults}
import java.io.{PrintWriter, StringWriter}
import org.specs.runner._
class interpreterSpec extends Specification with JUnit {
val writer = new StringWriter
val interpreter = new Interpreter(new Settings, new PrintWriter
(writer))
interpreter.interpret("1 + 1")
println(writer.toString)
}
You need specs-1.4.4 to run it but I can that you will have the same
issue with a standard JUnit test.
Thanks for your help,
Eric.