Feeds:
Posts
Comments

Being a good TTL is not it easy … what are the things that TTL needs to have ?

Below are my convictions about this:

1)  Solid Technical.

2)  Ability to break down tasks.

3)  As John Maxwell said “Leaders must be close enough to relate to others, but far enough ahead to motivate them.”

4)  Sorround himself with smart people..

5)  He needs to believe that the big credit for his team not for himself.

6)  Humble.

7)  Learn from his team… they have a lot .. specially juniours 🙂

8)  He needs to trust his team.

9)  Consistent with all team members.

10) Good Communication Skills.

11) Concerned about applying best practices.

12) Keep his team excited… and in continous challenge.

13) He needs to know his soldiers ..
Based on my experience I do beleive that Developers are 3 types:

a)Good Starter:
They like to start with new technlogy,framework, tool,but they hate reading books,best practices,… !!
because of that TTL cannot depend on them totally all the time after the project started… but he can get a great benifit by utilizing there
skills in the early stages from the project and POC tasks.
TTL needs to help him to be good finisher.

b)Good Finisher:
They like reading books, best practices..and they always says we cannot start before reading couple of chapters about this new topic!
TTL can depend on them after starting project to deliver and keep project stable.
TTL needs to help him to be good starter.

c)GOLDEN Devloper = Good Starter + Good Finisher:

14) He needs to keep hands dirty with code !

What you think guys…

Advertisements

Hi, This tutorial for people who wants to start with JSF2.0 AJAX quickly …

ok, lets start..

1) Open your eclipse… create new web project.
2) put jsf-api.jar, jsf-imp.jar under WEB-INF\lib folder.
3)create  juma.mohammad.MainBean class

package juma.mohammad;
import java.util.Date;
import javax.faces.bean.ManagedBean;
@ManagedBean
public class MainBean {
	private String date = (new Date()).toString();
	public void update() {
		try {
			Thread.sleep(4000);
			date = (new Date()).toString();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
	public String getDate() {
		return date;
	}
	public void setDate(String date) {
		this.date = date;
	}
}

Here we used @ManagedBean jsf2.0 annotation .. we marked here our MainBean as jsf Backing Bean..

4) web.xml as below:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
  </servlet-mapping>
  <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
  </context-param>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
</web-app>

our url pattern as its clear is  ” *.jsf ”

4) No need for faces-config.xml… thanks for jsf2.0 annotations 🙂

5)create index.jsp and put it under WebContent folder:

<% response.sendRedirect("main.jsf"); %>

6)create main.xhtml page and put it under WebContent Folder as well:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<title>JSF 2.0 Simple Ajax...</title>
	<style type="text/css" >
		.ajaxResult { color: #440000;
		              font-weight: bold;
		              font-size: 18px;
		              font-family: Arial, Helvetica, sans-serif;
		}
	</style>
	<script language="javascript" type="text/javascript">
		function showDateIndicator(data) {
			  showIndicatorRegion(data, "dateIndicator");
		}

		function showIndicatorRegion(data, regionId) {
			  if (data.status == "begin") {
				  document.getElementById(regionId).style.display = "inline";
			  } else if (data.status == "success") {
				  document.getElementById(regionId).style.display = "none";
			  }
			}
	</script>
</h:head>
<h:body>
	<h:form id="myForm">

		<h2>JSF 2.0 AJAX</h2>
		<br/>

		<h:commandButton value="Update Date" action="#{mainBean.update}">
			<f:ajax render="myForm:viewDate" onevent="showDateIndicator" />
		</h:commandButton>

		<table border="0px">
			<tr>
				<td><h:outputText value="#{mainBean.date}" id="viewDate" /></td>
				<td><span class="ajaxResult" id="dateIndicator" style="display: none; font-size: 60%"> <img src="ajax-loader.gif" /> Loading data from server... </span></td>
			</tr>

		</table>

	</h:form>
</h:body>
</html>

now, to enable Ajax behaviour we just need to use <f:ajax tag > which takes 2 attributes

a) rerender : which is responsible for updating specific area in the page

b) onevent : here we call javascript function which will handle the ajax call, and it will take response data as argument.

we used it here to show ajax indicator message , and once response back from server this function will hide ajax indicator message.
7)put this image ajax-loader.gif under WebContent folder:

8)Export project as a war, and deploy it …

I hope you will find this tutorial useful 🙂

Being an ‘A’ Developer is not easy: you should work hard, and read, and learn from your mistakes.

I tried to summarize my convictions about who ‘qualifies’ as an ‘A’ Developer, below:

1) ‘A’ Developer writes her/his code with a lot of enjoyment and enthusiasm.

2) ‘A’ Developer is not a coder; ‘A’ Developer is an ENGINEER.

3) ‘A’ Developer is always asking “Why” before starting to learn a new technology. For example, “Why Spring?”, “Why JPA?”, “Why JSF?”

4) ‘A’ Developer is Big Picture oriented, not details oriented.

5) ‘A’ Developer believes that Design Patterns are a MUST.

6) ‘A’ Developer should be involved in all tiers.

7)  ‘A’ Developer is a good starter and a good finisher as well.

8)  ‘A’ Developer has v.good communication skills.

9)  ‘A’ Developer does not depend on “Hello World” examples when trying to learn and master a new technology .

10) ‘A’ Developer is always updating him/herself with the latest market news and reads developers articles and comments.

11)  ‘A’ Developer is not a fantasist in terms of the latest framework or technology.

12)  ‘A’ Developer is a very good user to his IDE. He/she knows the most important options and shortcuts the IDE has.

13)  ‘A’ Developer hates the systematic route and always asks: “How I can automate this.”

14) ‘A’ Developer tends to keep things simple.

15) ‘A’ Developer is a reliable, committed, and hard worker.

16) ‘A’ Developer likes new challenges.

17) ‘A’ Developer understands the business before beginning to code.

18)  ‘A’ Developer looks for the best practice for everything he/she works on.

Am I right… what do you think…?!

Hi all,

I’d like to share with u the solution for Arabic in PDF Jasper Reports Problem.. Simply all what u need to do is to use a suitable font for arabic text and make it embedded in ur PDF.

Note :- Arial is highly recommended for Arabic.. so we will use it here.

1) Download Arial.TTF…

2) Put Arial.TTF in ur classpath.

3)Open ur *.jrxml file and replace all <font> tags with this:

<font fontName=”Arial” pdfFontName=”ARIAL.TTF” size=”22″ isPdfEmbedded =”true” pdfEncoding =”Identity-H”/>

u can change size, but other attributes DON’T TOUCH PLEASE.

Hopefully This will help anyone facing such problem.

After we explained how we can implement a JAX-WS web service (endpoint, client) in the JAX-WS Five Minute Tutorial, we will continue by explaining how we can deploy the web service endpoint on any application server… and here we’ll use Tomcat.

To deploy your WS endpoint you need to package it as a war first then deploy it on your application server.

Note:- You can download the source code from here this example from here.

Ok, lets begin

1) Open Eclipse.

2) Create a new Web project .

3) Create your Web Service interface (Greeting):

package juma.mohammad;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public interface Greeting {
 @WebMethod String sayHello(String name);
}

4) Create your Web Service implementation (GreetingImpl):

package juma.mohammad;

import javax.jws.WebService;

@WebService(endpointInterface = "juma.mohammad.Greeting")
public class GreetingImpl implements Greeting {

 @Override
 public String sayHello(String name) {
 return "Hello, Welcom to jax-ws " + name;
 }

}

5) Now , you need generate Web Services classes, open your command line, and type :

cd %project_home%
wsgen -s src -d build/classes -cp build/classes juma.mohammad.GreetingImpl

Good , now you have two classe(SayHello.java, SayHelloResponse.java) generated under /greetingWS/src/juma/mohammad/jaxws .
6) Now we need to write our web.xml and put it under greetingWS/WebContent/WEB-INF

<?xml version="1.0" encoding="UTF-8"?>
<web-app
 xmlns="http://java.sun.com/xml/ns/j2ee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
 version="2.4">
 <listener>
 <listener-class>
 com.sun.xml.ws.transport.http.servlet.WSServletContextListener
 </listener-class>
 </listener>
 <servlet>
 <servlet-name>GreetingWS</servlet-name>
 <servlet-class>
 com.sun.xml.ws.transport.http.servlet.WSServlet
 </servlet-class>

 </servlet>
 <servlet-mapping>
 <servlet-name>GreetingWS</servlet-name>
 <url-pattern>/greeting</url-pattern>
 </servlet-mapping>
</web-app>


Note that in this web.xml we just defined two things : 1) listener-class 2)servlet !

7) ok,the final step is that you need to add sun-jaxws.xml under /greetingWS/WebContent/WEB-INF which contains endpoints definition:

<?xml version="1.0" encoding="UTF-8"?>
<endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0">
 <endpoint
 name="GreetingWS"
 implementation="juma.mohammad.GreetingImpl"
 url-pattern="/greeting"/>
</endpoints>


8) You need to download JAX-WS library and put jars under /greetingWS/WebContent/WEB-INF/lib.

You can get jars from the attached sample 🙂

9) Great, now you just need to export this project as a war, and drop it under your Tomcat webapps folder .

10) Run Tomcat.

11) Try this url: http://localhost:8080/greetingWS/greeting

Congratulations… web service information page appeared 🙂

This tutorial is for people who want to run a JAX-WS example (Endpoint + Client) in just five minutes.

What you need to run this example:

  1. JDK 1.6
  2. Eclipse .
  3. Be Excited 😉

Note:- You can download the source code for this example from the resources section.

Developing WebService End Point

1) Open Eclipse, and create a java project “WS-Server”.

2) Create WS-Service Endpoint Interface:

package juma.mohammad;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public interface Greeting {
	 @WebMethod String sayHello(String name);
}

3) Create WS-Service Endpoint Implementation class:

package juma.mohammad;

import javax.jws.WebService;

@WebService(endpointInterface = "juma.mohammad.Greeting")
public class GreetingImpl implements Greeting {

	@Override
	public String sayHello(String name) {
		return "Hello, Welcom to jax-ws " + name;
	}

}

4) Create Endpoint Publisher class:

package juma;

import javax.xml.ws.Endpoint;

import juma.mohammad.GreetingImpl;

public class WSPublisher {
	public static void main(String[] args) {
		Endpoint.publish("http://localhost:8080/WS/Greeting",new GreetingImpl());
	}
}

5) Run the WSPublisher…. Guess what .. your WebService is published..
Wow.. check your service wsdl http://localhost:8080/WS/Greeting?wsdl

Developing WebService Client :

1) Open eclipse and create a new java project WS-Client

2) As you know we need to generate the client stubs… but how?

open your command line, and enter the wsimport command:

CD %CLIENT_PROJECT_HOME%\src
wsimport –s . http://localhost:8080/WS/Greeting?wsdl

You will find 6 java classes generated, and compiled under src/juma/mohammad.

You can remove *.class files , no need for them 🙂

3) Now Lets create Client Class which will be dependent on the stubs:

package juma;

import juma.mohammad.Greeting;
import juma.mohammad.GreetingImplService;

public class Client {
	public static void main(String[] args){

GreetingImplService service = new GreetingImplService();
Greeting greeting = service.getGreetingImplPort();
System.out.println("------->>  Call Started");
System.out.println(greeting.sayHello("Ali"));
System.out.println("------->>  Call Ended");
	}
}

4) Run the Client Class…. the output should looks like:

------->>  Call Started
Hello, Welcom to jax-ws Ali
------->>  Call Ended

Congratulations…. you managed to develop jax-ws Endpoint , Client..

The next tutorial will be how to deploy your Web Service on Tomcat.

Selenium and WebTest are two frameworks available for web test automation. This article compares both frameworks based on a set of 8 questions to help to choose between them.

1 ) Which one has the better IDE?
2 ) How easy / fast to write a comprehensive test case?
3 ) How easy is it to enhance and modify your test case scenario ?
4 ) Dealing with Javascript errors?
5 ) How easy is it to integrate your web test cases with project ?
6 ) What are the things that are in WebTest that you will miss in Selenium?
7 ) Documentation?
8 ) Generated Reports?

Which one has the better IDE?


Selenium has the better IDE , Selenium IDE is advanced and has a lot of luxuries. WebTest IDE is elementary.

How easy/fast to write a comprehensive test case?


In Selenium and WebTest it is easy to write test cases, but Selenium is much easier than WebTest … of course this is related to point 1(Selenium IDE is advanced compared with WebTest)!

How easy is it to enhance and modify your test case scenario ?


In Selenium this will be easier because of 2 reasons:
a) The test case is executed on the browser , so anyone can easily guess what is the flow and can suggest enhancements on the test case, no need to take a look at the code to guess what this test case is doing.
b ) Because Selenium IDE gives u the ability to modify your test case in a very friendly straight forward way, WebTest IDE does not.

Dealing with Javascript errors?


Selenium does not care if there is a JavaScript error or not, so you cannot depend on Selenium alone to guess JavaScript errors in the application!!!
WebTest does care about JavaScript errors, and it will not let you continue your test till you fix all JavaScript errors.

The first impression regarding this point that WebTest is better, right?
But this is not the case always, because sometimes you have to deal with a project that has many JavaScript errors and all what you want and need is to test functionality , server-side validation , flow ….
Selenium is your hero here…

WebTest will not continue executing test case if it discover any javascript error so it will let you down here..
The optimum thing in my opinion is to have the ability to test functionality and flow regardless if there is Javascript errors or not, and to have the ability to find JavaScript errors in screens.
I mean Javascript error should not stop you from testing the flow and functionality for screens.

But how we can do that?
Simply you can use FireBug FireFox plugin which catch JavaScript errors while Selenium is executing the TestCases, this helped me a lot before , Trust me in this 😉
So my opinion for this point is:
Selenium + FireBug is much better than WebTest.. .

How easy is it to integrate test cases with project ?


WebTest integration with projects is easy! You can easily integrate it to your build file,and it is will become easier to use continues integration tools like CruiseControl to run test cases.
WebTest much better here.

What the things that are in WebTest that you will miss in Selenium?


In WebTest you can verify text inside Excel and PDF.

Documentation?


The same .. no one wins here!

Generated Reports?


WebTest Reports is better, but the difference is not that much.
Based on the above , I do recommend Selenium …