question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Spock

See original GitHub issue

It would be great to have a support for Spock. So one could use the library like this:

import dev.morling.jfrunit.*
import spock.lang.Specification

import java.time.Duration

import static dev.morling.jfrunit.JfrEventsAssert.*
import static dev.morling.jfrunit.ExpectedEvent.*

@JfrEventTest
class JfrSpec extends Specification {

    JfrEvents jfrEvents = new JfrEvents()

    @EnableEvent('jdk.GarbageCollection')
    @EnableEvent('jdk.ThreadSleep')
    def 'should Have GC And Sleep Events'() throws Exception {
        when:
        System.gc()
        sleep(1000)

        then:
        assertThat(jfrEvents).contains(event('jdk.GarbageCollection'))
        assertThat(jfrEvents).contains(
                event('jdk.ThreadSleep').with('time', Duration.ofSeconds(1)))
    }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
phejlcommented, Mar 5, 2021

I think I might have a PR soon 😃

1reaction
gunnarmorlingcommented, Mar 5, 2021

Interesting idea, I certainly could see us doing that. What’s the language used above, Groovy?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spock
Spock is a testing and specification framework for Java and Groovy applications. What makes it stand out from the crowd is its beautiful...
Read more >
Introduction to Testing with Spock and Groovy - Baeldung
A quick and practical guide to testing with Spock and Groovy. ... As we can see, blocks help our test become more readable....
Read more >
Spock Tutorial: Testing With Spock Framework and Groovy
This introductory tutorial will explain all about Spock, which is a test framework that's built on top of Groovy. It enforces BDD at...
Read more >
Getting started with Spock | IntelliJ IDEA Documentation
Spock is a testing framework for Java and Groovy code that you can use to automate your tests. IntelliJ IDEA supports full Spock...
Read more >
spockframework/spock: The Enterprise-ready testing ... - GitHub
Spock is a BDD-style developer testing and specification framework for Java and Groovy applications.To learn more about Spock, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found