How to set up unit tests for Backbone web application - unit-testing

I am working on a single-page web application built with Backbone.js, Marionette.js, jQuery, Handlebars and other front-end libraries. The application uses server APIs to interact with its back-end. I am interested in setting up and writing unit tests for the front-end logic that is growing in size and complexity.
What tools do people use in the industry to test the front-end of a web application? How difficult is it to set up and use? Is there a front-end testing framework that can be used with a Backbone.js application?
I know about mock servers and I don't want to test the front-end with those. I would like to test the JavaScript code (client logic) of a Backbone + Marionette app.
Thank you.

Related

Does web framework do it all?

I would like to know of what web framework is responsible off.
I'm thinking to start a web app project, so I'm digging what frameworks should I use. So for HTML/CSS I'm thinking of Foundation framework, for JS I have chose to use React framework.
For a backend I have chosen to use Django framework, and it says that Django is a web framework. Will I be able to implement Foundation and React to django, or django will take care off all those aspects?

When to use standalone web service approach

I just started learning web services. In bottom up approach, I have found some examples without being deployed in any application server. I mean a standalone web service application.
Here is an example of such type.
I have also given a try and done a walk-through of deployable simple web service examples.
So far to my learning of web services, I got to know that firstly, bottom-up- approach is not recommended. Now, in bottom-up approach, this standalone web service. When is it applicable to follow standalone web service procedure?
Endpoint.publish();
I guess, this approach is provided just for beginners and not to follow as a real-time practice. Is my interpretation correct?
I would make my application as a standalone web service if it will have multiple clients like:
Web Client via a web browser
Mobile App Client
Desktop Client
Then I could build every one of them alone using whatever the technology I prefer, and make it consumes my standalone web service.
For example, You could imagine the guys behind Twitter started developing it by building their core system as web service, then they build an independent web interface application for it, then they built the Twitter Android and iPhone APP, and another one came and introduced a Twitter Desktop client like Tweetbot and TweetDeck ... etc

spring web controller use as web service

Currently I use Spring mvc to develop my we application. In future there will be a requirement to develop mobile app for this application.
In asp.net c# MVC have ability to use there web controller class as the web service. Then mobile app can use that controller class as web service.
I want to know is there an ability to use Spring MVC controllers as a we service. If yes, then how. Please explain.
You can easily write a Restful webservice using Spring MVC. The controller classes can return XML/JSON as required. It is simply a case of configuring an appropriate ViewResolver in this case a ContentNegotiationViewResolver.
This is an excellent guide which will walk you through the basics of Spring MVC as a webservice.

Nunit - XML based Data provider

I have used TestNG & Selenium for Test UI Automation
For .NET web services testing http web requests can be used to do functional testing
Has any one tried web services automation using Nunit ? Does it support passing data parameters in XML (Data Driven Testing) like TestNG?
Any experience/guidelines with WCF / ASPX 2.0 Web services functional test automation using Nunit if you can share would be helpful
Thanks,
Siva
I like to think about Web Services, WCF Services as another kind of interface to my business logic. And I only unit test my logic.
There is nothing specific in NUnit for testing WCF or Web Services.

Java EE and Grails: Communication with WebServices? Which framework?

Hy, I'm developing a Grails app which has to communicate with an existing Java EE application (built with EJB2).
Both the "legacy" app and the new Grails app will offer services and consume them.
For intercompatibility reasons, I'm thinking of communicating using WebServices. Now I'm wondering which frameworks I should use on both sides.
Since the Java EE application now runs under JDK5, I could use JAX-WS on I guess it would make sense to use Metro (https://jax-ws-commons.dev.java.net/grails/) on the Grails side. Does anybody have experiences with that? Or other suggestions?
If both the Grails and EJB applications live on the same LAN then there is nothing wrong with using RMI. Its the default way of talking to EJB's, is native to Java and is supported in Grails.
If you need to use Web Services then your container will have built in support for exposing the EJB's as Web Services (assuming J2EE 1.4 or later). Which container are you using?
If you cant use (or don't trust) the containers WS support then its best to pick a framework that you can use in both applications, thereby avoiding compatibility issues. Metro has worked well for me standalone but I haven't tried it with Grails.
Also there are more lightweight ways of exchanging XML messages than full SOAP'y Web Services. Hessian and Burlap are examples, plus Spring has its own HTTP messaging framework.