struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [3/5] struts git commit: WW-4210 Updates tests to use the class definition instead of string
Date Sat, 22 Apr 2017 15:42:25 GMT
WW-4210 Updates tests to use the class definition instead of string


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/ec241249
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/ec241249
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/ec241249

Branch: refs/heads/master
Commit: ec2412492503cdd0e90abf7f2cf2c3e50c8fa70c
Parents: 3e76564
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Thu Apr 20 08:29:53 2017 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Thu Apr 20 08:29:53 2017 +0200

----------------------------------------------------------------------
 .../xwork2/conversion/ConversionTestAction.java             | 9 +++++----
 .../com/opensymphony/xwork2/test/AnnotationDataAware.java   | 6 ++----
 .../com/opensymphony/xwork2/test/AnnotationTestBean2.java   | 5 ++---
 .../java/com/opensymphony/xwork2/test/AnnotationUser.java   | 4 ++--
 .../opensymphony/xwork2/test/annotations/PersonAction.java  | 4 ++--
 .../java/com/opensymphony/xwork2/util/AnnotatedCat.java     | 4 +---
 6 files changed, 14 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/ec241249/core/src/test/java/com/opensymphony/xwork2/conversion/ConversionTestAction.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/conversion/ConversionTestAction.java
b/core/src/test/java/com/opensymphony/xwork2/conversion/ConversionTestAction.java
index de743fe..d19aaf1 100644
--- a/core/src/test/java/com/opensymphony/xwork2/conversion/ConversionTestAction.java
+++ b/core/src/test/java/com/opensymphony/xwork2/conversion/ConversionTestAction.java
@@ -21,6 +21,7 @@ import com.opensymphony.xwork2.conversion.annotations.ConversionRule;
 import com.opensymphony.xwork2.conversion.annotations.ConversionType;
 import com.opensymphony.xwork2.conversion.annotations.TypeConversion;
 
+import java.math.BigInteger;
 import java.util.HashMap;
 import java.util.List;
 
@@ -49,7 +50,7 @@ public class ConversionTestAction implements Action {
         return convertInt;
     }
 
-    @TypeConversion(type = ConversionType.APPLICATION, converter = "com.opensymphony.xwork2.util.XWorkBasicConverter")
+    @TypeConversion(type = ConversionType.APPLICATION)
     public void setConvertInt( String convertInt ) {
         this.convertInt = convertInt;
     }
@@ -67,7 +68,7 @@ public class ConversionTestAction implements Action {
         return users;
     }
 
-    @TypeConversion(rule = ConversionRule.COLLECTION, converter = "java.lang.String")
+    @TypeConversion(rule = ConversionRule.COLLECTION, converterClass = String.class)
     public void setUsers( List users ) {
         this.users = users;
     }
@@ -76,7 +77,7 @@ public class ConversionTestAction implements Action {
         return keyValues;
     }
 
-    @TypeConversion(rule = ConversionRule.MAP, converter = "java.math.BigInteger")
+    @TypeConversion(rule = ConversionRule.MAP, converterClass = BigInteger.class)
     public void setKeyValues( HashMap keyValues ) {
         this.keyValues = keyValues;
     }
@@ -90,7 +91,7 @@ public class ConversionTestAction implements Action {
      *                   Application level exceptions should be handled by returning
      *                   an error value, such as Action.ERROR.
      */
-    @TypeConversion(type = ConversionType.APPLICATION, key = "java.util.Date", converter
= "com.opensymphony.xwork2.util.XWorkBasicConverter")
+    @TypeConversion(type = ConversionType.APPLICATION, key = "java.util.Date")
     public String execute() throws Exception {
         return SUCCESS;
     }

http://git-wip-us.apache.org/repos/asf/struts/blob/ec241249/core/src/test/java/com/opensymphony/xwork2/test/AnnotationDataAware.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/test/AnnotationDataAware.java b/core/src/test/java/com/opensymphony/xwork2/test/AnnotationDataAware.java
index fd63584..a30497b 100644
--- a/core/src/test/java/com/opensymphony/xwork2/test/AnnotationDataAware.java
+++ b/core/src/test/java/com/opensymphony/xwork2/test/AnnotationDataAware.java
@@ -17,6 +17,7 @@ package com.opensymphony.xwork2.test;
 
 import com.opensymphony.xwork2.conversion.annotations.Conversion;
 import com.opensymphony.xwork2.conversion.annotations.TypeConversion;
+import com.opensymphony.xwork2.conversion.impl.FooBarConverter;
 import com.opensymphony.xwork2.util.Bar;
 import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;
 import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
@@ -29,15 +30,12 @@ import com.opensymphony.xwork2.validator.annotations.Validation;
  * @author Mark Woon
  * @author Rainer Hermanns
  */
-@Validation()
 @Conversion()
 public interface AnnotationDataAware {
 
     void setBarObj(Bar b);
 
-    @TypeConversion(
-            converter = "com.opensymphony.xwork2.conversion.impl.FooBarConverter"
-    )
+    @TypeConversion(converterClass = FooBarConverter.class)
     Bar getBarObj();
 
     @RequiredFieldValidator(message = "You must enter a value for data.")

http://git-wip-us.apache.org/repos/asf/struts/blob/ec241249/core/src/test/java/com/opensymphony/xwork2/test/AnnotationTestBean2.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/test/AnnotationTestBean2.java b/core/src/test/java/com/opensymphony/xwork2/test/AnnotationTestBean2.java
index 3a1396b..ccd5ec1 100644
--- a/core/src/test/java/com/opensymphony/xwork2/test/AnnotationTestBean2.java
+++ b/core/src/test/java/com/opensymphony/xwork2/test/AnnotationTestBean2.java
@@ -18,6 +18,7 @@ package com.opensymphony.xwork2.test;
 import com.opensymphony.xwork2.AnnotatedTestBean;
 import com.opensymphony.xwork2.conversion.annotations.Conversion;
 import com.opensymphony.xwork2.conversion.annotations.TypeConversion;
+import com.opensymphony.xwork2.conversion.impl.FooBarConverter;
 import com.opensymphony.xwork2.util.Bar;
 import com.opensymphony.xwork2.util.Cat;
 
@@ -56,9 +57,7 @@ public class AnnotationTestBean2 extends AnnotatedTestBean implements Annotation
         return cat;
     }
 
-    @TypeConversion(
-            key = "cat", converter = "com.opensymphony.xwork2.conversion.impl.FooBarConverter"
-    )
+    @TypeConversion(key = "cat", converterClass = FooBarConverter.class)
     public void setCat(Cat cat) {
         this.cat = cat;
     }

http://git-wip-us.apache.org/repos/asf/struts/blob/ec241249/core/src/test/java/com/opensymphony/xwork2/test/AnnotationUser.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/test/AnnotationUser.java b/core/src/test/java/com/opensymphony/xwork2/test/AnnotationUser.java
index be2f863..fbf3535 100644
--- a/core/src/test/java/com/opensymphony/xwork2/test/AnnotationUser.java
+++ b/core/src/test/java/com/opensymphony/xwork2/test/AnnotationUser.java
@@ -82,12 +82,12 @@ public class AnnotationUser implements AnnotationUserMarker {
     }
 
     @KeyProperty( value = "name")
-    @TypeConversion( converter = "java.lang.String", rule = ConversionRule.COLLECTION)
+    @TypeConversion(converterClass = String.class, rule = ConversionRule.COLLECTION)
     public List getList() {
         return list;
     }
 
-    @TypeConversion( converter = "java.lang.String", rule = ConversionRule.MAP)
+    @TypeConversion(converterClass = String.class, rule = ConversionRule.MAP)
     public void setMap(Map m) {
         map = m;
     }

http://git-wip-us.apache.org/repos/asf/struts/blob/ec241249/core/src/test/java/com/opensymphony/xwork2/test/annotations/PersonAction.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/test/annotations/PersonAction.java
b/core/src/test/java/com/opensymphony/xwork2/test/annotations/PersonAction.java
index 72e20ef..c4a6c40 100644
--- a/core/src/test/java/com/opensymphony/xwork2/test/annotations/PersonAction.java
+++ b/core/src/test/java/com/opensymphony/xwork2/test/annotations/PersonAction.java
@@ -11,10 +11,10 @@ import java.util.List;
 	conversions={
 		@TypeConversion(type=ConversionType.APPLICATION,
 						key="com.opensymphony.xwork2.test.annotations.Address",
-						converter="com.opensymphony.xwork2.test.annotations.AddressTypeConverter"),
+						converterClass=AddressTypeConverter.class),
 		@TypeConversion(type=ConversionType.APPLICATION,
 						key="com.opensymphony.xwork2.test.annotations.Person",
-						converter="com.opensymphony.xwork2.test.annotations.PersonTypeConverter")})
+						converterClass=PersonTypeConverter.class)})
 public class PersonAction {
 	List<Person> users;
 	private List<Address> address;

http://git-wip-us.apache.org/repos/asf/struts/blob/ec241249/core/src/test/java/com/opensymphony/xwork2/util/AnnotatedCat.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/util/AnnotatedCat.java b/core/src/test/java/com/opensymphony/xwork2/util/AnnotatedCat.java
index 5733159..fdb0a50 100644
--- a/core/src/test/java/com/opensymphony/xwork2/util/AnnotatedCat.java
+++ b/core/src/test/java/com/opensymphony/xwork2/util/AnnotatedCat.java
@@ -50,9 +50,7 @@ public class AnnotatedCat {
         this.kittens = kittens;
     }
 
-    @TypeConversion(
-            key = "kittens", converter = "com.opensymphony.xwork2.util.Cat"
-    )
+    @TypeConversion(key = "kittens", converterClass = Cat.class)
     public List getKittens() {
         return kittens;
     }


Mime
View raw message