Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Using datatables in groovy step definitions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rsilva4  
View profile  
 More options Apr 11 2012, 5:10 am
From: rsilva4 <rubensilv...@gmail.com>
Date: Wed, 11 Apr 2012 02:10:57 -0700 (PDT)
Local: Wed, Apr 11 2012 5:10 am
Subject: [C-JVM]Using datatables in groovy step definitions
I can't find anything about this in the Groovy examples. Here what I
have tried:

Given(~'^the following external datasources:$') { eds ->

    def listEds = eds.asList(ExternalDataSource)
    listEds.each {
                print it
                ExternalDataSource.create(it);
        }
        assert ExternalDataSource.all().size() == listEds.size()

}

That outputs:

| Running 1 cucumber test...
org.codehaus.groovy.runtime.InvokerInvocationException:
groovy.lang.MissingMethodException: No signature of method:
net.inductiva.collector.ExternalDataSource.create() is applicable for
argument types: (net.inductiva.collector.ExternalDataSource) values:
[net.inductiva.collector.ExternalDataSource : null]
Possible solutions: create(), merge(), read(java.io.Serializable),
count(), delete(), ident()

'print it' prints nothing, and trying to debug (using eclipse STS)
does not stop at the breakpoints.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[C-JVM]Using datatables in groovy step definitions" by aslak hellesoy
aslak hellesoy  
View profile  
 More options Apr 11 2012, 6:41 am
From: aslak hellesoy <aslak.helle...@gmail.com>
Date: Wed, 11 Apr 2012 11:41:21 +0100
Local: Wed, Apr 11 2012 6:41 am
Subject: Re: [Cucumber:10960] [C-JVM]Using datatables in groovy step definitions

Here is an example:

https://github.com/cucumber/cucumber-jvm/commit/01932dcfdf5decd1374f7...

It looks like you're doing everything right.

Aslak


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Using datatables in groovy step definitions" by rsilva4
rsilva4  
View profile  
 More options Apr 11 2012, 6:43 am
From: rsilva4 <rubensilv...@gmail.com>
Date: Wed, 11 Apr 2012 03:43:14 -0700 (PDT)
Local: Wed, Apr 11 2012 6:43 am
Subject: Re: Using datatables in groovy step definitions
I managed to sucessufully test with the datatable:

Given(~'^the following external datasources:$') { eds ->

        def listEds = eds.asList(ExternalDataSource)
                listEds.each { ExternalDataSource it ->
                    it.save()
                }
        assert ExternalDataSource.findAll().size() == listEds.size()

}

However, I still don't have a clue how to debug or print stuff in the
step definitions.

On 11 Abr, 10:10, rsilva4 <rubensilv...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aslak hellesoy  
View profile  
 More options Apr 11 2012, 6:59 am
From: aslak hellesoy <aslak.helle...@gmail.com>
Date: Wed, 11 Apr 2012 11:59:00 +0100
Subject: Re: [Cucumber:10962] Re: Using datatables in groovy step definitions

On Wed, Apr 11, 2012 at 11:43 AM, rsilva4 <rubensilv...@gmail.com> wrote:
> I managed to sucessufully test with the datatable:

> Given(~'^the following external datasources:$') { eds ->

>        def listEds = eds.asList(ExternalDataSource)
>                listEds.each { ExternalDataSource it ->
>                    it.save()
>                }
>        assert ExternalDataSource.findAll().size() == listEds.size()
> }

> However, I still don't have a clue how to debug or print stuff in the
> step definitions.

Are you saying that `println("HELLO")` at the top of your step
definition prints nothing??

Aslak


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ruben Silva  
View profile  
 More options Apr 11 2012, 7:12 am
From: Ruben Silva <rubensilv...@gmail.com>
Date: Wed, 11 Apr 2012 12:12:51 +0100
Local: Wed, Apr 11 2012 7:12 am
Subject: Re: [Cucumber:11015] Re: Using datatables in groovy step definitions

Exactly. Your phrasing lead to an experiment:

import groovy.time.TimeCategory;
import cucumber.table.DataTable;
import net.inductiva.collector.ExternalDataSource;

this.metaClass.mixin (cucumber.runtime.groovy.EN)
println("HELLO")
Given(~'^the following external datasources:$') { eds ->
 println("HELLO Inside Given")

}

OUTPUT:

| Server running. Browse to http://localhost:8080/collector
HELLO
| Running 1 cucumber test...
| Completed 1 cucumber test, 0 failed in 581ms

The print inside the step it's not visible.
--
Ruben

On Wed, Apr 11, 2012 at 11:59, aslak hellesoy <aslak.helle...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aslak hellesoy  
View profile  
 More options Apr 11 2012, 7:38 am
From: aslak hellesoy <aslak.helle...@gmail.com>
Date: Wed, 11 Apr 2012 12:38:54 +0100
Local: Wed, Apr 11 2012 7:38 am
Subject: Re: [Cucumber:10964] Re: Using datatables in groovy step definitions

How do you know the step definition gets executed?
Is the output inside Eclipse's "console" window?
Can you see it if you run it all from outside eclipse (Maven, Ant,
whatever you're using)?

Aslak


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aslak hellesoy  
View profile  
 More options Apr 11 2012, 7:44 am
From: aslak hellesoy <aslak.helle...@gmail.com>
Date: Wed, 11 Apr 2012 12:44:36 +0100
Local: Wed, Apr 11 2012 7:44 am
Subject: Re: [Cucumber:10964] Re: Using datatables in groovy step definitions
On Wed, Apr 11, 2012 at 12:38 PM, aslak hellesoy

In IntelliJ, clicking on various nodes in the JUnit "tree" will
show/hide output so that only what was printed during a certain test
(scenario) is shown.
I'm not sure if Eclipse behaves the same, but it might. Try selecting
the root element.

Aslak


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ruben Silva  
View profile  
 More options Apr 11 2012, 10:23 am
From: Ruben Silva <rubensilv...@gmail.com>
Date: Wed, 11 Apr 2012 15:23:20 +0100
Local: Wed, Apr 11 2012 10:23 am
Subject: Re: [Cucumber:11018] Re: Using datatables in groovy step definitions

Yes the output inside Eclipse's "console" window.

Just tried using grails command from shell directly same result.

Can it be something related with my logging configuration? It seams
unlikely since the first print runs. I know that my step runs because if I
include some invalid assertion it fails, p.e.: assert false.

I don't get the Junit tree in eclipse because Cucumber tests are not seen
like Junit tests.

To use cucumber-jvm I follow this instructions
https://github.com/hauner/grails-cucumber/wiki/Testing-Grails-with-Cu...
which
results in adding this dependencies to my project:

../plugins/cucumber-0.2.3/lib/cucumber-core-1.0.0.RC21-SNAPSHOT.jar
../plugins/cucumber-0.2.3/lib/cucumber-groovy-1.0.0.RC21-SNAPSHOT.jar
../plugins/cucumber-0.2.3/lib/cucumber-html-0.2.1.jar
../plugins/cucumber-0.2.3/lib/gherkin-2.9.0.jar

Reading this
https://github.com/hauner/grails-cucumber/blob/master/CHANGES.md we can
realize that with the current release cucumber-jvm is embedded in the
plugin, something to change in the next release where it will fetch
cucumber-jvm as a dependency and move on to 1.0.2 version.

"Currently the plugin registers the cucumber test type only to the *functional
test phase*." can be read in the plugin page, so no unit tests

--
Ruben Silva

On Wed, Apr 11, 2012 at 12:44, aslak hellesoy <aslak.helle...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aslak hellesoy  
View profile  
 More options Apr 11 2012, 10:31 am
From: aslak hellesoy <aslak.helle...@gmail.com>
Date: Wed, 11 Apr 2012 15:31:14 +0100
Local: Wed, Apr 11 2012 10:31 am
Subject: Re: [Cucumber:10969] Re: Using datatables in groovy step definitions

On Wed, Apr 11, 2012 at 3:23 PM, Ruben Silva <rubensilv...@gmail.com> wrote:
> Yes the output inside Eclipse's "console" window.

> Just tried using grails command from shell directly same result.

> Can it be something related with my logging configuration? It seams unlikely
> since the first print runs. I know that my step runs because if I include
> some invalid assertion it fails, p.e.: assert false.

> I don't get the Junit tree in eclipse because Cucumber tests are not seen
> like Junit tests.

They are if you kick it off with JUnit:
https://github.com/cucumber/cucumber-jvm/blob/master/groovy/src/test/...
I assume you're using the CLI runner then.

Maybe you have run into the same issue as this?
https://groups.google.com/d/msg/cukes/HJ1Ik910jPc/e5ANfEx4Pv0J

Aslak


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ruben Silva  
View profile  
 More options Apr 12 2012, 4:33 am
From: Ruben Silva <rubensilv...@gmail.com>
Date: Thu, 12 Apr 2012 09:33:07 +0100
Local: Thurs, Apr 12 2012 4:33 am
Subject: Re: [Cucumber:11022] Re: Using datatables in groovy step definitions

Ok, we can track the why about not printing stuff here:
https://github.com/hauner/grails-cucumber/issues/4

Thanks Aslak for all your attention
--
Ruben Silva

On Wed, Apr 11, 2012 at 15:31, aslak hellesoy <aslak.helle...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »