FORGE-1863: Create a GenerateHashcodeEquals command inside the dev-tools...

...-java addon.

After the command, it writes Success and works correctly (tested in the command line and the tests), however in the command line it also leaves an exception:
``` Exception when parsing/running: java-generate-equals-and-hashcode --targetClass org.First.First --fields myFirstField , org.jboss.forge.roaster.model.impl.JavaClassImpl cannot be cast to org.jboss.forge.addon.resource.Resource ```
The same happens for the command *java-generate-getters-and-setters*.

Great!


On Tue, Jun 10, 2014 at 2:40 PM, Matej Briskar <notifications@github.com>
wrote:

> In
> dev-tools-java/src/test/java/org/jboss/forge/addon/devtools/java/JavaEqualsHashcodeCommandTest.java:
>
> > +      commandController.initialize();
> > +      commandController.setValueFor("targetClass", "Test");
> > +      UISelectMany<String> component = (UISelectMany<String>) commandController.getInputs().get("fields");
> > +      Iterable<String> valueChoices = component.getValueChoices();
> > +      commandController.setValueFor("fields", valueChoices);
> > +      commandController.execute();
> > +      reloadTargetClass();
> > +
> > +      assertNotNull(targetClass.getField("id"));
> > +      assertTrue(targetClass.getField("id").isPrivate());
> > +      assertNotNull(targetClass.getMethod("equals", Object.class));
> > +      assertNotNull(targetClass.
> getMethod("hashCode"));
> > +   }
> > +
> > +   @Test
> > +   public void testHashCodeAndEqualsAlreadyInClass() throws Exception
>
> the test is already here, will add the check for overwriting.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/forge/core/pull/470/files#r13611121>.
>



-- 
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."