Code Monkey home page Code Monkey logo

mockserver-grunt's People

Contributors

bitdeli-chef avatar jamesbloomnektan avatar jamesdbloom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mockserver-grunt's Issues

Using wildcard to match requests

I am trying to match the SOAP webservices request body to set the expectations.

My web services request content is too long to have all the values in the expectation. Is it possible to use wildcard approach with regex to match the pattern?

If yes, could you please provide an example for the same?

Adding callback to start_mockserver call

What do you think of adding callback function to start_mockserver call to be able to define expectations once server is started ?

It will provide async capability to the end users.

Something like this:

mockserver.start_mockserver({
                serverPort: 1080,
                serverSecurePort: 1082,
                proxyPort: 1090,
                proxySecurePort: 1092,
                verbose: true
            }, function() {
                  console.log('Ready');
             });

If you are open to this I can apply it soon.

WebJar - Wrong license type in NPM package.

I was all decided to go ahead and write a mockserver-client wrapper in ScalaJS for using as a backend when testing some browser-sensible code so I took the liberty of going to http://webjars.org to make it grab your mockserver-grunt NPM module so I can reference the library in SBT.

Unfortunately in the moment I hit "Build WebJar" I got this:

All attempts to determine an acceptable license have been exhausted. The package.json file did not contain a spec-compliant license definition and the license could not be determined by trolling through the source repo: git+https://github.com/jamesdbloom/mockserver-grunt The acceptable open source software licenses are at: https://bintray.com/docs/api/#_footnote_1 The provided licenses were: Apache This problem will likely need to be resolved by working with the library maintainers directly. If you feel you have reached this failure in error, please file an issue: https://github.com/webjars/webjars/issues

The issue seems to be that the "license type" referenced in the package.json must be either Apache-1.0 or Apache-2.0 (see https://bintray.com/docs/api/#_footnote_1) whilst current file only says Apache.

Allow users to configure debug port, suspend and log level

As discussed.

            var commandLineOptions = ['-Dfile.encoding=UTF-8', '-Dmockserver.logLevel=TRACE', '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005', '-jar', glob.sync('**/mockserver-netty-*-jar-with-dependencies.jar')];

Stopping mockserver fails to callback is not a function

Hey.

I'm utilizing mockserver for protractor tests to mock a server. Runs otherwise fine but stopping the mock server fails due to following error:


Using port '8500' to stop MockServer and MockServer Proxy
TypeError: callback is not a function
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)
[09:39:24] E/launcher - Process exited with error code 1

Using node v4.6.1 on Linux machines

When server starts to fast tests are failing with ECONNREFUSED

Hi @jamesdbloom,

I was running tests on very fast environment and realised that tests are failing with ECONNREFUSED when server starts too fast your check functions assumes everything is all right and passes control to tests to define the mocks and they fail cuz server seems to be not fully initialised.

request(options, function (error, response) {
    if (error) {
        deferred.reject(new Error(error));
    } else {
        setTimeout(fundeferred.resolve(response); }, 4000);
    }
});

This was the quick solution. but it's ugly. I'm thinking on how to get this solved properly and will send pull request. If you have any ideas let me know.

request(options, function (error, response) {
    if (error) {
        deferred.reject(new Error(error));
    } else {
        setTimeout(function() { deferred.resolve(response); }, 4000);
    }
});

stop_mockserver ignores port configuration

when I run the server via grunt and want to keep it active i am doing:
grunt start_mockserver
Then when finished I expected to be able to do:
grunt stop_mockserver
but it fails as it defaults to port 80.

stop_mockserver ignores the port settings unless run in the same task group within grunt like the tests are so the test port is still defined.

promise on mockserver-grunt never called

I've been looking for a way to mock an external api for quite some time and was very happy to find your mockserver packages for Node!

I've been able to use your mockserver-client without issues while running the mockserver itself through Homrebrew.

However I have not been as succesful running mockserver itself with the help of your mockserver-grunt package.

// When calling it like so, the promise will never execute:
var mockserver = require('mockserver-grunt');
mockserver
  .start_mockserver({ serverPort: 3200, verbose: true })
  .then(() => { console.log('loaded mockserver') ;} )

// I will see this printed though and the server will respond at the defined port
Skipping {"host":"oss.sonatype.org","path":"/content/repositories/releases/org/mock-server/mockserver-netty/3.10.6/mockserver-netty-3.10.6-jar-with-dependencies.jar","port":443} as file already downloaded
{ state: 'pending' }
> Running 'java -Dfile.encoding=UTF-8 -Dmockserver.logLevel=INFO -jar mockserver-netty-3.10.6-jar-with-dependencies.jar -serverPort 3200'
waiting for MockServer to start retries remaining: 100
...
waiting for MockServer to start retries remaining: 3
waiting for MockServer to start retries remaining: 2
waiting for MockServer to start retries remaining: 1
MockServer failed to start
2017-05-02 23:16:51,862 INFO o.m.m.MockServer MockServer started on port: 3200

// And when trying to stop it I'll see this
mockserver.stop_mockserver()
TypeError: Cannot read property 'serverPort' of undefined
...

The promise hooks would be greate for testing.

I'm on macOS, running node 4.6.2 and using "devDependencies": { "mockserver-grunt": 1.0.38" }.

Thank you in advance.

fix bower to download jar file

bower doesn't seem to be able to manage the jar file within the package.

change the execution process to check whether the jar file is present and download the correct version if its not present.

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.