small error in PublisherSubscriberSpeck example?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

small error in PublisherSubscriberSpeck example?

Frank Weber


I guess there is a small error in PublisherSubscriberSpeck example.

The following line in the wiki ...
class PublisherSubscriberSpeck {

... should be change in
class PublisherSubscriberSpeck extends Publisher{


http://code.google.com/p/spock/wiki/PublisherSubscriberSpecification


Regards,

Frank
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: small error in PublisherSubscriberSpeck example?

Peter Niederwieser
Administrator

What makes you think that PublisherSubscriberSpeck should extend  
Publisher? Publisher is the class under specification (class under  
test), PublisherSubscriberSpeck is the specification (test).

Cheers,
Peter

On Aug 3, 2009, at 5:17 PM, Frank Weber wrote:

>
>
> I guess there is a small error in PublisherSubscriberSpeck example.
>
> The following line in the wiki ...
> class PublisherSubscriberSpeck {
>
> ... should be change in
> class PublisherSubscriberSpeck extends Publisher{
>
>
> http://code.google.com/p/spock/wiki/PublisherSubscriberSpecification
>
>
> Regards,
>
> Frank
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: small error in PublisherSubscriberSpeck example?

Frank Weber
In reply to this post by Frank Weber

Hi Peter,

Well, I copied the example test over and below you find the mvn test report.
Any idea why this creates an error in my setup?

Thanks in advance,

Frank

[INFO] Found 3 Spock specifications
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory:
X:\Local\Workbench\workspace\bddspock\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running groovy.PublisherSubscriberSpeck
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.437
sec <<< FAILURE!
events are received by all
subscribers(groovy.PublisherSubscriberSpeck)  Time elapsed: 0.094 sec
<<< ERROR
!
groovy.lang.MissingPropertyException: No such property: subscribers
for class: groovy.PublisherSubscriberSp
eck
        at groovy.PublisherSubscriberSpeck.events are received by all
subscribers(PublisherSubscriberSpeck.groovy:
26)

Running groovy.HelloSpock
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.017 sec
Running groovy.StorySpock
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec

Results :

Tests in error:
  events are received by all subscribers(groovy.PublisherSubscriberSpeck)

Tests run: 3, Failures: 0, Errors: 1, Skipped: 0

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: small error in PublisherSubscriberSpeck example?

Peter Niederwieser
Administrator

Hmm, definitely works for me. Maybe you changed the following line:

pub.subscribers << sub1 << sub2

to:

subscribers << sub1 << sub2

?

Cheers,
Peter

On Aug 3, 2009, at 7:16 PM, Frank Weber wrote:

>
> Hi Peter,
>
> Well, I copied the example test over and below you find the mvn test  
> report.
> Any idea why this creates an error in my setup?
>
> Thanks in advance,
>
> Frank
>
> [INFO] Found 3 Spock specifications
> [INFO] [surefire:test {execution: default-test}]
> [INFO] Surefire report directory:
> X:\Local\Workbench\workspace\bddspock\target\surefire-reports
>
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running groovy.PublisherSubscriberSpeck
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.437
> sec <<< FAILURE!
> events are received by all
> subscribers(groovy.PublisherSubscriberSpeck)  Time elapsed: 0.094 sec
> <<< ERROR
> !
> groovy.lang.MissingPropertyException: No such property: subscribers
> for class: groovy.PublisherSubscriberSp
> eck
> at groovy.PublisherSubscriberSpeck.events are received by all
> subscribers(PublisherSubscriberSpeck.groovy:
> 26)
>
> Running groovy.HelloSpock
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:  
> 0.017 sec
> Running groovy.StorySpock
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:  
> 0.031 sec
>
> Results :
>
> Tests in error:
>  events are received by all  
> subscribers(groovy.PublisherSubscriberSpeck)
>
> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: small error in PublisherSubscriberSpeck example?

Frank Weber

My file name is PublisherSubscriberSpeck.groovy.
To me the class that is referenced with pub should instantiated with
the class Publisher.

In this case this line
    def pub = new PublisherSubscriberSpeck()
should be change to
    def pub = new Publisher()

This should do it, or ?

Regards

Frank

2009/8/3 Peter Niederwieser <[hidden email]>:

>
> Hmm, definitely works for me. Maybe you changed the following line:
>
> pub.subscribers << sub1 << sub2
>
> to:
>
> subscribers << sub1 << sub2
>
> ?
>
> Cheers,
> Peter
>
> On Aug 3, 2009, at 7:16 PM, Frank Weber wrote:
>
>>
>> Hi Peter,
>>
>> Well, I copied the example test over and below you find the mvn test
>> report.
>> Any idea why this creates an error in my setup?
>>
>> Thanks in advance,
>>
>> Frank
>>
>> [INFO] Found 3 Spock specifications
>> [INFO] [surefire:test {execution: default-test}]
>> [INFO] Surefire report directory:
>> X:\Local\Workbench\workspace\bddspock\target\surefire-reports
>>
>> -------------------------------------------------------
>> T E S T S
>> -------------------------------------------------------
>> Running groovy.PublisherSubscriberSpeck
>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.437
>> sec <<< FAILURE!
>> events are received by all
>> subscribers(groovy.PublisherSubscriberSpeck)  Time elapsed: 0.094 sec
>> <<< ERROR
>> !
>> groovy.lang.MissingPropertyException: No such property: subscribers
>> for class: groovy.PublisherSubscriberSp
>> eck
>>       at groovy.PublisherSubscriberSpeck.events are received by all
>> subscribers(PublisherSubscriberSpeck.groovy:
>> 26)
>>
>> Running groovy.HelloSpock
>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
>> 0.017 sec
>> Running groovy.StorySpock
>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
>> 0.031 sec
>>
>> Results :
>>
>> Tests in error:
>>  events are received by all
>> subscribers(groovy.PublisherSubscriberSpeck)
>>
>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0
>>
>> >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: small error in PublisherSubscriberSpeck example?

Peter Niederwieser
Administrator

Yes, "def pub = new Publisher()" is correct. I don't know where you  
got the other line from, it's definitely not from the Wiki.

Cheers,
Peter

On 04.08.2009, at 18:28, Frank Weber wrote:

>
> My file name is PublisherSubscriberSpeck.groovy.
> To me the class that is referenced with pub should instantiated with
> the class Publisher.
>
> In this case this line
>    def pub = new PublisherSubscriberSpeck()
> should be change to
>    def pub = new Publisher()
>
> This should do it, or ?
>
> Regards
>
> Frank
>
> 2009/8/3 Peter Niederwieser <[hidden email]>:
>>
>> Hmm, definitely works for me. Maybe you changed the following line:
>>
>> pub.subscribers << sub1 << sub2
>>
>> to:
>>
>> subscribers << sub1 << sub2
>>
>> ?
>>
>> Cheers,
>> Peter
>>
>> On Aug 3, 2009, at 7:16 PM, Frank Weber wrote:
>>
>>>
>>> Hi Peter,
>>>
>>> Well, I copied the example test over and below you find the mvn test
>>> report.
>>> Any idea why this creates an error in my setup?
>>>
>>> Thanks in advance,
>>>
>>> Frank
>>>
>>> [INFO] Found 3 Spock specifications
>>> [INFO] [surefire:test {execution: default-test}]
>>> [INFO] Surefire report directory:
>>> X:\Local\Workbench\workspace\bddspock\target\surefire-reports
>>>
>>> -------------------------------------------------------
>>> T E S T S
>>> -------------------------------------------------------
>>> Running groovy.PublisherSubscriberSpeck
>>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:  
>>> 0.437
>>> sec <<< FAILURE!
>>> events are received by all
>>> subscribers(groovy.PublisherSubscriberSpeck)  Time elapsed: 0.094  
>>> sec
>>> <<< ERROR
>>> !
>>> groovy.lang.MissingPropertyException: No such property: subscribers
>>> for class: groovy.PublisherSubscriberSp
>>> eck
>>>       at groovy.PublisherSubscriberSpeck.events are received by all
>>> subscribers(PublisherSubscriberSpeck.groovy:
>>> 26)
>>>
>>> Running groovy.HelloSpock
>>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
>>> 0.017 sec
>>> Running groovy.StorySpock
>>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
>>> 0.031 sec
>>>
>>> Results :
>>>
>>> Tests in error:
>>>  events are received by all
>>> subscribers(groovy.PublisherSubscriberSpeck)
>>>
>>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0
>>>
>>>>
>>
>>
>>>
>>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: small error in PublisherSubscriberSpeck example?

Frank Weber

Uups, that may have gotten wrong during a renaming process.

Sorry,

Frank

2009/8/4 Peter Niederwieser <[hidden email]>:

>
> Yes, "def pub = new Publisher()" is correct. I don't know where you
> got the other line from, it's definitely not from the Wiki.
>
> Cheers,
> Peter
>
> On 04.08.2009, at 18:28, Frank Weber wrote:
>
>>
>> My file name is PublisherSubscriberSpeck.groovy.
>> To me the class that is referenced with pub should instantiated with
>> the class Publisher.
>>
>> In this case this line
>>    def pub = new PublisherSubscriberSpeck()
>> should be change to
>>    def pub = new Publisher()
>>
>> This should do it, or ?
>>
>> Regards
>>
>> Frank
>>
>> 2009/8/3 Peter Niederwieser <[hidden email]>:
>>>
>>> Hmm, definitely works for me. Maybe you changed the following line:
>>>
>>> pub.subscribers << sub1 << sub2
>>>
>>> to:
>>>
>>> subscribers << sub1 << sub2
>>>
>>> ?
>>>
>>> Cheers,
>>> Peter
>>>
>>> On Aug 3, 2009, at 7:16 PM, Frank Weber wrote:
>>>
>>>>
>>>> Hi Peter,
>>>>
>>>> Well, I copied the example test over and below you find the mvn test
>>>> report.
>>>> Any idea why this creates an error in my setup?
>>>>
>>>> Thanks in advance,
>>>>
>>>> Frank
>>>>
>>>> [INFO] Found 3 Spock specifications
>>>> [INFO] [surefire:test {execution: default-test}]
>>>> [INFO] Surefire report directory:
>>>> X:\Local\Workbench\workspace\bddspock\target\surefire-reports
>>>>
>>>> -------------------------------------------------------
>>>> T E S T S
>>>> -------------------------------------------------------
>>>> Running groovy.PublisherSubscriberSpeck
>>>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
>>>> 0.437
>>>> sec <<< FAILURE!
>>>> events are received by all
>>>> subscribers(groovy.PublisherSubscriberSpeck)  Time elapsed: 0.094
>>>> sec
>>>> <<< ERROR
>>>> !
>>>> groovy.lang.MissingPropertyException: No such property: subscribers
>>>> for class: groovy.PublisherSubscriberSp
>>>> eck
>>>>       at groovy.PublisherSubscriberSpeck.events are received by all
>>>> subscribers(PublisherSubscriberSpeck.groovy:
>>>> 26)
>>>>
>>>> Running groovy.HelloSpock
>>>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
>>>> 0.017 sec
>>>> Running groovy.StorySpock
>>>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
>>>> 0.031 sec
>>>>
>>>> Results :
>>>>
>>>> Tests in error:
>>>>  events are received by all
>>>> subscribers(groovy.PublisherSubscriberSpeck)
>>>>
>>>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0
>>>>
>>>>>
>>>
>>>
>>>>
>>>
>>
>> >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...