package org.simpleframework.xml.load;

import org.simpleframework.xml.Element;
import org.simpleframework.xml.Order;
import org.simpleframework.xml.Transient;
import org.simpleframework.xml.ValidationTestCase;

public class RedundantOrderTest extends ValidationTestCase {

   @Order(elements={"a", "b", "c"})
   public static class ElementEntry {
      
      @Element
      private String a;
      
      @Element
      private String b;
      
      @Transient
      private String c;
      
      private ElementEntry() {
         super();
      }
      
      public ElementEntry(String a, String b, String c) {
         this.a = a;
         this.b = b;
         this.c = c;
      }
   }
   

   @Order(attributes={"a", "b", "c"})
   public static class AttributeEntry {
      
      @Element
      private String a;
      
      @Element
      private String b;
      
      @Transient
      private String c;
      
      private AttributeEntry() {
         super();
      }
      
      public AttributeEntry(String a, String b, String c) {
         this.a = a;
         this.b = b;
         this.c = c;
      }
   }
   
   public void testRedundantElementOrder() throws Exception {
      ElementEntry entry = new ElementEntry("a", "b", "c");
      Persister persister = new Persister();
      boolean exception = false;
      
      try {
         validate(entry, persister);
      }catch(ElementException e) {
         exception = true;
      }
      assertTrue(exception);
   }
   
   public void testRedundantAttributeOrder() throws Exception {
      AttributeEntry entry = new AttributeEntry("a", "b", "c");
      Persister persister = new Persister();
      boolean exception = false;
      
      try {
         validate(entry, persister);
      }catch(AttributeException e) {
         exception = true;
      }
      assertTrue(exception);
   }
}

@@ -32,16 +32,58 @@
 .load;%0A%0A
+import org.simpleframework.xml.Attribute;%0A
 import o
@@ -110,24 +110,24 @@
 ml.Element;%0A
-
 import org.s
@@ -816,39 +816,41 @@
 %7B%0A      %0A      @
-Element
+Attribute
 %0A      private S
@@ -864,39 +864,41 @@
 ;%0A      %0A      @
-Element
+Attribute
 %0A      private S
@@ -1450,32 +1450,62 @@
 tException e) %7B%0A
+         e.printStackTrace();%0A
          excepti
@@ -1815,32 +1815,32 @@
 ry, persister);%0A
-
       %7Dcatch(Att
@@ -1852,32 +1852,62 @@
 eException e) %7B%0A
+         e.printStackTrace();%0A
          excepti

Update the test for order validation