equal
deleted
inserted
replaced
36 * @bug 8132973 8132732 8155013 8154958 |
36 * @bug 8132973 8132732 8155013 8154958 |
37 * @summary Some check for BeanProperty annotation |
37 * @summary Some check for BeanProperty annotation |
38 * @author a.stepanov |
38 * @author a.stepanov |
39 * @run main AnonymousClassBeanPropertyTest |
39 * @run main AnonymousClassBeanPropertyTest |
40 */ |
40 */ |
41 |
41 //TODO in final revision each test should have only one checkInfo/checkAlternate |
42 |
|
43 public class AnonymousClassBeanPropertyTest { |
42 public class AnonymousClassBeanPropertyTest { |
44 |
43 |
45 private final static String DESCRIPTION = "TEST"; |
44 private final static String DESCRIPTION = "TEST"; |
46 private final static boolean BOUND = true; |
45 private final static boolean BOUND = true; |
47 private final static boolean EXPERT = false; |
46 private final static boolean EXPERT = false; |
653 }; |
652 }; |
654 ok = checkInfo(testGetSet_2.getClass(), "IGetSet-2", true); |
653 ok = checkInfo(testGetSet_2.getClass(), "IGetSet-2", true); |
655 System.out.println("OK = " + ok); |
654 System.out.println("OK = " + ok); |
656 passed = passed && ok; |
655 passed = passed && ok; |
657 |
656 |
658 // TODO: please uncomment/update after 8132973 fix |
|
659 /* |
|
660 IGetSet testGetSet_3 = new IGetSet() { |
657 IGetSet testGetSet_3 = new IGetSet() { |
661 |
658 |
662 private double x; |
659 private double x; |
663 |
660 |
664 @Override |
661 @Override |
686 public void addPropertyChangeListener(PropertyChangeListener l) {} |
683 public void addPropertyChangeListener(PropertyChangeListener l) {} |
687 public void removePropertyChangeListener(PropertyChangeListener l) {} |
684 public void removePropertyChangeListener(PropertyChangeListener l) {} |
688 }; |
685 }; |
689 ok = checkInfo(testGetSet_3.getClass(), "IGetSet-3", true); |
686 ok = checkInfo(testGetSet_3.getClass(), "IGetSet-3", true); |
690 System.out.println("OK = " + ok); |
687 System.out.println("OK = " + ok); |
691 ok2 = checkAlternativeInfo(testGetSet_3.getClass(), "IGetSet-3"); |
688 passed = passed && ok; |
692 System.out.println("OK = " + ok2); |
|
693 passed = passed && (ok || ok2); |
|
694 */ |
|
695 |
689 |
696 //---------------------------------------------------------------------- |
690 //---------------------------------------------------------------------- |
697 |
691 |
698 IGetSetByIndex testGetSetByIndex_1 = new IGetSetByIndex() { |
692 IGetSetByIndex testGetSetByIndex_1 = new IGetSetByIndex() { |
699 |
693 |
744 }; |
738 }; |
745 ok = checkInfo(testGetSetByIndex_2.getClass(), "IGetSetByIndex-2", true); |
739 ok = checkInfo(testGetSetByIndex_2.getClass(), "IGetSetByIndex-2", true); |
746 System.out.println("OK = " + ok); |
740 System.out.println("OK = " + ok); |
747 passed = passed && ok; |
741 passed = passed && ok; |
748 |
742 |
749 // TODO: please uncomment/update after 8132973 fix |
|
750 /* |
|
751 IGetSetByIndex testGetSetByIndex_3 = new IGetSetByIndex() { |
743 IGetSetByIndex testGetSetByIndex_3 = new IGetSetByIndex() { |
752 |
744 |
753 private double x[] = {X, X}; |
745 private double x[] = {X, X}; |
754 |
746 |
755 @BeanProperty( |
747 @BeanProperty( |
781 public void addPropertyChangeListener(PropertyChangeListener l) {} |
773 public void addPropertyChangeListener(PropertyChangeListener l) {} |
782 public void removePropertyChangeListener(PropertyChangeListener l) {} |
774 public void removePropertyChangeListener(PropertyChangeListener l) {} |
783 }; |
775 }; |
784 ok = checkInfo(testGetSetByIndex_3.getClass(), "IGetSetByIndex-3", true); |
776 ok = checkInfo(testGetSetByIndex_3.getClass(), "IGetSetByIndex-3", true); |
785 System.out.println("OK = " + ok); |
777 System.out.println("OK = " + ok); |
786 ok2 = checkAlternativeInfo( |
778 passed = passed && ok; |
787 testGetSetByIndex_3.getClass(), "IGetSetByIndex-3"); |
|
788 System.out.println("OK = " + ok2); |
|
789 passed = passed && (ok || ok2); |
|
790 */ |
|
791 |
779 |
792 //---------------------------------------------------------------------- |
780 //---------------------------------------------------------------------- |
793 |
781 |
794 // TODO: please uncomment/update after 8155013 fix |
782 // TODO: please uncomment/update after 8155013 fix |
795 /* |
783 /* |
853 ok = checkInfo(testGetSetBoth_2.getClass(), "IGetSetBoth-2", true); |
841 ok = checkInfo(testGetSetBoth_2.getClass(), "IGetSetBoth-2", true); |
854 System.out.println("OK = " + ok); |
842 System.out.println("OK = " + ok); |
855 passed = passed && ok; |
843 passed = passed && ok; |
856 */ |
844 */ |
857 |
845 |
858 // TODO: please uncomment/update after 8132973 fix |
846 // TODO: please uncomment/update after 8155013 fix |
859 /* |
847 /* |
860 IGetSetBoth testGetSetBoth_3 = new IGetSetBoth() { |
848 IGetSetBoth testGetSetBoth_3 = new IGetSetBoth() { |
861 |
849 |
862 private double x[] = {X, X}; |
850 private double x[] = {X, X}; |
863 |
851 |
976 System.out.println("OK = " + ok); |
964 System.out.println("OK = " + ok); |
977 ok2 = checkAlternativeInfo(testIs_3.getClass(), "IIs-3"); |
965 ok2 = checkAlternativeInfo(testIs_3.getClass(), "IIs-3"); |
978 System.out.println("OK = " + ok2); |
966 System.out.println("OK = " + ok2); |
979 passed = passed && (ok || ok2); |
967 passed = passed && (ok || ok2); |
980 |
968 |
981 // TODO: please uncomment/update after 8132973 fix |
|
982 /* |
|
983 IIs testIs_4 = new IIs() { |
969 IIs testIs_4 = new IIs() { |
984 |
970 |
985 private boolean b; |
971 private boolean b; |
986 |
972 |
987 @BeanProperty( |
973 @BeanProperty( |
1008 public void addPropertyChangeListener(PropertyChangeListener l) {} |
994 public void addPropertyChangeListener(PropertyChangeListener l) {} |
1009 public void removePropertyChangeListener(PropertyChangeListener l) {} |
995 public void removePropertyChangeListener(PropertyChangeListener l) {} |
1010 }; |
996 }; |
1011 ok = checkInfo(testIs_4.getClass(), "IIs-4", false); |
997 ok = checkInfo(testIs_4.getClass(), "IIs-4", false); |
1012 System.out.println("OK = " + ok); |
998 System.out.println("OK = " + ok); |
1013 ok2 = checkAlternativeInfo(testIs_4.getClass(), "IIs-4"); |
999 passed = passed && ok; |
1014 System.out.println("OK = " + ok2); |
|
1015 passed = passed && (ok || ok2); |
|
1016 */ |
|
1017 |
|
1018 |
1000 |
1019 //---------------------------------------------------------------------- |
1001 //---------------------------------------------------------------------- |
1020 |
1002 |
1021 |
1003 |
1022 if (!passed) { throw new RuntimeException("test failed"); } |
1004 if (!passed) { throw new RuntimeException("test failed"); } |