From: <iro...@us...> - 2009-09-25 21:30:18
|
Revision: 159 http://pojomatic.svn.sourceforge.net/pojomatic/?rev=159&view=rev Author: iroberts Date: 2009-09-25 21:29:50 +0000 (Fri, 25 Sep 2009) Log Message: ----------- clean up eclipse warnings Modified Paths: -------------- trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/EqualsInheritanceTest.java trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java Modified: trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java =================================================================== --- trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java 2009-09-19 17:02:30 UTC (rev 158) +++ trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/ClassPropertiesTest.java 2009-09-25 21:29:50 UTC (rev 159) @@ -54,8 +54,9 @@ @Test public void testAnnotatedMethods() throws Exception { class MethodPojo { - @Property public int getInt() { return 0; } + @SuppressWarnings("unused") @Property public int getInt() { return 0; } @Property @SuppressWarnings("unused") private String privateString() { return null; } + @SuppressWarnings("unused") @Property(policy=PojomaticPolicy.EQUALS) public double onlyForEquals() { return 0.0; } } @@ -96,13 +97,16 @@ @Test(expected=IllegalArgumentException.class) public void testAnnotatedMethodReturningVoid() { - class MethodReturnsVoidPojo { @Property public void noReturn() {} } + class MethodReturnsVoidPojo { @SuppressWarnings("unused") @Property public void noReturn() {} } new ClassProperties(MethodReturnsVoidPojo.class); } @Test(expected=IllegalArgumentException.class) public void testAnnotatedMethodTakingArgs() { - class MethodTakesArgsPojo { @Property public int takesArgs(String death) { return death.length(); } } + class MethodTakesArgsPojo { + @SuppressWarnings("unused") @Property public int takesArgs(String death) { + return death.length(); } + } new ClassProperties(MethodTakesArgsPojo.class); } @@ -143,7 +147,7 @@ @AutoProperty(autoDetect=AutoDetectPolicy.METHOD) class ChildAutoMethodPojo extends ParentPojo { @Override public int getFoo() { return 2; } - public int getBar() { return 2; } + @SuppressWarnings("unused") public int getBar() { return 2; } } ClassProperties childClassProperties = new ClassProperties(ChildAutoMethodPojo.class); @@ -154,13 +158,13 @@ assertEquals(expected, asSet(childClassProperties.getHashCodeProperties())); assertEquals(expected, asSet(childClassProperties.getToStringProperties())); } - + @Test public void testAutoInheritanceAnnotatedParent() throws Exception { @AutoProperty(autoDetect=AutoDetectPolicy.METHOD) class ChildExtendsAnnotatedPojo extends ParentPojo { @Override public int getFoo() { return 0; } - public String getMyString() { return "foo"; } + @SuppressWarnings("unused") public String getMyString() { return "foo"; } } Set<PropertyElement> expectedParent = asSet(TestUtils.method(ParentPojo.class, "getFoo")); @@ -181,9 +185,9 @@ @Test public void testAutoInheritanceAutoParentAnnotatedChild() throws Exception { class ChildExtendsAutoPojo extends ParentAutoPojo { - @Property public String other; + @SuppressWarnings("unused") @Property public String other; @Override public int getFoo() { return 2; } - public String getBar() { return ""; } + @SuppressWarnings("unused") public String getBar() { return ""; } } Set<PropertyElement> expectedParent = asSet(TestUtils.method(ParentAutoPojo.class, "getFoo")); @@ -202,7 +206,7 @@ assertEquals(expectedChild, asSet(childClassProperties.getHashCodeProperties())); assertEquals(expectedChild, asSet(childClassProperties.getToStringProperties())); } - + @Test public void testAnnotatedStaticField() { try { @@ -211,7 +215,7 @@ } catch (IllegalArgumentException e) { assertEquals( - "Static field " + StaticField.class.getName() + ".a is annotated with @Property", + "Static field " + StaticField.class.getName() + ".a is annotated with @Property", e.getMessage()); } } @@ -224,11 +228,11 @@ } catch (IllegalArgumentException e) { assertEquals( - "Static method " + StaticMethod.class.getName() + ".a() is annotated with @Property", + "Static method " + StaticMethod.class.getName() + ".a() is annotated with @Property", e.getMessage()); } } - + @Test public void testInterface() throws Exception { ClassProperties classProperties = new ClassProperties(Interface.class); PropertyElement getFoo = TestUtils.method(Interface.class, "getFoo"); Modified: trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/EqualsInheritanceTest.java =================================================================== --- trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/EqualsInheritanceTest.java 2009-09-19 17:02:30 UTC (rev 158) +++ trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/EqualsInheritanceTest.java 2009-09-25 21:29:50 UTC (rev 159) @@ -8,7 +8,7 @@ public class EqualsInheritanceTest { private static class Parent { - @Property int x = 3; + @SuppressWarnings("unused") @Property int x = 3; @Override public boolean equals(Object obj) { @@ -30,7 +30,7 @@ } @Test public void testChildWithNewProperty() { - class Child extends Parent { @Property int y = 4; } + class Child extends Parent { @SuppressWarnings("unused") @Property int y = 4; } Child child = new Child(); Pojomator<Child> childPojomator = new PojomatorImpl<Child>(Child.class); Modified: trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java =================================================================== --- trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java 2009-09-19 17:02:30 UTC (rev 158) +++ trunk/PojomaticAll/Pojomatic/src/test/java/org/pojomatic/internal/PojomatorImplTest.java 2009-09-25 21:29:50 UTC (rev 159) @@ -86,7 +86,7 @@ @Test public void testObjectArrayPropertyEquals() { class StringArrayProperty { public StringArrayProperty(String... strings) { this.strings = strings; } - @Property String[] strings; + @SuppressWarnings("unused") @Property String[] strings; } Pojomator<StringArrayProperty> STRING_ARRAY_PROPERTY_POJOMATOR = makePojomatorImpl(StringArrayProperty.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |