Search in sources :

Example 51 with JetConfig

use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.

the class XmlConfigTest method when_classpathMemberSpecified_usesSpecifiedResource.

@Test
public void when_classpathMemberSpecified_usesSpecifiedResource() {
    // Given
    Properties properties = new Properties();
    properties.put(XmlJetConfigLocator.HAZELCAST_MEMBER_CONFIG_PROPERTY, "classpath:" + TEST_XML_2);
    // When
    JetConfig jetConfig = XmlJetConfigBuilder.getConfig(properties);
    // Then
    assertXmlMemberConfig(jetConfig.getHazelcastConfig());
}
Also used : Properties(java.util.Properties) JetConfig(com.hazelcast.jet.config.JetConfig) Test(org.junit.Test)

Example 52 with JetConfig

use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.

the class XmlConfigTest method when_edgeDefaultsSpecified_usesSpecified.

@Test
public void when_edgeDefaultsSpecified_usesSpecified() {
    // Given
    Properties properties = new Properties();
    properties.put(XmlJetConfigLocator.HAZELCAST_JET_CONFIG_PROPERTY, "classpath:" + TEST_XML_1);
    // When
    JetConfig jetConfig = XmlJetConfigBuilder.getConfig(properties);
    // Then
    EdgeConfig edgeConfig = jetConfig.getDefaultEdgeConfig();
    assertEquals("queueSize", 999, edgeConfig.getQueueSize());
    assertEquals("packetSizeLimit", 997, edgeConfig.getPacketSizeLimit());
    assertEquals("receiveWindowMultiplier", 996, edgeConfig.getReceiveWindowMultiplier());
}
Also used : EdgeConfig(com.hazelcast.jet.config.EdgeConfig) Properties(java.util.Properties) JetConfig(com.hazelcast.jet.config.JetConfig) Test(org.junit.Test)

Example 53 with JetConfig

use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.

the class XmlConfigTest method when_configMemberHasVariable_variablesAreReplaced.

@Ignore("To confirm if substitution in Jet should be visible to IMDG")
@Test
public void when_configMemberHasVariable_variablesAreReplaced() {
    // Given
    Properties properties = new Properties();
    properties.put(XmlJetConfigLocator.HAZELCAST_MEMBER_CONFIG_PROPERTY, "classpath:${my.filename}");
    properties.put("my.filename", TEST_XML_2);
    properties.put("imdg.instance.name", INSTANCE_NAME);
    // When
    JetConfig jetConfig = XmlJetConfigBuilder.getConfig(properties);
    // Then
    assertXmlMemberConfig(jetConfig.getHazelcastConfig());
    assertThat(jetConfig.getHazelcastConfig().getInstanceName(), equalTo(INSTANCE_NAME));
}
Also used : Properties(java.util.Properties) JetConfig(com.hazelcast.jet.config.JetConfig) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 54 with JetConfig

use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet-reference-manual by hazelcast.

the class LogDebug method s2.

static void s2() {
    // tag::s2[]
    JetConfig config = new JetConfig();
    config.getHazelcastConfig().setProperty("hazelcast.logging.type", "log4j");
// end::s2[]
}
Also used : JetConfig(com.hazelcast.jet.config.JetConfig)

Example 55 with JetConfig

use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet-reference-manual by hazelcast.

the class Configuration method s2.

static void s2() {
    // tag::s2[]
    JetConfig jetConfig = new JetConfig();
    jetConfig.getHazelcastConfig().getGroupConfig().setName("test");
    JetInstance jet = Jet.newJetInstance(jetConfig);
// end::s2[]
}
Also used : JetInstance(com.hazelcast.jet.JetInstance) JetConfig(com.hazelcast.jet.config.JetConfig)

Aggregations

JetConfig (com.hazelcast.jet.config.JetConfig)56 Before (org.junit.Before)21 Test (org.junit.Test)15 JetInstance (com.hazelcast.jet.JetInstance)14 Config (com.hazelcast.config.Config)10 Properties (java.util.Properties)9 EventJournalConfig (com.hazelcast.config.EventJournalConfig)8 CountDownLatch (java.util.concurrent.CountDownLatch)7 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)4 EdgeConfig (com.hazelcast.jet.config.EdgeConfig)4 ClientConfig (com.hazelcast.client.config.ClientConfig)3 MapConfig (com.hazelcast.config.MapConfig)3 JobConfig (com.hazelcast.jet.config.JobConfig)3 MockPS (com.hazelcast.jet.core.TestProcessors.MockPS)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 InputStream (java.io.InputStream)3 JoinConfig (com.hazelcast.config.JoinConfig)2 HazelcastInstance (com.hazelcast.core.HazelcastInstance)2 JetTestInstanceFactory (com.hazelcast.jet.JetTestInstanceFactory)2 Job (com.hazelcast.jet.Job)2