Project: Making a SIP GUI test harness with Grails and SIPP – Part III

Project: Making a SIP GUI test harness with Grails and SIPP – Part III

Part I, discussed this project and walked through setting up SIPP scenarios and Grails (making a basic Grails project.)

Part II, discussed adding in a Service Layer to do the SIPP call and added some call validation.


Now What?

So now what? Well you can add on to your test harness. You can add other domain classes, controllers and services as needed.

For example, what if you wanted to have a different interface, where a user just enters a phone number and a proxy, and the service not only uses sipp but iterates through a list of carriers?

You could do that by adding in a new Domain object, and generate controllers/views… then make a service to handle the logic.  Like in the service you might define a list:
def carriers = [‘Sprint’,’TCast’,’Verizon’] and iterate through it with a for loop, like:

for (c in carriers) {
     def carrier = c
     def dialNum = "sipp -s ${dnis} ${ipprox} -sf ${carrier}_outbound_call.xml -l 1 -m 1 -d 5000".execute().text
 ....

Or what if you wanted a Service that would handle some audio analysis, so you could turn the audio of the phone call to a string and compare it against an expected value?  

You can keep adding onto the project with more and more cases.  

In the end, the code is centralized, and we have a UI for free. This UI can be used by us or other testers.

Tomcat

So lastly, there is the aspect of deployment.  For QA, we usually run our own servers and environments.  In my case, I have a variety of Linux Centos VM’s available to me.  I basically put Tomcat up on one of those guys. 

I’m assuming you got Tomcat up and running, as I wont cover setting it up in this post.

To deploy a Grails application, you basically do what you would do in Java – you create a WAR file and drop the WAR file in the Tomcat webapp folder. 

So there’s two ways I can think of doing this…. the hard way and the easy way.

The Hard Way

The hard way, basically means you do it the long way.  In this method, you simply open the grails command line in Intellij and type:
grails war
and hit enter or click ok.  

It will generate a war file and drop it in your project under /target.

Then you would SCP/FTP that up to your Tomcat server

That’s not so hard.  But there’s an easier way….

The Easy Way

First you need to set this up.  After that it’s easy.  

The easy way is easy, because once it’s set up, you don’t do any FTP/SCP or WAR Generation. You just run a command and it does all that.  

To get here, you will first need to do a few things – 

On the Tomcat server, edit the tomcat-users.xml file.  In that file you want to add a role group (if you don’t have it) called “manager-script.”

Add a user with the role  manager-script… jot down the username and pass you gave it… you’ll be adding that in the Grails configuration.

In Grails 2.2.4 Tomcat deployment plugin is already installed.  What you need to do is configure it so that when you deploy via your IDE, it will do all the WAR generation and SCP to your Tomcat server, for you.

**NOTE: I’m having issues with Grails 2.3Pre Release at this time, with Tomcat deployments**

In Grails, you open your /conf/Config.groovy file and add this:

/**
 * TOMCAT DEPLOY CONFIG
 */
tomcat.deploy.username="grails"
tomcat.deploy.password="pass"
tomcat.deploy.url="http://[your Tomcat server]/manager/text"
/**
 * END TOMCAT CONFIG
 */


That’s it.  

Now to deploy to Tomcat, you do this command: grails tomcat deploy 
from the command line within the IDE. 


Project: Making a SIP GUI test harness with Grails and SIPP – Part III
User Rating: 0 (0 votes)