i have a javascript code written in node.js (VS Code), how to place it in jsr223 post processer.
Java and Node.js are different beasts and cannot be easily integrated.
The options are in:
Execute your Node.js scripts using OS Process Sampler like you would do from a terminal/command prompt
Re-write your Node.js code in Groovy as it's the only recommended scripting language for JMeter as of now
Consider using J2V8 for your code invocation if it's complex and either cannot be easily converted to Groovy or suitable for command-line execution.
Related
I am currently trying to refactor an existing gnome-shell extension's codebase. Part of that is introducing unit tests as it seems rather neglectful to not use tests in 2016.
After some tinkering I managed to setup a working node-phantomjs-qunit pipeline that actually gets me somewhere.
However, shell extensions use a custom imports-mechanic as well as
some amendments to build in classes (ex: String.format via GJS) that make it impossible to actually test those files in a isolated environment, that is: not within the shell.
So my question is: Is it really true that it is impossible to write unit tests for shell extensions?
I've done some work with unit tests with gnome shell extensions, take a look at this extension for a complete example:
https://github.com/emerinohdz/power-alt-tab
I've used webpack with babel (optional) and GJS. It is even built using Travis CI.
I've included a dumb polyfill for the GS parts I needed, and provided an alternative to handle modules, using ES6 imports instead of the default GS imports mechanism. No integration tests are possible right now, only unit tests, but at least you have control of most of your codebase.
Is CppUnit the only C/C++ unit test framework currently available for use with Sonar?
What would be involved in adding additional C/C++ unit testing frameworks? (e.g. how many lines of code is the CppUnit plugin, how reusable, etc.)
I think you should better send your queries in Sonar's mailing lists : http://www.sonarsource.org/support/support/
See the unit test page: http://docs.codehaus.org/display/SONAR/Unit+Test+Support
From that page:
The C++ Plugin parses xunit compliant format using the
sonar.cxx.xunit.reportPath. To use other formats, first they need to
be converted using the property sonar.cxx.xunit.xsltURL
For convenience the following xsl are provided
boosttest-1.x-to-junit-1.0.xsl For transforming Boost-reports
cpptestunit-1.x-to-junit-1.0.xsl For transforming
CppTestUnit-reports cppunit-1.x-to-junit-1.0.xsl For transforming CppUnit-reports
So packages that support xUnit format, like Google Test Framework, should be supported. Otherwise, if they output xml they should be supportable by changing the xslt.
I'm working within the context of RPG Maker VX Ace. It has some Ruby extensions, and it has a subset of the Ruby 1.8 library built in. It also allows me to add my own .rb files -- such as the Ruby 1.9.3 source files -- albeit that I cannot use any code that has C extensions. If it requires a .so file, it won't work -- I'll get an error that "this application cannot load extensions/plugins."
Having understood this, I need some way to make an HTTP request. What I mean is:
Call a URL (eg. http://myserver.com/blah?data=abcd
Return the response (which will be a string -- not full HTML, just an identifier of some sort)
I have tried using open-uri and net/http. Both of them have different issues that prevent me from using. One (I think it's the latter) requires TcpSocket, which is implemented in C and is not "pure" Ruby. The other one gives me an error about an undefined constant related to sockets.
I've also tried using the Socket class, and it gives me a similar error.
TLDR: Is there some way I can make a Ruby HTTP call with pure Ruby, no C extensions? That is what I need.
I solved this by writing some code and calling it from Ruby. Easy breezy.
Using .NET, I created a non-command-line, non-service application; something which I can invoke like a command-line app, but without the command-line window. To do this:
Create a new command-line project
Go to project properties
Change the type to "Windows Forms Application"
When you run your project, it'll run like any command-line project (args, etc.) but no windows will appear.
From there, it was easy to make an asynchronous HTTP request and store the response in a text file. This is sufficient for now.
You could call out to a shell and execute curl (depending on your environment and the speed you want)
result = `curl "http://myserver.com/blah?data=abcd" -s`
The -s makes curl silent. See if that stops the dos box coming up.
Is it possible to generate test code from a cucumber feature file? Some developers prefer to read actual code instead of parsing the natural language and associated step definitions used by Cucumber.
Instead of (or as a side effect of) running cucumber a file with test code could be generated. E.g. the code that is inside the step definitions.
Both Ruby and Python have the ability of calling the debugger from code ( using the ruby-debug gem or the pdb module ). I'd like to know if something like that's available for Groovy.
I'm not interested in debugging with the IDE.
AFAIK Groovy does not support this. If you want to debug your options are:
Start the groovy process by passing the debug arguments to the JVM. Once the process has started, use a command-line Java remote debugger
Use an IDE (IMO, IntelliJ has the best support for debugging Groovy)