Skip to content

Commit

Permalink
WFLY-7389 Improve statistics-enabled="false" testing in infinispan su…
Browse files Browse the repository at this point in the history
…bsystem for EAP 6.2
  • Loading branch information
rhusar committed Oct 26, 2016
1 parent 35ff7b3 commit 68e7677
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Expand Up @@ -25,9 +25,11 @@
import static org.jboss.as.clustering.controller.PropertiesTestUtil.checkMapResults;
import static org.jboss.as.clustering.controller.PropertiesTestUtil.executeOpInBothControllersWithAttachments;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.COMPOSITE;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STEPS;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION;
import static org.junit.Assert.assertFalse;

import java.io.IOException;
Expand All @@ -37,6 +39,7 @@

import org.jboss.as.clustering.controller.CommonRequirement;
import org.jboss.as.clustering.controller.CommonUnaryRequirement;
import org.jboss.as.clustering.controller.Operations;
import org.jboss.as.controller.ModelVersion;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
Expand Down Expand Up @@ -449,10 +452,18 @@ protected boolean isAttributeWritable(String attributeName) {
return true;
}

@Override
protected boolean checkValue(ModelNode operation, String attrName, ModelNode attribute, boolean isGeneratedWriteAttribute) {
if (!isGeneratedWriteAttribute && Operations.getName(operation).equals(WRITE_ATTRIBUTE_OPERATION) && operation.hasDefined(NAME) && operation.get(NAME).asString().equals(CacheContainerResourceDefinition.Attribute.DEFAULT_CACHE.getName())) {
// The attribute won't be defined in the :write-attribute(name=default-cache,.. boot operation so don't reject in that case
return false;
}
return !attribute.equals(new ModelNode(true));
}

@Override
protected boolean checkValue(String attrName, ModelNode attribute, boolean isWriteAttribute) {
// The attribute won't be defined in the :write-attribute(name=default-cache,.. boot operation so don't reject in that case
return attribute.isDefined() && !attribute.equals(new ModelNode(true));
throw new IllegalStateException();
}

@Override
Expand Down
Expand Up @@ -20,8 +20,9 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<subsystem xmlns="urn:jboss:domain:infinispan:4.0">
<cache-container name="minimal" default-cache="local" statistics-enabled="false">
<local-cache name="local" statistics-enabled="false"/>
<!-- Don't specify statistics-enabled="false" here so that we test undefined values too -->
<cache-container name="minimal" default-cache="local">
<local-cache name="local"/>
</cache-container>
<cache-container name="maximal" aliases="alias1 alias2" default-cache="local" jndi-name="java:global/infinispan/maximal" module="org.infinispan" statistics-enabled="false">
<transport channel="maximal-channel" lock-timeout="120000"/>
Expand Down

0 comments on commit 68e7677

Please sign in to comment.