Package com.oracle.bedrock.junit
Class CoherenceClusterExtension
java.lang.Object
com.oracle.bedrock.testsupport.junit.AbstractBaseAssembly<CoherenceClusterMember,CoherenceCluster,CoherenceClusterExtension>
com.oracle.bedrock.junit.CoherenceClusterExtension
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback,org.junit.jupiter.api.extension.BeforeAllCallback,org.junit.jupiter.api.extension.Extension
public class CoherenceClusterExtension
extends com.oracle.bedrock.testsupport.junit.AbstractBaseAssembly<CoherenceClusterMember,CoherenceCluster,CoherenceClusterExtension>
implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback
-
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 TypeMethodDescriptionvoidafterAll(org.junit.jupiter.api.extension.ExtensionContext extensionContext) voidbeforeAll(org.junit.jupiter.api.extension.ExtensionContext extensionContext) 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 thisCoherenceClusterExtension.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
-
CoherenceClusterExtension
public CoherenceClusterExtension()Constructs aCoherenceClusterExtension.
-
-
Method Details
-
createBuilder
- Specified by:
createBuilderin classcom.oracle.bedrock.testsupport.junit.AbstractBaseAssembly<CoherenceClusterMember,CoherenceCluster, CoherenceClusterExtension>
-
beforeAll
public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Exception - Specified by:
beforeAllin interfaceorg.junit.jupiter.api.extension.BeforeAllCallback- Throws:
Exception
-
afterAll
public void afterAll(org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Exception - Specified by:
afterAllin interfaceorg.junit.jupiter.api.extension.AfterAllCallback- Throws:
Exception
-
getCluster
Obtains theCoherenceClustercreated by theCoherenceClusterResource.- Returns:
- the
CoherenceCluster
-
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.Only a single session may be created by a
CoherenceClusterResourceagainst theCoherenceCluster.Attempts to request a session multiple times with the same
SessionBuilderwill return the same session.- Parameters:
builder- the builder for the specific type of session- Returns:
- a
ConfigurableCacheFactoryrepresenting the Coherence Session. - Throws:
IllegalStateException- when an attempt to request sessions for differentSessionBuilders is made
-
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 thisCoherenceClusterExtension.- Returns:
- the common options for this
CoherenceClusterExtension
-