You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by gp...@apache.org on 2012/01/05 21:22:50 UTC
git commit: DELTASPIKE-42 initial implementation of @Exclude
Updated Branches:
refs/heads/master 2d5f58d63 -> 57bb748a0
DELTASPIKE-42 initial implementation of @Exclude
Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/57bb748a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/57bb748a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/57bb748a
Branch: refs/heads/master
Commit: 57bb748a0f27bf234330c5170414269a515c622f
Parents: 2d5f58d
Author: gpetracek <gp...@apache.org>
Authored: Thu Jan 5 21:21:40 2012 +0100
Committer: gpetracek <gp...@apache.org>
Committed: Thu Jan 5 21:21:40 2012 +0100
----------------------------------------------------------------------
.../deltaspike/core/api/exclude/Exclude.java | 105 ++++++++
.../AbstractPropertyExpressionInterpreter.java | 102 +++++++
.../api/interpreter/ExpressionInterpreter.java | 33 +++
.../core/api/interpreter/SimpleOperationEnum.java | 50 ++++
.../core/impl/exclude/ExcludeExtension.java | 207 +++++++++++++++
.../interpreter/PropertyExpressionInterpreter.java | 38 +++
.../services/javax.enterprise.inject.spi.Extension | 20 ++
.../deltaspike/test/core/api/exclude/Bean.java | 26 ++
.../deltaspike/test/core/api/exclude/DevBean.java | 30 ++
.../test/core/api/exclude/DevDbBean.java | 29 ++
.../test/core/api/exclude/ExcludeTest.java | 116 ++++++++
.../ExcludeTestProjectStageDevelopment.java | 79 ++++++
.../deltaspike/test/core/api/exclude/NoBean.java | 29 ++
.../test/core/api/exclude/ProdDbBean.java | 30 ++
.../deltaspike/test/core/api/exclude/StdBean.java | 30 ++
.../PropertyExpressionInterpreterTest.java | 79 ++++++
.../test/resources/apache-deltaspike.properties | 3 +-
.../deltaspike/example/echo/NoEchoService.java | 37 +++
18 files changed, 1042 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/exclude/Exclude.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/exclude/Exclude.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/exclude/Exclude.java
new file mode 100644
index 0000000..8302980
--- /dev/null
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/exclude/Exclude.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.core.api.exclude;
+
+import org.apache.deltaspike.core.api.interpreter.ExpressionInterpreter;
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Supported usages:
+ * <pre>
+ * @Exclude
+ * @Exclude(ifProjectStage=Production.class)
+ * @Exclude(exceptIfProjectStage=UnitTest.class)
+ * @Exclude(onExpression="myProperty==myValue")
+ * @Exclude(onExpression="[my custom expression syntax]", interpretedBy=CustomExpressionInterpreter.class)
+ * </pre>
+ *
+ * <p/>
+ * examples:
+ * <p/>
+ * <p>the following bean gets excluded in any case</p>
+ * <pre>
+ * @Exclude
+ * public class NoBean {}
+ * </pre>
+ *
+ * <p/>
+ * <p>the following bean gets excluded in case of project-stage development</p>
+ * <pre>
+ * @Exclude(ifProjectStage = ProjectStage.Development.class)
+ * public class ProductionBean {}
+ * </pre>
+ *
+ * <p/>
+ * <p>the following bean gets excluded in every case except of project-stage development</p>
+ * <pre>
+ * @Exclude(exceptIfProjectStage = ProjectStage.Development.class)
+ * public class DevBean {}
+ * </pre>
+ *
+ * <p/>
+ * <p>the following bean gets excluded if the expression evaluates to true.
+ * that means there is a configured property called 'myProper' with the value 'myValue'</p>
+ * <pre>
+ * @Exclude(onExpression="myProperty==myValue")
+ * public class ProductionBean {}
+ * </pre>
+ *
+ * <p/>
+ * <p>the following bean gets excluded if the expression evaluates to true</p>
+ * @Exclude(onExpression="[my custom expression syntax]", interpretedBy=CustomExpressionInterpreter.class)
+ * public class ProductionBean {}
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface Exclude
+{
+ /**
+ * The {@link org.apache.deltaspike.core.api.projectstage.ProjectStage}s
+ * which lead to deactivating this bean.
+ * If the current ProjectStage is in this list, the bean will get vetoed.
+ * @return 1-n project-stages which are not allowed for the annotated artifact
+ */
+ Class<? extends ProjectStage>[] ifProjectStage() default {};
+
+ /**
+ * The {@link org.apache.deltaspike.core.api.projectstage.ProjectStage}s
+ * which lead to activating this bean.
+ * If the current ProjectStage is not in this list, the bean will get vetoed.
+ * @return 1-n project-stages which are allowed for the annotated artifact
+ */
+ Class<? extends ProjectStage>[] exceptIfProjectStage() default {};
+
+ /**
+ * Expression which signals if the annotated bean should be deactivated or not
+ * @return expression-string which will be interpreted
+ */
+ String onExpression() default "";
+
+ /**
+ * @return class of the interpeter which should be used (default leads to a simple config-property interpreter)
+ */
+ Class<? extends ExpressionInterpreter> interpretedBy() default ExpressionInterpreter.class;
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/AbstractPropertyExpressionInterpreter.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/AbstractPropertyExpressionInterpreter.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/AbstractPropertyExpressionInterpreter.java
new file mode 100644
index 0000000..678c219
--- /dev/null
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/AbstractPropertyExpressionInterpreter.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.core.api.interpreter;
+
+import org.apache.deltaspike.core.api.exclude.Exclude;
+
+/**
+ * Base implementation for simple (property) expressions
+ *
+ * Supported operations:<p/>
+ * <ul>
+ * <li>[key]==[value]</li>
+ * <li>[key]!=[value]</li>
+ * <li>[key]==* (a value is required)</li>
+ * <li>; (separator)</li>
+ * </ul>
+ */
+public abstract class AbstractPropertyExpressionInterpreter implements ExpressionInterpreter<String, Boolean>
+{
+ /**
+ * {@inheritDoc}
+ */
+ public final Boolean evaluate(String expressions)
+ {
+ boolean result = false;
+ String[] foundExpressions = expressions.split(";");
+
+ SimpleOperationEnum operation;
+ for(String expression : foundExpressions)
+ {
+ result = false;
+ if(expression.contains(SimpleOperationEnum.IS.getValue()))
+ {
+ operation = SimpleOperationEnum.IS;
+ }
+ else if(expression.contains(SimpleOperationEnum.NOT.getValue()))
+ {
+ operation = SimpleOperationEnum.NOT;
+ }
+ else
+ {
+ throw new IllegalStateException("expression: " + expression + " isn't supported by " +
+ Exclude.class.getName() + " via " + getClass().getName() +
+ " supported operations: " + SimpleOperationEnum.getOperations() + "separator: ';'");
+ }
+
+ String[] keyValue = expression.split(operation.getValue());
+
+ String configuredValue = getConfiguredValue(keyValue[0]);
+
+ if(configuredValue != null)
+ {
+ configuredValue = configuredValue.trim();
+ }
+ else
+ {
+ configuredValue = "";
+ }
+
+ if(!"*".equals(keyValue[1]) && "".equals(configuredValue))
+ {
+ continue;
+ }
+
+ if("*".equals(keyValue[1]) && !"".equals(configuredValue))
+ {
+ result = true;
+ continue;
+ }
+
+ if(SimpleOperationEnum.IS.equals(operation) && !keyValue[1].equalsIgnoreCase(configuredValue))
+ {
+ return false;
+ }
+ else if(SimpleOperationEnum.NOT.equals(operation) && keyValue[1].equalsIgnoreCase(configuredValue))
+ {
+ return false;
+ }
+ result = true;
+ }
+
+ return result;
+ }
+
+ protected abstract String getConfiguredValue(String key);
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/ExpressionInterpreter.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/ExpressionInterpreter.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/ExpressionInterpreter.java
new file mode 100644
index 0000000..a86bb6a
--- /dev/null
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/ExpressionInterpreter.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.core.api.interpreter;
+
+/**
+ * Interface for interpreting an expression e.g. provided by
+ * {@link org.apache.deltaspike.core.api.exclude.Exclude#onExpression()}
+ */
+public interface ExpressionInterpreter<E, R>
+{
+ /**
+ * Evaluates the given expression and returns the result for it
+ * @param expression expression which should be evaluated
+ * @return result of the evaluated expression
+ */
+ R evaluate(E expression);
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/SimpleOperationEnum.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/SimpleOperationEnum.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/SimpleOperationEnum.java
new file mode 100644
index 0000000..32cb094
--- /dev/null
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/interpreter/SimpleOperationEnum.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.core.api.interpreter;
+
+/**
+ * Operations supported by {@link AbstractPropertyExpressionInterpreter}
+ */
+enum SimpleOperationEnum
+{
+ IS("=="), NOT("!=");
+
+ private final String value;
+
+ SimpleOperationEnum(String value)
+ {
+ this.value = value;
+ }
+
+ String getValue()
+ {
+ return value;
+ }
+
+ static String getOperations()
+ {
+ String operations = "";
+
+ for(SimpleOperationEnum operation : SimpleOperationEnum.values())
+ {
+ operations += operation.getValue() + " ";
+ }
+ return operations;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/exclude/ExcludeExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/exclude/ExcludeExtension.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/exclude/ExcludeExtension.java
new file mode 100644
index 0000000..664ce25
--- /dev/null
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/exclude/ExcludeExtension.java
@@ -0,0 +1,207 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.core.impl.exclude;
+
+import org.apache.deltaspike.core.api.activation.Deactivatable;
+import org.apache.deltaspike.core.api.exclude.Exclude;
+import org.apache.deltaspike.core.api.interpreter.ExpressionInterpreter;
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.core.api.util.ClassUtils;
+import org.apache.deltaspike.core.impl.interpreter.PropertyExpressionInterpreter;
+import org.apache.deltaspike.core.impl.projectstage.ProjectStageProducer;
+import org.apache.deltaspike.core.impl.util.ClassDeactivation;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterDeploymentValidation;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * <p>This class implements the logic for handling
+ * {@link org.apache.deltaspike.core.api.exclude.Exclude} annotations.</p>
+ * <p/>
+ * <p>Further details see {@link org.apache.deltaspike.core.api.exclude.Exclude}</p>
+ */
+public class ExcludeExtension implements Extension, Deactivatable
+{
+ private static final Logger LOG = Logger.getLogger(ExcludeExtension.class.getName());
+
+ /**
+ * triggers initialization in any case
+ * @param afterDeploymentValidation observed event
+ */
+ @SuppressWarnings("UnusedDeclaration")
+ protected void initProjectStage(@Observes AfterDeploymentValidation afterDeploymentValidation)
+ {
+ ProjectStageProducer.getInstance();
+ }
+
+ /**
+ * Observer which is vetoing beans based on {@link Exclude}
+ * @param processAnnotatedType observed event
+ */
+ @SuppressWarnings("UnusedDeclaration")
+ protected void vetoBeans(@Observes ProcessAnnotatedType<Object> processAnnotatedType)
+ {
+ if (!isActivated() ||
+ !processAnnotatedType.getAnnotatedType().getJavaClass().isAnnotationPresent(Exclude.class))
+ {
+ return;
+ }
+
+ //TODO needs further discussions for a different feature CodiStartupBroadcaster.broadcastStartup();
+
+ Exclude exclude = processAnnotatedType.getAnnotatedType().getJavaClass().getAnnotation(Exclude.class);
+
+ if (!evalExcludeWithoutCondition(processAnnotatedType, exclude))
+ {
+ return; //veto called already
+ }
+
+ if (!evalExcludeInProjectStage(processAnnotatedType, exclude))
+ {
+ return; //veto called already
+ }
+
+ if (!evalExcludeNotInProjectStage(processAnnotatedType, exclude))
+ {
+ return; //veto called already
+ }
+
+ evalExcludeWithExpression(processAnnotatedType, exclude);
+ }
+
+ private boolean evalExcludeWithoutCondition(ProcessAnnotatedType<Object> processAnnotatedType, Exclude exclude)
+ {
+ if (exclude.ifProjectStage().length == 0 && exclude.exceptIfProjectStage().length == 0 &&
+ "".equals(exclude.onExpression()))
+ {
+ veto(processAnnotatedType, "Stateless");
+ return false;
+ }
+ return true;
+ }
+
+ private boolean evalExcludeInProjectStage(ProcessAnnotatedType<Object> processAnnotatedType, Exclude exclude)
+ {
+ Class<? extends ProjectStage>[] activatedIn = exclude.ifProjectStage();
+
+ if (activatedIn.length == 0)
+ {
+ return true;
+ }
+
+ if (isInProjectStage(activatedIn))
+ {
+ veto(processAnnotatedType, "IfProjectState");
+ return false;
+ }
+ return true;
+ }
+
+ private boolean evalExcludeNotInProjectStage(ProcessAnnotatedType<Object> processAnnotatedType, Exclude exclude)
+ {
+ Class<? extends ProjectStage>[] notIn = exclude.exceptIfProjectStage();
+
+ if (notIn.length == 0)
+ {
+ return true;
+ }
+
+ if (!isInProjectStage(notIn))
+ {
+ veto(processAnnotatedType, "ExceptIfProjectState");
+ return false;
+ }
+ return true;
+ }
+
+ private void evalExcludeWithExpression(ProcessAnnotatedType<Object> processAnnotatedType, Exclude exclude)
+ {
+ if ("".equals(exclude.onExpression()))
+ {
+ return;
+ }
+
+ if (isDeactivated(exclude, PropertyExpressionInterpreter.class))
+ {
+ veto(processAnnotatedType, "Expression");
+ }
+ }
+
+ private boolean isInProjectStage(Class<? extends ProjectStage>[] activatedIn)
+ {
+ if (activatedIn != null && activatedIn.length > 0)
+ {
+ ProjectStage ps = ProjectStageProducer.getInstance().getProjectStage();
+ for (Class<? extends ProjectStage> activated : activatedIn)
+ {
+ if (ps.getClass().equals(activated))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private boolean isDeactivated(Exclude exclude, Class defaultExpressionInterpreterClass)
+ {
+ String expressions = exclude.onExpression();
+
+ Class<? extends ExpressionInterpreter> interpreterClass = exclude.interpretedBy();
+
+ if (interpreterClass.equals(ExpressionInterpreter.class))
+ {
+ interpreterClass = defaultExpressionInterpreterClass;
+ }
+
+ ExpressionInterpreter<String, Boolean> expressionInterpreter =
+ ClassUtils.tryToInstantiateClass(interpreterClass);
+
+ if (expressionInterpreter == null)
+ {
+ if (LOG.isLoggable(Level.WARNING))
+ {
+ LOG.warning("can't instantiate " + interpreterClass.getClass().getName());
+ }
+ return true;
+ }
+
+ return expressionInterpreter.evaluate(expressions);
+ }
+
+ private void veto(ProcessAnnotatedType<?> processAnnotatedType, String vetoType)
+ {
+ processAnnotatedType.veto();
+ LOG.finer(vetoType + " based veto for bean with type: " +
+ processAnnotatedType.getAnnotatedType().getJavaClass());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isActivated()
+ {
+ return ClassDeactivation.isClassActivated(getClass());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/interpreter/PropertyExpressionInterpreter.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/interpreter/PropertyExpressionInterpreter.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/interpreter/PropertyExpressionInterpreter.java
new file mode 100644
index 0000000..8ad33fc
--- /dev/null
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/interpreter/PropertyExpressionInterpreter.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.core.impl.interpreter;
+
+import org.apache.deltaspike.core.api.config.ConfigResolver;
+import org.apache.deltaspike.core.api.interpreter.AbstractPropertyExpressionInterpreter;
+
+/**
+ * Interpreter which uses the lookup chain of DeltaSpike for configured values
+ */
+public class PropertyExpressionInterpreter extends AbstractPropertyExpressionInterpreter
+{
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getConfiguredValue(String key)
+ {
+ return ConfigResolver.getPropertyValue(key);
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/deltaspike/core/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
new file mode 100644
index 0000000..4f09ffd
--- /dev/null
+++ b/deltaspike/core/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -0,0 +1,20 @@
+#####################################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#####################################################################################
+
+org.apache.deltaspike.core.impl.exclude.ExcludeExtension
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/Bean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/Bean.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/Bean.java
new file mode 100644
index 0000000..05aaee0
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/Bean.java
@@ -0,0 +1,26 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.deltaspike.test.core.api.exclude;
+
+/**
+ * Class which is always active
+ */
+public class Bean
+{
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/DevBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/DevBean.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/DevBean.java
new file mode 100644
index 0000000..3b3c446
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/DevBean.java
@@ -0,0 +1,30 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.deltaspike.test.core.api.exclude;
+
+import org.apache.deltaspike.core.api.exclude.Exclude;
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+
+/**
+ * Class which gets only included in case of project-stage development
+ */
+@Exclude(exceptIfProjectStage = ProjectStage.Development.class)
+public class DevBean
+{
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/DevDbBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/DevDbBean.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/DevDbBean.java
new file mode 100644
index 0000000..92570ff
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/DevDbBean.java
@@ -0,0 +1,29 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.deltaspike.test.core.api.exclude;
+
+import org.apache.deltaspike.core.api.exclude.Exclude;
+
+/**
+ * Class which gets excluded if the configured value for 'db' is 'prodDB'
+ */
+@Exclude(onExpression = "db==prodDB")
+public class DevDbBean
+{
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTest.java
new file mode 100644
index 0000000..f7746b5
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTest.java
@@ -0,0 +1,116 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.deltaspike.test.core.api.exclude;
+
+
+import org.apache.deltaspike.core.api.provider.BeanProvider;
+import org.apache.deltaspike.core.impl.projectstage.ProjectStageProducer;
+import org.apache.deltaspike.test.core.api.temptestutil.ShrinkWrapArchiveUtil;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Tests for {@link org.apache.deltaspike.core.api.exclude.Exclude}
+ */
+@RunWith(Arquillian.class)
+public class ExcludeTest
+{
+ /**
+ * X TODO creating a WebArchive is only a workaround because JavaArchive cannot contain other archives.
+ */
+ @Deployment
+ public static WebArchive deploy()
+ {
+ System.setProperty("org.apache.deltaspike.ProjectStage", "Production");
+ ProjectStageProducer.setProjectStage(null);
+
+ return ShrinkWrap.create(WebArchive.class)
+ .addAsLibraries(ShrinkWrapArchiveUtil.getArchives(null,
+ "META-INF/beans.xml",
+ new String[]{"org.apache.deltaspike.core",
+ "org.apache.deltaspike.test.core.api.exclude"},
+ null))
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+ }
+
+ /**
+ * check if this package is included at all
+ */
+ @Test
+ public void simpleCheckOfBeansInPackage()
+ {
+ Bean testBean = BeanProvider.getContextualReference(Bean.class, true);
+
+ Assert.assertNotNull(testBean);
+ }
+
+ /**
+ * bean is excluded in any case
+ */
+ @Test
+ public void excludeWithoutCondition()
+ {
+ NoBean noBean = BeanProvider.getContextualReference(NoBean.class, true);
+
+ Assert.assertNull(noBean);
+ }
+
+ /**
+ * bean included in case of project-stage development
+ */
+ @Test
+ public void includeInCaseOfProjectStageProduction()
+ {
+ StdBean stdBean = BeanProvider.getContextualReference(StdBean.class, true);
+
+ Assert.assertNotNull(stdBean);
+ }
+
+ /**
+ * bean excluded in case of project-stage development
+ */
+ @Test
+ public void excludedInCaseOfProjectStageProduction()
+ {
+ DevBean devBean = BeanProvider.getContextualReference(DevBean.class, true);
+
+ Assert.assertNull(devBean);
+ }
+
+ /**
+ * beans de-/activated via expressions
+ */
+ @Test
+ public void excludedIfExpressionMatch()
+ {
+ ProdDbBean prodDbBean = BeanProvider.getContextualReference(ProdDbBean.class, true);
+
+ Assert.assertNotNull(prodDbBean);
+
+ DevDbBean devDbBean = BeanProvider.getContextualReference(DevDbBean.class, true);
+
+ Assert.assertNull(devDbBean);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTestProjectStageDevelopment.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTestProjectStageDevelopment.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTestProjectStageDevelopment.java
new file mode 100644
index 0000000..e80fd1b
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTestProjectStageDevelopment.java
@@ -0,0 +1,79 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.deltaspike.test.core.api.exclude;
+
+
+import org.apache.deltaspike.core.api.provider.BeanProvider;
+import org.apache.deltaspike.core.impl.projectstage.ProjectStageProducer;
+import org.apache.deltaspike.test.core.api.temptestutil.ShrinkWrapArchiveUtil;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Tests for {@link org.apache.deltaspike.core.api.exclude.Exclude}
+ */
+@RunWith(Arquillian.class)
+public class ExcludeTestProjectStageDevelopment
+{
+ /**
+ * X TODO creating a WebArchive is only a workaround because JavaArchive cannot contain other archives.
+ */
+ @Deployment
+ public static WebArchive deploy()
+ {
+ System.setProperty("org.apache.deltaspike.ProjectStage", "Development");
+ ProjectStageProducer.setProjectStage(null);
+
+ return ShrinkWrap.create(WebArchive.class)
+ .addAsLibraries(ShrinkWrapArchiveUtil.getArchives(null,
+ "META-INF/beans.xml",
+ new String[]{"org.apache.deltaspike.core",
+ "org.apache.deltaspike.test.core.api.exclude"},
+ null))
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+ }
+
+ /**
+ * bean included in case of project-stage development
+ */
+ @Test
+ public void includeInCaseOfProjectStageDevelopment()
+ {
+ DevBean devBean = BeanProvider.getContextualReference(DevBean.class, true);
+
+ Assert.assertNotNull(devBean);
+ }
+
+ /**
+ * bean excluded in case of project-stage development
+ */
+ @Test
+ public void excludedInCaseOfProjectStageDevelopment()
+ {
+ StdBean stdBean = BeanProvider.getContextualReference(StdBean.class, true);
+
+ Assert.assertNull(stdBean);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/NoBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/NoBean.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/NoBean.java
new file mode 100644
index 0000000..2fa899d
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/NoBean.java
@@ -0,0 +1,29 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.deltaspike.test.core.api.exclude;
+
+import org.apache.deltaspike.core.api.exclude.Exclude;
+
+/**
+ * Class which gets excluded in any case
+ */
+@Exclude
+public class NoBean
+{
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ProdDbBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ProdDbBean.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ProdDbBean.java
new file mode 100644
index 0000000..828ef9b
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ProdDbBean.java
@@ -0,0 +1,30 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.deltaspike.test.core.api.exclude;
+
+import org.apache.deltaspike.core.api.exclude.Exclude;
+
+/**
+ * Class which gets excluded if there is a configured value for the key called 'db' and
+ * the value is not 'prodDB'
+ */
+@Exclude(onExpression = "db!=prodDB;db==*")
+public class ProdDbBean
+{
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/StdBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/StdBean.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/StdBean.java
new file mode 100644
index 0000000..919ffb3
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/StdBean.java
@@ -0,0 +1,30 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.deltaspike.test.core.api.exclude;
+
+import org.apache.deltaspike.core.api.exclude.Exclude;
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+
+/**
+ * Class which gets excluded in case of project-stage development
+ */
+@Exclude(ifProjectStage = ProjectStage.Development.class)
+public class StdBean
+{
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/interpreter/PropertyExpressionInterpreterTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/interpreter/PropertyExpressionInterpreterTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/interpreter/PropertyExpressionInterpreterTest.java
new file mode 100644
index 0000000..b5cd3aa
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/interpreter/PropertyExpressionInterpreterTest.java
@@ -0,0 +1,79 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.deltaspike.test.core.api.interpreter;
+
+import org.apache.deltaspike.core.api.interpreter.ExpressionInterpreter;
+import org.apache.deltaspike.core.impl.interpreter.PropertyExpressionInterpreter;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Tests for {@link org.apache.deltaspike.core.impl.interpreter.PropertyExpressionInterpreter}
+ */
+public class PropertyExpressionInterpreterTest
+{
+ @Test
+ public void testSimplePropertyExpressions()
+ {
+ ExpressionInterpreter<String, Boolean> interpreter = new PropertyExpressionInterpreter(){};
+
+ System.setProperty("k.1", "v1");
+ Assert.assertEquals(interpreter.evaluate("k.1==v1"), Boolean.TRUE);
+ Assert.assertEquals(interpreter.evaluate("k.1==v2"), Boolean.FALSE);
+
+ Assert.assertEquals(interpreter.evaluate("k.1!=v1"), Boolean.FALSE);
+ Assert.assertEquals(interpreter.evaluate("k.1!=v2"), Boolean.TRUE);
+
+ try
+ {
+ Assert.assertEquals(interpreter.evaluate("k.1=v1"), Boolean.TRUE);
+ }
+ catch (IllegalStateException e)
+ {
+ return;
+ }
+
+ Assert.fail();
+ }
+
+ @Test
+ public void testSimpleAndRequiredPropertyExpressions()
+ {
+ ExpressionInterpreter<String, Boolean> interpreter = new PropertyExpressionInterpreter(){};
+
+ System.setProperty("k.1", "v1");
+ Assert.assertEquals(interpreter.evaluate("k.1==v1;k.1==*"), Boolean.TRUE);
+ Assert.assertEquals(interpreter.evaluate("ik.1==*"), Boolean.FALSE);
+
+ Assert.assertEquals(interpreter.evaluate("k.1!=v2;k.1==*"), Boolean.TRUE);
+ Assert.assertEquals(interpreter.evaluate("ik.1!=v2;ik.1==*"), Boolean.FALSE);
+ }
+
+ @Test
+ public void testMultiplePropertyExpressions()
+ {
+ ExpressionInterpreter<String, Boolean> interpreter = new PropertyExpressionInterpreter(){};
+
+ System.setProperty("k.1", "v1");
+ System.setProperty("k.2", "v2");
+ Assert.assertEquals(interpreter.evaluate("k.1==v1;k.2==v2"), Boolean.TRUE);
+ Assert.assertEquals(interpreter.evaluate("k.1==v1;k.2==v1"), Boolean.FALSE);
+ Assert.assertEquals(interpreter.evaluate("k.1==v2;k.2==v2"), Boolean.FALSE);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/core/impl/src/test/resources/apache-deltaspike.properties
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/resources/apache-deltaspike.properties b/deltaspike/core/impl/src/test/resources/apache-deltaspike.properties
index e90dcb2..494a83a 100644
--- a/deltaspike/core/impl/src/test/resources/apache-deltaspike.properties
+++ b/deltaspike/core/impl/src/test/resources/apache-deltaspike.properties
@@ -15,4 +15,5 @@
#specific language governing permissions and limitations
#under the License.
-testProperty02=test_value_02
\ No newline at end of file
+testProperty02=test_value_02
+db=prodDB
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/57bb748a/deltaspike/examples/jse-owb-examples/src/main/java/org/apache/deltaspike/example/echo/NoEchoService.java
----------------------------------------------------------------------
diff --git a/deltaspike/examples/jse-owb-examples/src/main/java/org/apache/deltaspike/example/echo/NoEchoService.java b/deltaspike/examples/jse-owb-examples/src/main/java/org/apache/deltaspike/example/echo/NoEchoService.java
new file mode 100644
index 0000000..6a916b9
--- /dev/null
+++ b/deltaspike/examples/jse-owb-examples/src/main/java/org/apache/deltaspike/example/echo/NoEchoService.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.example.echo;
+
+import org.apache.deltaspike.core.api.exclude.Exclude;
+
+/**
+ * This implementation can't be used as CDI bean
+ */
+@Exclude
+public class NoEchoService implements EchoService
+{
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String echo(String message)
+ {
+ return message;
+ }
+}