Skip to content

Commit

Permalink
ISPN-5023 Random Failues on *FactoryBeanTest in the Spring Modules
Browse files Browse the repository at this point in the history
Force the test JMX domain even if the configuration was loaded from a file.
  • Loading branch information
danberindei committed Nov 26, 2014
1 parent 2519083 commit fb65b15
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 36 deletions.
4 changes: 0 additions & 4 deletions spring/spring/pom.xml
Expand Up @@ -41,10 +41,6 @@

</description>

<properties>
<infinispan.test.parallel.threads>1</infinispan.test.parallel.threads>
</properties>

<developers>
<developer>
<id>obergner</id>
Expand Down
Expand Up @@ -11,7 +11,6 @@
import org.springframework.core.io.Resource;

import java.io.IOException;
import java.io.InputStream;

/**
* <p>
Expand Down Expand Up @@ -47,7 +46,7 @@ protected EmbeddedCacheManager createBackingEmbeddedCacheManager() throws IOExce
configurationBuilderHolder.getDefaultConfigurationBuilder().read(builder.build());
}

return new DefaultCacheManager(configurationBuilderHolder, true);
return createCacheManager(configurationBuilderHolder);
} else {
if (gcb == null) {
if (logger.isDebugEnabled()) logger.debug("GlobalConfigurationBuilder is null. Using default new " +
Expand All @@ -65,8 +64,8 @@ protected EmbeddedCacheManager createBackingEmbeddedCacheManager() throws IOExce
}
}

protected EmbeddedCacheManager createCacheManager(InputStream is) throws IOException {
return new DefaultCacheManager(is);
protected EmbeddedCacheManager createCacheManager(ConfigurationBuilderHolder configurationBuilderHolder) {
return new DefaultCacheManager(configurationBuilderHolder, true);
}

protected EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder globalBuilder, ConfigurationBuilder builder) {
Expand Down
Expand Up @@ -2,12 +2,10 @@

import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.configuration.parsing.ConfigurationBuilderHolder;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.test.fwk.TestCacheManagerFactory;

import java.io.IOException;
import java.io.InputStream;

/**
* Bean that creates cache manager instances produced
* by the test cache manager factory.
Expand All @@ -23,8 +21,8 @@ protected EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder glo
}

@Override
protected EmbeddedCacheManager createCacheManager(InputStream is) throws IOException {
return TestCacheManagerFactory.fromStream(is);
protected EmbeddedCacheManager createCacheManager(ConfigurationBuilderHolder configurationBuilderHolder) {
return TestCacheManagerFactory.createClusteredCacheManager(configurationBuilderHolder);
}

}
Expand Up @@ -2,12 +2,10 @@

import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.configuration.parsing.ConfigurationBuilderHolder;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.test.fwk.TestCacheManagerFactory;

import java.io.IOException;
import java.io.InputStream;

/**
* Bean that creates cache manager instances produced
* by the test cache manager factory.
Expand All @@ -23,8 +21,8 @@ protected EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder glo
}

@Override
protected EmbeddedCacheManager createCacheManager(InputStream is) throws IOException {
return TestCacheManagerFactory.fromStream(is);
protected EmbeddedCacheManager createCacheManager(ConfigurationBuilderHolder configurationBuilderHolder) {
return TestCacheManagerFactory.createClusteredCacheManager(configurationBuilderHolder);
}

}
4 changes: 0 additions & 4 deletions spring/spring4/pom.xml
Expand Up @@ -41,10 +41,6 @@

</description>

<properties>
<infinispan.test.parallel.threads>1</infinispan.test.parallel.threads>
</properties>

<developers>
<developer>
<id>obergner</id>
Expand Down
Expand Up @@ -11,7 +11,6 @@
import org.springframework.core.io.Resource;

import java.io.IOException;
import java.io.InputStream;

/**
* <p>
Expand Down Expand Up @@ -47,7 +46,7 @@ protected EmbeddedCacheManager createBackingEmbeddedCacheManager() throws IOExce
configurationBuilderHolder.getDefaultConfigurationBuilder().read(builder.build());
}

return new DefaultCacheManager(configurationBuilderHolder, true);
return createCacheManager(configurationBuilderHolder);
} else {
if (gcb == null) {
if (logger.isDebugEnabled()) logger.debug("GlobalConfigurationBuilder is null. Using default new " +
Expand All @@ -65,8 +64,8 @@ protected EmbeddedCacheManager createBackingEmbeddedCacheManager() throws IOExce
}
}

protected EmbeddedCacheManager createCacheManager(InputStream is) throws IOException {
return new DefaultCacheManager(is);
protected EmbeddedCacheManager createCacheManager(ConfigurationBuilderHolder configurationBuilderHolder) {
return new DefaultCacheManager(configurationBuilderHolder, true);
}

protected EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder globalBuilder, ConfigurationBuilder builder) {
Expand Down
Expand Up @@ -2,12 +2,10 @@

import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.configuration.parsing.ConfigurationBuilderHolder;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.test.fwk.TestCacheManagerFactory;

import java.io.IOException;
import java.io.InputStream;

/**
* Bean that creates cache manager instances produced
* by the test cache manager factory.
Expand All @@ -23,8 +21,8 @@ protected EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder glo
}

@Override
protected EmbeddedCacheManager createCacheManager(InputStream is) throws IOException {
return TestCacheManagerFactory.fromStream(is);
protected EmbeddedCacheManager createCacheManager(ConfigurationBuilderHolder configurationBuilderHolder) {
return TestCacheManagerFactory.createClusteredCacheManager(configurationBuilderHolder);
}

}
Expand Up @@ -2,12 +2,10 @@

import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.configuration.parsing.ConfigurationBuilderHolder;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.test.fwk.TestCacheManagerFactory;

import java.io.IOException;
import java.io.InputStream;

/**
* Bean that creates cache manager instances produced
* by the test cache manager factory.
Expand All @@ -23,8 +21,8 @@ protected EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder glo
}

@Override
protected EmbeddedCacheManager createCacheManager(InputStream is) throws IOException {
return TestCacheManagerFactory.fromStream(is);
protected EmbeddedCacheManager createCacheManager(ConfigurationBuilderHolder configurationBuilderHolder) {
return TestCacheManagerFactory.createClusteredCacheManager(configurationBuilderHolder);
}

}

0 comments on commit fb65b15

Please sign in to comment.