Wednesday, June 25, 2008

Quick publishing your application to Process server (using WID)

While doing development you will be changing lot of things in your code. To test those changes usually we used to restart the project.But WID(WebSphere Integeration Developer) has smart option, After completing your changes build the application.Go to problem tab you can see a message stating that your project has changed need to be reinstalled in server. Select the particular row, and right click there you will see a option called Quick Fix. This option will replace the files which has got modified. Your publishing process became faster now :-)

Thursday, June 19, 2008

FireFox 3

Guys Firefox 3 is out. one of the best browsers ever i have used. Lots & Lots of extensions for development, themes etc.... why waiting get the worlds fastest browser Firefox. I have downloaded FireFox3 and Mozilla gave a certificate. Here is the certificate



Wednesday, June 18, 2008

Dasathavaram Review

Good movie, the name kamal hassan is the only selling point. It works too. Ten characters sitting for makeup itself is pain in XXX. I will bet only kamal can do it. voice modulation, body language for 10 characters in superb. RAW officer character is very good, thats the comedian character. After watching so many films i think makeup of some characters can be still taken care. But kamal covers it up all.

The only thing i thought was CG (Computer Graphics) is bad. It could have given more importance. some of the scenes look so pathetic with CG. I don't know how kamal missed it. Fletcher character was good, very sad about mallika ending :-(.....

As we have been seeing kamal for many years we can identify the characters, but if some one sees the film for the first time. Then it would be difficult to identify kamal. Hats off to kamal. A true actor, story teller, producer who thinks always about the film industry and how to make films good.
very proud of kamal Hassan.

Tuesday, June 10, 2008

Using WSExplorer in WID

We are using WID(websphere Integeration developer) for our project, since we do lot of our work on business process, MQ and web-services. It becomes diffcult sometimes testing web-services, but when you have WID it easy. WID has WSExplorer built-in.After installing the project with web-servcies. publish the WSDL from the server.


This will publish a zip file, inside the zip file open wsdl file. copy the SOAP url and paste in the browser, append ?wsdl to the URL copied. you will see wsdl file again. check the URL in the browser it might have changed copy the URL from the browser


open the WSExplorer in WID,select wsdl page link and paste the URL which you have copied from the URL and click GO



select the interface operation, you will get screen where you can input your data and invoke the interface.This will call your web-services


if you are using the URL from published zip file, you will be getting this error

so next time if you get this error you know what to do :-)

Wednesday, June 04, 2008

Accessing private methods using JUNIT

If you want to test private method of class which has object's as arguments here is the example to how do it.

First SampleObject



package com.sathish;
public class Sample {
public String example;
public String example1;
/**
* @return Returns the example.
*/
public String getExample() {
return example;
}
/**
* @param example The example to set.
*/
public void setExample(String example) {
this.example = example;
}
/**
* @return Returns the example1.
*/
public String getExample1() {
return example1;
}
/**
* @param example1 The example1 to set.
*/
public void setExample1(String example1) {
this.example1 = example1;
}
}



 


Second the Class with private method

package com.sathish;
public class SampleMain {

private Sample getSampleValues(Sample sample)
{
System.
out.println(" Sample Values Setting in SampleMain"+sample.getExample());
return sample;
}
}


 



Third JUNIT Class File



package com.sathish;

import java.lang.reflect.Method;
import junit.framework.TestCase;

public class SampleTest extends TestCase {
/*
* @see TestCase#setUp()
*/
private Sample sample;
private SampleMain sampleMain;
protected void setUp() throws Exception {

sample=
new Sample();
sampleMain=
new SampleMain();
}
public final void testGetSampleValues()
{
try
{
sample.setExample(
" setting Example 1");
final Method[] methods = SampleMain.
class.getDeclaredMethods();
for (int i = 0; i < methods.length; i++) {
if (methods[i].getName().equals("getSampleValues")) {
final Object
params[] = {sample};
methods[i].setAccessible(
true);
sample = (Sample)methods[i].invoke(sampleMain,
params);
}
}
}
catch(Exception exception)
{
exception.printStackTrace();
}
}
}


 


 

If you check in the JUNIT class, we will be using reflections to find the method and invoke .getDeclaredMethods() method will give array of methods declared in the SampleMain class looping through the methods we are getting the method which has declared private here getSampleValues.

Then we are preparing arguments, setting that particular method accessible and then invoking method with arguments



finally this the output after running the JUNIT file

Sample Values Setting in SampleMain setting Example 1