[richfaces-svn-commits] JBoss Rich Faces SVN: r351 - trunk/richfaces/toolBar/src/test/java/org/richfaces/component.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Wed Apr 11 07:08:18 EDT 2007
Author: A.Skokov
Date: 2007-04-11 07:08:17 -0400 (Wed, 11 Apr 2007)
New Revision: 351
Added:
trunk/richfaces/toolBar/src/test/java/org/richfaces/component/UIToolBarGroupTest.java
Log:
test updated
Added: trunk/richfaces/toolBar/src/test/java/org/richfaces/component/UIToolBarGroupTest.java
===================================================================
--- trunk/richfaces/toolBar/src/test/java/org/richfaces/component/UIToolBarGroupTest.java (rev 0)
+++ trunk/richfaces/toolBar/src/test/java/org/richfaces/component/UIToolBarGroupTest.java 2007-04-11 11:08:17 UTC (rev 351)
@@ -0,0 +1,89 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * 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.component;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+
+/**
+ * Unit test for UIToolBarGroup.
+ */
+public class UIToolBarGroupTest extends AbstractAjax4JsfTestCase {
+
+ private UIToolBarGroup toolBarGroup;
+ private UIToolBar toolBar;
+ private UIForm form;
+
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public UIToolBarGroupTest(String testName) {
+ super(testName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+
+ toolBar = (UIToolBar)application.createComponent("org.richfaces.ToolBar");
+ toolBar.setId("toolBar");
+
+ toolBarGroup = (UIToolBarGroup)application.createComponent("org.richfaces.ToolBarGroup");
+
+ form = new HtmlForm();
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ super.tearDown();
+ toolBarGroup = null;
+ toolBar = null;
+ form = null;
+ }
+
+ public void testGetToolBar1() throws Exception {
+ assertNull(toolBarGroup.getToolBar());
+
+ toolBar.getChildren().add(toolBarGroup);
+ assertTrue(toolBarGroup.getToolBar() instanceof UIToolBar);
+ }
+
+ public void testGetToolBar2() throws Exception {
+ assertNull(toolBarGroup.getToolBar());
+
+ form.getChildren().add(toolBarGroup);
+
+ try {
+ toolBarGroup.getToolBar();
+ assertTrue(false);
+ } catch(Exception ex) {
+ }
+ }
+}
More information about the richfaces-svn-commits
mailing list