Search in sources :

Example 1 with ServerSessionConfigurationBean

use of com.oracle.coherence.spring.configuration.session.ServerSessionConfigurationBean in project coherence-spring by coherence-community.

the class CoherencePropertiesTests method testCoherenceConfiguration.

@Test
void testCoherenceConfiguration() {
    final List<ServerSessionConfigurationBean> serverSessions = this.coherenceProperties.getSessions().getServer();
    assertThat(serverSessions.get(0).getConfiguration()).isNotNull();
    assertThat(serverSessions.get(1).getConfiguration()).isNotNull();
    assertThat(serverSessions.get(2).getConfiguration()).isNotNull();
    final SessionConfiguration sessionConfiguration1 = serverSessions.get(0).getConfiguration().get();
    final SessionConfiguration sessionConfiguration2 = serverSessions.get(1).getConfiguration().get();
    final SessionConfiguration sessionConfiguration3 = serverSessions.get(2).getConfiguration().get();
    assertThat(sessionConfiguration1.getName()).isEqualTo(Coherence.DEFAULT_NAME);
    validateConfigUri("coherence-cache-config.xml", sessionConfiguration1);
    assertThat(sessionConfiguration1.getScopeName()).isEqualTo("fooscope");
    assertThat(sessionConfiguration1.getPriority()).isEqualTo(1);
    assertThat(sessionConfiguration2.getName()).isEqualTo("test");
    validateConfigUri("test-coherence-config.xml", sessionConfiguration2);
    assertThat(sessionConfiguration2.getScopeName()).isEqualTo("barscope");
    assertThat(sessionConfiguration2.getPriority()).isEqualTo(2);
    assertThat(sessionConfiguration3.getName()).isEqualTo(Coherence.DEFAULT_NAME);
    validateConfigUri("test-coherence-config.xml", sessionConfiguration3);
    assertThat(sessionConfiguration3.getScopeName()).isEqualTo("myscope");
    assertThat(sessionConfiguration3.getPriority()).isEqualTo(SessionConfiguration.DEFAULT_PRIORITY);
}
Also used : ServerSessionConfigurationBean(com.oracle.coherence.spring.configuration.session.ServerSessionConfigurationBean) SessionConfiguration(com.tangosol.net.SessionConfiguration) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

ServerSessionConfigurationBean (com.oracle.coherence.spring.configuration.session.ServerSessionConfigurationBean)1 SessionConfiguration (com.tangosol.net.SessionConfiguration)1 Test (org.junit.jupiter.api.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1