Posts

Showing posts from 2012

Running Jstestdriver with PhantomJs in Windows

Image
Using JSTestDriver with PhantomJS Locally PahntomJS is command line web browser JSTestDriver can be integrated to Jenkins; it can also be used for unit testing JavaScritpt Code; Only that it needs a browser running to execute the test cases.Using PahntomJs as the browser will  remove the need for a GUI browser to be launched from the script driven CI evnironment. Steps First start JStestdriver D:\Coding\lib>java -jar JsTestDriver-1.3.5.jar  --port 9876 --captureConsole --runnerMode DEBUG Starting Phantomjs browser and using it to capture the JStestdriver Download Phantomjs Download and use the javascript that is used to capture the pahntom browser https://github.com/larrymyers/js-test-driver-phantomjs/blob/master/phantomjs-jstd.js d:\Program_Files\phantomjs-1.7.0-windows>phantomjs.exe phantomjs-jstd.js Wed Oct 31 2012 12:07:26 GMT+0530 (India Standard Time): Attempting (1) to load:   http://localhost:9876/capture Run your JStestdiver tests http://cod

JAX-RS with GSON and Jersy

Following from the excellent tutorial from Vogella ( http://www.vogella.com/articles/REST/article.html  ), extending with some extra details.  Using GSON in this as my  class had  a custom class wrapped in Java collection, GSON makes it very easy to marshall JSON, same also with JAXB using Jersy; But with GSON unmarshalling to Java is also pretty easy.  Also multiple parmeter support is shown So let us start with the interface first. Kindly read Roy Thomas Fielding's 2000 Dissertation, where he described his architecture style for the web This is a must read for , especially 'architects'. Enough Talk, Let us show some code Yes read about JAX-RS annotations, otherwise it is a simple Java Class (packaged as a servlet - WAR, see Vogellas article first. Okay here goes the interface (in rest everything is HTTP,GET,SET, POST etc package com.test.prog; import java.util.ArrayList; import java.util.List; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws

Ubuntu 11.10 on my Dell Inspirion M101Z (dual core)

From the time I had this  laptop   Dell Inspiron M101z (AMD Athlon II Neo K325 Processor 1.3GHz, 2GB RAM)   ( http://asia.cnet.com/product/dell-inspiron-m101z-amd-athlon-ii-neo-k325-processor-1-3ghz-4gb-ram-45287123.htm ), I had used the excellent wubi installer to dual boot Ubuntu  10.10 to my system. This was okay, however the Windows 7 starter OS I have in this is also pretty light and fast and most often I was using it. I guess with Windows Ubuntu half lost the battle. Since Ubuntu has lot of releases, one day I tried upgrading Ubuntu in place. I guess upgrade is one area where Ubuntu is not that strong as earlier also upgrade has not been smooth.However this time, it managed to corrupt the Windows booting also. Since mine is a kind of high power Netbook, there is no CD tray. My hear skipped a beat when I saw this. However Windows 7 asked if it should go ahead and repair. Usually this sort of dialog from windows results in nothing much worthwhile, but this time in Windows 7 it a