use of org.guvnor.ala.wildfly.model.WildflyProviderImpl in project kie-wb-common by kiegroup.
the class WildflyAccessInterfaceImplTest method testWildflyClient.
@Test
public void testWildflyClient() {
final String hostId = "localhost";
final String port = "8081";
final String managementPort = "9991";
final String user = "admin";
final String password = "pass";
final WildflyClient client = accessInterface.getWildflyClient(new WildflyProviderImpl(new WildflyProviderConfigImpl(PROVIDER, hostId, port, managementPort, user, password)));
assertNotNull(client);
assertEquals(client.getPort(), 8081);
assertEquals(client.getManagementPort(), 9991);
assertEquals(client.getHost(), hostId);
assertEquals(client.getProviderName(), PROVIDER);
assertEquals(client.getUser(), user);
assertEquals(client.getPassword(), password);
}
use of org.guvnor.ala.wildfly.model.WildflyProviderImpl in project kie-wb-common by kiegroup.
the class WildflyAccessInterfaceImplTest method testWildflyClientNull.
@Test
public void testWildflyClientNull() {
final WildflyClient client = accessInterface.getWildflyClient(new WildflyProviderImpl(new WildflyProviderConfigImpl(PROVIDER, null, null, null, null, null)));
assertNotNull(client);
assertEquals(client.getPort(), 8080);
assertEquals(client.getManagementPort(), 9990);
}
use of org.guvnor.ala.wildfly.model.WildflyProviderImpl in project kie-wb-common by kiegroup.
the class WildflyProviderConfigExecutor method apply.
@Override
public Optional<WildflyProvider> apply(final WildflyProviderConfig wildflyProviderConfig) {
if (wildflyProviderConfig.getName() == null || wildflyProviderConfig.getName().isEmpty()) {
throw new ProvisioningException("No name was provided for the WildflyProviderConfig.getName() " + "configuration parameter. You might probably have to properly set " + "the pipeline input parameter: " + ProviderConfig.PROVIDER_NAME);
}
Provider provider = runtimeRegistry.getProvider(wildflyProviderConfig.getName());
WildflyProvider wildflyProvider;
if (provider != null) {
if (!(provider instanceof WildflyProvider)) {
throw new ProvisioningException("The provider: " + wildflyProviderConfig.getName() + " must be an instance of " + WildflyProviderConfig.class + " but is: " + provider.getClass());
} else {
wildflyProvider = (WildflyProvider) provider;
}
} else {
wildflyProvider = new WildflyProviderImpl(new WildflyProviderConfigImpl(wildflyProviderConfig.getName(), wildflyProviderConfig.getHost(), wildflyProviderConfig.getPort(), wildflyProviderConfig.getManagementPort(), wildflyProviderConfig.getUser(), wildflyProviderConfig.getPassword()));
runtimeRegistry.registerProvider(wildflyProvider);
}
return Optional.of(wildflyProvider);
}
Aggregations