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*.

Sure. You can fix those in a separate PR if you like :)


On Sat, Jun 7, 2014 at 6:10 PM, Matej Briskar <notifications@github.com>
wrote:

> In
> dev-tools-java/src/test/java/org/jboss/forge/addon/devtools/java/JavaEqualsHashcodeCommandTest.java:
>
> > +      createCommandController();
> > +
> > +      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"));
> > +   }
> > +
> > +   private void createTempProject()
>
> I copied these test methods from some parser-java commands. Should I fix
> them too?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/forge/core/pull/470/files#r13521667>.
>



-- 
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."