use of com.oracle.bedrock.runtime.coherence.callables.IsServiceRunning in project coherence-spring by coherence-community.
the class ExtendSessionCoherenceIndexedSessionRepositoryTests method setup.
@BeforeAll
static void setup() {
final LocalPlatform platform = LocalPlatform.get();
// Start the Coherence server
server = platform.launch(CoherenceClusterMember.class, CacheConfig.of("server-coherence-cache-config.xml"), LocalHost.only(), IPv4Preferred.yes(), DisplayName.of("server"));
// Wait for Coherence to start
Eventually.assertDeferred(() -> server.invoke(new IsServiceRunning("ExtendTcpCacheService")), is(true));
}
use of com.oracle.bedrock.runtime.coherence.callables.IsServiceRunning in project coherence-spring by coherence-community.
the class CacheStoreDemoIT method setup.
@BeforeAll
static void setup() throws Exception {
File outputDir = MavenProjectFileUtils.ensureTestOutputFolder(CacheStoreDemoIT.class, null);
File dbDir = new File(outputDir, "hsqldb");
// clean-up any previous database files from old tests
MavenProjectFileUtils.recursiveDelete(dbDir);
// re-create the db folder
assertThat(dbDir.mkdirs(), is(true));
assertThat(dbDir.exists(), is(true));
assertThat(dbDir.isDirectory(), is(true));
// Run db processes on the local machine
LocalPlatform platform = LocalPlatform.get();
testLogs.init(CacheStoreDemoIT.class, "logs");
// Start the HSQLDB listening on port 9001
hsqldb = platform.launch(JavaApplication.class, ClassName.of(Server.class), WorkingDirectory.at(dbDir), testLogs, ClassPath.ofClass(Server.class), Arguments.of("--database.0", "file:testdb", "--dbname.0", "testdb", "--port", 9001), IPv4Preferred.yes(), DisplayName.of("HSQLDB"));
// Start the Coherence demo server
server = platform.launch(CoherenceClusterMember.class, ClassName.of(CacheStoreDemo.class), testLogs, SystemProperty.of("spring.jmx.enabled", true), LocalHost.only(), IPv4Preferred.yes(), DisplayName.of("server"));
// Wait for Spring to start
Eventually.assertDeferred(() -> server.invoke(IsSpringUp.INSTANCE), is(true));
// Ensure the Coherence Extend proxy has started
Eventually.assertDeferred(() -> server.invoke(new IsServiceRunning("Proxy")), is(true));
// Create the local Coherence Extend client
CoherenceConfiguration config = CoherenceConfiguration.builder().withSession(SessionConfiguration.create("client-cache-config.xml")).build();
Coherence coherence = Coherence.client(config);
// wait at most 1 minute for the Coherence DefaultCacheServer to start
// DefaultCacheServer is started automatically by the application but for the
// tests to pass we need to ensure it has finished starting cache services.
coherence.start().get(1, TimeUnit.MINUTES);
// Create the Coherence Session using the client cache configuration that will connect over Extend.
session = coherence.getSession();
}
Aggregations