[arquillian-issues] [JBoss JIRA] (ARQGRA-433) FieldAccessValidatorEnricher checks access to fields uniformly

Juraj Húska (JIRA) issues at jboss.org
Tue Apr 1 06:17:13 EDT 2014


    [ https://issues.jboss.org/browse/ARQGRA-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12958020#comment-12958020 ] 

Juraj Húska edited comment on ARQGRA-433 at 4/1/14 6:15 AM:
------------------------------------------------------------

[~lfryc] I would like to propose stop using of this enricher. IMHO not permitting public fields is too strict. Tests are more readable when public fields are in place, and lot of people are using them in tests.

Afaik we wanted to drop support for public fields all together ARQGRA-337. The reason is written there, however, I think that we have a workaround in place, which works quite good. (enriching test two times ?).

Do we still want this ? And in which release ?
                
      was (Author: jhuska):
    [~lfryc] I would like to propose stop using of this enricher. IMHO not permitting public fields is too strict. Tests are more readable when public fields are in place, and lot of people are using them in tests.

Afaik we wanted to drop support for public fields all together. If I am correct it is mainly to enhance performance (test would not be needed to be enriched two times).

Do we still want this ? And in which release ?
                  
> FieldAccessValidatorEnricher checks access to fields uniformly
> --------------------------------------------------------------
>
>                 Key: ARQGRA-433
>                 URL: https://issues.jboss.org/browse/ARQGRA-433
>             Project: Arquillian Graphene
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.2.Final
>            Reporter: Stefan Miklosovic
>            Priority: Optional
>
> I have this test
> {code}
>     @Rule
>     public ExpectedException expectedException = ExpectedException.none();
>     @Test
>     @InSequence(2)
>     @ReportMessage("This method should pass.")
>     public void testWithExpectedExceptionRule() {
>         expectedException.expect(RuntimeException.class);
>         throw new RuntimeException("this exception is expected");
>     }
> {code}
> Logger writes this out:
> WARNING: Public field 'expectedException' found in org.arquillian.droidium.devconf.AeroGearTestCase. Direct access to fields outside of the declaring class is not allowed.
> Apr 01, 2014 11:50:27 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
> However that @Rule field _has to be_ public
> {quote}
> A field must be public, not static, and a subtype of TestRule
> {quote}
> So in this case  validation does not make sense.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the arquillian-issues mailing list