[
https://issues.jboss.org/browse/FORGE-1209?page=com.atlassian.jira.plugin...
]
George Gastaldi updated FORGE-1209:
-----------------------------------
Description:
Imported.isSatisfied returns true for objects without an active context.
eg:
{code:java}
@CommandScoped
public class CommandScopedModel
{code}
The following test fails:
Having :
{code:java}
@Inject
private Imported<CommandScopedModel> modelInstance;
{code}
Considering that the custom scope context is implemented correctly, the following code
fails in the first assertion:
{code:java}
@Test
public void testImportedWithCustomScope() throws Exception
{
Assert.assertFalse("Should not be satisfied since there is no Context in
scope", modelInstance.isSatisfied());
Assert.assertTrue(wizardTester.isValid());
Assert.assertTrue("Should be satisfied since there command context was
initialized", modelInstance.isSatisfied());
wizardTester.finish(null);
Assert.assertFalse("Should not be satisfied since there is no Context in scope
after finish is called",
modelInstance.isSatisfied());
}
{code}
This is implemented in the ui-addon:
{{org.jboss.forge.addon.ui.scope.CommandScopedTest.testImportedWithCustomScope()}}
was:
Imported.isSatisfied returns true for objects without an active contexts.
eg:
{code:java}
@CommandScoped
public class CommandScopedModel
{code}
The following test fails:
Having :
{code:java}
@Inject
private Imported<CommandScopedModel> modelInstance;
{code}
Considering that the custom scope context is implemented correctly, the following code
fails in the first assertion:
{code:java}
@Test
public void testImportedWithCustomScope() throws Exception
{
Assert.assertFalse("Should not be satisfied since there is no Context in
scope", modelInstance.isSatisfied());
Assert.assertTrue(wizardTester.isValid());
Assert.assertTrue("Should be satisfied since there command context was
initialized", modelInstance.isSatisfied());
wizardTester.finish(null);
Assert.assertFalse("Should not be satisfied since there is no Context in scope
after finish is called",
modelInstance.isSatisfied());
}
{code}
This is implemented in the ui-addon:
{{org.jboss.forge.addon.ui.scope.CommandScopedTest.testImportedWithCustomScope()}}
Imported<?>.isSatisfied ignores custom scopes
---------------------------------------------
Key: FORGE-1209
URL:
https://issues.jboss.org/browse/FORGE-1209
Project: Forge
Issue Type: Bug
Components: Furnace (Container)
Reporter: George Gastaldi
Fix For: 2.x Future
Imported.isSatisfied returns true for objects without an active context.
eg:
{code:java}
@CommandScoped
public class CommandScopedModel
{code}
The following test fails:
Having :
{code:java}
@Inject
private Imported<CommandScopedModel> modelInstance;
{code}
Considering that the custom scope context is implemented correctly, the following code
fails in the first assertion:
{code:java}
@Test
public void testImportedWithCustomScope() throws Exception
{
Assert.assertFalse("Should not be satisfied since there is no Context in
scope", modelInstance.isSatisfied());
Assert.assertTrue(wizardTester.isValid());
Assert.assertTrue("Should be satisfied since there command context was
initialized", modelInstance.isSatisfied());
wizardTester.finish(null);
Assert.assertFalse("Should not be satisfied since there is no Context in scope
after finish is called",
modelInstance.isSatisfied());
}
{code}
This is implemented in the ui-addon:
{{org.jboss.forge.addon.ui.scope.CommandScopedTest.testImportedWithCustomScope()}}
--
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