Mocking Classes for QFTest - easymock

At my company we are trying to make tests for a GUI build on JAVA swing using an automation tool called QFTEST.
In order to get better code coverage we came to the conclusion that a mocking specific classes is necessary. My boss has directed me to learn a EasyMock. However, from reading the documentation I came to believe that EasyMock must work with JUNIT and cannot be used as a standalone... Is this correct?
The bottom line:
Is it possible to integrate EasyMock with QFTEST?
If not, do you have another idea for a solution?
Thankyou!

Though I've not used easymock, we have used mockito (very similar) and we have used qftest separately. There should be no reason why you need junit to use either mockito or easymock as these two will work with testng for example. You will just need to decide how you will make your calls to easy mock/mockito as I think you have a choice of jython/groovy to write extended scripts.
Regards,
Mike

Related

Is testing in Create-React-App handled automatically or do I need to create/import custom testing?

I'm using create-react-app to build my app. Do I need to do any custom testing or is it all handled by create-react-app?
Also, do the errors and prompts I receive in my terminal and console cover all testing or is there something else I need to do before releasing an app for production.
Thanks
I'm not exactly sure what you mean by testing…
If you mean unit tests, then no. create-react-app can't automatically test your application for you. It has no idea what you're trying to acomplish with your application, so it can't test it.
Or are you talking about build warnings and errors? In that case create-react-app will tell you what it is able to gather, which should be quite a bit, but it can't find possible runtime errors.
In any case if you want your whole applications functionality covered by tests, you need to write those yourself. If you're not familiar with testing in general you may want to have a look at one or more react unit testing articles (https://felixgerschau.com/unit-testing-react-introduction/ could be starting point) and depending on what you want looking into e2e tests could also be worthwhile.

Adding ACL support to parse4cn1

I'm working on an app written in Codename One together with the parse4cn1 library, the combination of which is a real pleasure to use. However, I need support for a few things in parse4cn1 that are not implemented, most importantly ACL and was wondering if Chidiebere has any hints on how to do this (e.g. how did you implement parse4cn1 yourself - from scratch or copying the open source Parse SDK for Android)? If I manage to do something of a decent quality I will try to share back. Thanks in advance
I never got around implementing ACLs (it's still on the TODO list). parse4cn1's interface closes resembles the Parse Android SDK interface and I'll like it to stay that way for convenience. In this case, the interface of interest would be the ParseACL which is documented here.
The actual implementation will need to be done via REST API calls.
Things to bear in mind:
We use the Android SDK API simply for defining methods and signatures for the corresponding class in ParseACL but do not use the SDKs for anything can be be done via REST.
By design, any calls requiring the master key will not be supported in parse4cn1 due to security considerations. If really needed, the functionality should be exposed via server-side cloud code.
Pull requests without unit tests for the added functionality or breaking existing tests will be rejected.
See also the Contributions section of the parse4cn1 github repo.
Good luck with your implementation and I hope to see a PR from you soon ;)
It was implemented from a Java port on top of the REST API's here but was later modified to use the SDK's to allow things like push (which are now no longer relevant).
In the past I just contributed pull a request to the project to get the fixes/features I needed. It was really easy to work with and compile.

Run system tests against deployed app with Nancy.Testing

I've successfully set up some tests that run complete use cases against our code base using nancy.testing.
Now I'd like to use the same tests for what we call release tests: We deploy the complete application to a staging server and run the system tests against it. We already use that approach successfully with a WCF application.
Is there an easy way to make this work? I've noticed that Browser and BrowserResponse do not use any abstractions, so I cannot replace them with a SystemTestBrowser or similar.
I could of course abstract the whole nancy.testing package away, but I thought I ask here first if someone knows a simpler approach.
Nancy.Testing does not use any network communication at all. If you can think of a nice abstract then please let us know and we can talk and see if it's something we'd like to get into the package!

How to wrap a C library so that it can be called from a web service

We have a library with very complex logic implemented in C. It has a command line interface with not too complex string-based arguments. In order to access this, we would like to wrap the library so that it can be accessed with simple XML RPC or even straightforward HTTP POST calls.
Having some experience with Java, my first idea would be
Wrap the library in JNI/JNA
Use a thin WS stack and a servlet engine
Proxy requests through Apache to the servlet engine
I believe there should already be something simple that could be used, so I am posting this question here. A solution has the following requirements
It should be deployable to a current linux distribution, preferrably already available via package management
It should integrate with a standard web server (as in my example Apache)
Small changes to the library's interface should be manageable
End-to-end (HTTP-WS-library-WS-HTTP) the solution should not incur too much overhead, but reliability is very important
Alternatively to the JNI/JNA proposal, I think in the C# world it should not be too difficult to write a web service and call this unmanaged code module, but I hope someone can give me some pointers that are feasible in regards to the requirements.
If you're going with web services, perhaps Soaplab would be useful. It's basically a tool to wrap existing command line applications in SOAP web services. The web services it generates look a bit weird but it is quite a popular way to make something like this work.
Creating an apache module is quite easy and since your familiar with xmlrpc you should check out mod-xmlrpc2. You can easily add your C code to this apache module and have a running xmlrpc server in minutes
I think you may also publish it as a SOAP based web service. gSoap can be used to provide the service interface out of the library. Have you explored gSOAP? See http://www.cs.fsu.edu/~engelen/soap.html
Regards,
Kangkan
Depends what technology you're comfortable with, what you already have installed and working on your servers, and what your load requirements are.
How about raw CGI? Assuming the C code is stateless between requests, you can do this without modifying the library at all. Write a simple script which pulls the request parameters out of the CGI environment, perhaps sanitises the input, calls the library via the command-line interface, and packages the result into whatever HTTP response you want. Then configure Apache to dispatch the relevant URL(s) to this script. Python, for example, has library support for XML-RPC, and so does every other scripting language used on the web.
Servlets sound like overkill, but for instance if you want multiple requests per CGI process instantiation, and don't feel like getting involved in Apache configuration, then it might be easiest to stick with what you know.
I'm doing a similar thing with C++ at the moment. In my case, I'm writing a PHP module to allow PHP scripts to access the logic in my C++ library.
I can then use whatever format I want to allow the rest of the world to see it - initially it will just be through a PHP web application but I'll also be developing an XML-RPC interface.
If you're going down the JNI route, check out SWIG.
http://www.swig.org/Doc1.3/Java.html
Assuming you have headers to project bindings with, swig is pretty easy to work with.

Windows Forms Test Automation

We are looking for a way to automate windows forms for acceptance testing. Our requirements are:
Must be usable by non-developers (ie: people with no development environment installed)
Must have a recorder
Must support third-party controls
Must have basic functionality (allow clicking on buttons, inputing text, validating results, accros multiple windows if necessary)
Basically, something like Selenium, but for windows forms.
For what it's worth, I've been testing for 15 years, and to this day have never seen ROI on tests created in this fashion. Automated testing, is obviously a good thing, but if you are just taking test cases that should be manual test cases and having minimum wage workers "automate" them, you will almost always end up with a mass of unmaintainable fragile tests that save no time in the end and get thrown out quickly.
The FitNesse suggestion from paiNie is a great suggestion.
Must be usable by non-developers
Any not-web test automation tool will need either dev`s well-known ide (Eclipse etc.) or test tool ide. SilkTest, TestComplete etc. will also make u to write some code.
U can separate work between devs and testers using tool for creating "executable requirements" like "Fitnesse" or Concordion
AutomatedQA TestComplete meets your requirements AFAIK
HP QuickTest Pro is a good tool, even for non-developers
Posting this on behalf of my wife :)
We were using a tool from Compuware called TestPartner to create the test scripts for testing a WinForms client-server application. For managing and controlling the scripts execution we were using Compuware QA Director.
TestPartner uses VBA which is quite easy to understand and to use. Some non-developers could even know it because they write Excel macros.
It has good record-and-replay functionality and is very good with objects recognition.
So you could use it for both simple scripts created by your business users and to create a framework of advanced scripts by your developers and test engineers.
Never used it but Borland SilkTest seems to be another meeting your requirements.
Basically, something like Selenium, but for windows forms.
You could try AutoIt. It's free and has a community site where you could find already created solutions.
However I'm generally concerned about your goal. Acceptance criteria are informal.
Have you got already ideas how would you be translating informal stuff to technical requirements?
We use TestComplete for automating our Windows forms test cases. It is a pretty good product overall.
The main issue you will run into is that while most of these products will meet all of your requirements, you are going to run into a lot of maintenance issues, especially having non-developers recording the tests.
Although it may seem like a good idea to quickly record all of your tests then have them run from the recordings, you will have a much better ROI by actually treating your automated tests like regular development. Recordings will leave you with a lot of duplicated code, which is very difficult to maintain. By properly designing the tests and breaking out reusable code you will end up with much more stable tests and you will be able to get your results much quicker.
The Vermont HighTest:
http://www.vtsoft.com/vcsproducts/index.html
The 30 day trial looked pretty good!
Check out Oracle/Empirix e-Test.
Check the perfect solution. TestComplete is a great tool for record and play and creating your own scripts using VB, C#, C++ or anything else you want. It beats Silk, Compuware, Mercury hands down. It has very low price per license. You can get 5 license for price of 1 license in Compuware and silk, and 1/4 license for price Mercury.
You can try Sikuli. It's free and easy. No programming skills needed.

Resources