Package com.oracle.bedrock.junit
Class CoherenceClusterResource
java.lang.Object
com.oracle.bedrock.testsupport.junit.AbstractBaseAssembly<CoherenceClusterMember,CoherenceCluster,CoherenceClusterResource>
com.oracle.bedrock.testsupport.junit.AbstractAssemblyResource<CoherenceClusterMember,CoherenceCluster,CoherenceClusterResource>
com.oracle.bedrock.junit.CoherenceClusterResource
- All Implemented Interfaces:
org.junit.rules.TestRule
public class CoherenceClusterResource
extends com.oracle.bedrock.testsupport.junit.AbstractAssemblyResource<CoherenceClusterMember,CoherenceCluster,CoherenceClusterResource>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
Fields inherited from class com.oracle.bedrock.testsupport.junit.AbstractBaseAssembly
assembly, assemblyBuilder, closingOptionsByType, commonOptionsByType, creationOptionsByType, infrastructure, launchDefinitions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafter()org.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runner.Description description) protected voidbefore()com.tangosol.net.SessionbuildSession(SessionBuilder builder) Obtains aSession, against theCoherenceCluster.protected CoherenceClusterBuildercom.tangosol.net.ConfigurableCacheFactorycreateSession(SessionBuilder builder) Obtains a session, represented as aConfigurableCacheFactory, against theCoherenceCluster.Obtains theCoherenceClustercreated by theCoherenceClusterResource.com.oracle.bedrock.Option[]Return the common options for thisCoherenceClusterResource.include(int count, com.oracle.bedrock.Option... options) Defines the necessary information for launching one or moreCoherenceClusterMembers as part of theCoherenceClusterwhen theCoherenceClusterResourceis established.Methods inherited from class com.oracle.bedrock.testsupport.junit.AbstractBaseAssembly
close, include, start, using, using, with, withClosingOptions, withOverridingOptions
-
Constructor Details
-
CoherenceClusterResource
public CoherenceClusterResource()Constructs aCoherenceClusterResource.
-
-
Method Details
-
createBuilder
- Specified by:
createBuilderin classcom.oracle.bedrock.testsupport.junit.AbstractAssemblyResource<CoherenceClusterMember,CoherenceCluster, CoherenceClusterResource>
-
getCluster
Obtains theCoherenceClustercreated by theCoherenceClusterResource.- Returns:
- the
CoherenceCluster
-
before
- Overrides:
beforein classcom.oracle.bedrock.testsupport.junit.AbstractAssemblyResource<CoherenceClusterMember,CoherenceCluster, CoherenceClusterResource> - Throws:
Throwable
-
after
protected void after()- Overrides:
afterin classcom.oracle.bedrock.testsupport.junit.AbstractAssemblyResource<CoherenceClusterMember,CoherenceCluster, CoherenceClusterResource>
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) - Specified by:
applyin interfaceorg.junit.rules.TestRule- Overrides:
applyin classcom.oracle.bedrock.testsupport.junit.AbstractAssemblyResource<CoherenceClusterMember,CoherenceCluster, CoherenceClusterResource>
-
include
Defines the necessary information for launching one or moreCoherenceClusterMembers as part of theCoherenceClusterwhen theCoherenceClusterResourceis established.The
Platformon which theCoherenceClusterMembers are launched is based on thePlatformPredicatespecified as anOption. By default, this isPlatformPredicate.any().Multiple calls to this method are permitted, allowing a
CoherenceClusterto be created containing multiple different types ofCoherenceClusters.This is equivalent to calling
AbstractBaseAssembly.include(int, Class, Option...)using aCoherenceClusterMemberclass as theApplicationclass.- Parameters:
count- the number of instances of theCoherenceClusterthat should be launched for theCoherenceClusteroptions- theOptions to use for launching theCoherenceClusters- Returns:
- the
CoherenceClusterResourceto permit fluent-style method calls
-
createSession
Obtains a session, represented as aConfigurableCacheFactory, against theCoherenceCluster.Attempts to request a
ConfigurableCacheFactorymultiple times with the sameSessionBuilderwill return the sameConfigurableCacheFactory.- Parameters:
builder- the builder for the specific type of session- Returns:
- a
ConfigurableCacheFactoryrepresenting the Coherence Session
-
buildSession
Obtains aSession, against theCoherenceCluster. Attempts to request a session multiple times with the sameSessionBuilderwill return the same session.- Parameters:
builder- the builder for the specific type of session- Returns:
- a
Session
-
getCommonOptions
public com.oracle.bedrock.Option[] getCommonOptions()Return the common options for thisCoherenceClusterResource.- Returns:
- the common options for this
CoherenceClusterResource
-