<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Free practice test , mock test, driving test, interview questions &#187; spring</title>
	<atom:link href="http://www.skill-guru.com/blog/tag/spring/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.skill-guru.com/blog</link>
	<description>Find free mock and practice test, create and sell tests</description>
	<lastBuildDate>Thu, 29 Jul 2010 14:16:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Prototype scope in Spring beans</title>
		<link>http://www.skill-guru.com/blog/2010/07/29/prototype-scope-in-spring-beans/</link>
		<comments>http://www.skill-guru.com/blog/2010/07/29/prototype-scope-in-spring-beans/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 14:16:30 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=2494</guid>
		<description><![CDATA[When you specify a bean as prototype in xml file or through annotation
&#60;bean
id=&#8221;myBeanInstance&#8221;
class=&#8221;com.xyx.PrototypeBeanExample&#8221;
scope=&#8221;prototype&#8221;
autowire=&#8221;byName&#8221;&#62;
&#60;/bean&#62;
it means that every time a request for this bean is made, a new instance is created. If you want to see the illustration
Prototype bean in Spring
Prototype is meant for beans which hold some state.
The  bean lifecycle also changes in prototype bean. From [...]]]></description>
			<content:encoded><![CDATA[<p>When you specify a bean as <strong>prototype</strong> in xml file or through annotation</p>
<p>&lt;bean<br />
id=&#8221;myBeanInstance&#8221;<br />
class=&#8221;com.xyx.PrototypeBeanExample&#8221;<br />
<strong>scope=&#8221;prototype&#8221;</strong><br />
autowire=&#8221;byName&#8221;&gt;</p>
<p>&lt;/bean&gt;</p>
<p>it means that every time a request for this bean is made, <strong>a new instance</strong> is created. If you want to see the illustration</p>
<p><a href="http://static.springsource.org/spring/docs/2.0.x/reference/beans.html#beans-factory-scopes-prototype">Prototype bean in Spring</a></p>
<p>Prototype is meant for beans which hold some state.</p>
<p>The  bean lifecycle also changes in prototype bean. From Spring&#8217;s doc</p>
<blockquote><p>Spring does not manage the complete lifecycle of a prototype bean: the 			container instantiates, configures, decorates and otherwise assembles a 			prototype object, hands it to the client and then has no further knowledge 			of that prototype instance</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/07/29/prototype-scope-in-spring-beans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating hibernate search with a Spring and JPA Application</title>
		<link>http://www.skill-guru.com/blog/2010/07/19/integrting-hibernate-search-with-a-spring-and-jpa-application/</link>
		<comments>http://www.skill-guru.com/blog/2010/07/19/integrting-hibernate-search-with-a-spring-and-jpa-application/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 15:51:41 +0000</pubDate>
		<dc:creator>smitha</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[hibernate search]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=2421</guid>
		<description><![CDATA[In this post we will talk about how to integrate hibernate Search into your existing Spring, JPA and Hibernate application and some of the challenges we faced.
We  have a web application using Hibernate (with JPA ) and Spring. This application relies on Spring for transaction, bean initialization / injection etc. EntityManager, transaction are configured in [...]]]></description>
			<content:encoded><![CDATA[<p>In this post we will talk about how to integrate hibernate Search into your existing Spring, JPA and Hibernate application and some of the challenges we faced.</p>
<p>We  have a web application using Hibernate (with JPA ) and Spring. This application relies on Spring for transaction, bean initialization / injection etc. EntityManager, transaction are configured in application.xml file. When integrating Hibernate search in such an application one might face problems. In this post I am sharing some problems I faced during integration and the solution I found.</p>
<p>entitymanager configuration in my application.xml</p>
<p>Spring configuration:<br />
&lt;bean id=&#8221;propertyConfigurer&#8221;&gt;<br />
&lt;property name=&#8221;location&#8221; value=&#8221;classpath:myproperties.properties&#8221;/&gt;<br />
&lt;/bean&gt;</p>
<p><span id="more-2421"></span><br />
&lt;bean id=&#8221;dataSource&#8221; destroy-method=&#8221;close&#8221;&gt;<br />
&lt;property name=&#8221;driverClass&#8221; value=&#8221;${db.driverClass}&#8221;/&gt;<br />
&lt;property name=&#8221;jdbcUrl&#8221; value=&#8221;${db.url}&#8221;/&gt;<br />
&lt;property name=&#8221;user&#8221; value=&#8221;${db.username}&#8221;/&gt;<br />
&lt;property name=&#8221;password&#8221; value=&#8221;${db.password}&#8221;/&gt;<br />
&lt;property name=&#8221;minPoolSize&#8221; value=&#8221;2&#8243;/&gt;<br />
&lt;property name=&#8221;maxPoolSize&#8221; value=&#8221;8&#8243;/&gt;<br />
&lt;property name=&#8221;breakAfterAcquireFailure&#8221; value=&#8221;false&#8221;/&gt;<br />
&lt;property name=&#8221;acquireRetryAttempts&#8221; value=&#8221;3&#8243;/&gt;<br />
&lt;!&#8211; property name=&#8221;idleConnectionTestPeriod&#8221; value=&#8221;300&#8243; &#8211;&gt;<br />
&lt;property name=&#8221;testConnectionOnCheckout&#8221; value=&#8221;true&#8221;/&gt;<br />
&lt;/bean&gt;</p>
<p>&lt;bean id=&#8221;entityManager&#8221;<br />
p:dataSource-ref=&#8221;dataSource&#8221;&gt;<br />
&lt;property name=&#8221;persistenceUnitName&#8221; value=&#8221;defaultManager&#8221; /&gt;<br />
&lt;property name=&#8221;jpaVendorAdapter&#8221;&gt;<br />
&lt;bean&gt;<br />
&lt;property name=&#8221;database&#8221; value=&#8221;${jpa.database}&#8221;/&gt;<br />
&lt;property name=&#8221;showSql&#8221; value=&#8221;${jpa.showSql}&#8221;/&gt;<br />
&lt;/bean&gt;<br />
&lt;/property&gt;<br />
&lt;/bean&gt;</p>
<p>&lt;bean id=&#8221;transactionManager&#8221;<br />
p:entityManagerFactory-ref=&#8221;entityManager&#8221;/&gt;</p>
<p>In the base DAO, I have  entityManager  as class level variable, value to which will be injected by spring:</p>
<p>@PersistenceContext(unitName = &#8220;defaultManager&#8221;)<br />
private EntityManager entityManager;<br />
For Hibernate search we need FullTextEntityManager. This instance of FullTextEntityManager  will be created using entityManager as below:<br />
fullTextEntityManager = Search.getFullTextEntityManager(entityManager);</p>
<p>To make fullTextEntityManager available for search in the DAO class , I creates a class level variable fullTextEntityManager and  initialized this in @postConstruct method (after entityManager injection) as below.<br />
@PersistenceContext(unitName = &#8220;defaultManager&#8221;)<br />
private EntityManager entityManager;</p>
<p>FullTextEntityManager fullTextEntityManager;</p>
<p>public abstractDAO(){<br />
super();</p>
<p>@PostConstruct<br />
public void setPersistenceUnit(){<br />
super.setUnit(entityManager);<br />
fullTextEntityManager = Search.getFullTextEntityManager(entityManager);</p>
<p>}</p>
<p>public FullTextEntityManager getFullTextEntityManager(){<br />
return fullTextEntityManager;<br />
}<br />
But this approach gave me<br />
org.hibernate.SessionException: Session is closed!<br />
Exception whenever I tried to search.</p>
<p>My initial action was to look into index directory to see if they are being created. It looked perfectly ok there.</p>
<p><em>The problem was, search operation was not getting transaction while searching. The spring was not injecting transaction into a fullTextEntityManager created from entityManager</em>.</p>
<p>For a try I introduced EXTENDED persistence context as below:<br />
@PersistenceContext(unitName = &#8220;defaultManager&#8221;,type=PersistenceContextType.EXTENDED)<br />
private EntityManager entityManager;</p>
<p>and search started working!! But this gave me other problems. Any changes to the entity bean got saved into DB without even committing!!!! I had to revert this change.</p>
<p>My second approach to solve this was to configure fullTextEntirtyManager as Spring bean (as entityManager was configured) so that it can get the transaction.<br />
I couldn’t do it properly as I found no spring’s implementation for fullTextEntirtyManager bean configuration.</p>
<p>After a lot of tries and searching, just changing my DAO code solved this. Instead of making FullTextEntityManager a class level variable, I instatiated it from entityManager whenever I wanted to search. Something like below:</p>
<p>@PersistenceContext(unitName = &#8220;defaultManager&#8221;)<br />
private EntityManager entityManager;</p>
<p>public abstractDAO(){<br />
super();<br />
}</p>
<p>@PostConstruct<br />
public void setPersistenceUnit(){<br />
super.setUnit(entityManager);</p>
<p>}</p>
<p>public FullTextEntityManager getFullTextEntityManager(){<br />
FullTextEntityManager fullTextEntityManager;<br />
fullTextEntityManager = Search.getFullTextEntityManager(entityManager);<br />
return fullTextEntityManager;<br />
}<br />
This solved my problem and the search is working perfectly now.</p>
<p>Going for an interview or want to test your hibernate skills , check out our <a href="../../tag/hibernate">hibernate interview questions</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/07/19/integrting-hibernate-search-with-a-spring-and-jpa-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How good are Spring certification practice tests at Skill-Guru ?</title>
		<link>http://www.skill-guru.com/blog/2010/07/07/how-good-are-spring-certification-practice-tests-at-skill-guru/</link>
		<comments>http://www.skill-guru.com/blog/2010/07/07/how-good-are-spring-certification-practice-tests-at-skill-guru/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 02:57:53 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Mock  Exam / Certifications]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=2455</guid>
		<description><![CDATA[In our previous posts we had mentioned that Ikoko has added 2 mock test of 50 questions each at Skill-Guru
Spring certification mock test 1
Spring certification mock test 2
These tests are priced at $0.99 each . So how good are the tests ?
Follow this discussion on javaranch to see what real users who have been through [...]]]></description>
			<content:encoded><![CDATA[<p>In our previous posts we had mentioned that Ikoko has added 2 mock test of 50 questions each at <a href="http://www.skill-guru.com">Skill-Guru</a></p>
<p><a href="http://skill-guru.com/test/81/core-spring-3.0-certification-mock">Spring certification mock test 1</a></p>
<p><a href="http://skill-guru.com/test/86/core-spring-3.0-certification-mock-test-2">Spring certification mock test 2</a></p>
<p>These tests are priced at $0.99 each . So how good are the tests ?</p>
<p>Follow this discussion on javaranch to see what real users who have been through Spring certification are saying about the test</p>
<p><a href="http://www.coderanch.com/t/497889/Spring/Failed-Core-Spring-Certification">Failed Core Spring certification</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/07/07/how-good-are-spring-certification-practice-tests-at-skill-guru/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Practice test for Spring Certification</title>
		<link>http://www.skill-guru.com/blog/2010/06/24/practice-test-for-spring-certification/</link>
		<comments>http://www.skill-guru.com/blog/2010/06/24/practice-test-for-spring-certification/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 03:11:30 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Mock  Exam / Certifications]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[practice-test]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=2425</guid>
		<description><![CDATA[ikoko had added 2nd mock practice test for Spring Certification . He had added first test Core Spring 3.0 Certification Mock and has received very good response from users. The users have found value in the $0.99 test .
We hope that you like his Core Spring 3.0 Certification Mock Test 2 . This test covers [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.skill-guru.com/guru/ikoko">ikoko</a> had added 2nd<a href="http://www.skill-guru.com/test/86/core-spring-3.0-certification-mock-test-2"> mock practice test for Spring Certification </a>. He had added first test <a href="http://www.skill-guru.com/test/81/core-spring-3.0-certification-mock">Core Spring 3.0 Certification Mock</a> and has received very good response from users. The users have found value in the $0.99 test .</p>
<p>We hope that you like his <a href="http://www.skill-guru.com/test/86/core-spring-3.0-certification-mock-test-2">Core Spring 3.0 Certification Mock Test 2</a> . This test covers topics on container, Test, AOP, SpEL, Database, JMS, JMX, Web, MVC, Remoting etc</p>
<p>Looking for your feedback and inputs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/06/24/practice-test-for-spring-certification/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hibernate Search – Getting Started</title>
		<link>http://www.skill-guru.com/blog/2010/06/15/hibernate-search-%e2%80%93-getting-started/</link>
		<comments>http://www.skill-guru.com/blog/2010/06/15/hibernate-search-%e2%80%93-getting-started/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 18:34:12 +0000</pubDate>
		<dc:creator>smitha</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[hibernate search]]></category>
		<category><![CDATA[Hibernate Tutorials]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=2383</guid>
		<description><![CDATA[Once your dynamic site has gone bigger, data in relational database has grown, there is always a need for searching the contents. SQL queries with like &#8216;%&#8230;%&#8217; are useful. But to do multiple columns / table searching, we&#8217;ll need to have big SQL queries with different conditions, ANDed and ORed. Such searching is not realistic [...]]]></description>
			<content:encoded><![CDATA[<p>Once your dynamic site has gone bigger, data in relational database has grown, there is always a need for searching the contents. SQL queries with like &#8216;%&#8230;%&#8217; are useful. But to do multiple columns / table searching, we&#8217;ll need to have big SQL queries with different conditions, ANDed and ORed. Such searching is not realistic and can not be maintained and extended easily.<br />
For Hibernate users, Hibernate search helps searching rows from database. Without writing any complex SQL queries, you can search multiple columns and get related objects from db.</p>
<p>In our site <a href="http://www.skill-guru.com">Skill-Guru</a> , you will notice a search box on the right hand side.  We have enabled the search on few tables and columns initially. Currently it will search for the tests , description and keywords for the input keyword.</p>
<p><span id="more-2383"></span></p>
<p>Hibernate search searches objects from text queries. It uses<strong> Apache Lucene </strong>Indexing technique. It indexes the tables with the help of annotations. Also it does the synchronization of database and index. Following tutorial demonstrates a simple searching example using hibernate search. The application uses JPA way.</p>
<p>Consider any site selling some products. You want to search products by title, description etc. Consider following products table.</p>
<p>create table product(<br />
id int(5) not null auto_increment,<br />
title varchar(100) not null,<br />
description varchar(250) not null,<br />
manufacture_date datetime,<br />
primary key(id));<br />
To start with Hibernate Search , you must have hibernate search downloaded. Download Hibernate search 3.1.1 and Hibernate 3.<br />
Create a java application and add required jars to your build path. <a href="http://www.skill-guru.com/blog/wp-content/uploads/2010/06/jarsUsed.txt" target="_blank">Click here </a>to know exact jars used in this project.</p>
<p>Crate a src/META-INF directory and create a persistence.xml file with following contents (edit it according to your database parameters)</p>
<blockquote><p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;persistence xmlns=&#8221;<a href="http://java.sun.com/xml/ns/persistence">http://java.sun.com/xml/ns/persistence</a>&#8221;<br />
xmlns:xsi=&#8221;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&#8221;<br />
xsi:schemaLocation=&#8221;<a href="http://java.sun.com/xml/ns/persistence">http://java.sun.com/xml/ns/persistence</a><br />
<a href="http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd</a>&#8221; version=&#8221;1.0&#8243;&gt;</p>
<p>&lt;persistence-unit name=&#8221;defaultManager&#8221;<br />
transaction-type=&#8221;RESOURCE_LOCAL&#8221;&gt;<br />
&lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;<br />
&lt;properties&gt;<br />
&lt;property name=&#8221;hibernate.connection.driver_class&#8221;<br />
value=&#8221;com.mysql.jdbc.Driver&#8221; /&gt;<br />
&lt;property name=&#8221;hibernate.connection.url&#8221;<br />
value=&#8221;jdbc:mysql://localhost:3306/hibernatetest&#8221; &gt;&lt;/property&gt;<br />
&lt;property name=&#8221;hibernate.connection.username&#8221; value=&#8221;root&#8221; /&gt;<br />
&lt;property name=&#8221;hibernate.connection.password&#8221;<br />
value=&#8221;root&#8221; /&gt;<br />
&lt;property name=&#8221;hibernate.show_sql&#8221; value=&#8221;false&#8221; /&gt;</p>
<p>&lt;property name=&#8221;hibernate.search.default.directory_provider&#8221;<br />
value=&#8221;org.hibernate.search.store.FSDirectoryProvider&#8221; /&gt;<br />
&lt;property name=&#8221;hibernate.search.indexing_strategy&#8221; value=&#8221;manual&#8221; /&gt;<br />
&lt;property name=&#8221;hibernate.search.default.indexBase&#8221; value=&#8221;e:\indexes&#8221; /&gt;<br />
&lt;/properties&gt;<br />
&lt;/persistence-unit&gt;<br />
&lt;/persistence&gt;</p></blockquote>
<p>Make sure you have database url, username and password entered properly. Another important factor is the indexBase directory. Hibernate search creates indexes for each table it need to search and those indexes will be saved in this directory.</p>
<p>The properties:<br />
&lt;property name=&#8221;hibernate.search.default.directory_provider&#8221;<br />
value=&#8221;org.hibernate.search.store.FSDirectoryProvider&#8221; /&gt;<br />
&lt;property name=&#8221;hibernate.search.indexing_strategy&#8221; value=&#8221;manual&#8221; /&gt;<br />
&lt;property name=&#8221;hibernate.search.default.indexBase&#8221; value=&#8221;e:\indexes&#8221; /&gt;<br />
are used by Hibernate Search.</p>
<p>Create test.eo package and create a ProductEO class. The ProductEO entity class for products table might look like below:</p>
<p>Create test.eo package and create a ProductEO class. The ProductEO entity class for products table might look like below:</p>
<blockquote><p>package test.eo;</p>
<p>import java.util.Date;</p>
<p>import javax.persistence.Column;<br />
import javax.persistence.GeneratedValue;<br />
import javax.persistence.GenerationType;<br />
import javax.persistence.Id;<br />
import javax.persistence.Entity;<br />
import javax.persistence.Table;</p>
<p>@Entity<br />
@Table(name=”product”)<br />
public class ProductEO {</p>
<p>@Id<br />
@GeneratedValue(strategy = GenerationType.IDENTITY)<br />
@Column(name=”id”)<br />
private Integer id;</p>
<p>@Column(name=”title”)<br />
private String title;</p>
<p>@Column(name=”description”)<br />
private String description;</p>
<p>@Column(name=”manufacture_date”)<br />
private Date manifactureDate;</p>
<p>public Integer getId() {<br />
return id;<br />
}<br />
public void setId(Integer id) {<br />
this.id = id;<br />
}<br />
public String getTitle() {<br />
return title;<br />
}<br />
public void setTitle(String title) {<br />
this.title = title;<br />
}<br />
public String getDescription() {<br />
return description;<br />
}<br />
public void setDescription(String description) {<br />
this.description = description;<br />
}<br />
public Date getManifactureDate() {<br />
return manifactureDate;<br />
}<br />
public void setManifactureDate(Date manifactureDate) {<br />
this.manifactureDate = manifactureDate;<br />
}<br />
}</p></blockquote>
<p>To make this entity to be able to be searched, we need to add some more annotations. Altered Entity class is shown below:</p>
<blockquote><p>package test.eo;</p>
<p>import java.util.Date;</p>
<p>import javax.persistence.Column;<br />
import javax.persistence.Entity;<br />
import javax.persistence.GeneratedValue;<br />
import javax.persistence.GenerationType;<br />
import javax.persistence.Id;<br />
import javax.persistence.Table;</p>
<p>import org.hibernate.search.annotations.DocumentId;<br />
import org.hibernate.search.annotations.Field;<br />
import org.hibernate.search.annotations.Index;<br />
import org.hibernate.search.annotations.Indexed;<br />
import org.hibernate.search.annotations.Store;</p>
<p>@Entity<br />
@Table(name=”product”)<br />
@Indexed<br />
public class ProductEO {</p>
<p>@DocumentId<br />
@Id<br />
@GeneratedValue(strategy = GenerationType.IDENTITY)<br />
@Column(name=”id”)<br />
private Integer id;</p>
<p>@Field(index=Index.TOKENIZED, store=Store.NO)<br />
@Column(name=”title”)<br />
private String title;</p>
<p>@Field(index=Index.TOKENIZED, store=Store.NO)<br />
@Column(name=”description”)<br />
private String description;</p>
<p>@Column(name=”manufacture_date”)<br />
private Date manifactureDate;</p>
<p>public Integer getId() {<br />
return id;<br />
}<br />
public void setId(Integer id) {<br />
this.id = id;<br />
}<br />
public String getTitle() {<br />
return title;<br />
}<br />
public void setTitle(String title) {<br />
this.title = title;<br />
}<br />
public String getDescription() {<br />
return description;<br />
}<br />
public void setDescription(String description) {<br />
this.description = description;<br />
}<br />
public Date getManifactureDate() {<br />
return manifactureDate;<br />
}<br />
public void setManifactureDate(Date manifactureDate) {<br />
this.manifactureDate = manifactureDate;<br />
}<br />
}</p></blockquote>
<p>We added following:</p>
<p>1. @Indexed annotation to Class<br />
2. @DocumentId annotation on the primary key. Hibernate Search needs to store an id in the index to ensure index uniqueness for a given entity. This annotation marks that unique property. In most of the cases this will be the primary key.<br />
3. @Field(index=Index.TOKENIZED, store=Store.NO) annotation on the fields, which need to be matched while searching. The parameter<br />
index=Index.TOKENIZED will ensure that the text will be tokenized (in short words will be identified) using the default Lucene analyzer. store=Store.NO is to  ensures that the actual data will not be stored in the index.</p>
<p>Now define a HibernateEntitymanagerHelper class in package test.services to initialize persistence context as below:</p>
<blockquote><p>package test.services;<br />
import javax.persistence.*;<br />
public class HibernateEntitymanagerHelper {<br />
private static EntityManagerFactory emf;<br />
static{<br />
try{<br />
emf = Persistence.createEntityManagerFactory(“defaultManager”);<br />
}catch(Throwable tw){<br />
throw new ExceptionInInitializerError(tw);<br />
}<br />
}<br />
public static EntityManagerFactory getEntityManagerFactory() {<br />
return emf;<br />
}<br />
public static void shutdown() {<br />
emf.close();<br />
}<br />
}</p></blockquote>
<p>Create following AddProducts  class in test.services package and add some data into the table:</p>
<blockquote><p>package test.services;</p>
<p>import javax.persistence.EntityManager;<br />
import test.eo.*;<br />
import java.util.Date;</p>
<p>public class AddProducts {<br />
public static void main(String[] args) {<br />
try{<br />
EntityManager em = HibernateEntitymanagerHelper.getEntityManagerFactory().createEntityManager();<br />
em.getTransaction().begin();<br />
ProductEO prodEO = new ProductEO();<br />
prodEO.setTitle(“Mike”);<br />
prodEO.setDescription(“XXX company Mike”);<br />
prodEO.setManifactureDate(new Date());<br />
em.persist(prodEO);</p>
<p>prodEO = new ProductEO();<br />
prodEO.setTitle(“Phone”);<br />
prodEO.setDescription(“YYY company Phone”);<br />
prodEO.setManifactureDate(new Date());<br />
em.persist(prodEO);</p>
<p>prodEO = new ProductEO();<br />
prodEO.setTitle(“Microphone”);<br />
prodEO.setDescription(“YYY company Microphone”);<br />
prodEO.setManifactureDate(new Date());</p>
<p>em.persist(prodEO);<br />
em.getTransaction().commit();</p>
<p>}catch(Exception e){<br />
e.printStackTrace();<br />
}<br />
}<br />
}</p></blockquote>
<p>Now, this is time to test. For Hibernate search to work you have to trigger an initial Indexing to populate the Lucene index with the data already present in your database.  Following code creates indexes and then does searching.</p>
<blockquote><p>package test.services;</p>
<p>import java.util.List;</p>
<p>import javax.persistence.EntityManager;<br />
import test.eo.*;<br />
import java.util.Date;<br />
import org.apache.lucene.analysis.standard.StandardAnalyzer;<br />
import org.apache.lucene.queryParser.MultiFieldQueryParser;<br />
import org.hibernate.search.jpa.FullTextEntityManager;<br />
import org.hibernate.search.jpa.Search;</p>
<p>public class ProductService {</p>
<p>/**<br />
* @param args<br />
*/<br />
public static void main(String[] args) {</p>
<p>try{<br />
EntityManager em = HibernateEntitymanagerHelper.getEntityManagerFactory().createEntityManager();<br />
FullTextEntityManager fullTextEntityManager =  Search.getFullTextEntityManager(em);</p>
<p>fullTextEntityManager.getTransaction().begin();</p>
<p>List&lt;ProductEO&gt; products = em.createQuery(“select product  from ProductEO as  product”).getResultList();<br />
for (ProductEO product : products) {<br />
fullTextEntityManager.index(product);<br />
System.out.println(“Product”+product.getTitle());<br />
}</p>
<p>String[] fields = new String[]{“title”, “description”};<br />
MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, new StandardAnalyzer());<br />
// parser.setDefaultOperator(QueryParser.AND_OPERATOR);</p>
<p>/*<br />
* Search only by lowercase<br />
*/<br />
org.apache.lucene.search.Query query = parser.parse( “phone” );<br />
// wrap Lucene query in a javax.persistence.Query<br />
javax.persistence.Query persistenceQuery =  fullTextEntityManager.createFullTextQuery(query, ProductEO.class);<br />
// execute search<br />
List&lt;ProductEO&gt; result = persistenceQuery.getResultList();<br />
System.out.println(“result ::”+result);<br />
for (ProductEO product : result) {<br />
System.out.println(“product ::”+product.getTitle());<br />
}</p>
<p>fullTextEntityManager.getTransaction().commit();<br />
em.close();<br />
HibernateEntitymanagerHelper.shutdown();<br />
}catch(Exception e){<br />
e.printStackTrace();<br />
}</p>
<p>}</p>
<p>}</p>
<p>Going for an interview or want to test your hibernate skills , check out our <a href="http://www.skill-guru.com/tag/hibernate">hibernate interview questions</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/06/15/hibernate-search-%e2%80%93-getting-started/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Spring certification practice test</title>
		<link>http://www.skill-guru.com/blog/2010/06/08/spring-certification-practice-test/</link>
		<comments>http://www.skill-guru.com/blog/2010/06/08/spring-certification-practice-test/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 01:12:01 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Mock  Exam / Certifications]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[practice-test]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=2356</guid>
		<description><![CDATA[DanielButcher is a Sun J2EE architect who has sat 5 Sun certifications, Core Spring and PRINCE2. He has  over ten years enterprise level Java experience and over 5 years Spring experience.
He has created Core Spring Certification practice test at Skill-Guru.  It is a 50 questions test priced at $0.99 and 10 questions are free. An [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.skill-guru.com/guru/danielbutcher">DanielButcher </a>is a Sun J2EE architect who has sat 5 Sun certifications, Core Spring and PRINCE2. He has  over ten years enterprise level Java experience and over 5 years Spring experience.</p>
<p>He has created <a href="http://www.skill-guru.com/test/81/core-spring-certification">Core Spring Certification practice test </a>at <a href="http://www.skill-guru.com">Skill-Guru</a>.  It is a 50 questions test priced at $0.99 and 10 questions are free. An absolute bargain !!</p>
<p>Take the <a href="http://www.skill-guru.com/test/81/core-spring-certification">Spring certification practice test</a> before you take that Spring certification.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/06/08/spring-certification-practice-test/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Custom Annotation in Java 5.0</title>
		<link>http://www.skill-guru.com/blog/2010/06/03/customannotation/</link>
		<comments>http://www.skill-guru.com/blog/2010/06/03/customannotation/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 07:11:00 +0000</pubDate>
		<dc:creator>fanand</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[annotation]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=2342</guid>
		<description><![CDATA[Overview
Previous versions of Java provided a limited and ad-hoc mechanism for annotating code through JavaDoc comments
Java 1.5 allows both runtime and compile-time processing of annotation data. Annotations are said to annotate a Java element. A good example is the @deprecated JavaDoc tag. The @deprecated tag is used for documentation purposes. This tag has no effect [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Overview</strong></p>
<p>Previous versions of Java provided a limited and ad-hoc mechanism for annotating code through JavaDoc comments</p>
<p>Java 1.5 allows both runtime and compile-time processing of annotation data. Annotations are said to annotate a Java element. A good example is the @deprecated JavaDoc tag. The @deprecated tag is used for documentation purposes. This tag has no effect on the code it describes, but causes the compiler to produce warnings if any other code references the tagged element.</p>
<p>Annotations will also be used for compile-time checking such as to produce warnings and errors for different failure scenarios. An example of an annotation that is used at compile time is the new @Deprecated annotation, which acts the same as the old @deprecated JavaDoc tag.</p>
<h2>How to define an Annotation?</h2>
<p>Annotations are defined in following way:<span id="more-2342"></span></p>
<p>public @interface MyFirstAnnotation</p>
<p>{</p>
<pre> // define the properties.</pre>
<pre> // define the properties.</pre>
<p>}</p>
<p>MyFirstAnnotation is the name of the annotation.</p>
<p>Annotation may have metadata defined for itself also. Following are the Meta data that can be defined for an Annotation.</p>
<p>Target Annotation: The element (Packages, Classes, variables &amp; methods) on which an Annotation has been defined is also needs to be specified. It needs to be specified in the following way:</p>
<p><strong>@Target(ElementType.METHOD)</strong></p>
<p>public @interface MyFirstAnnotation</p>
<p>{</p>
<pre>// define the properties.</pre>
<pre>// define the properties.</pre>
<p>}</p>
<pre>Here ‘@Target’ is a meta data for the annotation ‘MyFirstAnnotation’ and it symbolizes that the annotation can only be used with a method. ‘ElementType’ is an already defined Enum in ‘java.lang.annotation’ package.</pre>
<pre>               ElementType can have the following usages

<strong><a href="../wp-content/uploads/2010/06/Untitled-1-copy.jpg"><a href="http://www.skill-guru.com/blog/wp-content/uploads/2010/06/Untitled-1-copy1.jpg"><img class="aligncenter size-full wp-image-2375" src="http://www.skill-guru.com/blog/wp-content/uploads/2010/06/Untitled-1-copy1.jpg" alt="Custom Annatation" width="250" height="119" /></a>
</a></strong></pre>
<pre>Rentention Annotaion: This is another metadata for an Annotation. It tells to what extent an Annotation should be retained.</pre>
<p><strong>@Retention(RetentionPolicy.CLASS)</strong></p>
<p><strong>@Target(ElementType.METHOD)</strong></p>
<p>public @interface MyFirstAnnotation</p>
<p>{</p>
<pre> // define the properties.</pre>
<pre> // define the properties.</pre>
<p>}</p>
<pre>An annotation can be retained at Code level or at class file level or at runtime JVM level. In the above example, the retention is at class file level. ‘RetentionPolicy’ is an already defined Enum in ‘java.lang.annotation’ package.</pre>
<pre>               RententionPolicy can have following levels.

<a href="http://www.skill-guru.com/blog/wp-content/uploads/2010/06/Untitled-2-copy1.jpg"><img class="aligncenter size-full wp-image-2374" src="http://www.skill-guru.com/blog/wp-content/uploads/2010/06/Untitled-2-copy1.jpg" alt="Custom Annatation" width="256" height="50" /></a>
</pre>
<h2>Types of Annotation</h2>
<pre>Annotation can be of 3 types</pre>
<pre>Marker annotations: This kind of annotation has no variables. They are identified by only their name.</pre>
<pre>They are defined as follows:</pre>
<p>public @interface MarkerAnnotation {</p>
<p>}</p>
<pre>          Used as @ MarkerAnnotation</pre>
<pre>Single Value Annotations: This kind of annotations is provided with a single value.</pre>
<pre>They are defined as follows:</pre>
<p>public @interface SingleValueAnnotation {</p>
<p>String name();</p>
<p>}</p>
<p>Used as @SingleValueAnnotation(“singlevalue”)</p>
<pre>Full annotations: This kind of annotations has multiple data members. This need to use fuller syntax.</pre>
<pre>They are defined as follows:</pre>
<p>public @interface FullAnnotation {</p>
<p>String[] names();</p>
<p>}</p>
<p>Used as @FullAnnotation(value1=”val1”,value2=”val2”)</p>
<pre><strong> </strong></pre>
<p>Here is an example full annotation:</p>
<p>/**</p>
<p>* Describes the Request-For-Enhancement(RFE) that led</p>
<p>* to the presence of the annotated API element.</p>
<p>*/</p>
<p>public @interface RequestForEnhancement {</p>
<p>int    id();</p>
<p>String synopsis();</p>
<p>String engineer() default &#8220;[unassigned]&#8220;;</p>
<p>String date()    default &#8220;[unimplemented]&#8220;;</p>
<p>}</p>
<p>Once an annotation type is defined, you can use it to annotate declarations. An annotation is a special kind of modifier, and can be used anywhere that other modifiers (such as public, static, or final) can be used. By convention, annotations precede other modifiers. Annotations consist of an at-sign (@) followed by an annotation type and a parenthesized list of element-value pairs. The values must be compile-time constants. Here is a method declaration with an annotation corresponding to the annotation type declared above:</p>
<p>@RequestForEnhancement(</p>
<p>id       = 2868724,</p>
<p>synopsis = &#8220;Enable time-travel&#8221;,</p>
<p>engineer = &#8220;Mr. Peabody&#8221;,</p>
<p>date     = &#8220;4/1/2007&#8243;</p>
<p>)</p>
<p>public static void travelThroughTime(Date destination) { &#8230; }</p>
<h2>Conclusion</h2>
<p>Before the advent of Annotations, Applications had to define their meta-data in some configuration files and usually these meta-data were externalized from the Application. Now, they can directly define this meta-data information in the source code<strong><br />
</strong></p>
<div style="overflow: hidden;width: 1px;height: 1px"><!--[if !mso]&gt; &lt;!  v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} --> <!--[endif]--><!--[if gte mso 9]&gt;  Normal 0   false false false        MicrosoftInternetExplorer4  &lt;![endif]--><!--[if gte mso 9]&gt;   &lt;![endif]--><!--  /* Font Definitions */  @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:Calibri; 	mso-fareast-font-family:Calibri; 	mso-bidi-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]&gt; &lt;!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Table Normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} --> <!--[endif]--><span style="font-size: 11pt;line-height: 115%;font-family: Arial"><!--[if gte vml 1]&gt;                    &lt;![endif]--><!--[if !vml]--><img src="/DOCUME%7E1/KPOM/LOCALS%7E1/Temp/msohtml1/01/clip_image002.jpg" alt="" width="256" height="50" /><!--[endif]--></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/06/03/customannotation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Is Spring Web Flow Right for Me ?</title>
		<link>http://www.skill-guru.com/blog/2010/05/20/is-spring-web-flow-right-for-me/</link>
		<comments>http://www.skill-guru.com/blog/2010/05/20/is-spring-web-flow-right-for-me/#comments</comments>
		<pubDate>Fri, 21 May 2010 00:20:17 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[Spring webflow]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=2311</guid>
		<description><![CDATA[Web based application beyond a size become complex to manage. Page definitions,  managing application flow , state management , orchestration of all this become a difficult task. That is why we have frameworks to ease out this task for us.
One of the choices which come to mind is Spring webflow.  Spring webflow is for management [...]]]></description>
			<content:encoded><![CDATA[<p>Web based application beyond a size become complex to manage. Page definitions,  managing application flow , state management , orchestration of all this become a difficult task. That is why we have frameworks to ease out this task for us.</p>
<p>One of the choices which come to mind is <a href="http://www.springsource.org/webflow">Spring webflow</a>.  Spring webflow is for management of page flow , navigation and state management. It is <strong>not an</strong> full fledged MVC framework like JSF 2.0 or Apache Struts.</p>
<p>You might get confused by the definition of Spring webflow on its home page</p>
<blockquote><p>Spring Web Flow is the project in the Spring Portfolio that focuses on providing the infrastructure for building and running rich web applications. As a Spring project, Web Flow builds on the Spring Web MVC framework to provide:<span id="more-2311"></span></p>
<ul>
<li>A domain-specific-language for defining reusable controller modules called <a href="http://static.springframework.org/spring-webflow/docs/2.0.x/reference/html/ch02s02.html" target="_blank">flows</a></li>
<li>An advanced controller engine for managing conversational state</li>
<li>First-class support for using Ajax to construct rich user interfaces</li>
</ul>
</blockquote>
<p><strong>Be very clear on your requirements</strong>. Do you really need all these features which Spring webflow offers ?</p>
<p>Some features which I liked in Spring webflow 1.0 was the state management and navigation. Did not use Spring webflow for any other task beyond that.</p>
<p>In state management,  one of the neat features was Flow scope which allowed the data to live for a use case or a <strong>flow</strong>. This was less than session and more than request.  Perfect for some of the situations we had.</p>
<p>But if you have simple  web application, free flowing links it is not advised. Also if you are using JSF2 or any other similar framework, it does not make sense to go with Spring webflow and introduce complexity in application</p>
<p>From Spring Confluence page , <a href="http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?pageId=1491">Is Spring web flow right for me</a></p>
<blockquote><p>Spring web flow is not a one-size-fits-all solution. It is a powerful system to implement <em>controlled navigations</em> that represent user conversations that drive business processes.  It is not ideally suited for web sites that require a lot of <em>free browsing</em>.</p></blockquote>
<p>Another good documentation on web flow is <a href="http://www.theserverside.com/news/1365092/A-Proposal-for-SAML-communications-with-JAAS">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/05/20/is-spring-web-flow-right-for-me/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Selenium &#8211; Web application testing tool</title>
		<link>http://www.skill-guru.com/blog/2010/05/12/selenium-web-application-testing-tool/</link>
		<comments>http://www.skill-guru.com/blog/2010/05/12/selenium-web-application-testing-tool/#comments</comments>
		<pubDate>Wed, 12 May 2010 14:03:13 +0000</pubDate>
		<dc:creator>fanand</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=2151</guid>
		<description><![CDATA[What is Selenium ?

Selenium is an open source, robust set of tools that supports rapid development of test automation for web-based applications. This tool is primarily developed in Java Script and browser technologies and hence supports all the major browsers on all the platforms. Most of the time, we will not need to change our [...]]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: left;"><strong>What is Selenium ?<br />
</strong></h3>
<p>Selenium is an open source, robust set of tools that supports rapid development of test automation for web-based applications. This tool is primarily developed in Java Script and browser technologies and hence supports all the major browsers on all the platforms. Most of the time, we will not need to change our scripts for them to work on other platforms. Selenium provides a record/playback tool for authoring tests without learning a test scripting language.</p>
<h3><strong>Selenium Components</strong></h3>
<p>There are three variants of Selenium, which can be used in isolation or in combination to create complete automation suite for the web applications. Each one has a specific role in aiding the development of web application test automation.</p>
<ul>
<li>Selenium IDE</li>
<li>Selenium Core</li>
<li>Selenium RC<span id="more-2151"></span></li>
</ul>
<h3><strong>Selenium IDE</strong><strong> </strong></h3>
<p>Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and has a recording feature, which will keep account of user actions as they are performed and store them as a reusable script to play back. Selenium-IDE also offers full editing of test cases for more precision and control.</p>
<p><strong>How to Use Selenium</strong>:</p>
<p>Select &#8220;Selenium IDE&#8221; from the Tools menu in Firefox. By default when the IDE comes up it has recording turned on. Go to a web site that you want to record, click on the record button and begin the browsing task(s).  we will notice that as we click and type in the browser the IDE is recording everything we are doing.  When we are done, simply end recording and click on the green arrow to play back the script you just created.  Don&#8217;t forget to save your script before closing the IDE.Below are the screen shots of working of Selenium IDE and the script generated by IDE.</p>
<p>Please find in below link the Video presentation to record and execute a test</p>
<p><strong><a href="http://wiki.openqa.org/download/attachments/400/Selenium+IDE.swf">http://wiki.openqa.org/download/attachments/400/Selenium+IDE.swf</a>?</strong></p>
<p><strong><a href="http://www.skill-guru.com/blog/wp-content/uploads/2010/05/selenium_1.jpg"><img class="aligncenter size-full wp-image-2157" src="http://www.skill-guru.com/blog/wp-content/uploads/2010/05/selenium_1.jpg" alt="Selenium" width="366" height="336" /></a></strong></p>
<p><strong><a href="http://www.skill-guru.com/blog/wp-content/uploads/2010/05/Selenium_2.png"><img class="aligncenter size-full wp-image-2158" src="http://www.skill-guru.com/blog/wp-content/uploads/2010/05/Selenium_2.png" alt="Selenium" width="402" height="337" /></a></strong></p>
<p>Biggest drawback of Selenium IDE is its limitation in terms of browser support. Though Selenium scripts can be used for most of the browser and operating system,</p>
<p><strong> </strong></p>
<h3><strong>Advantages of Selenium:</strong></h3>
<ul>
<li>It is a Open source</li>
<li>Simple, Easy to install, Easy to work</li>
<li>Selenium IDE is the only flavor of Selenium which allows you to record user action on browser window</li>
</ul>
<ul>
<li>Can also record user actions in most of the popular languages like Java, C#, Perl, Ruby</li>
<li>It will not record any operation that you do on your computer apart from the events on Firefox browser window</li>
<li>During recording if you right click on any element it will show all the selenium commands available</li>
<li>we can also edit existing command, by selecting it and editing on the boxes available</li>
<li>we can also insert/delete commands by choosing appropriate option after right clicking</li>
<li>Choose appropriate run option &#8211; i.e walk, run or test runner and review your results</li>
</ul>
<p><strong> </strong></p>
<h3><strong>Disadvantages </strong><strong>of Selenium</strong><strong>:</strong></h3>
<ul>
<li>Limitation in terms of browser support (It runs only in Mozilla).Scripts written using Selenium IDE can be used for other  browsers only if it is used with Selenium RC or Selenium Core.</li>
<li>We can’t run recorded script if it is converted to Java, C#, Ruby etc.</li>
<li>Not allowed to write manual scripts like conditions and Loops for Data Driven Testing</li>
<li>There is no option to verify images.</li>
</ul>
<h3><strong>Selenium Core</strong><strong> </strong></h3>
<p>Selenium Core is a test tool for web applications. Selenium Core tests run directly in a browser, just as real users do. They run in Internet Explorer, Mozilla and Firefox on Windows, Linux and Macintosh. It is a simpler form of Selenium, and suitable for non-developers.</p>
<p>Browser compatibility testing: To test the application if it works correctly on different browsers and operating systems. The same script can run on any Selenium platform.<br />
System functional testing: Create regression tests to verify application functionality and user acceptance.</p>
<p>Disadvantages:</p>
<ul>
<li>It cannot switch between http and https protocols.</li>
<li>It cannot handle file upload</li>
<li>It is extremely complicated for first time users.</li>
</ul>
<h3><strong>Selenium Remote Control</strong><strong> </strong></h3>
<p>Selenium-RC is the solution for tests that need more than simple browser actions and linear execution. We can use Selenium-RC whenever our test requires logic which is not supported by Selenium-IDE. Selenium-RC uses the full power of programming languages to create more complex tests like reading and writing files, querying a database, and emailing test results.</p>
<p><a href="http://www.skill-guru.com/blog/wp-content/uploads/2010/05/Selenium_3.png"><img class="aligncenter size-full wp-image-2160" src="http://www.skill-guru.com/blog/wp-content/uploads/2010/05/Selenium_3.png" alt="Selenium" width="488" height="305" /></a></p>
<p><strong>Features</strong></p>
<ul>
<li>We can use Java syntax to write test script</li>
<li>Easy to conduct Data Driven Testing</li>
<li>We can read files to get test data</li>
<li>We can store Test Results into files</li>
</ul>
<p>Disadvantages</p>
<ul>
<li>We can only run a limited number of concurrent tests on the same remote control before seriously impacting its stability.</li>
</ul>
<table style="height: 281px;" border="0" cellspacing="2" cellpadding="2" width="588">
<tbody>
<tr style="border: 1px solid #ccc;">
<td style="text-align: left;" width="216" valign="top"><strong> </strong><strong>Browser</strong></p>
<p><strong><br />
</strong></p>
<hr />Firefox 3.x,Firefox 3, Firefox 2</p>
<p>IE 8,IE 7,IE 6</p>
<p>Safari 4,Safari 3 ,Safari 2</p>
<p>Opera 10,Opera 9,Opera 8</p>
<p>Google Chrome</td>
<td style="text-align: left;" width="232" valign="top"><strong>Selenium-IDE </strong></p>
<p><strong><br />
</strong></p>
<hr />Record and playback tests</p>
<p>Test execution only via Selenium-RC*</p>
<p>Test execution only via Selenium-RC</p>
<p>Test execution only via Selenium-RC</p>
<p>Test execution only via Selenium-RC(Windows)</td>
<td style="text-align: left;" width="174" valign="top"><strong>Selenium-RC </strong></p>
<p><strong><br />
</strong></p>
<hr />Start browser, run tests</p>
<p>Start browser, run Tests</p>
<p>Start browser, run tests</p>
<p>Start browser, run tests</p>
<p>Start browser, run tests</td>
<td width="194" valign="top"><strong>Operating Systems</strong></p>
<hr />Windows, Linux,Mac</p>
<p>Windows</p>
<p>Mac</p>
<p>Windows, Linux, Mac</p>
<p>Windows</td>
</tr>
</tbody>
</table>
<p>* Tests developed on Firefox via Selenium-IDE can be executed on any other supported browser via a simple Selenium-RC command line.</p>
<p><strong>References</strong></p>
<p><strong> </strong></p>
<ul>
<li><strong><a href="http://seleniumhq.org/docs/book/Selenium_Documentation.pdf">http://seleniumhq.org/docs/book/Selenium_Documentation.pdf</a></strong></li>
<li><strong><a href="http://www.dynamitemap.com/selenium/">http://www.dynamitemap.com/selenium/</a></strong></li>
<li><strong><a href="http://www.peratia.com/index.php?p=analysis&amp;article=selenium_core_basics">http://www.peratia.com/index.php?p=analysis&amp;article=selenium_core_basics</a></strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/05/12/selenium-web-application-testing-tool/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Error creating bean with name &#8216;flowExecutor&#8217;</title>
		<link>http://www.skill-guru.com/blog/2010/04/26/error-creating-bean-with-name-flowexecutor/</link>
		<comments>http://www.skill-guru.com/blog/2010/04/26/error-creating-bean-with-name-flowexecutor/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 03:27:35 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=2127</guid>
		<description><![CDATA[If you are getting this error , it because of in correct libraries in your lib folder.
If you are lazy enough to build the project using maven , here is another option
Go to this link
http://www.springsource.org/webflow-samples
Download and run the sample . Copy all the libraries into your project . Make sure you have deleted all the [...]]]></description>
			<content:encoded><![CDATA[<p>If you are getting this error , it because of in correct libraries in your lib folder.</p>
<p>If you are lazy enough to build the project using maven , here is another option</p>
<p>Go to this link</p>
<p>http://www.springsource.org/webflow-samples</p>
<p>Download and run the sample . Copy all the libraries into your project . Make sure you have deleted all the old jar files.</p>
<p>The exception you were seeing earlier should be gone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/04/26/error-creating-bean-with-name-flowexecutor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
