Author: nbelaevski
Date: 2009-07-20 19:19:40 -0400 (Mon, 20 Jul 2009)
New Revision: 14970
Removed:
root/framework/trunk/legacy-tests/src/test/java/org/ajax4jsf/context/InitParametersTest.java
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/JavaBeanWrapperTest.java
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/MethodBindingExpressionTest.java
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/NullExpressionTest.java
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/TestObj.java
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/WrappedBeanComparatorTest.java
Log:
Delete already moved legacy tests
Deleted:
root/framework/trunk/legacy-tests/src/test/java/org/ajax4jsf/context/InitParametersTest.java
===================================================================
---
root/framework/trunk/legacy-tests/src/test/java/org/ajax4jsf/context/InitParametersTest.java 2009-07-20
23:18:35 UTC (rev 14969)
+++
root/framework/trunk/legacy-tests/src/test/java/org/ajax4jsf/context/InitParametersTest.java 2009-07-20
23:19:40 UTC (rev 14970)
@@ -1,132 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.context;
-
-import java.util.Map;
-
-import javax.faces.FacesException;
-
-import org.ajax4jsf.application.AjaxStateManager;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-
-/**
- * @author asmirnov
- *
- */
-public class InitParametersTest extends AbstractAjax4JsfTestCase {
-
- private static final String STRING_PARAM = "init";
- private static final int INT_PARAM = 367;
- private static final String NO = "no";
- private static final String TRUE = "true";
- private static final String ORG_AJAX4JSF_STRING = "org.ajax4jsf.STRING";
- private static final String ORG_AJAX4JSF_INT = "org.ajax4jsf.INT";
- private static final String ORG_AJAX4JSF_FALSE = "org.ajax4jsf.FALSE";
- private static final String ORG_AJAX4JSF_TRUE = "org.ajax4jsf.TRUE";
-
- /**
- * @param name
- */
- public InitParametersTest(String name) {
- super(name);
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
- */
- public void setUp() throws Exception {
- super.setUp();
- servletContext.addInitParameter(ORG_AJAX4JSF_TRUE, TRUE);
- servletContext.addInitParameter(ORG_AJAX4JSF_FALSE, NO);
- servletContext.addInitParameter(ORG_AJAX4JSF_INT, String.valueOf(INT_PARAM));
- servletContext.addInitParameter(ORG_AJAX4JSF_STRING, STRING_PARAM);
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
- */
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Test method for {@link
org.ajax4jsf.context.ContextInitParameters#getNumbersOfViewsInSession(javax.faces.context.FacesContext)}.
- */
- public void testGetNumbersOfViewsInSession() {
- assertEquals(AjaxStateManager.DEFAULT_NUMBER_OF_VIEWS,
ContextInitParameters.getNumbersOfViewsInSession(facesContext));
- }
-
- /**
- * Test method for {@link
org.ajax4jsf.context.ContextInitParameters#getNumbersOfLogicalViews(javax.faces.context.FacesContext)}.
- */
- public void testGetNumbersOfLogicalViews() {
- assertEquals(AjaxStateManager.DEFAULT_NUMBER_OF_VIEWS,
ContextInitParameters.getNumbersOfLogicalViews(facesContext));
- }
-
- /**
- * Test method for {@link
org.ajax4jsf.context.ContextInitParameters#getInteger(javax.faces.context.FacesContext,
java.lang.String[], int)}.
- */
- public void testGetInteger() {
- String[] params = {"foo.bar",ORG_AJAX4JSF_INT};
- int value = ContextInitParameters.getInteger(facesContext, params, 12);
- assertEquals(INT_PARAM, value);
- String[] params2 = {"foo.bar"};
- value = ContextInitParameters.getInteger(facesContext, params2, 12);
- assertEquals(12, value);
- String[] params3 = {"foo.bar",ORG_AJAX4JSF_STRING};
- try {
- value = ContextInitParameters.getInteger(facesContext, params3, 12);
- } catch (FacesException e) {
- return;
- }
- assertFalse("No exception on invalid parameter",true);
- }
-
- /**
- * Test method for {@link
org.ajax4jsf.context.ContextInitParameters#getString(javax.faces.context.FacesContext,
java.lang.String[], java.lang.String)}.
- */
- public void testGetString() {
- String[] params = {"foo.bar",ORG_AJAX4JSF_STRING};
- String value = ContextInitParameters.getString(facesContext, params, "foo");
- assertEquals(STRING_PARAM, value);
- String[] params2 = {"foo.bar"};
- value = ContextInitParameters.getString(facesContext, params2, "foo");
- assertEquals("foo", value);
- }
-
- /**
- * Test method for {@link
org.ajax4jsf.context.ContextInitParameters#getBoolean(javax.faces.context.FacesContext,
java.lang.String[], boolean)}.
- */
- public void testGetBoolean() {
- String[] params = {"foo.bar",ORG_AJAX4JSF_TRUE};
- boolean value = ContextInitParameters.getBoolean(facesContext, params, false);
- assertTrue(value);
- String[] params2 = {"foo.bar"};
- value = ContextInitParameters.getBoolean(facesContext, params2, true);
- assertTrue(value);
- String[] params3 = {"foo.bar",ORG_AJAX4JSF_FALSE};
- value = ContextInitParameters.getBoolean(facesContext, params3, true);
- assertFalse(value);
- String[] params4 = {"foo.bar",ORG_AJAX4JSF_STRING};
- try {
- value = ContextInitParameters.getBoolean(facesContext, params4, false);
- } catch (FacesException e) {
- return;
- }
- assertFalse("No exception on invalid parameter",true);
- }
-
- /**
- * Test method for {@link
org.ajax4jsf.context.ContextInitParameters#getInitParameter(javax.faces.context.FacesContext,
java.lang.String[])}.
- */
- public void testGetInitParameter() {
- String[] params = {"foo.bar",ORG_AJAX4JSF_STRING};
- String value = ContextInitParameters.getInitParameter(facesContext, params);
- assertEquals(STRING_PARAM, value);
- String[] params2 = {"foo.bar"};
- value = ContextInitParameters.getInitParameter(facesContext, params2);
- assertNull(value);
- }
-
-}
Deleted:
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/JavaBeanWrapperTest.java
===================================================================
---
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/JavaBeanWrapperTest.java 2009-07-20
23:18:35 UTC (rev 14969)
+++
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/JavaBeanWrapperTest.java 2009-07-20
23:19:40 UTC (rev 14970)
@@ -1,78 +0,0 @@
-/**
- * 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.model.impl.expressive;
-
-import java.util.Collections;
-import java.util.Map;
-
-import org.richfaces.model.impl.expressive.JavaBeanWrapper;
-
-import junit.framework.TestCase;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class JavaBeanWrapperTest extends TestCase {
-
-
- private JavaBeanWrapper wrapper;
- final Boolean test = Boolean.TRUE;
- final Map props = Collections.singletonMap("true", test);
- /**
- * @param name
- */
- public JavaBeanWrapperTest(String name) {
- super(name);
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- wrapper = new JavaBeanWrapper(test, props);
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- wrapper = null;
- }
-
- /**
- * Test method for {@link
org.richfaces.model.impl.expressive.JavaBeanWrapper#getProperty(java.lang.String)}.
- */
- public void testGetProperty() {
- assertEquals(test, wrapper.getProperty("true"));
- }
-
- /**
- * Test method for {@link
org.richfaces.model.impl.expressive.JavaBeanWrapper#getWrappedObject()}.
- */
- public void testGetWrappedObject() {
- assertEquals(test, wrapper.getWrappedObject());
- }
-
-}
Deleted:
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/MethodBindingExpressionTest.java
===================================================================
---
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/MethodBindingExpressionTest.java 2009-07-20
23:18:35 UTC (rev 14969)
+++
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/MethodBindingExpressionTest.java 2009-07-20
23:19:40 UTC (rev 14970)
@@ -1,35 +0,0 @@
-/**
- *
- */
-package org.richfaces.model.impl.expressive;
-
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.el.MockMethodExpression;
-
-/**
- * @author Konstantin Mishin
- *
- */
-public class MethodBindingExpressionTest extends AbstractJsfTestCase {
-
- /**
- * @param name
- */
- public MethodBindingExpressionTest(String name) {
- super(name);
- }
-
- /**
- * Test method for {@link
org.richfaces.model.impl.expressive.MethodBindingExpression#MethodBindingExpression(javax.faces.context.FacesContext,
javax.el.MethodExpression)}
- * and {@link
org.richfaces.model.impl.expressive.MethodBindingExpression#evaluate(java.lang.Object)}.
- */
- public final void testMethodBindingExpression() {
- String expression = "expression";
- MethodBindingExpression methodBindingExpression =
- new MethodBindingExpression(facesContext,
- new MockMethodExpression(expression, null, String.class));
-
- assertEquals(methodBindingExpression.evaluate(null), expression);
- }
-
-}
Deleted:
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/NullExpressionTest.java
===================================================================
---
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/NullExpressionTest.java 2009-07-20
23:18:35 UTC (rev 14969)
+++
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/NullExpressionTest.java 2009-07-20
23:19:40 UTC (rev 14970)
@@ -1,66 +0,0 @@
-/**
- * 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.model.impl.expressive;
-
-import org.richfaces.model.impl.expressive.Expression;
-import org.richfaces.model.impl.expressive.NullExpression;
-
-import junit.framework.TestCase;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class NullExpressionTest extends TestCase {
-
-
- private Expression expression;
-
- /**
- * @param name
- */
- public NullExpressionTest(String name) {
- super(name);
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- expression = new NullExpression("_id2");
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- expression = null;
- }
-
- public void testEvaluate() {
- Object o = new Object();
- assertNull(expression.evaluate(o));
- }
-
-}
Deleted:
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/TestObj.java
===================================================================
---
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/TestObj.java 2009-07-20
23:18:35 UTC (rev 14969)
+++
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/TestObj.java 2009-07-20
23:19:40 UTC (rev 14970)
@@ -1,46 +0,0 @@
-/**
- * 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.model.impl.expressive;
-
-public class TestObj {
- private String name;
-
- /**
- *
- */
- public TestObj() {
- // TODO Auto-generated constructor stub
- }
-
- public TestObj(String name) {
- this.name = name;
- }
-
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-}
\ No newline at end of file
Deleted:
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/WrappedBeanComparatorTest.java
===================================================================
---
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/WrappedBeanComparatorTest.java 2009-07-20
23:18:35 UTC (rev 14969)
+++
root/framework/trunk/legacy-tests/src/test/java/org/richfaces/model/impl/expressive/WrappedBeanComparatorTest.java 2009-07-20
23:19:40 UTC (rev 14970)
@@ -1,102 +0,0 @@
-/**
- * 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.model.impl.expressive;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.richfaces.model.SortField;
-import org.richfaces.model.impl.expressive.JavaBeanWrapper;
-import org.richfaces.model.impl.expressive.WrappedBeanComparator;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class WrappedBeanComparatorTest extends TestCase {
-
- private SortField[] sortFields;
- private WrappedBeanComparator comparator;
-
- private static final int [][] testData = {{0,0}, {0,1}, {1, 0}, {1, 1} };
-
- private JavaBeanWrapper [] testWrapers;
-
- public WrappedBeanComparatorTest(String name) {
- super(name);
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- sortFields = new SortField[2];
- sortFields[0] = new SortField("a", Boolean.FALSE);
- sortFields[1] = new SortField("b", Boolean.TRUE);
-
-
- comparator = new WrappedBeanComparator(sortFields);
-
- testWrapers = new JavaBeanWrapper[testData.length];
- for(int i = 0; i < testData.length; i++) {
- testWrapers[i] = w(testData[i]);
- }
-
- }
-
- private JavaBeanWrapper w(int [] ints) {
- Map m = new HashMap();
- m.put("a", new Integer(ints[0]));
- m.put("b", new Integer(ints[1]));
-
- return new JavaBeanWrapper(m, m);
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- sortFields = null;
- comparator = null;
- testWrapers = null;
- }
-
- /**
- * Test method for {@link
org.richfaces.model.impl.expressive.WrappedBeanComparator#compare(java.lang.Object,
java.lang.Object)}.
- */
- public final void testCompare() {
-
- assertTrue(comparator.compare(w(new int[] {1, 0}), w(new int [] {1, 1})) < 0);
- assertTrue(comparator.compare(w(new int[] {1, 1}), w(new int [] {0, 0})) < 0);
- assertTrue(comparator.compare(w(new int[] {0, 0}), w(new int [] {0, 1})) < 0);
- assertTrue(comparator.compare(w(new int[] {1, 0}), w(new int [] {1, 0})) == 0);
- //assertTrue(comparator.compare(w(new int[] {1, 0}), w(new int [] {1, 1})) < 0);
- //assertTrue(comparator.compare(w(new int[] {1, 0}), w(new int [] {1, 1})) < 0);
-
- }
-
-}