[forge-dev] FacetNotFoundException after setup in tests
Rafael Pestano
rmpestano at gmail.com
Sun Sep 20 13:39:50 EDT 2015
There is any hint to run tests faster? I noticed that tests are running
much slower than in Forge 1 where I could run 60 (IT)tests
<https://github.com/rmpestano/intrabundle/tree/master/src/test/java/br/ufrgs/rmpestano/intrabundle/plugin>
in less then 1 minute and now in current Forge runtime it takes 1:30 sec
to run 5 tests.
2015-09-20 14:35 GMT-03:00 Rafael Pestano <rmpestano at gmail.com>:
> yeap, that explains much things hehe
>
> thanks George!
>
> 2015-09-20 13:59 GMT-03:00 George Gastaldi <ggastald at redhat.com>:
>
>> Hi Rafael,
>>
>> Judging by your code in
>> https://github.com/rmpestano/swagger-addon/blob/master/src/main/java/com/tdc/addon/swagger/facet/SwaggerFacetImpl.java,
>> it looks like copyResources() is throwing an UnsupportedOperationException,
>> making it impossible to complete the install() method.
>>
>>
>> Em domingo, 20 de setembro de 2015, Rafael Pestano <rmpestano at gmail.com>
>> escreveu:
>>
>>> Hi guys.
>>>
>>>
>>> I'm facing a problem when testing an addon setup command, here is some
>>> code:
>>>
>>>
>>>
>>> @Test
>>> public void testSwaggerSetup() throws Exception {
>>> //facetFactory.install(project, SwaggerFacet.class);
>>> try (CommandController controller = uiTestHarness.createCommandController(SwaggerSetupCommand.class,
>>> project.getRoot())) {
>>> controller.initialize();
>>> Assert.assertTrue(controller.isValid());
>>> final AtomicBoolean flag = new AtomicBoolean();
>>> controller.getContext().addCommandExecutionListener(new AbstractCommandExecutionListener() {
>>> @Override
>>> public void postCommandExecuted(UICommand command, UIExecutionContext context, Result result) {
>>> if (result.getMessage().equals("Swagger setup completed successfully!")) {
>>> flag.set(true);
>>> }
>>> }
>>> });
>>> controller.execute();
>>> Assert.assertTrue(flag.get());
>>> SwaggerFacet facet = project.getFacet(SwaggerFacet.class);
>>> Assert.assertTrue(facet.isInstalled());
>>>
>>>
>>>
>>> I receive 'No Facet of type [interface
>>> com.tdc.addon.swagger.facet.SwaggerFacet] is installed.
>>> org.jboss.forge.addon.facets.FacetNotFoundException'" when i try to get
>>> facet:
>>>
>>> project.getFacet(SwaggerFacet.class);
>>>
>>>
>>> if I uncomment "facetFactory.install(project, SwaggerFacet.class);" the
>>> test passes.
>>>
>>> I've debuged setup command and the facet is installed (temp project pom
>>> is updated after setup) and 'flag.get()' returns true.
>>>
>>> Any hints?
>>>
>>> souces are here:
>>> https://github.com/rmpestano/swagger-addon/blob/master/src/test/java/com/tdc/swagger/addon/SwaggerSetupCommandTest.java
>>> <https://github.com/rmpestano/swagger-addon/blob/master/src/test/java/com/tdc/swagger/addon/SwaggerSetupCommandTest.java#L111>
>>>
>>> thanks in advance.
>>>
>>>
>>> --
>>> <http://www.advancedit.com.br/>Att,
>>>
>>> Rafael M. Pestano
>>>
>>> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>> http://rpestano.wordpress.com/
>>> @realpestano <https://twitter.com/realpestano>
>>>
>>
>>
>> --
>> *George Gastaldi | Senior Software Engineer*
>>
>> JBoss Forge Team
>> T: +55 11 3524-6169
>> M: +55 47 9711-1000
>>
>>
>> _______________________________________________
>> forge-dev mailing list
>> forge-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>
>
>
>
> --
> <http://www.advancedit.com.br/>Att,
>
> Rafael M. Pestano
>
> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> http://rpestano.wordpress.com/
> @realpestano <https://twitter.com/realpestano>
>
--
<http://www.advancedit.com.br/>Att,
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
http://rpestano.wordpress.com/
@realpestano <https://twitter.com/realpestano>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20150920/2e1c3569/attachment-0001.html
More information about the forge-dev
mailing list