Results 1 to 2 of 2

Thread: GGTS3.0.0M3 Integration Spock tests not running

  1. #1
    Join Date
    May 2005
    Posts
    6

    Default GGTS3.0.0M3 Integration Spock tests not running

    I have a number of Spock Unit Tests that run fine in the IDE when you do a Run As->JUnit Test.

    But my Spock Integration Test doesn't run at all. When I run it, I get the following error:

    java.lang.NullPointerException: Cannot get property 'mainContext' on null object
    at grails.plugin.spock.IntegrationSpec.$spock_initial izeSharedFields(IntegrationSpec.groovy)

    This is what happens from the command line when you run JUnit tests and Spock tests together, so I suspect that it's being treated as a pure JUnit test instead of as a Spock test?

    The class extends grails.plugin.spock.IntegrationSpec instead of spock.lang.Specification. When I change the extends to Specification, then it gets much further along but that doesn't work since the vanilla Specification doesn't provide integration test support.

  2. #2
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    747

    Default

    A few questions for you:

    1. I assume this is a grails project. What grails version?
    2. If this is a grails project, you cannot run integration tests through Run As -> JUnit Test. You must Use Run as -> Grails command (test app). What happens when you try this?

    If this doesn't help, then...
    3. What STS version?
    4. What spock version?
    5. Do you have a full stack trace?
    6. Where is the stack trace being displayed? In the console or in the Eclipse error log?
    7. What is the command you are running on the command line to get this to run?
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •