[richfaces-svn-commits] JBoss Rich Faces SVN: r14544 - in branches/community/3.3.X/test-applications/regressionArea: regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181 and 6 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Sat Jun 6 08:06:29 EDT 2009


Author: mvitenkov
Date: 2009-06-06 08:06:28 -0400 (Sat, 06 Jun 2009)
New Revision: 14544

Added:
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Album.java
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Artist.java
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Library.java
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/RF7181Validator.java
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Song.java
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7181/
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7181/Test.java
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7292/
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7292/Test.java
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/images/
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/images/disc.gif
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/images/singer.gif
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/images/song.gif
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7181.xhtml
   branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7292.xhtml
Log:
RF-7181,RF-7292 selenium test were added.

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Album.java
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Album.java	                        (rev 0)
+++ branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Album.java	2009-06-06 12:06:28 UTC (rev 14544)
@@ -0,0 +1,117 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.regressionarea.issues.rf7181;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.richfaces.model.TreeNode;
+
+/**
+ * @author Mikhail Vitenkov
+ * @since 3.3.2
+ */
+public class Album implements TreeNode {
+	
+	private static final long serialVersionUID = 6514596192023597908L;
+	private long id;
+	private Map songs = new LinkedHashMap();
+	private String title;
+	private Integer year;
+	private Artist artist;
+
+	public Album(long id) {
+		this.id = id;
+	}
+	
+	public void addSong(Song song) {
+		addChild(Long.toString(song.getId()), song);
+		song.setParent(this);
+	}
+	public void addChild(Object identifier, TreeNode child) {
+		songs.put(identifier, child);
+	}
+
+	public TreeNode getChild(Object id) {
+		return (TreeNode) songs.get(id);
+	}
+
+	public Iterator getChildren() {
+		return songs.entrySet().iterator();
+	}
+
+	public Object getData() {
+		return this;
+	}
+
+	public TreeNode getParent() {
+		return artist;
+	}
+
+	public boolean isLeaf() {
+		return songs.isEmpty();
+	}
+
+	public void removeChild(Object id) {
+		songs.remove(id);
+	}
+
+	public void setData(Object data) {
+	}
+
+	public void setParent(TreeNode parent) {
+		this.artist = (Artist) parent;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public Integer getYear() {
+		return year;
+	}
+
+	public void setYear(Integer year) {
+		this.year = year;
+	}
+
+	public long getId() {
+		return id;
+	}
+
+	public Artist getArtist() {
+		return artist;
+	}
+
+	public void setArtist(Artist artist) {
+		this.artist = artist;
+	}
+	
+	public String getType() {
+		return "album";
+	}
+
+}

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Artist.java
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Artist.java	                        (rev 0)
+++ branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Artist.java	2009-06-06 12:06:28 UTC (rev 14544)
@@ -0,0 +1,112 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.regressionarea.issues.rf7181;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.richfaces.model.TreeNode;
+
+/**
+ * @author Mikhail Vitenkov
+ * @since 3.3.2
+ */
+public class Artist implements TreeNode {
+	private long id;
+	private Map albums = new LinkedHashMap();
+	private String name;
+	private Library library;
+	
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 6831863694596474846L;
+
+	public Artist(long id) {
+		this.id = id;
+	}
+
+	public void addAlbum(Album album) {
+		addChild(Long.toString(album.getId()), album);
+		album.setParent(this);
+	}
+	
+	public void addChild(Object identifier, TreeNode child) {
+		albums.put(identifier, child);
+	}
+
+	public TreeNode getChild(Object id) {
+		return (TreeNode) albums.get(id);
+	}
+
+	public Iterator getChildren() {
+		return albums.entrySet().iterator();
+	}
+
+	public Object getData() {
+		return this;
+	}
+
+	public TreeNode getParent() {
+		return library;
+	}
+
+	public boolean isLeaf() {
+		return albums.isEmpty();
+	}
+
+	public void removeChild(Object id) {
+		albums.remove(id);
+	}
+
+	public void setData(Object data) {
+	}
+
+	public void setParent(TreeNode parent) {
+		library = (Library) parent;
+	}
+
+	public long getId() {
+		return id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Library getLibrary() {
+		return library;
+	}
+
+	public void setLibrary(Library library) {
+		this.library = library;
+	}
+	public String getType() {
+		return "artist";
+	}
+
+}

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Library.java
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Library.java	                        (rev 0)
+++ branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Library.java	2009-06-06 12:06:28 UTC (rev 14544)
@@ -0,0 +1,242 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.regressionarea.issues.rf7181;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.model.TreeNode;
+
+/**
+ * @author Mikhail Vitenkov
+ * @since 3.3.2
+ */
+ at Name("rf7181")
+ at Scope(ScopeType.SESSION)
+public class Library implements TreeNode {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -3530085227471752526L;
+	private Map artists = null;
+	private Object state1;
+	private Object state2;
+	private List<Song> songsList;
+	private Set<Song> selectedSongsSet = new HashSet<Song>();
+	private List<Song> selectedSongsList = new ArrayList<Song>();
+	private String input1;
+	private String input2;
+	
+	public Library() {
+		songsList = new ArrayList<Song>();
+		songsList.addAll(getLibraryAsList());
+		input1 = "input1";
+		input2 = "input2";
+	}	
+	private Map getArtists() {
+		if (this.artists==null) {
+			initData();
+		}
+		return this.artists;
+	}
+	public void addArtist(Artist artist) {
+		addChild(Long.toString(artist.getId()), artist);
+	}
+	
+	public void addChild(Object identifier, TreeNode child) {
+		getArtists().put(identifier, child);
+		child.setParent(this);
+	}
+
+	public TreeNode getChild(Object id) {
+		return (TreeNode) getArtists().get(id);
+	}
+
+	public Iterator getChildren() {
+		return getArtists().entrySet().iterator();
+	}
+
+	public Object getData() {
+		return this;
+	}
+
+	public TreeNode getParent() {
+		return null;
+	}
+
+	public boolean isLeaf() {
+		return getArtists().isEmpty();
+	}
+
+	public void removeChild(Object id) {
+		getArtists().remove(id);
+	}
+
+	public void setData(Object data) {
+	}
+
+	public void setParent(TreeNode parent) {
+	}
+
+	public String getType() {
+		return "library";
+	}
+	
+	
+	private long nextId = 0;
+	private long getNextId() {
+		return nextId++;
+	}
+	private Map albumCache = new HashMap();
+	private Map artistCache = new HashMap();
+	private Artist getArtistByName(String name, Library library) {
+		Artist artist = (Artist)artistCache.get(name);
+		if (artist==null) {
+			artist = new Artist(getNextId());
+			artist.setName(name);
+			artistCache.put(name, artist);
+			library.addArtist(artist);
+		}
+		return artist;
+	}
+	private Album getAlbumByTitle(String title, Artist artist) {
+		Album album = (Album)albumCache.get(title);
+		if (album==null) {
+			album = new Album(getNextId());
+			album.setTitle(title);
+			albumCache.put(title, album);
+			artist.addAlbum(album);
+		}
+		return album;
+	}
+	
+	private void initData() {
+		artists = new HashMap();
+		InputStream is = this.getClass().getClassLoader().getResourceAsStream("data.txt");
+		ByteArrayOutputStream os = new ByteArrayOutputStream();
+		byte[] rb = new byte[1024];
+		int read;
+		try {
+			do {
+				read = is.read(rb);
+				if (read>0) {
+					os.write(rb, 0, read);
+				}
+			} while (read>0);
+			String buf = os.toString();
+			StringTokenizer toc1 = new StringTokenizer(buf,"\n");
+			while (toc1.hasMoreTokens()) {
+				String str = toc1.nextToken();
+				StringTokenizer toc2 = new StringTokenizer(str, "\t");
+				String songTitle = toc2.nextToken();
+				String artistName = toc2.nextToken();
+				String albumTitle = toc2.nextToken();
+				toc2.nextToken();
+				toc2.nextToken();
+				String albumYear = toc2.nextToken();
+				Artist artist = getArtistByName(artistName,this);
+				Album album = getAlbumByTitle(albumTitle, artist);
+				album.setYear(new Integer(albumYear));
+				Song song = new Song(getNextId());
+				song.setTitle(songTitle);
+				album.addSong(song);
+			}
+		} catch (IOException e) {
+			throw new RuntimeException(e);
+		}
+	}
+	public Object getState1() {
+		return state1;
+	}
+	public void setState1(Object state1) {
+		this.state1 = state1;
+	}
+	public Object getState2() {
+		return state2;
+	}
+	public void setState2(Object state2) {
+		this.state2 = state2;
+	}
+	
+	public void walk(TreeNode node, List<TreeNode> appendTo, Class<? extends TreeNode> type) {
+		if (type.isInstance(node)){
+			appendTo.add(node);
+		}
+		Iterator<Map.Entry<Object, TreeNode>> iterator = node.getChildren();
+		while(iterator.hasNext()) {
+			walk(iterator.next().getValue(), appendTo, type);
+		}
+		
+	}
+	
+	public ArrayList getLibraryAsList(){
+		ArrayList appendTo = new ArrayList();
+		walk(this, appendTo, Song.class);
+		return appendTo;
+	}
+	public List<Song> getSongsList() {
+		return songsList;
+	}
+	public void setSongsList(List<Song> songsList) {
+		this.songsList = songsList;
+	}
+	public void takeSelection() {
+		selectedSongsList.clear();
+		selectedSongsList.addAll(selectedSongsSet);
+	}
+	public Set<Song> getSelectedSongsSet() {
+		return selectedSongsSet;
+	}
+	public void setSelectedSongsSet(Set<Song> selectedSongsSet) {
+		this.selectedSongsSet = selectedSongsSet;
+	}
+	public List<Song> getSelectedSongsList() {
+		return selectedSongsList;
+	}
+	public void setSelectedSongsList(List<Song> selectedSongsList) {
+		this.selectedSongsList = selectedSongsList;
+	}
+	public String getInput1() {
+		return input1;
+	}
+	public void setInput1(String input1) {
+		this.input1 = input1;
+	}
+	public String getInput2() {
+		return input2;
+	}
+	public void setInput2(String input2) {
+		this.input2 = input2;
+	}
+
+}

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/RF7181Validator.java
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/RF7181Validator.java	                        (rev 0)
+++ branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/RF7181Validator.java	2009-06-06 12:06:28 UTC (rev 14544)
@@ -0,0 +1,40 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.regressionarea.issues.rf7181;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+/**
+ * @author Mikhail Vitenkov
+ * @since 3.3.2
+ */
+public class RF7181Validator implements Validator {	
+
+	public void validate(FacesContext context, UIComponent component,
+			Object value) throws ValidatorException {		
+			throw new ValidatorException(new FacesMessage("id="
+					+ component.getClientId(context)));		
+	}
+}

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Song.java
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Song.java	                        (rev 0)
+++ branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7181/Song.java	2009-06-06 12:06:28 UTC (rev 14544)
@@ -0,0 +1,160 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.regressionarea.issues.rf7181;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.richfaces.model.TreeNode;
+
+/**
+ * @author Mikhail Vitenkov
+ * @since 3.3.2
+ */
+public class Song implements TreeNode {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 7155620465939481885L;
+	private long id;
+	private String title;
+	private String genre;
+	private int trackNumber;
+	private Album album;
+
+	public Song(long id,String title,int num) {
+		this.id=id;
+		this.title=title;
+		this.genre=genre;
+		this.trackNumber=num;
+	}	
+	
+	public Song(long id) {
+		this.id = id;
+	}
+	
+	public void addChild(Object identifier, TreeNode child) {
+		throw new UnsupportedOperationException("Songs do not have children");
+	}
+
+	public TreeNode getChild(Object id) {
+		throw new UnsupportedOperationException("Songs do not have children");
+	}
+
+	public Iterator getChildren() {
+		// TODO: Fix me!
+		return new ArrayList().iterator(); // work around limitation for TreeNode
+	}
+
+	public Object getData() {
+		return this;
+	}
+
+	public TreeNode getParent() {
+		return album;
+	}
+
+	public boolean isLeaf() {
+		return true;
+	}
+
+	public void removeChild(Object id) {
+		throw new UnsupportedOperationException("Songs do not have children");
+	}
+
+	public void setData(Object data) {
+	}
+
+	public void setParent(TreeNode parent) {
+		this.album = (Album) parent;
+	}
+
+	public Album getAlbum() {
+		return album;
+	}
+
+	public void setAlbum(Album album) {
+		this.album = album;
+	}
+
+	public String getGenre() {
+		return genre;
+	}
+
+	public void setGenre(String genre) {
+		this.genre = genre;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public int getTrackNumber() {
+		return trackNumber;
+	}
+
+	public void setTrackNumber(int trackNumber) {
+		this.trackNumber = trackNumber;
+	}
+
+	public long getId() {
+		return id;
+	}
+	public String getType() {
+		return "song";
+	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + (int) (id ^ (id >>> 32));
+		result = prime * result + ((title == null) ? 0 : title.hashCode());
+		result = prime * result + trackNumber;
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		final Song other = (Song) obj;
+		if (id != other.id)
+			return false;
+		if (title == null) {
+			if (other.title != null)
+				return false;
+		} else if (!title.equals(other.title))
+			return false;
+		if (trackNumber != other.trackNumber)
+			return false;
+		return true;
+	}
+
+}

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7181/Test.java
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7181/Test.java	                        (rev 0)
+++ branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7181/Test.java	2009-06-06 12:06:28 UTC (rev 14544)
@@ -0,0 +1,56 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.testng.rf7181;
+
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+
+/**
+ * @author Mikhail Vitenkov
+ * @since 3.3.2
+ */
+public class Test extends SeleniumTestBase {
+	
+	@org.testng.annotations.Test
+	public void testExecute() throws Exception {
+		renderPage();
+		
+		//waiting for a4j:poll(interval="3000")
+		pause(3500,null);
+			
+		boolean saTree1 = selenium.getText("//dl[@class='rich-messages']/dt[1]/span").contains("saTreeText");
+		boolean saTree2 = selenium.getText("//dl[@class='rich-messages']/dt[2]/span").contains("saTreeText");
+		boolean saTree3 = selenium.getText("//dl[@class='rich-messages']/dt[3]/span").contains("saTreeText");
+		boolean saTree4 = selenium.getText("//dl[@class='rich-messages']/dt[4]/span").contains("saTreeText");
+		boolean effectsScript = selenium.getText("//dl[@class='rich-messages']/dt[5]/span").contains("effectsScriptText");
+		
+		Assert.assertEquals(saTree1, true);
+		Assert.assertEquals(saTree2, true);
+		Assert.assertEquals(saTree3, true);
+		Assert.assertEquals(saTree4, true);
+		Assert.assertEquals(effectsScript, true);
+	}
+		
+	public String getTestUrl() {
+		return "pages/rf7181.xhtml";
+	}
+
+}
\ No newline at end of file

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7292/Test.java
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7292/Test.java	                        (rev 0)
+++ branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7292/Test.java	2009-06-06 12:06:28 UTC (rev 14544)
@@ -0,0 +1,50 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.testng.rf7292;
+
+import org.richfaces.SeleniumTestBase;
+
+/**
+ * @author Mikhail Vitenkov
+ * @since 3.3.2
+ */
+public class Test extends SeleniumTestBase {
+	private static final String FORM = "form";
+	private static final String SECOND_LABEL = FORM + ":second_lbl";
+	private static final String OUT = FORM + ":out";
+	
+	private String getIdSelector(String id) {
+		return "//*[@id='" + id + "']";
+	}
+
+	@org.testng.annotations.Test
+	public void testExecute() throws Exception {
+		renderPage();
+		
+		clickAjaxCommandAndWait(getIdSelector(SECOND_LABEL));		
+		AssertVisible(OUT);		
+	}
+		
+	public String getTestUrl() {
+		return "pages/rf7292.xhtml";
+	}
+
+}
\ No newline at end of file

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/images/disc.gif
===================================================================
(Binary files differ)


Property changes on: branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/images/disc.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/images/singer.gif
===================================================================
(Binary files differ)


Property changes on: branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/images/singer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/images/song.gif
===================================================================
(Binary files differ)


Property changes on: branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/images/song.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7181.xhtml
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7181.xhtml	                        (rev 0)
+++ branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7181.xhtml	2009-06-06 12:06:28 UTC (rev 14544)
@@ -0,0 +1,56 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:a4j="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich">
+
+<ui:composition template="/layout/layout.xhtml">
+	<ui:define name="template">
+		<h:form>
+		<rich:messages></rich:messages>
+			<a4j:poll id="poll" interval="3000" enabled="true"
+				process="saTree, effectsScript" ajaxSingle="true" />
+			<script type="text/javascript">window.effects = new Array();</script>
+
+			<a4j:outputPanel id="effectsScript">
+				<h:inputText value="effectsScriptText" id="effectsScriptText">
+					<f:validator validatorId="rf7181Validator" />
+				</h:inputText>
+				<script type="text/javascript">
+while (effects.length > 0) {
+var effectFunc = effects.shift();
+effectFunc();
+}
+</script>
+			</a4j:outputPanel>
+
+
+			<rich:tree style="width:300px" value="#{rf7181.data}" var="item"
+				nodeFace="#{item.type}" id="saTree">
+				<rich:treeNode id="artistNode" type="artist"
+					iconLeaf="/images/tree/singer.gif" icon="/images/tree/singer.gif">
+					<h:outputText value="#{item.name}" />
+					<h:inputText value="#{item.name}" id="saTreeText">
+						<f:validator validatorId="rf7181Validator" />
+					</h:inputText>
+					<rich:effect id="clickEffect" event="onclick" type="Highlight"
+						params="duration:0.8" />
+					<rich:effect id="evEff" for="artistNode"
+						name="effects[effects.length]" rendered="#{true}" type="Highlight"
+						params="duration:1.9" />
+				</rich:treeNode>
+				<rich:treeNode type="album" iconLeaf="/images/tree/disc.gif"
+					icon="/images/tree/disc.gif">
+					<h:outputText value="#{item.title}" />
+				</rich:treeNode>
+				<rich:treeNode type="song" iconLeaf="/images/tree/song.gif"
+					icon="/images/tree/song.gif">
+					<h:outputText value="#{item.title}" />
+				</rich:treeNode>
+			</rich:tree>
+		</h:form>
+	</ui:define>
+</ui:composition>
+</html>
\ No newline at end of file

Added: branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7292.xhtml
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7292.xhtml	                        (rev 0)
+++ branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7292.xhtml	2009-06-06 12:06:28 UTC (rev 14544)
@@ -0,0 +1,24 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:a4j="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich">
+
+<ui:composition template="/layout/layout.xhtml">
+	<ui:define name="template">
+		<h:form id="form">
+			<rich:tabPanel id="tabPanelID">
+				<rich:tab label="first"></rich:tab>
+				<rich:tab label="second" switchType="ajax" id="second">
+					<h:outputText value="SUCCESSFULL" id="out" />
+				</rich:tab>
+				<rich:tab label="third"></rich:tab>
+			</rich:tabPanel>
+			<br />
+			<a4j:status startText="Work" stopText="Stop" id="status"></a4j:status>
+		</h:form>
+	</ui:define>
+</ui:composition>
+</html>
\ No newline at end of file




More information about the richfaces-svn-commits mailing list