GithubHelp home page GithubHelp logo

Comments (7)

tomakehurst avatar tomakehurst commented on July 1, 2024

Hi,

Thanks for the feedback!

Two questions:
Is there a reason the @rule approach, or programmatic startup/shutdown inline with your tests isn't suitable?

Have you looked into the option of a Maven mojo that programmatically starts and stops WireMock programmatically? I'm not sure whether there are JVM forking issues with this, but if not then it could be done in very little code and without changing WireMock.

Another tactical approach you could consider is packing WireMock into a WAR (the example-war sub-project in the source shows how to do this) and then running that in Jetty via the Maven plugin.

I agree that some kind of Maven plugin for this might be useful though. I'll add it to the list.

Tom

from wiremock.

rowanhill avatar rowanhill commented on July 1, 2024

One use case for a REST-based stop command is when using WireMock outside of Java: it's easy enough to start WireMock in standalone mode, but the only way to stop it then is to kill its process. It'd be more elegant to be able to ask WireMock to stop itself - c.f. Selenium's /selenium-server/driver/?cmd=shutDownSeleniumServer URL.

from wiremock.

tomakehurst avatar tomakehurst commented on July 1, 2024

If you've got sufficient access to the remote machine to be able to start it, surely can also kill -3 it?

I've run it this way on a number of projects and these days I tend to wrap it in a unix service so that I can just service wiremock start and service wiremock stop.

Perhaps it's not so simple in under Windows?

from wiremock.

rowanhill avatar rowanhill commented on July 1, 2024

Yes, you can kill the process (and I suspect you could even manage to do something along those lines in Windows), it just strikes me as being more pleasant (and platform agnostic) to be able to issue a graceful shutdown command.

I've just been having a look into doing this, and it does seem fairly achievable - I won't submit a pull request if you're against it, though. :)

from wiremock.

yogurtearl avatar yogurtearl commented on July 1, 2024

+1, I think this would be useful.

from wiremock.

tomakehurst avatar tomakehurst commented on July 1, 2024

OK, if you're happy to create a PR, I'm happy to merge it.

from wiremock.

tomakehurst avatar tomakehurst commented on July 1, 2024

Released in 1.40

from wiremock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.