My Thoughts: October 2011

Tuesday, October 11

Running JavaScript in the Java platform


Java is one of the powerful language.And we can do so mang things with it .

If you want to integrate javascript code with your javacode then it is very simple.
the steps are
1. Create ScriptEngineManager object
2.Get the ScriptEngine object from scriptEngineManager
3.Evaluate a script using the ScriptEngine object.

Here is the sample code :
You need to include "javax.script" package.

The scripting API consists of interfaces and classes that define Java Scripting Engines and provides a

framework for their use in Java applications.


import javax.script.*;

public class Javascript {


public static void main(String[] args) {
// Creating ScriptEngineManager
ScriptEngineManager mgr = new ScriptEngineManager();
//getting the ScriptEngine object
 ScriptEngine jsEngine = mgr.getEngineByName("JavaScript");
 try {
//Evaluate the script.For this we are using eval method
   jsEngine.eval("print('Hello, world!')");
 

 } catch (ScriptException ex) {
     ex.printStackTrace();
 }  

 try {
//We can import even java pacjages from script
   jsEngine.eval("importPackage(javax.swing);" +
       "var optionPane = " +
       "  JOptionPane.showMessageDialog(null, 'Hello, world!');");
 } catch (ScriptException ex) {
   ex.printStackTrace();
 }

}

}

Thursday, October 6

Happy Dasara

Wish you Happy Dasara




Steve Jobs Dies

Who doesn't know about Steve Jobs in this world.

He is the one who kept Apple in the top place of industry. He is the creator of Apple iPhone,iPad,iPod.

But he passed away today.We all miss him very badly .

The homepage of Apple's website this evening switched to a full-page image of Jobs with the text,

"Steve Jobs 1955-2011."


Clicking on the image revealed the additional text:

"Apple has lost a visionary and creative genius, and the world has lost an amazing human being. Those of us who have been fortunate enough to know and work with Steve have lost a dear friend and an inspiring mentor. Steve leaves behind a company that only he could have built, and his spirit will forever be the foundation of Apple."



Tuesday, October 4

Business Vs Testing

These are the words that I came to know from one of my friend :

"Business team will always look for something which is better than today. Testing team will always look for perfectness. "

Its true. There is nothing to be blamed.


But , having something better than today , always may not give good results.Every new feature has to meet some standards to maintain company brand.

And there is no perfect person , software in this world. As a tester if you don't give green signal for your product until it reaches perfectness , then your product will never never reach the customer.At somewhere and some point you have to stop testing and let the product go out.

At the end , goal of Testing Team is to improve business which is as same as Business Team :) .