Problem with the classname of test

24 views
Skip to first unread message

Jeppe Nejsum Madsen

unread,
Mar 23, 2011, 5:46:59 AM3/23/11
to specs...@googlegroups.com
Hi,

When running tests from the Gradle build tool I've been having
problems with the classnames of a test which seems to be the hashcode.
Details of the problem here:

http://gradle.1045684.n5.nabble.com/Problem-with-missing-packages-in-test-report-for1-0m1-td4224193.html

Is there a better way than implementing my own runner to fix this?

/Jeppe

etorreborre

unread,
Mar 23, 2011, 6:28:46 PM3/23/11
to specs-users
If I remember correctly, the hashcode "trick" was necessary to have
tests tree created ok in eclipse.

What I need to do now is detect the eclipse case, handle it
accordingly, and leave the general case with className being used to
identify a test.

I've created issue 179 for this: http://code.google.com/p/specs/issues/detail?id=179

E.

On Mar 23, 8:46 pm, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
> Hi,
>
> When running tests from the Gradle build tool I've been having
> problems with the classnames of a test which seems to be the hashcode.
> Details of the problem here:
>
> http://gradle.1045684.n5.nabble.com/Problem-with-missing-packages-in-...

etorreborre

unread,
Mar 24, 2011, 5:52:55 AM3/24/11
to specs-users
I've tried a fix in the latest SNAPSHOT version (1.6.8-SNAPSHOT) but I
don't have a Gradle project to test.

Can you please test the fix and come back to me?

(a link to a sample project would be nice so I could also test how
specs2 is behaving)

Thanks.

Eric.

Jeppe Nejsum Madsen

unread,
Mar 24, 2011, 6:13:47 AM3/24/11
to specs...@googlegroups.com
On Thu, Mar 24, 2011 at 10:52 AM, etorreborre <etorr...@gmail.com> wrote:
> I've tried a fix in the latest SNAPSHOT version (1.6.8-SNAPSHOT) but I
> don't have a Gradle project to test.
>
> Can you please test the fix and come back to me?
Seems they now all get the same name:

<?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="0" hostname="jnmmbp.local"
name="fleetzone.unittest.POIUnitTest" tests="7" time="0.05"
timestamp="2011-03-24T10:09:32">
<properties />
<testcase classname="org.specs.runner.ExampleTestCase" name="be
readable" time="0.0" />
<testcase classname="org.specs.runner.ExampleTestCase" name="read
all sheets" time="0.0" />
<testcase classname="org.specs.runner.ExampleTestCase" name="have
the name Sheet1" time="0.0" />
<testcase classname="org.specs.runner.ExampleTestCase" name="have
correct column headers" time="0.0" />
<testcase classname="org.specs.runner.ExampleTestCase" name="have
correct row 1 values" time="0.0" />
<testcase classname="org.specs.runner.ExampleTestCase" name="have
correct row 2 values" time="0.0" />
<testcase classname="org.specs.runner.ExampleTestCase" name="have
correct row 3 values" time="0.0010" />
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>


> (a link to a sample project would be nice so I could also test how
> specs2 is behaving)

I'll try to create a test project. I'll be back

/Jeppe

Jeppe Nejsum Madsen

unread,
Mar 24, 2011, 6:29:40 AM3/24/11
to specs...@googlegroups.com

I've updated my Lift sample here: https://github.com/jeppenejsum/liftstart

To run tests, just clone and do "./gradlew test"

Output is in build/reports/tests/index.html

/Jeppe

etorreborre

unread,
Mar 24, 2011, 7:35:56 AM3/24/11
to specs-users
Cool, your project downloads and runs fine with just one command!

etorreborre

unread,
Mar 24, 2011, 7:31:50 AM3/24/11
to specs-users
I can see that the tests have the same class name but different names.

That's what was expected isn't it?

E.

On Mar 24, 9:13 pm, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:

Jeppe Nejsum Madsen

unread,
Mar 24, 2011, 11:00:22 AM3/24/11
to specs...@googlegroups.com
On Thu, Mar 24, 2011 at 12:31 PM, etorreborre <etorr...@gmail.com> wrote:
> I can see that the tests have the same class name but different names.
>
> That's what was expected isn't it?

Maybe it's not clear from the example, but all the specs have the same
class "org.specs.runner.ExampleTestCase"

There's no ExampleTestCase in the source, making it very difficult to
figure which test is being run.

While example.snippet.HelloWorldTestSpecsAsTest shows up in the
results, there are no test cases attached.

/Jeppe

etorreborre

unread,
Mar 24, 2011, 5:46:13 PM3/24/11
to specs-users
Ok I was a bit blind here!

I'll try to fix that over the weekend.

E.

On Mar 25, 2:00 am, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:

etorreborre

unread,
Mar 25, 2011, 9:49:29 AM3/25/11
to specs-users
Can you please try the latest snapshot? I think this is better (but
dear JUnit runners of different flavors are difficult to
accomodate,....)

Jeppe Nejsum Madsen

unread,
Mar 25, 2011, 10:23:29 AM3/25/11
to specs...@googlegroups.com
On Fri, Mar 25, 2011 at 2:49 PM, etorreborre <etorr...@gmail.com> wrote:
> Can you please try the latest snapshot? I think this is better (but
> dear JUnit runners of different flavors are difficult to
> accomodate,....)

Thanks for looking into this ;-)

Just tried to compile my test project and it seems the compiler crashes:

15:18:07.601 [ERROR] [system.err] error: error while loading
HasResults, oversubscribed literal/length tree
15:18:08.110 [ERROR] [system.err] one error found

15:18:08.226 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: :
Compile failed with 1 error; see the compiler error output for
details.
15:18:08.227 [ERROR] [org.gradle.BuildExceptionReporter] at
scala.tools.ant.Scalac.error(Scalac.scala:460)
15:18:08.227 [ERROR] [org.gradle.BuildExceptionReporter] at
scala.tools.ant.Scalac.executeInternal(Scalac.scala:650)
15:18:08.227 [ERROR] [org.gradle.BuildExceptionReporter] at
scala.tools.ant.Scalac.execute(Scalac.scala:586)
15:18:08.228 [ERROR] [org.gradle.BuildExceptionReporter] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
15:18:08.228 [ERROR] [org.gradle.BuildExceptionReporter] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
15:18:08.228 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:71)
15:18:08.229 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.project.AntBuilderDelegate.nodeCompleted(DefaultIsolatedAntBuilder.groovy:137)
15:18:08.240 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.tasks.scala.AntScalaCompiler$_execute_closure1.doCall(AntScalaCompiler.groovy:56)
15:18:08.241 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:61)
15:18:08.241 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:31)
15:18:08.242 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.util.ConfigureUtil$configure.call(Unknown Source)
15:18:08.242 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.project.DefaultIsolatedAntBuilder.execute(DefaultIsolatedAntBuilder.groovy:98)
15:18:08.242 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.project.IsolatedAntBuilder$execute.call(Unknown
Source)
15:18:08.243 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.tasks.scala.AntScalaCompiler.execute(AntScalaCompiler.groovy:53)
15:18:08.243 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.tasks.scala.DefaultScalaJavaJointCompiler.execute(DefaultScalaJavaJointCompiler.java:75)
15:18:08.243 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.tasks.compile.IncrementalJavaSourceCompiler.execute(IncrementalJavaSourceCompiler.java:73)
15:18:08.244 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.tasks.scala.ScalaCompile.compile(ScalaCompile.java:90)
15:18:08.244 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:158)
15:18:08.245 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
15:18:08.245 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.tasks.scala.ScalaCompile_Decorated.invokeMethod(Unknown
Source)
15:18:08.245 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
15:18:08.246 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:131)
15:18:08.246 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:130)
15:18:08.247 [ERROR] [org.gradle.BuildExceptionReporter] at
org.gradle.api.internal.tasks.DefaultTaskExecuter.executeActions(DefaultTaskExecuter.java:58)
15:18:08.247 [ERROR] [org.gradle.BuildExceptionReporter] ... 27 more


When compiling our real project, gradle fails during testing

Caused by: java.lang.NullPointerException
at org.gradle.api.internal.tasks.testing.junit.JUnitXmlReportGenerator.output(JUnitXmlReportGenerator.java:59)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:88)

It looks like it tries to generate an XML file for each specification,
but the XML files don't contain any tests. Eg here's an example:

<?xml version="1.0" encoding="UTF-8"?>

<testsuite errors="0" failures="0" hostname="jnmmbp.local" name="read
all sheets" tests="1" time="0.0" timestamp="2011-03-25T14:06:45">
<properties />


<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>

/Jeppe

etorreborre

unread,
Mar 25, 2011, 10:37:42 AM3/25/11
to specs-users
Well the compiler crash doesn't look good in the first place.

Is there anything you can do to clear the caches for .class files or
jars?

The test project is ok here (and it's even working with specs2 now!).
For example, I added this:

package org.specs.examples
import org.specs._


class HelloWorldTest extends SpecificationWithJUnit {
"The 'Hello world' string" should {
"contain 11 characters" in {
1 must_== 1
}
"start with 'Hello'" in {
1 must_== 1
}
"end with 'world'" in {
1 must_== 1
}
}
}

and the result is:

<?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="0" hostname="PC"
name="org.specs.examples.HelloWorldTest" tests="3" time="0.065"
timestamp="2011-03-25T14:32:20">
<properties />
<testcase classname="org.specs.examples.HelloWorldTest"
name="contain 11 characters" time="0.0010" />
<testcase classname="org.specs.examples.HelloWorldTest" name="start
with &apos;Hello&apos;" time="0.0010" />
<testcase classname="org.specs.examples.HelloWorldTest" name="end
with &apos;world&apos;" time="0.0" />
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>

That being said, the NPE during the test execution might mean that
there is still a nasty corner case.

E.

On Mar 26, 1:23 am, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
> On Fri, Mar 25, 2011 at 2:49 PM, etorreborre <etorrebo...@gmail.com> wrote:
> > Can you please try the latest snapshot? I think this is better (but
> > dear JUnit runners of different flavors are difficult to
> > accomodate,....)
>
> Thanks for looking into this ;-)
>
> Just tried to compile my test project and it seems the compiler crashes:
>
> 15:18:07.601 [ERROR] [system.err] error: error while loading
> HasResults, oversubscribed literal/length tree
> 15:18:08.110 [ERROR] [system.err] one error found
>
> 15:18:08.226 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: :
> Compile failed with 1 error; see the compiler error output for
> details.
> 15:18:08.227 [ERROR] [org.gradle.BuildExceptionReporter]        at
> scala.tools.ant.Scalac.error(Scalac.scala:460)
> 15:18:08.227 [ERROR] [org.gradle.BuildExceptionReporter]        at
> scala.tools.ant.Scalac.executeInternal(Scalac.scala:650)
> 15:18:08.227 [ERROR] [org.gradle.BuildExceptionReporter]        at
> scala.tools.ant.Scalac.execute(Scalac.scala:586)
> 15:18:08.228 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
> 15:18:08.228 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> 15:18:08.228 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntB uilder.java:71)
> 15:18:08.229 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.project.AntBuilderDelegate.nodeCompleted(DefaultIso latedAntBuilder.groovy:137)
> 15:18:08.240 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.tasks.scala.AntScalaCompiler$_execute_closure1.doCa ll(AntScalaCompiler.groovy:56)
> 15:18:08.241 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:61)
> 15:18:08.241 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:31)
> 15:18:08.242 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.util.ConfigureUtil$configure.call(Unknown Source)
> 15:18:08.242 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.project.DefaultIsolatedAntBuilder.execute(DefaultIs olatedAntBuilder.groovy:98)
> 15:18:08.242 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.project.IsolatedAntBuilder$execute.call(Unknown
> Source)
> 15:18:08.243 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.tasks.scala.AntScalaCompiler.execute(AntScalaCompil er.groovy:53)
> 15:18:08.243 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.tasks.scala.DefaultScalaJavaJointCompiler.execute(D efaultScalaJavaJointCompiler.java:75)
> 15:18:08.243 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.tasks.compile.IncrementalJavaSourceCompiler.execute (IncrementalJavaSourceCompiler.java:73)
> 15:18:08.244 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.tasks.scala.ScalaCompile.compile(ScalaCompile.java:90)
> 15:18:08.244 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.ja va:158)
> 15:18:08.245 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynami cObject.java:93)
> 15:18:08.245 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.tasks.scala.ScalaCompile_Decorated.invokeMethod(Unknown
> Source)
> 15:18:08.245 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
> 15:18:08.246 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $2.execute(AnnotationProcessingTaskFactory.java:131)
> 15:18:08.246 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $2.execute(AnnotationProcessingTaskFactory.java:130)
> 15:18:08.247 [ERROR] [org.gradle.BuildExceptionReporter]        at
> org.gradle.api.internal.tasks.DefaultTaskExecuter.executeActions(DefaultTas kExecuter.java:58)
> 15:18:08.247 [ERROR] [org.gradle.BuildExceptionReporter]        ... 27 more
>
> When compiling our real project, gradle fails during testing
>
> Caused by: java.lang.NullPointerException
>         at org.gradle.api.internal.tasks.testing.junit.JUnitXmlReportGenerator.output( JUnitXmlReportGenerator.java:59)
>         at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp l.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatc h.java:35)
>         at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatc h.java:24)
>         at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch. java:88)

Jeppe Nejsum Madsen

unread,
Mar 25, 2011, 11:24:57 AM3/25/11
to specs...@googlegroups.com
On Fri, Mar 25, 2011 at 3:37 PM, etorreborre <etorr...@gmail.com> wrote:
> Well the compiler crash doesn't look good in the first place.
>
> Is there anything you can do to clear the caches for .class files or
> jars?

Just tried deleting both the gradle cache and the build dir same
result. (I'm on OS X, dunno if that makes a difference)


> The test project is ok here (and it's even working with specs2 now!).

But did you try it with specs (not specs2) also?

That XML file looks fine.


> That being said, the NPE during the test execution might mean that
> there is still a nasty corner case.

But I think this may be caused by all the XML files being empty in my case.....

/Jeppe

Lanny Ripple

unread,
Mar 25, 2011, 4:24:13 PM3/25/11
to specs-users
Hello. I'd like to add that I am now seeing the same error when I try
to compile my code which uses specs_2.8.1-1.6.7-SNAPSHOT. Maven
reported a checksum error when it fetched the latest SNAPSHOT and
since then I get:

[INFO] Compiling 26 source files to /home/lanny/work/IdeaProjects/
Hadoop/target/test-classes at 1301083725575
[ERROR] error: error while loading HasResults, oversubscribed literal/
length tree
[ERROR] one error found
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] wrap: org.apache.commons.exec.ExecuteException: Process exited
with an error: 1(Exit value: 1)

when trying to compile my tests. (I have tried several times to
delete the jar and meta data from my local maven repository and let it
re-download all without success.)

-lanny

etorreborre

unread,
Mar 25, 2011, 9:33:38 PM3/25/11
to specs-users
Hi,

I redeployed and tested again after having cleaned the cache. This is
ok, please have a go at it.

E.

Lanny Ripple

unread,
Mar 26, 2011, 12:37:55 AM3/26/11
to specs-users
Oops. Meant 1.6.8-SNAPSHOT but retried and everything is working
again. Thanks very much for the quick attention to it.

-lanny

Jeppe Nejsum Madsen

unread,
Mar 28, 2011, 5:31:25 AM3/28/11
to specs...@googlegroups.com
On Sat, Mar 26, 2011 at 2:33 AM, etorreborre <etorr...@gmail.com> wrote:
> Hi,
>
> I redeployed and tested again after having cleaned the cache. This is
> ok, please have a go at it.

Great, works now. Thanks.

One minor nitpick is that the timing info on testcase seems wrong:

<testsuite errors="0" failures="0" hostname="jnmmbp.local"

name="fleetzone.integrationtest.excel.ExcelImporterUnitTest" tests="6"
time="52.737" timestamp="2011-03-28T09:07:10">
<properties />
<testcase classname="fleetzone.integrationtest.excel.ExcelImporterSpec$"
name="parse template correctly" time="0.0030" />
<testcase classname="fleetzone.integrationtest.excel.ExcelImporterSpec$"
name="parse template correctly" time="0.0" />
<testcase classname="fleetzone.integrationtest.excel.ExcelImporterSpec$"
name="parse template with warnings correctly" time="0.0" />
<testcase classname="fleetzone.integrationtest.excel.ExcelImporterSpec$"
name="parse Dagrofa correctly twice" time="0.0010" />
<testcase classname="fleetzone.integrationtest.excel.ExcelImporterSpec$"
name="parse COOP B correctly" time="0.0" />
<testcase classname="fleetzone.integrationtest.excel.ExcelImporterSpec$"
name="parse COOP A correctly" time="0.0010" />
....

The suite takes 52 seconds (which is correct), but it seem each test
case is off.

/Jeppe

Jeppe Nejsum Madsen

unread,
Mar 28, 2011, 7:49:00 AM3/28/11
to specs...@googlegroups.com

Ohh, another minor detail :-)

We have something like this:

"An Excel 2007 file" ->-(excel2007) should {
behave like "An Excel 2003 file"
}

The output doesn't seem to include this info, it repeats the testcases
twice with the same name:

<testcase classname="fleetzone.integrationtest.excel.ExcelParserSpec$"


name="be readable" time="0.0" />

...
<testcase classname="fleetzone.integrationtest.excel.ExcelParserSpec$"


name="be readable" time="0.0" />

/Jeppe

etorreborre

unread,
Mar 28, 2011, 9:03:29 AM3/28/11
to specs-users
I'm not sure that I can really do much on that one without big changes
on the JUnit runner.

specs2 JUnit runner is a bit different and may behave better to that
respect (so that may be a good reason to migrate someday :-))

E.

On Mar 28, 8:31 pm, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:

etorreborre

unread,
Mar 28, 2011, 9:06:18 AM3/28/11
to specs-users
I'll try to reproduce that on a small example to see what's wrong.

E.

Jeppe Nejsum Madsen

unread,
Mar 28, 2011, 11:00:48 AM3/28/11
to specs...@googlegroups.com
On Mon, Mar 28, 2011 at 3:03 PM, etorreborre <etorr...@gmail.com> wrote:
> I'm not sure that I can really do much on that one without big changes
> on the JUnit runner.
>
> specs2 JUnit runner is a bit different and may behave better to that
> respect (so that may be a good reason to migrate someday :-))

Ok, will have a look at some point. Is there a "how to upgrade" doc
somewhere or can they both exist at the same time in a project?

/Jeppe

Jeppe Nejsum Madsen

unread,
Mar 28, 2011, 11:50:04 AM3/28/11
to specs...@googlegroups.com
On Sat, Mar 26, 2011 at 2:33 AM, etorreborre <etorr...@gmail.com> wrote:
> Hi,
>
> I redeployed and tested again after having cleaned the cache. This is
> ok, please have a go at it.

Ohh, now just tried in IntelliJ and now it cannot find any tests :-(

I'll have to run, but will try old version later just to verify that
it is indeed the new stuff that breaks this....


/Jeppe

Jeppe Nejsum Madsen

unread,
Mar 28, 2011, 11:55:03 AM3/28/11
to specs...@googlegroups.com

Oh never mind....IntelliJ crashed during compilation. Everything works
fine after full rebuild, I'll shut up now and go home :-)

/Jeppe

etorreborre

unread,
Mar 28, 2011, 6:15:37 PM3/28/11
to specs-users
> Ok, will have a look at some point. Is there a "how to upgrade" doc

Not yet. I'd like to write a blog post at least about it but time is
scarce,...

In a few words here, those are the things to change:

- package names: org.specs becomes org.specs2.mutable._
- some matchers: for example containInOrder become
contain(....).inOrder
- there might be some type inference issues with some matchers (for
example be_== now matches precisely with T. If you want to match with
Any, you need to use be_===)
- the ScalaCheck api has changed
- the tags api has changed
- doBefore/doAfter/... have to be managed differently

[cool, I have an outline for my blog post now :-)]

If you want you can have a look at the migrated specs for lift:
https://github.com/lift/framework/tree/eto_issue_941.

Eric.

> somewhere or can they both exist at the same time in a project?

Definitely yes. This is one of the reasons why I chose a new package
name for specs2 instead of just bumping the version number to 2.

Eric.

On Mar 29, 2:00 am, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
Reply all
Reply to author
Forward
0 new messages