Search in sources :

Example 1 with WildflyRuntimeExecConfig

use of org.guvnor.ala.wildfly.config.WildflyRuntimeExecConfig in project kie-wb-common by kiegroup.

the class ContextAwareWildflyRuntimeExecConfigTest method testContextUsingPath.

@Test
public void testContextUsingPath() {
    final ContextAwareWildflyRuntimeExecConfig config = new ContextAwareWildflyRuntimeExecConfig();
    final WildflyProvider provider = mock(WildflyProvider.class);
    final Map<String, Object> context = singletonMap("wildfly-provider", provider);
    config.setContext(context);
    assertEquals(provider, config.getProviderId());
    assertEquals(WAR_PATH_DEFAULT_EXPRESSION, config.getWarPath());
    final WildflyRuntimeExecConfig configClone = config.asNewClone(config);
    assertEquals(provider, configClone.getProviderId());
    assertEquals(WAR_PATH_DEFAULT_EXPRESSION, configClone.getWarPath());
}
Also used : ContextAwareWildflyRuntimeExecConfig(org.guvnor.ala.wildfly.config.impl.ContextAwareWildflyRuntimeExecConfig) WildflyRuntimeExecConfig(org.guvnor.ala.wildfly.config.WildflyRuntimeExecConfig) ContextAwareWildflyRuntimeExecConfig(org.guvnor.ala.wildfly.config.impl.ContextAwareWildflyRuntimeExecConfig) WildflyProvider(org.guvnor.ala.wildfly.model.WildflyProvider) Test(org.junit.Test)

Example 2 with WildflyRuntimeExecConfig

use of org.guvnor.ala.wildfly.config.WildflyRuntimeExecConfig in project kie-wb-common by kiegroup.

the class ContextAwareWildflyRuntimeExecConfigTest method testContextUsingMavenBinary.

@Test
public void testContextUsingMavenBinary() {
    final ContextAwareWildflyRuntimeExecConfig config = new ContextAwareWildflyRuntimeExecConfig();
    final Map<String, Object> context = new HashMap<>();
    final WildflyProvider provider = mock(WildflyProvider.class);
    context.put("wildfly-provider", provider);
    final MavenBinary binary = mock(MavenBinary.class);
    final Path path = mock(Path.class);
    when(binary.getPath()).thenReturn(path);
    when(path.toString()).thenReturn(FILE_PATH);
    context.put("binary", binary);
    config.setContext(context);
    assertEquals(provider, config.getProviderId());
    assertEquals(FILE_PATH, config.getWarPath());
    final WildflyRuntimeExecConfig configClone = config.asNewClone(config);
    assertEquals(provider, configClone.getProviderId());
    assertEquals(FILE_PATH, configClone.getWarPath());
}
Also used : Path(org.uberfire.java.nio.file.Path) HashMap(java.util.HashMap) ContextAwareWildflyRuntimeExecConfig(org.guvnor.ala.wildfly.config.impl.ContextAwareWildflyRuntimeExecConfig) WildflyRuntimeExecConfig(org.guvnor.ala.wildfly.config.WildflyRuntimeExecConfig) ContextAwareWildflyRuntimeExecConfig(org.guvnor.ala.wildfly.config.impl.ContextAwareWildflyRuntimeExecConfig) MavenBinary(org.guvnor.ala.build.maven.model.MavenBinary) WildflyProvider(org.guvnor.ala.wildfly.model.WildflyProvider) Test(org.junit.Test)

Aggregations

WildflyRuntimeExecConfig (org.guvnor.ala.wildfly.config.WildflyRuntimeExecConfig)2 ContextAwareWildflyRuntimeExecConfig (org.guvnor.ala.wildfly.config.impl.ContextAwareWildflyRuntimeExecConfig)2 WildflyProvider (org.guvnor.ala.wildfly.model.WildflyProvider)2 Test (org.junit.Test)2 HashMap (java.util.HashMap)1 MavenBinary (org.guvnor.ala.build.maven.model.MavenBinary)1 Path (org.uberfire.java.nio.file.Path)1