Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Much better configuration system for TCK, clean up TCK SPI and API
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@1453 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
5 changed files
with
61 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
porting-package/src/main/java/org/jboss/webbeans/porting/ContainersImpl.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
porting-package/src/main/java/org/jboss/webbeans/porting/ELImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.jboss.webbeans.porting; | ||
|
||
import javax.el.ELContext; | ||
|
||
import org.jboss.webbeans.mock.el.EL; | ||
|
||
public class ELImpl implements org.jboss.webbeans.tck.spi.EL | ||
{ | ||
|
||
|
||
@SuppressWarnings("unchecked") | ||
public <T> T evaluateValueExpression(String expression, Class<T> expectedType) | ||
{ | ||
ELContext elContext = EL.createELContext(); | ||
return (T) EL.EXPRESSION_FACTORY.createValueExpression(elContext, expression, expectedType).getValue(elContext); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
public <T> T evaluateMethodExpression(String expression, Class<T> expectedType, Class<?>[] expectedParamTypes, Object[] expectedParams) | ||
{ | ||
ELContext elContext = EL.createELContext(); | ||
return (T) EL.EXPRESSION_FACTORY.createMethodExpression(elContext, expression, expectedType, expectedParamTypes).invoke(elContext, expectedParams); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
porting-package/src/main/java/org/jboss/webbeans/porting/StandaloneContainersImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.jboss.webbeans.porting; | ||
|
||
import java.lang.annotation.Annotation; | ||
import java.util.List; | ||
|
||
import javax.inject.manager.Manager; | ||
|
||
import org.jboss.webbeans.ManagerImpl; | ||
import org.jboss.webbeans.mock.MockBootstrap; | ||
import org.jboss.webbeans.mock.MockWebBeanDiscovery; | ||
import org.jboss.webbeans.tck.spi.StandaloneContainers; | ||
|
||
public class StandaloneContainersImpl implements StandaloneContainers | ||
{ | ||
|
||
public Manager deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Class<?>... classes) | ||
{ | ||
MockBootstrap bootstrap = new MockBootstrap(); | ||
ManagerImpl manager = bootstrap.getManager(); | ||
if (enabledDeploymentTypes != null) | ||
{ | ||
manager.setEnabledDeploymentTypes(enabledDeploymentTypes); | ||
} | ||
bootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(classes)); | ||
bootstrap.boot(); | ||
return manager; | ||
} | ||
|
||
public Manager deploy(java.lang.Class<?>... classes) | ||
{ | ||
return deploy(null, classes); | ||
} | ||
|
||
} |
3 changes: 2 additions & 1 deletion
3
porting-package/src/main/resources/META-INF/web-beans-tck.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
org.jboss.webbeans.tck.spi.Managers=org.jboss.webbeans.porting.ManagersImpl | ||
org.jboss.webbeans.tck.spi.Beans=org.jboss.webbeans.porting.BeansImpl | ||
org.jboss.webbeans.tck.spi.Contexts=org.jboss.webbeans.porting.ContextsImpl | ||
org.jboss.webbeans.tck.spi.Containers=org.jboss.webbeans.porting.ContainersImpl | ||
org.jboss.webbeans.tck.spi.StandaloneContainers=org.jboss.webbeans.porting.StandaloneContainersImpl | ||
org.jboss.webbeans.tck.spi.EL=org.jboss.webbeans.porting.ELImpl |