[webbeans-issues] [JBoss JIRA] Commented: (WBRI-33) ComponentMetaModelTest is failing
by Pete Muir (JIRA)
[ https://jira.jboss.org/jira/browse/WBRI-33?page=com.atlassian.jira.plugin... ]
Pete Muir commented on WBRI-33:
-------------------------------
Please *do* some research before posting incorrect assertions like this, as otherwise you are wasting everyones time. As you are too lazy to actually look at the spec, read 2.4.5, point 3.
> //this name says you are looking for a exception
Of course it doesn't, it says I'm testing what happens with multiple incompatible scopes specified on stereotypes, with the scoped specified on the the component (as you can see from the code).
> // because you cant have RequestedScope and Application scope, so, i think my patch failed because it did right thing.
Where does the spec assert this? In fact, where does the test even specify this.
> ComponentMetaModelTest is failing
> ---------------------------------
>
> Key: WBRI-33
> URL: https://jira.jboss.org/jira/browse/WBRI-33
> Project: Web Beans RI
> Issue Type: Bug
> Affects Versions: 1.0.0.EDR2
> Environment: JDK 1.6
> Windows Vista
> JUnit 4.4
> Reporter: Diego Coronel
> Assignee: Pete Muir
> Attachments: ComponentMetaModelTestPatch.patch
>
>
> Test "testMutipleIncompatibleScopeStereotypesWithScopeSpecified" isnt correct, it was waiting a scope but the correct is check if AbstractComponentModel is going to throw RuntimeException.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 6 months
[webbeans-issues] [JBoss JIRA] Commented: (WBRI-33) ComponentMetaModelTest is failing
by Diego Coronel (JIRA)
[ https://jira.jboss.org/jira/browse/WBRI-33?page=com.atlassian.jira.plugin... ]
Diego Coronel commented on WBRI-33:
-----------------------------------
hey,
Sry, but i think my patch is right, can you confirm this?
In your code in class ComponentMetaModelTest you have a method: testMutipleIncompatibleScopeStereotypesWithScopeSpecified, pls ready my comment in your code:
@Test
//this name says you are looking for a exception
public void testMutipleIncompatibleScopeStereotypesWithScopeSpecified()
{
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
// FishStereotypeBinding extends RiverFishStereotype that is @ApplicationScoped
annotations.put(FishStereotype.class, new FishStereotypeBinding());
// AnimalStereotypeBinding extends AnimalStereotype that is @RequestScoped
annotations.put(AnimalStereotype.class, new AnimalStereotypeBinding());
// and both annotations are in same Map
AnnotatedItem annotatedItem = new MutableAnnotatedItem(SeaBass.class, annotations);
// so, probably at you class AbstractComponentModel in method initScopeType your code should throws
//else if (stereotypes.getPossibleScopeTypes().size() > 1)
// {
// throw new RuntimeException("All stereotypes must specify the same scope OR a scope must be specified on the component");
// }
// because you cant have RequestedScope and Application scope, so, i think my patch failed because it did right thing.
// sry about complexity of my patch WBRI-34, i tried to extract some codes to a private method and use the superclass to make all logic
SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new ClassAnnotatedItem(SeaBass.class), annotatedItem, container);
assert trout.getScopeType().annotationType().equals(RequestScoped.class);
}
Is my logic correct? if not, pls can you explain.
> ComponentMetaModelTest is failing
> ---------------------------------
>
> Key: WBRI-33
> URL: https://jira.jboss.org/jira/browse/WBRI-33
> Project: Web Beans RI
> Issue Type: Bug
> Affects Versions: 1.0.0.EDR2
> Environment: JDK 1.6
> Windows Vista
> JUnit 4.4
> Reporter: Diego Coronel
> Assignee: Pete Muir
> Attachments: ComponentMetaModelTestPatch.patch
>
>
> Test "testMutipleIncompatibleScopeStereotypesWithScopeSpecified" isnt correct, it was waiting a scope but the correct is check if AbstractComponentModel is going to throw RuntimeException.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 6 months