You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by hu...@apache.org on 2006/11/06 16:02:22 UTC
svn commit: r471756 [28/31] - in /struts/struts2/trunk: apps/blank/
apps/blank/src/main/java/example/ apps/blank/src/test/java/example/
apps/mailreader/src/main/java/mailreader2/
apps/portlet/src/main/java/org/apache/struts2/portlet/example/ apps/portl...
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DatePickerTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DatePickerTagTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DatePickerTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DatePickerTagTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
@@ -55,7 +58,7 @@
assertTrue("Should contain format", writer.toString().indexOf("#yyyy/#MM/#dd #hh:#mm:#ss") > -1);
}
- // NOTE: Switching to Dojo's DatePicker, i18n is not supported,
+ // NOTE: Switching to Dojo's DatePicker, i18n is not supported,
// Commenting out this test case
/*public void testLanguage() throws Exception {
tag.setLanguage("da");
@@ -65,7 +68,7 @@
assertTrue("Should contain danish language", writer.toString().indexOf("/struts/jscalendar/lang/calendar-da.js") > -1);
}*/
-
+
// NOTE: Switching to Dojo's DatePicker, showing time is not supported.
// Commenting this test case
/*public void testShowstime() throws Exception {
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DateTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DateTagTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DateTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DateTagTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DivTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DivTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DivTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DivTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DoubleSelectTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DoubleSelectTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DoubleSelectTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DoubleSelectTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
@@ -26,7 +29,7 @@
/**
* Test case for DoubleSelectTag.
- *
+ *
*/
public class DoubleSelectTest extends AbstractUITagTest {
@@ -87,10 +90,10 @@
verify(SelectTag.class.getResource("DoubleSelect-1.txt"));
}
-
+
public void testDoubleWithDefaultSelectedValues() throws Exception {
-
- TestAction testAction = (TestAction) action;
+
+ TestAction testAction = (TestAction) action;
Region antwerp = new Region("Antwerp", "AN");
Region gent = new Region("Gent", "GN");
@@ -126,7 +129,7 @@
tag.setValue("'FR'");
tag.setDoubleValue("'BOR'");
-
+
tag.setList("list2");
tag.setDoubleList("regions");
@@ -147,11 +150,11 @@
tag.doEndTag();
verify(SelectTag.class.getResource("DoubleSelect-2.txt"));
-
-
+
+
}
-
-
+
+
public void testGenericSimple() throws Exception {
DoubleSelectTag tag = new DoubleSelectTag();
prepareTagGeneric(tag);
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FieldErrorTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FieldErrorTagTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FieldErrorTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FieldErrorTagTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
@@ -31,212 +34,212 @@
/**
* FieldError Tag Test Case.
- *
+ *
*/
public class FieldErrorTagTest extends AbstractUITagTest {
-
- public void testWithoutParamsWithFieldErrors() throws Exception {
- FieldErrorTag tag = new FieldErrorTag();
- ((InternalAction)action).setHaveFieldErrors(true);
- tag.setPageContext(pageContext);
- tag.doStartTag();
- tag.doEndTag();
-
- verify(FieldErrorTagTest.class.getResource("fielderror-1.txt"));
- }
-
- public void testWithoutParamsWithoutFieldErrors() throws Exception {
- FieldErrorTag tag = new FieldErrorTag();
- ((InternalAction)action).setHaveFieldErrors(false);
- tag.setPageContext(pageContext);
- tag.doStartTag();
- tag.doEndTag();
-
- verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
- }
-
- public void testWithParamsWithFieldErrors1() throws Exception {
- FieldErrorTag tag = new FieldErrorTag();
- ((InternalAction)action).setHaveFieldErrors(true);
- tag.setPageContext(pageContext);
- tag.doStartTag();
- ParamTag pTag1 = new ParamTag();
- pTag1.setPageContext(pageContext);
- pTag1.setValue("%{'field1'}");
- pTag1.doStartTag();
- pTag1.doEndTag();
-
- ParamTag pTag2 = new ParamTag();
- pTag2.setPageContext(pageContext);
- pTag2.setValue("%{'field3'}");
- pTag2.doStartTag();
- pTag2.doEndTag();
-
- tag.doEndTag();
-
- verify(FieldErrorTagTest.class.getResource("fielderror-3.txt"));
- }
-
- public void testWithParamsWithFieldErrors2() throws Exception {
- FieldErrorTag tag = new FieldErrorTag();
- ((InternalAction)action).setHaveFieldErrors(true);
- tag.setPageContext(pageContext);
- tag.doStartTag();
- ParamTag pTag1 = new ParamTag();
- pTag1.setPageContext(pageContext);
- pTag1.setValue("%{'field1'}");
- pTag1.doStartTag();
- pTag1.doEndTag();
-
- ParamTag pTag2 = new ParamTag();
- pTag2.setPageContext(pageContext);
- pTag2.setValue("%{'field2'}");
- pTag2.doStartTag();
- pTag2.doEndTag();
-
- tag.doEndTag();
-
- verify(FieldErrorTagTest.class.getResource("fielderror-4.txt"));
- }
-
-
- public void testWithParamsWithFieldErrors3() throws Exception {
- FieldErrorTag tag = new FieldErrorTag();
- ((InternalAction)action).setHaveFieldErrors(true);
- tag.setPageContext(pageContext);
- tag.doStartTag();
- ParamTag pTag1 = new ParamTag();
- pTag1.setPageContext(pageContext);
- pTag1.setValue("%{'field2'}");
- pTag1.doStartTag();
- pTag1.doEndTag();
-
- tag.doEndTag();
-
- verify(FieldErrorTagTest.class.getResource("fielderror-5.txt"));
- }
-
- public void testWithParamsWithoutFieldErrors1() throws Exception {
- FieldErrorTag tag = new FieldErrorTag();
- ((InternalAction)action).setHaveFieldErrors(false);
- tag.setPageContext(pageContext);
- tag.doStartTag();
- ParamTag pTag1 = new ParamTag();
- pTag1.setPageContext(pageContext);
- pTag1.setValue("%{'field1'}");
- pTag1.doStartTag();
- pTag1.doEndTag();
-
- ParamTag pTag2 = new ParamTag();
- pTag2.setPageContext(pageContext);
- pTag2.setValue("%{'field3'}");
- pTag2.doStartTag();
- pTag2.doEndTag();
- tag.doEndTag();
-
- verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
- }
-
- public void testWithParamsWithoutFieldErrors2() throws Exception {
- FieldErrorTag tag = new FieldErrorTag();
- ((InternalAction)action).setHaveFieldErrors(false);
- tag.setPageContext(pageContext);
- tag.doStartTag();
- ParamTag pTag1 = new ParamTag();
- pTag1.setPageContext(pageContext);
- pTag1.setValue("%{'field1'}");
- pTag1.doStartTag();
- pTag1.doEndTag();
-
- ParamTag pTag2 = new ParamTag();
- pTag2.setPageContext(pageContext);
- pTag2.setValue("%{'field3'}");
- pTag2.doStartTag();
- pTag2.doEndTag();
- tag.doEndTag();
-
- verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
- }
-
-
- public void testWithParamsWithoutFieldErrors3() throws Exception {
- FieldErrorTag tag = new FieldErrorTag();
- ((InternalAction)action).setHaveFieldErrors(false);
- tag.setPageContext(pageContext);
- tag.doStartTag();
- ParamTag pTag1 = new ParamTag();
- pTag1.setPageContext(pageContext);
- pTag1.setValue("%{'field2'}");
- pTag1.doStartTag();
- pTag1.doEndTag();
-
- tag.doEndTag();
-
- verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
- }
-
- public void testWithNullFieldErrors() throws Exception {
- FieldErrorTag tag = new FieldErrorTag();
- ((InternalAction)action).setHaveFieldErrors(false);
- ((InternalAction)action).setReturnNullForFieldErrors(true);
- tag.setPageContext(pageContext);
- tag.doStartTag();
- ParamTag pTag1 = new ParamTag();
- pTag1.setPageContext(pageContext);
- pTag1.setValue("%{'field2'}");
- pTag1.doStartTag();
- pTag1.doEndTag();
-
- tag.doEndTag();
-
- verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
- }
-
-
- public Action getAction() {
- return new InternalAction();
- }
-
-
- public class InternalAction extends ActionSupport {
-
- private boolean haveFieldErrors = false;
- private boolean returnNullForFieldErrors = false;
-
- public void setHaveFieldErrors(boolean haveFieldErrors) {
- this.haveFieldErrors = haveFieldErrors;
- }
-
- public void setReturnNullForFieldErrors(boolean returnNullForFieldErrors) {
- this.returnNullForFieldErrors = returnNullForFieldErrors;
- }
-
- public Map getFieldErrors() {
- if (haveFieldErrors) {
- List err1 = new ArrayList();
- err1.add("field error message number 1");
- List err2 = new ArrayList();
- err2.add("field error message number 2");
- List err3 = new ArrayList();
- err3.add("field error message number 3");
- Map fieldErrors = new LinkedHashMap();
- fieldErrors.put("field1", err1);
- fieldErrors.put("field2", err2);
- fieldErrors.put("field3", err3);
- return fieldErrors;
- }
- else if (returnNullForFieldErrors) {
- return null;
- }
- else {
- return Collections.EMPTY_MAP;
- }
- }
-
- public boolean hasFieldErrors() {
- return haveFieldErrors;
- }
- }
+
+ public void testWithoutParamsWithFieldErrors() throws Exception {
+ FieldErrorTag tag = new FieldErrorTag();
+ ((InternalAction)action).setHaveFieldErrors(true);
+ tag.setPageContext(pageContext);
+ tag.doStartTag();
+ tag.doEndTag();
+
+ verify(FieldErrorTagTest.class.getResource("fielderror-1.txt"));
+ }
+
+ public void testWithoutParamsWithoutFieldErrors() throws Exception {
+ FieldErrorTag tag = new FieldErrorTag();
+ ((InternalAction)action).setHaveFieldErrors(false);
+ tag.setPageContext(pageContext);
+ tag.doStartTag();
+ tag.doEndTag();
+
+ verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
+ }
+
+ public void testWithParamsWithFieldErrors1() throws Exception {
+ FieldErrorTag tag = new FieldErrorTag();
+ ((InternalAction)action).setHaveFieldErrors(true);
+ tag.setPageContext(pageContext);
+ tag.doStartTag();
+ ParamTag pTag1 = new ParamTag();
+ pTag1.setPageContext(pageContext);
+ pTag1.setValue("%{'field1'}");
+ pTag1.doStartTag();
+ pTag1.doEndTag();
+
+ ParamTag pTag2 = new ParamTag();
+ pTag2.setPageContext(pageContext);
+ pTag2.setValue("%{'field3'}");
+ pTag2.doStartTag();
+ pTag2.doEndTag();
+
+ tag.doEndTag();
+
+ verify(FieldErrorTagTest.class.getResource("fielderror-3.txt"));
+ }
+
+ public void testWithParamsWithFieldErrors2() throws Exception {
+ FieldErrorTag tag = new FieldErrorTag();
+ ((InternalAction)action).setHaveFieldErrors(true);
+ tag.setPageContext(pageContext);
+ tag.doStartTag();
+ ParamTag pTag1 = new ParamTag();
+ pTag1.setPageContext(pageContext);
+ pTag1.setValue("%{'field1'}");
+ pTag1.doStartTag();
+ pTag1.doEndTag();
+
+ ParamTag pTag2 = new ParamTag();
+ pTag2.setPageContext(pageContext);
+ pTag2.setValue("%{'field2'}");
+ pTag2.doStartTag();
+ pTag2.doEndTag();
+
+ tag.doEndTag();
+
+ verify(FieldErrorTagTest.class.getResource("fielderror-4.txt"));
+ }
+
+
+ public void testWithParamsWithFieldErrors3() throws Exception {
+ FieldErrorTag tag = new FieldErrorTag();
+ ((InternalAction)action).setHaveFieldErrors(true);
+ tag.setPageContext(pageContext);
+ tag.doStartTag();
+ ParamTag pTag1 = new ParamTag();
+ pTag1.setPageContext(pageContext);
+ pTag1.setValue("%{'field2'}");
+ pTag1.doStartTag();
+ pTag1.doEndTag();
+
+ tag.doEndTag();
+
+ verify(FieldErrorTagTest.class.getResource("fielderror-5.txt"));
+ }
+
+ public void testWithParamsWithoutFieldErrors1() throws Exception {
+ FieldErrorTag tag = new FieldErrorTag();
+ ((InternalAction)action).setHaveFieldErrors(false);
+ tag.setPageContext(pageContext);
+ tag.doStartTag();
+ ParamTag pTag1 = new ParamTag();
+ pTag1.setPageContext(pageContext);
+ pTag1.setValue("%{'field1'}");
+ pTag1.doStartTag();
+ pTag1.doEndTag();
+
+ ParamTag pTag2 = new ParamTag();
+ pTag2.setPageContext(pageContext);
+ pTag2.setValue("%{'field3'}");
+ pTag2.doStartTag();
+ pTag2.doEndTag();
+ tag.doEndTag();
+
+ verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
+ }
+
+ public void testWithParamsWithoutFieldErrors2() throws Exception {
+ FieldErrorTag tag = new FieldErrorTag();
+ ((InternalAction)action).setHaveFieldErrors(false);
+ tag.setPageContext(pageContext);
+ tag.doStartTag();
+ ParamTag pTag1 = new ParamTag();
+ pTag1.setPageContext(pageContext);
+ pTag1.setValue("%{'field1'}");
+ pTag1.doStartTag();
+ pTag1.doEndTag();
+
+ ParamTag pTag2 = new ParamTag();
+ pTag2.setPageContext(pageContext);
+ pTag2.setValue("%{'field3'}");
+ pTag2.doStartTag();
+ pTag2.doEndTag();
+ tag.doEndTag();
+
+ verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
+ }
+
+
+ public void testWithParamsWithoutFieldErrors3() throws Exception {
+ FieldErrorTag tag = new FieldErrorTag();
+ ((InternalAction)action).setHaveFieldErrors(false);
+ tag.setPageContext(pageContext);
+ tag.doStartTag();
+ ParamTag pTag1 = new ParamTag();
+ pTag1.setPageContext(pageContext);
+ pTag1.setValue("%{'field2'}");
+ pTag1.doStartTag();
+ pTag1.doEndTag();
+
+ tag.doEndTag();
+
+ verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
+ }
+
+ public void testWithNullFieldErrors() throws Exception {
+ FieldErrorTag tag = new FieldErrorTag();
+ ((InternalAction)action).setHaveFieldErrors(false);
+ ((InternalAction)action).setReturnNullForFieldErrors(true);
+ tag.setPageContext(pageContext);
+ tag.doStartTag();
+ ParamTag pTag1 = new ParamTag();
+ pTag1.setPageContext(pageContext);
+ pTag1.setValue("%{'field2'}");
+ pTag1.doStartTag();
+ pTag1.doEndTag();
+
+ tag.doEndTag();
+
+ verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
+ }
+
+
+ public Action getAction() {
+ return new InternalAction();
+ }
+
+
+ public class InternalAction extends ActionSupport {
+
+ private boolean haveFieldErrors = false;
+ private boolean returnNullForFieldErrors = false;
+
+ public void setHaveFieldErrors(boolean haveFieldErrors) {
+ this.haveFieldErrors = haveFieldErrors;
+ }
+
+ public void setReturnNullForFieldErrors(boolean returnNullForFieldErrors) {
+ this.returnNullForFieldErrors = returnNullForFieldErrors;
+ }
+
+ public Map getFieldErrors() {
+ if (haveFieldErrors) {
+ List err1 = new ArrayList();
+ err1.add("field error message number 1");
+ List err2 = new ArrayList();
+ err2.add("field error message number 2");
+ List err3 = new ArrayList();
+ err3.add("field error message number 3");
+ Map fieldErrors = new LinkedHashMap();
+ fieldErrors.put("field1", err1);
+ fieldErrors.put("field2", err2);
+ fieldErrors.put("field3", err3);
+ return fieldErrors;
+ }
+ else if (returnNullForFieldErrors) {
+ return null;
+ }
+ else {
+ return Collections.EMPTY_MAP;
+ }
+ }
+
+ public boolean hasFieldErrors() {
+ return haveFieldErrors;
+ }
+ }
}
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FileTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FileTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FileTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FileTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/HeadTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/HeadTagTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/HeadTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/HeadTagTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
@@ -42,7 +45,7 @@
tag.doStartTag();
tag.doEndTag();
tag.setCalendarcss(null); // null = should use calendar-blue.css
-
+
verify(HeadTagTest.class.getResource("HeadTagTest-1.txt"));
}
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/HiddenTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/HiddenTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/HiddenTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/HiddenTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/JspTemplateTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/JspTemplateTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/JspTemplateTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/JspTemplateTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/LabelTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/LabelTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/LabelTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/LabelTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/MockTag.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/MockTag.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/MockTag.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/MockTag.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
@@ -29,9 +32,9 @@
*/
public class MockTag extends BodyTagSupport {
- private static final long serialVersionUID = 2694367759647164641L;
-
- private static String s;
+ private static final long serialVersionUID = 2694367759647164641L;
+
+ private static String s;
private static Integer i;
private static Double d;
private static Long l;
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptGroupTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptGroupTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptGroupTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptGroupTest.java Mon Nov 6 07:01:43 2006
@@ -1,120 +1,123 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
import org.apache.struts2.views.jsp.AbstractUITagTest;
/**
- *
+ *
*/
public class OptGroupTest extends AbstractUITagTest {
-
-
- public void testOptGroupSimple() throws Exception {
- SelectTag selectTag = new SelectTag();
- selectTag.setName("mySelection");
- selectTag.setLabel("My Selection");
- selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
-
- OptGroupTag optGroupTag1 = new OptGroupTag();
- optGroupTag1.setLabel("My Label 1");
- optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}");
-
- OptGroupTag optGroupTag2 = new OptGroupTag();
- optGroupTag2.setLabel("My Label 2");
- optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}");
-
- selectTag.setPageContext(pageContext);
- selectTag.doStartTag();
- optGroupTag1.setPageContext(pageContext);
- optGroupTag1.doStartTag();
- optGroupTag1.doEndTag();
- optGroupTag2.setPageContext(pageContext);
- optGroupTag2.doStartTag();
- optGroupTag2.doEndTag();
- selectTag.doEndTag();
-
-
- //System.out.println(writer.toString());
- verify(SelectTag.class.getResource("OptGroup-1.txt"));
- }
-
-
- public void testOptGroupWithSingleSelect() throws Exception {
-
- SelectTag selectTag = new SelectTag();
- selectTag.setName("mySelection");
- selectTag.setLabel("My Selection");
- selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
- selectTag.setValue("%{'EEE'}");
-
- OptGroupTag optGroupTag1 = new OptGroupTag();
- optGroupTag1.setLabel("My Label 1");
- optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}");
-
- OptGroupTag optGroupTag2 = new OptGroupTag();
- optGroupTag2.setLabel("My Label 2");
- optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}");
-
- selectTag.setPageContext(pageContext);
- selectTag.doStartTag();
- optGroupTag1.setPageContext(pageContext);
- optGroupTag1.doStartTag();
- optGroupTag1.doEndTag();
- optGroupTag2.setPageContext(pageContext);
- optGroupTag2.doStartTag();
- optGroupTag2.doEndTag();
- selectTag.doEndTag();
-
-
- //System.out.println(writer.toString());
- verify(SelectTag.class.getResource("OptGroup-2.txt"));
- }
-
-
- public void testOptGroupWithMultipleSelect() throws Exception {
- SelectTag selectTag = new SelectTag();
- selectTag.setMultiple("true");
- selectTag.setName("mySelection");
- selectTag.setLabel("My Selection");
- selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
- selectTag.setValue("%{{'EEE','BBB','TWO'}}");
-
- OptGroupTag optGroupTag1 = new OptGroupTag();
- optGroupTag1.setLabel("My Label 1");
- optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}");
-
- OptGroupTag optGroupTag2 = new OptGroupTag();
- optGroupTag2.setLabel("My Label 2");
- optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}");
-
- selectTag.setPageContext(pageContext);
- selectTag.doStartTag();
- optGroupTag1.setPageContext(pageContext);
- optGroupTag1.doStartTag();
- optGroupTag1.doEndTag();
- optGroupTag2.setPageContext(pageContext);
- optGroupTag2.doStartTag();
- optGroupTag2.doEndTag();
- selectTag.doEndTag();
-
-
- //System.out.println(writer.toString());
- verify(SelectTag.class.getResource("OptGroup-3.txt"));
- }
+
+
+ public void testOptGroupSimple() throws Exception {
+ SelectTag selectTag = new SelectTag();
+ selectTag.setName("mySelection");
+ selectTag.setLabel("My Selection");
+ selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
+
+ OptGroupTag optGroupTag1 = new OptGroupTag();
+ optGroupTag1.setLabel("My Label 1");
+ optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}");
+
+ OptGroupTag optGroupTag2 = new OptGroupTag();
+ optGroupTag2.setLabel("My Label 2");
+ optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}");
+
+ selectTag.setPageContext(pageContext);
+ selectTag.doStartTag();
+ optGroupTag1.setPageContext(pageContext);
+ optGroupTag1.doStartTag();
+ optGroupTag1.doEndTag();
+ optGroupTag2.setPageContext(pageContext);
+ optGroupTag2.doStartTag();
+ optGroupTag2.doEndTag();
+ selectTag.doEndTag();
+
+
+ //System.out.println(writer.toString());
+ verify(SelectTag.class.getResource("OptGroup-1.txt"));
+ }
+
+
+ public void testOptGroupWithSingleSelect() throws Exception {
+
+ SelectTag selectTag = new SelectTag();
+ selectTag.setName("mySelection");
+ selectTag.setLabel("My Selection");
+ selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
+ selectTag.setValue("%{'EEE'}");
+
+ OptGroupTag optGroupTag1 = new OptGroupTag();
+ optGroupTag1.setLabel("My Label 1");
+ optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}");
+
+ OptGroupTag optGroupTag2 = new OptGroupTag();
+ optGroupTag2.setLabel("My Label 2");
+ optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}");
+
+ selectTag.setPageContext(pageContext);
+ selectTag.doStartTag();
+ optGroupTag1.setPageContext(pageContext);
+ optGroupTag1.doStartTag();
+ optGroupTag1.doEndTag();
+ optGroupTag2.setPageContext(pageContext);
+ optGroupTag2.doStartTag();
+ optGroupTag2.doEndTag();
+ selectTag.doEndTag();
+
+
+ //System.out.println(writer.toString());
+ verify(SelectTag.class.getResource("OptGroup-2.txt"));
+ }
+
+
+ public void testOptGroupWithMultipleSelect() throws Exception {
+ SelectTag selectTag = new SelectTag();
+ selectTag.setMultiple("true");
+ selectTag.setName("mySelection");
+ selectTag.setLabel("My Selection");
+ selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
+ selectTag.setValue("%{{'EEE','BBB','TWO'}}");
+
+ OptGroupTag optGroupTag1 = new OptGroupTag();
+ optGroupTag1.setLabel("My Label 1");
+ optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}");
+
+ OptGroupTag optGroupTag2 = new OptGroupTag();
+ optGroupTag2.setLabel("My Label 2");
+ optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}");
+
+ selectTag.setPageContext(pageContext);
+ selectTag.doStartTag();
+ optGroupTag1.setPageContext(pageContext);
+ optGroupTag1.doStartTag();
+ optGroupTag1.doEndTag();
+ optGroupTag2.setPageContext(pageContext);
+ optGroupTag2.doStartTag();
+ optGroupTag2.doEndTag();
+ selectTag.doEndTag();
+
+
+ //System.out.println(writer.toString());
+ verify(SelectTag.class.getResource("OptGroup-3.txt"));
+ }
}
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptionTransferSelectTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptionTransferSelectTagTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptionTransferSelectTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptionTransferSelectTagTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
@@ -24,497 +27,497 @@
import org.apache.struts2.views.jsp.AbstractUITagTest;
/**
- *
+ *
*/
public class OptionTransferSelectTagTest extends AbstractUITagTest {
- public void testWithAllSelected() throws Exception {
- List left = new ArrayList();
- left.add("Left1");
- left.add("Left2");
-
- List right = new ArrayList();
- right.add("Right1");
- right.add("Right2");
-
- TestAction testaction = (TestAction) action;
- testaction.setCollection(left);
- testaction.setList2(right);
-
- OptionTransferSelectTag tag = new OptionTransferSelectTag();
- tag.setPageContext(pageContext);
-
- tag.setName("collection");
- tag.setId("id");
- tag.setList("collection");
- tag.setSize("20");
- tag.setMultiple("true");
- tag.setEmptyOption("true");
-
- tag.setDoubleName("list2");
- tag.setDoubleList("list2");
- tag.setDoubleId("doubleId");
- tag.setDoubleSize("20");
- tag.setMultiple("true");
- tag.setDoubleEmptyOption("true");
-
- tag.setAllowAddAllToLeft("true");
- tag.setAllowAddAllToRight("true");
- tag.setAllowAddToLeft("true");
- tag.setAllowAddToRight("true");
- tag.setAllowSelectAll("true");
-
- tag.setAddAllToLeftLabel("All Left");
- tag.setAddAllToRightLabel("All Right");
- tag.setAddToLeftLabel("Left");
- tag.setAddToRightLabel("Right");
- tag.setSelectAllLabel("Select All");
-
- tag.setLeftTitle("Title Left");
- tag.setRightTitle("Title Right");
-
- tag.setButtonCssClass("buttonCssClass");
- tag.setButtonCssStyle("buttonCssStyle");
-
- tag.setHeaderKey("Header Key");
- tag.setHeaderValue("Header Value");
-
- tag.setDoubleHeaderKey("Double Header Key");
- tag.setDoubleHeaderValue("Double Header Value");
-
- tag.doStartTag();
- tag.doEndTag();
-
- //System.out.println(writer.toString());
- verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-1.txt"));
- }
-
- public void testWithPartialSelectedOnBothSides() throws Exception {
- List left = new ArrayList();
- left.add("Left2");
-
- List right = new ArrayList();
- right.add("Right2");
-
- List leftVal = new ArrayList();
- leftVal.add("Left1");
- leftVal.add("Left2");
- leftVal.add("Left3");
-
- List rightVal = new ArrayList();
- rightVal.add("Right1");
- rightVal.add("Right2");
- rightVal.add("Right3");
-
-
- TestAction testaction = (TestAction) action;
- testaction.setCollection(left);
- testaction.setList2(right);
- testaction.setCollection2(leftVal);
- testaction.setList3(rightVal);
-
-
- OptionTransferSelectTag tag = new OptionTransferSelectTag();
- tag.setPageContext(pageContext);
-
- tag.setName("collection");
- tag.setId("id");
- tag.setList("collection2");
- tag.setSize("20");
- tag.setMultiple("true");
- tag.setEmptyOption("true");
-
- tag.setDoubleName("list2");
- tag.setDoubleList("list3");
- tag.setDoubleId("doubleId");
- tag.setDoubleSize("20");
- tag.setMultiple("true");
- tag.setDoubleEmptyOption("true");
-
- tag.setAllowAddAllToLeft("true");
- tag.setAllowAddAllToRight("true");
- tag.setAllowAddToLeft("true");
- tag.setAllowAddToRight("true");
- tag.setAllowSelectAll("true");
-
- tag.setAddAllToLeftLabel("All Left");
- tag.setAddAllToRightLabel("All Right");
- tag.setAddToLeftLabel("Left");
- tag.setAddToRightLabel("Right");
- tag.setSelectAllLabel("Select All");
-
- tag.setLeftTitle("Title Left");
- tag.setRightTitle("Title Right");
-
- tag.setButtonCssClass("buttonCssClass");
- tag.setButtonCssStyle("buttonCssStyle");
-
- tag.setHeaderKey("Header Key");
- tag.setHeaderValue("Header Value");
-
- tag.setDoubleHeaderKey("Double Header Key");
- tag.setDoubleHeaderValue("Double Header Value");
-
- tag.doStartTag();
- tag.doEndTag();
-
- //System.out.println(writer.toString());
- verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-2.txt"));
- }
-
- public void testWithoutHeaderOnBothSides() throws Exception {
- List left = new ArrayList();
- left.add("Left2");
-
- List right = new ArrayList();
- right.add("Right2");
-
- List leftVal = new ArrayList();
- leftVal.add("Left1");
- leftVal.add("Left2");
- leftVal.add("Left3");
-
- List rightVal = new ArrayList();
- rightVal.add("Right1");
- rightVal.add("Right2");
- rightVal.add("Right3");
-
-
- TestAction testaction = (TestAction) action;
- testaction.setCollection(left);
- testaction.setList2(right);
- testaction.setCollection2(leftVal);
- testaction.setList3(rightVal);
-
-
- OptionTransferSelectTag tag = new OptionTransferSelectTag();
- tag.setPageContext(pageContext);
-
- tag.setName("collection");
- tag.setId("id");
- tag.setList("collection2");
- tag.setSize("20");
- tag.setMultiple("true");
- tag.setEmptyOption("true");
-
- tag.setDoubleName("list2");
- tag.setDoubleList("list3");
- tag.setDoubleId("doubleId");
- tag.setDoubleSize("20");
- tag.setMultiple("true");
- tag.setDoubleEmptyOption("true");
-
- tag.setAllowAddAllToLeft("true");
- tag.setAllowAddAllToRight("true");
- tag.setAllowAddToLeft("true");
- tag.setAllowAddToRight("true");
- tag.setAllowSelectAll("true");
-
- tag.setAddAllToLeftLabel("All Left");
- tag.setAddAllToRightLabel("All Right");
- tag.setAddToLeftLabel("Left");
- tag.setAddToRightLabel("Right");
- tag.setSelectAllLabel("Select All");
-
- tag.setLeftTitle("Title Left");
- tag.setRightTitle("Title Right");
-
- tag.setButtonCssClass("buttonCssClass");
- tag.setButtonCssStyle("buttonCssStyle");
-
- tag.doStartTag();
- tag.doEndTag();
-
- //System.out.println(writer.toString());
- verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-3.txt"));
- }
-
- public void testWithoutHeaderOnOneSide() throws Exception {
- List left = new ArrayList();
- left.add("Left2");
-
- List right = new ArrayList();
- right.add("Right2");
-
- List leftVal = new ArrayList();
- leftVal.add("Left1");
- leftVal.add("Left2");
- leftVal.add("Left3");
-
- List rightVal = new ArrayList();
- rightVal.add("Right1");
- rightVal.add("Right2");
- rightVal.add("Right3");
-
-
- TestAction testaction = (TestAction) action;
- testaction.setCollection(left);
- testaction.setList2(right);
- testaction.setCollection2(leftVal);
- testaction.setList3(rightVal);
-
-
- OptionTransferSelectTag tag = new OptionTransferSelectTag();
- tag.setPageContext(pageContext);
-
- tag.setName("collection");
- tag.setId("id");
- tag.setList("collection2");
- tag.setSize("20");
- tag.setMultiple("true");
- tag.setEmptyOption("true");
-
- tag.setDoubleName("list2");
- tag.setDoubleList("list3");
- tag.setDoubleId("doubleId");
- tag.setDoubleSize("20");
- tag.setMultiple("true");
- tag.setDoubleEmptyOption("true");
-
- tag.setAllowAddAllToLeft("true");
- tag.setAllowAddAllToRight("true");
- tag.setAllowAddToLeft("true");
- tag.setAllowAddToRight("true");
- tag.setAllowSelectAll("true");
-
- tag.setAddAllToLeftLabel("All Left");
- tag.setAddAllToRightLabel("All Right");
- tag.setAddToLeftLabel("Left");
- tag.setAddToRightLabel("Right");
- tag.setSelectAllLabel("Select All");
-
- tag.setLeftTitle("Title Left");
- tag.setRightTitle("Title Right");
-
- tag.setButtonCssClass("buttonCssClass");
- tag.setButtonCssStyle("buttonCssStyle");
-
- tag.setHeaderKey("Header Key");
- tag.setHeaderValue("Header Value");
-
- tag.doStartTag();
- tag.doEndTag();
-
- //System.out.println(writer.toString());
- verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-4.txt"));
- }
-
- public void testWithoutEmptyOptionOnBothSides() throws Exception {
- List left = new ArrayList();
- left.add("Left2");
-
- List right = new ArrayList();
- right.add("Right2");
-
- List leftVal = new ArrayList();
- leftVal.add("Left1");
- leftVal.add("Left2");
- leftVal.add("Left3");
-
- List rightVal = new ArrayList();
- rightVal.add("Right1");
- rightVal.add("Right2");
- rightVal.add("Right3");
-
-
- TestAction testaction = (TestAction) action;
- testaction.setCollection(left);
- testaction.setList2(right);
- testaction.setCollection2(leftVal);
- testaction.setList3(rightVal);
-
-
- OptionTransferSelectTag tag = new OptionTransferSelectTag();
- tag.setPageContext(pageContext);
-
- tag.setName("collection");
- tag.setId("id");
- tag.setList("collection2");
- tag.setSize("20");
- tag.setMultiple("true");
- tag.setEmptyOption("false");
-
- tag.setDoubleName("list2");
- tag.setDoubleList("list3");
- tag.setDoubleId("doubleId");
- tag.setDoubleSize("20");
- tag.setMultiple("true");
- tag.setDoubleEmptyOption("false");
-
- tag.setAllowAddAllToLeft("true");
- tag.setAllowAddAllToRight("true");
- tag.setAllowAddToLeft("true");
- tag.setAllowAddToRight("true");
- tag.setAllowSelectAll("true");
-
- tag.setAddAllToLeftLabel("All Left");
- tag.setAddAllToRightLabel("All Right");
- tag.setAddToLeftLabel("Left");
- tag.setAddToRightLabel("Right");
- tag.setSelectAllLabel("Select All");
-
- tag.setLeftTitle("Title Left");
- tag.setRightTitle("Title Right");
-
- tag.setButtonCssClass("buttonCssClass");
- tag.setButtonCssStyle("buttonCssStyle");
-
- tag.setHeaderKey("Header Key");
- tag.setHeaderValue("Header Value");
-
- tag.setDoubleHeaderKey("Double Header Key");
- tag.setDoubleHeaderValue("Double Header Value");
-
- tag.doStartTag();
- tag.doEndTag();
-
- //System.out.println(writer.toString());
- verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-5.txt"));
- }
-
- public void testWithoutEmptyOptionOnOneSide() throws Exception {
- List left = new ArrayList();
- left.add("Left2");
-
- List right = new ArrayList();
- right.add("Right2");
-
- List leftVal = new ArrayList();
- leftVal.add("Left1");
- leftVal.add("Left2");
- leftVal.add("Left3");
-
- List rightVal = new ArrayList();
- rightVal.add("Right1");
- rightVal.add("Right2");
- rightVal.add("Right3");
-
-
- TestAction testaction = (TestAction) action;
- testaction.setCollection(left);
- testaction.setList2(right);
- testaction.setCollection2(leftVal);
- testaction.setList3(rightVal);
-
-
- OptionTransferSelectTag tag = new OptionTransferSelectTag();
- tag.setPageContext(pageContext);
-
- tag.setName("collection");
- tag.setId("id");
- tag.setList("collection2");
- tag.setSize("20");
- tag.setMultiple("true");
- tag.setEmptyOption("true");
-
- tag.setDoubleName("list2");
- tag.setDoubleList("list3");
- tag.setDoubleId("doubleId");
- tag.setDoubleSize("20");
- tag.setMultiple("true");
- tag.setDoubleEmptyOption("false");
-
- tag.setAllowAddAllToLeft("true");
- tag.setAllowAddAllToRight("true");
- tag.setAllowAddToLeft("true");
- tag.setAllowAddToRight("true");
- tag.setAllowSelectAll("true");
-
- tag.setAddAllToLeftLabel("All Left");
- tag.setAddAllToRightLabel("All Right");
- tag.setAddToLeftLabel("Left");
- tag.setAddToRightLabel("Right");
- tag.setSelectAllLabel("Select All");
-
- tag.setLeftTitle("Title Left");
- tag.setRightTitle("Title Right");
-
- tag.setButtonCssClass("buttonCssClass");
- tag.setButtonCssStyle("buttonCssStyle");
-
- tag.setHeaderKey("Header Key");
- tag.setHeaderValue("Header Value");
-
- tag.setDoubleHeaderKey("Double Header Key");
- tag.setDoubleHeaderValue("Double Header Value");
-
- tag.doStartTag();
- tag.doEndTag();
-
- //System.out.println(writer.toString());
- verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-6.txt"));
- }
-
- public void testDisableSomeButtons() throws Exception {
- List left = new ArrayList();
- left.add("Left2");
-
- List right = new ArrayList();
- right.add("Right2");
-
- List leftVal = new ArrayList();
- leftVal.add("Left1");
- leftVal.add("Left2");
- leftVal.add("Left3");
-
- List rightVal = new ArrayList();
- rightVal.add("Right1");
- rightVal.add("Right2");
- rightVal.add("Right3");
-
-
- TestAction testaction = (TestAction) action;
- testaction.setCollection(left);
- testaction.setList2(right);
- testaction.setCollection2(leftVal);
- testaction.setList3(rightVal);
-
-
- OptionTransferSelectTag tag = new OptionTransferSelectTag();
- tag.setPageContext(pageContext);
-
- tag.setName("collection");
- tag.setId("id");
- tag.setList("collection2");
- tag.setSize("20");
- tag.setMultiple("true");
- tag.setEmptyOption("true");
-
- tag.setDoubleName("list2");
- tag.setDoubleList("list3");
- tag.setDoubleId("doubleId");
- tag.setDoubleSize("20");
- tag.setMultiple("true");
- tag.setDoubleEmptyOption("true");
-
- tag.setAllowAddAllToLeft("false");
- tag.setAllowAddAllToRight("false");
- tag.setAllowAddToLeft("true");
- tag.setAllowAddToRight("true");
- tag.setAllowSelectAll("false");
-
- tag.setAddAllToLeftLabel("All Left");
- tag.setAddAllToRightLabel("All Right");
- tag.setAddToLeftLabel("Left");
- tag.setAddToRightLabel("Right");
- tag.setSelectAllLabel("Select All");
-
- tag.setLeftTitle("Title Left");
- tag.setRightTitle("Title Right");
-
- tag.setButtonCssClass("buttonCssClass");
- tag.setButtonCssStyle("buttonCssStyle");
-
- tag.setHeaderKey("Header Key");
- tag.setHeaderValue("Header Value");
-
- tag.setDoubleHeaderKey("Double Header Key");
- tag.setDoubleHeaderValue("Double Header Value");
-
- tag.doStartTag();
- tag.doEndTag();
-
- //System.out.println(writer.toString());
- verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-7.txt"));
- }
+ public void testWithAllSelected() throws Exception {
+ List left = new ArrayList();
+ left.add("Left1");
+ left.add("Left2");
+
+ List right = new ArrayList();
+ right.add("Right1");
+ right.add("Right2");
+
+ TestAction testaction = (TestAction) action;
+ testaction.setCollection(left);
+ testaction.setList2(right);
+
+ OptionTransferSelectTag tag = new OptionTransferSelectTag();
+ tag.setPageContext(pageContext);
+
+ tag.setName("collection");
+ tag.setId("id");
+ tag.setList("collection");
+ tag.setSize("20");
+ tag.setMultiple("true");
+ tag.setEmptyOption("true");
+
+ tag.setDoubleName("list2");
+ tag.setDoubleList("list2");
+ tag.setDoubleId("doubleId");
+ tag.setDoubleSize("20");
+ tag.setMultiple("true");
+ tag.setDoubleEmptyOption("true");
+
+ tag.setAllowAddAllToLeft("true");
+ tag.setAllowAddAllToRight("true");
+ tag.setAllowAddToLeft("true");
+ tag.setAllowAddToRight("true");
+ tag.setAllowSelectAll("true");
+
+ tag.setAddAllToLeftLabel("All Left");
+ tag.setAddAllToRightLabel("All Right");
+ tag.setAddToLeftLabel("Left");
+ tag.setAddToRightLabel("Right");
+ tag.setSelectAllLabel("Select All");
+
+ tag.setLeftTitle("Title Left");
+ tag.setRightTitle("Title Right");
+
+ tag.setButtonCssClass("buttonCssClass");
+ tag.setButtonCssStyle("buttonCssStyle");
+
+ tag.setHeaderKey("Header Key");
+ tag.setHeaderValue("Header Value");
+
+ tag.setDoubleHeaderKey("Double Header Key");
+ tag.setDoubleHeaderValue("Double Header Value");
+
+ tag.doStartTag();
+ tag.doEndTag();
+
+ //System.out.println(writer.toString());
+ verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-1.txt"));
+ }
+
+ public void testWithPartialSelectedOnBothSides() throws Exception {
+ List left = new ArrayList();
+ left.add("Left2");
+
+ List right = new ArrayList();
+ right.add("Right2");
+
+ List leftVal = new ArrayList();
+ leftVal.add("Left1");
+ leftVal.add("Left2");
+ leftVal.add("Left3");
+
+ List rightVal = new ArrayList();
+ rightVal.add("Right1");
+ rightVal.add("Right2");
+ rightVal.add("Right3");
+
+
+ TestAction testaction = (TestAction) action;
+ testaction.setCollection(left);
+ testaction.setList2(right);
+ testaction.setCollection2(leftVal);
+ testaction.setList3(rightVal);
+
+
+ OptionTransferSelectTag tag = new OptionTransferSelectTag();
+ tag.setPageContext(pageContext);
+
+ tag.setName("collection");
+ tag.setId("id");
+ tag.setList("collection2");
+ tag.setSize("20");
+ tag.setMultiple("true");
+ tag.setEmptyOption("true");
+
+ tag.setDoubleName("list2");
+ tag.setDoubleList("list3");
+ tag.setDoubleId("doubleId");
+ tag.setDoubleSize("20");
+ tag.setMultiple("true");
+ tag.setDoubleEmptyOption("true");
+
+ tag.setAllowAddAllToLeft("true");
+ tag.setAllowAddAllToRight("true");
+ tag.setAllowAddToLeft("true");
+ tag.setAllowAddToRight("true");
+ tag.setAllowSelectAll("true");
+
+ tag.setAddAllToLeftLabel("All Left");
+ tag.setAddAllToRightLabel("All Right");
+ tag.setAddToLeftLabel("Left");
+ tag.setAddToRightLabel("Right");
+ tag.setSelectAllLabel("Select All");
+
+ tag.setLeftTitle("Title Left");
+ tag.setRightTitle("Title Right");
+
+ tag.setButtonCssClass("buttonCssClass");
+ tag.setButtonCssStyle("buttonCssStyle");
+
+ tag.setHeaderKey("Header Key");
+ tag.setHeaderValue("Header Value");
+
+ tag.setDoubleHeaderKey("Double Header Key");
+ tag.setDoubleHeaderValue("Double Header Value");
+
+ tag.doStartTag();
+ tag.doEndTag();
+
+ //System.out.println(writer.toString());
+ verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-2.txt"));
+ }
+
+ public void testWithoutHeaderOnBothSides() throws Exception {
+ List left = new ArrayList();
+ left.add("Left2");
+
+ List right = new ArrayList();
+ right.add("Right2");
+
+ List leftVal = new ArrayList();
+ leftVal.add("Left1");
+ leftVal.add("Left2");
+ leftVal.add("Left3");
+
+ List rightVal = new ArrayList();
+ rightVal.add("Right1");
+ rightVal.add("Right2");
+ rightVal.add("Right3");
+
+
+ TestAction testaction = (TestAction) action;
+ testaction.setCollection(left);
+ testaction.setList2(right);
+ testaction.setCollection2(leftVal);
+ testaction.setList3(rightVal);
+
+
+ OptionTransferSelectTag tag = new OptionTransferSelectTag();
+ tag.setPageContext(pageContext);
+
+ tag.setName("collection");
+ tag.setId("id");
+ tag.setList("collection2");
+ tag.setSize("20");
+ tag.setMultiple("true");
+ tag.setEmptyOption("true");
+
+ tag.setDoubleName("list2");
+ tag.setDoubleList("list3");
+ tag.setDoubleId("doubleId");
+ tag.setDoubleSize("20");
+ tag.setMultiple("true");
+ tag.setDoubleEmptyOption("true");
+
+ tag.setAllowAddAllToLeft("true");
+ tag.setAllowAddAllToRight("true");
+ tag.setAllowAddToLeft("true");
+ tag.setAllowAddToRight("true");
+ tag.setAllowSelectAll("true");
+
+ tag.setAddAllToLeftLabel("All Left");
+ tag.setAddAllToRightLabel("All Right");
+ tag.setAddToLeftLabel("Left");
+ tag.setAddToRightLabel("Right");
+ tag.setSelectAllLabel("Select All");
+
+ tag.setLeftTitle("Title Left");
+ tag.setRightTitle("Title Right");
+
+ tag.setButtonCssClass("buttonCssClass");
+ tag.setButtonCssStyle("buttonCssStyle");
+
+ tag.doStartTag();
+ tag.doEndTag();
+
+ //System.out.println(writer.toString());
+ verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-3.txt"));
+ }
+
+ public void testWithoutHeaderOnOneSide() throws Exception {
+ List left = new ArrayList();
+ left.add("Left2");
+
+ List right = new ArrayList();
+ right.add("Right2");
+
+ List leftVal = new ArrayList();
+ leftVal.add("Left1");
+ leftVal.add("Left2");
+ leftVal.add("Left3");
+
+ List rightVal = new ArrayList();
+ rightVal.add("Right1");
+ rightVal.add("Right2");
+ rightVal.add("Right3");
+
+
+ TestAction testaction = (TestAction) action;
+ testaction.setCollection(left);
+ testaction.setList2(right);
+ testaction.setCollection2(leftVal);
+ testaction.setList3(rightVal);
+
+
+ OptionTransferSelectTag tag = new OptionTransferSelectTag();
+ tag.setPageContext(pageContext);
+
+ tag.setName("collection");
+ tag.setId("id");
+ tag.setList("collection2");
+ tag.setSize("20");
+ tag.setMultiple("true");
+ tag.setEmptyOption("true");
+
+ tag.setDoubleName("list2");
+ tag.setDoubleList("list3");
+ tag.setDoubleId("doubleId");
+ tag.setDoubleSize("20");
+ tag.setMultiple("true");
+ tag.setDoubleEmptyOption("true");
+
+ tag.setAllowAddAllToLeft("true");
+ tag.setAllowAddAllToRight("true");
+ tag.setAllowAddToLeft("true");
+ tag.setAllowAddToRight("true");
+ tag.setAllowSelectAll("true");
+
+ tag.setAddAllToLeftLabel("All Left");
+ tag.setAddAllToRightLabel("All Right");
+ tag.setAddToLeftLabel("Left");
+ tag.setAddToRightLabel("Right");
+ tag.setSelectAllLabel("Select All");
+
+ tag.setLeftTitle("Title Left");
+ tag.setRightTitle("Title Right");
+
+ tag.setButtonCssClass("buttonCssClass");
+ tag.setButtonCssStyle("buttonCssStyle");
+
+ tag.setHeaderKey("Header Key");
+ tag.setHeaderValue("Header Value");
+
+ tag.doStartTag();
+ tag.doEndTag();
+
+ //System.out.println(writer.toString());
+ verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-4.txt"));
+ }
+
+ public void testWithoutEmptyOptionOnBothSides() throws Exception {
+ List left = new ArrayList();
+ left.add("Left2");
+
+ List right = new ArrayList();
+ right.add("Right2");
+
+ List leftVal = new ArrayList();
+ leftVal.add("Left1");
+ leftVal.add("Left2");
+ leftVal.add("Left3");
+
+ List rightVal = new ArrayList();
+ rightVal.add("Right1");
+ rightVal.add("Right2");
+ rightVal.add("Right3");
+
+
+ TestAction testaction = (TestAction) action;
+ testaction.setCollection(left);
+ testaction.setList2(right);
+ testaction.setCollection2(leftVal);
+ testaction.setList3(rightVal);
+
+
+ OptionTransferSelectTag tag = new OptionTransferSelectTag();
+ tag.setPageContext(pageContext);
+
+ tag.setName("collection");
+ tag.setId("id");
+ tag.setList("collection2");
+ tag.setSize("20");
+ tag.setMultiple("true");
+ tag.setEmptyOption("false");
+
+ tag.setDoubleName("list2");
+ tag.setDoubleList("list3");
+ tag.setDoubleId("doubleId");
+ tag.setDoubleSize("20");
+ tag.setMultiple("true");
+ tag.setDoubleEmptyOption("false");
+
+ tag.setAllowAddAllToLeft("true");
+ tag.setAllowAddAllToRight("true");
+ tag.setAllowAddToLeft("true");
+ tag.setAllowAddToRight("true");
+ tag.setAllowSelectAll("true");
+
+ tag.setAddAllToLeftLabel("All Left");
+ tag.setAddAllToRightLabel("All Right");
+ tag.setAddToLeftLabel("Left");
+ tag.setAddToRightLabel("Right");
+ tag.setSelectAllLabel("Select All");
+
+ tag.setLeftTitle("Title Left");
+ tag.setRightTitle("Title Right");
+
+ tag.setButtonCssClass("buttonCssClass");
+ tag.setButtonCssStyle("buttonCssStyle");
+
+ tag.setHeaderKey("Header Key");
+ tag.setHeaderValue("Header Value");
+
+ tag.setDoubleHeaderKey("Double Header Key");
+ tag.setDoubleHeaderValue("Double Header Value");
+
+ tag.doStartTag();
+ tag.doEndTag();
+
+ //System.out.println(writer.toString());
+ verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-5.txt"));
+ }
+
+ public void testWithoutEmptyOptionOnOneSide() throws Exception {
+ List left = new ArrayList();
+ left.add("Left2");
+
+ List right = new ArrayList();
+ right.add("Right2");
+
+ List leftVal = new ArrayList();
+ leftVal.add("Left1");
+ leftVal.add("Left2");
+ leftVal.add("Left3");
+
+ List rightVal = new ArrayList();
+ rightVal.add("Right1");
+ rightVal.add("Right2");
+ rightVal.add("Right3");
+
+
+ TestAction testaction = (TestAction) action;
+ testaction.setCollection(left);
+ testaction.setList2(right);
+ testaction.setCollection2(leftVal);
+ testaction.setList3(rightVal);
+
+
+ OptionTransferSelectTag tag = new OptionTransferSelectTag();
+ tag.setPageContext(pageContext);
+
+ tag.setName("collection");
+ tag.setId("id");
+ tag.setList("collection2");
+ tag.setSize("20");
+ tag.setMultiple("true");
+ tag.setEmptyOption("true");
+
+ tag.setDoubleName("list2");
+ tag.setDoubleList("list3");
+ tag.setDoubleId("doubleId");
+ tag.setDoubleSize("20");
+ tag.setMultiple("true");
+ tag.setDoubleEmptyOption("false");
+
+ tag.setAllowAddAllToLeft("true");
+ tag.setAllowAddAllToRight("true");
+ tag.setAllowAddToLeft("true");
+ tag.setAllowAddToRight("true");
+ tag.setAllowSelectAll("true");
+
+ tag.setAddAllToLeftLabel("All Left");
+ tag.setAddAllToRightLabel("All Right");
+ tag.setAddToLeftLabel("Left");
+ tag.setAddToRightLabel("Right");
+ tag.setSelectAllLabel("Select All");
+
+ tag.setLeftTitle("Title Left");
+ tag.setRightTitle("Title Right");
+
+ tag.setButtonCssClass("buttonCssClass");
+ tag.setButtonCssStyle("buttonCssStyle");
+
+ tag.setHeaderKey("Header Key");
+ tag.setHeaderValue("Header Value");
+
+ tag.setDoubleHeaderKey("Double Header Key");
+ tag.setDoubleHeaderValue("Double Header Value");
+
+ tag.doStartTag();
+ tag.doEndTag();
+
+ //System.out.println(writer.toString());
+ verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-6.txt"));
+ }
+
+ public void testDisableSomeButtons() throws Exception {
+ List left = new ArrayList();
+ left.add("Left2");
+
+ List right = new ArrayList();
+ right.add("Right2");
+
+ List leftVal = new ArrayList();
+ leftVal.add("Left1");
+ leftVal.add("Left2");
+ leftVal.add("Left3");
+
+ List rightVal = new ArrayList();
+ rightVal.add("Right1");
+ rightVal.add("Right2");
+ rightVal.add("Right3");
+
+
+ TestAction testaction = (TestAction) action;
+ testaction.setCollection(left);
+ testaction.setList2(right);
+ testaction.setCollection2(leftVal);
+ testaction.setList3(rightVal);
+
+
+ OptionTransferSelectTag tag = new OptionTransferSelectTag();
+ tag.setPageContext(pageContext);
+
+ tag.setName("collection");
+ tag.setId("id");
+ tag.setList("collection2");
+ tag.setSize("20");
+ tag.setMultiple("true");
+ tag.setEmptyOption("true");
+
+ tag.setDoubleName("list2");
+ tag.setDoubleList("list3");
+ tag.setDoubleId("doubleId");
+ tag.setDoubleSize("20");
+ tag.setMultiple("true");
+ tag.setDoubleEmptyOption("true");
+
+ tag.setAllowAddAllToLeft("false");
+ tag.setAllowAddAllToRight("false");
+ tag.setAllowAddToLeft("true");
+ tag.setAllowAddToRight("true");
+ tag.setAllowSelectAll("false");
+
+ tag.setAddAllToLeftLabel("All Left");
+ tag.setAddAllToRightLabel("All Right");
+ tag.setAddToLeftLabel("Left");
+ tag.setAddToRightLabel("Right");
+ tag.setSelectAllLabel("Select All");
+
+ tag.setLeftTitle("Title Left");
+ tag.setRightTitle("Title Right");
+
+ tag.setButtonCssClass("buttonCssClass");
+ tag.setButtonCssStyle("buttonCssStyle");
+
+ tag.setHeaderKey("Header Key");
+ tag.setHeaderValue("Header Value");
+
+ tag.setDoubleHeaderKey("Double Header Key");
+ tag.setDoubleHeaderValue("Double Header Value");
+
+ tag.doStartTag();
+ tag.doEndTag();
+
+ //System.out.println(writer.toString());
+ verify(OptionTransferSelectTagTest.class.getResource("optiontransferselect-7.txt"));
+ }
}
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/PasswordTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/PasswordTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/PasswordTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/PasswordTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;
@@ -27,28 +30,28 @@
/**
*/
public class RadioTest extends AbstractUITagTest {
-
- public void testMapWithBooleanAsKey() throws Exception {
- TestAction testAction = (TestAction) action;
-
- HashMap map = new LinkedHashMap();
- map.put(Boolean.TRUE, "male");
- map.put(Boolean.FALSE, "female");
- testAction.setMap(map);
-
- RadioTag tag = new RadioTag();
- tag.setPageContext(pageContext);
- tag.setLabel("mylabel");
- tag.setName("myname");
- tag.setValue("%{'true'}");
- tag.setList("map");
-
- tag.doStartTag();
- tag.doEndTag();
-
- verify(RadioTag.class.getResource("Radio-3.txt"));
- }
-
+
+ public void testMapWithBooleanAsKey() throws Exception {
+ TestAction testAction = (TestAction) action;
+
+ HashMap map = new LinkedHashMap();
+ map.put(Boolean.TRUE, "male");
+ map.put(Boolean.FALSE, "female");
+ testAction.setMap(map);
+
+ RadioTag tag = new RadioTag();
+ tag.setPageContext(pageContext);
+ tag.setLabel("mylabel");
+ tag.setName("myname");
+ tag.setValue("%{'true'}");
+ tag.setList("map");
+
+ tag.doStartTag();
+ tag.doEndTag();
+
+ verify(RadioTag.class.getResource("Radio-3.txt"));
+ }
+
public void testMapChecked() throws Exception {
TestAction testAction = (TestAction) action;
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/ResetTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/ResetTest.java?view=diff&rev=471756&r1=471755&r2=471756
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/ResetTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/ResetTest.java Mon Nov 6 07:01:43 2006
@@ -1,19 +1,22 @@
/*
* $Id$
*
- * Copyright 2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.struts2.views.jsp.ui;