[forge-dev] JavaSourceClass parameter

George Gastaldi ggastald at redhat.com
Mon Jan 30 07:57:27 EST 2017


By using a UIInput, you need to specify the converter (setConverter - from
string to JavaClassSource) otherwise Forge wouldn't know what to do.

If you were using UISelectOne, it would be a matter of calling
testClass.setItemLabelConverter(JavaClassSource::getName) since Forge would
query the available valueChoices instead.

Em 30 de jan de 2017 10:22, "Alex Soto Bueno" <asotobue at redhat.com>
escreveu:

Hi mates,

currently I am creating a command that should receive a Test Java Class as
parameter.

I have created a command with an attribute of type JavaClassSource.

@Inject
   @WithAttributes(shortName = 'j', label = "Test Class", required = true)
   private UIInput<JavaClassSource> testClass;

Then when I try to run this command from CLI the first thing I have noted
is that autocompletition of the java class name does not work, and when I
set it manually typing all characters
i.e arquillian-algeron-create-contract-fragment --consumer consumer
--provider provider --fragment myFragment --test-class
org.contract.MyContract then I got No converter found from java.lang.String
to org.jboss.forge.roaster.model.source.JavaClassSource

I think that this is because it expects the class to be found as main java
classes and not test classes, any idea on why this is happening?

Thank you so much.
_______________________________________________
forge-dev mailing list
forge-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev


More information about the forge-dev mailing list