Hi Ivan,
The faceted object assigned in the facet instance will only be set when you
install a facet (using the FacetFactory).
The facet values in the UISelectOne can only be used after they are
installed in a given project.
Therefore, as a rule of thumb, don't expect the faceted object to be set on
the Facet objects returned from UISelectOne.getValueChoices unless they are
explicitly installed in the faceted project (eg FacetFactory.install() is
called).
Best Regards,
George Gastaldi
Em 15/02/2016 20:02, "Ivan St. Ivanov" <ivan.st.ivanov(a)gmail.com>
escreveu:
Hey everybody,
I am trying to add a test for the TestingSetupCommand, part of the testing
addon, that I want to develop. What is particular about this command and
the addon:
- They use the simple furnace container instead of cdi
- The command has UISelectOne input which values are supposed to be
implementations of the TestingFacet interface (JUnitTestingFacet and
TestNGTestingFacet)
The testing facet base class that is extended by both facet
implementations has a method that returns the dependency facet of the
currently selected project:
private DependencyFacet getDependencyFacet()
{
return getFaceted().getFacet(DependencyFacet.class);
}
And this method works fine when it is called when the test sets up the
test project. However, when I "select" a testing framework form the
UISelectOne, the value that I get back (in my case TestNGTestingFacet) does
not have a valid origin field (it's null). Is it possible that upon setup
the UISelectOne's items are not initialized properly?
You can check the code in my repository:
https://github.com/ivannov/core/tree/FORGE-2545
Just put a breakpoint in AbstractTestingFacet::getDependencyFacet and run
TestSetupCommandTest::testSetupTestNG. Check the content of the
getFaceted() return value.
Thanks,
Ivan
_______________________________________________
forge-dev mailing list
forge-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev