use of com.redhat.jenkins.plugins.ci.GlobalCIConfiguration in project jms-messaging-plugin by jenkinsci.
the class AmqMessagingPluginIntegrationTest method setUp.
@Before
public void setUp() throws IOException, InterruptedException {
// Can be moved to @BeforeClass, BUT there are tests that stops the container on purpose - breaks subsequent tests.
amq = docker.create();
String brokerUrl = amq.getBroker();
Thread.sleep(3000);
GlobalCIConfiguration gcc = GlobalCIConfiguration.get();
gcc.setConfigs(Collections.singletonList(new ActiveMqMessagingProvider(DEFAULT_PROVIDER_NAME, brokerUrl, false, DEFAULT_TOPIC_NAME, null, new UsernameAuthenticationMethod("admin", Secret.fromString("redhat")))));
// TODO test connection
}
use of com.redhat.jenkins.plugins.ci.GlobalCIConfiguration in project jms-messaging-plugin by jenkinsci.
the class AmqMessagingPluginLockdownIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
ActiveMQContainer amq = docker.create();
GlobalCIConfiguration gcc = GlobalCIConfiguration.get();
gcc.setConfigs(Collections.singletonList(new ActiveMqMessagingProvider("name", createFailoverUrl(amq.getBroker()), true, "CI", null, new UsernameAuthenticationMethod("admin", Secret.fromString("redhat")))));
String adminUser = "admin";
String user = "user";
configureSecurity(adminUser, user);
// TODO test connection. WebClient? Rest?
}
use of com.redhat.jenkins.plugins.ci.GlobalCIConfiguration in project jms-messaging-plugin by jenkinsci.
the class AmqMessagingPluginWithFailoverIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
amq = docker.create();
GlobalCIConfiguration gcc = GlobalCIConfiguration.get();
gcc.setConfigs(Collections.singletonList(new ActiveMqMessagingProvider(SharedMessagingPluginIntegrationTest.DEFAULT_PROVIDER_NAME, createFailoverUrl(amq.getBroker()), true, "CI", null, new UsernameAuthenticationMethod("admin", Secret.fromString("redhat")))));
// TODO test connection. WebClient? Rest?
}
use of com.redhat.jenkins.plugins.ci.GlobalCIConfiguration in project jms-messaging-plugin by jenkinsci.
the class MessageUtils method sendMessage.
public static SendResult sendMessage(Run<?, ?> build, TaskListener listener, ProviderData pdata) {
String startMessage = "Sending message for job '" + build.getParent().getName() + "'.";
log.info(startMessage);
listener.getLogger().println(startMessage);
GlobalCIConfiguration config = GlobalCIConfiguration.get();
JMSMessagingWorker worker = config.getProvider(pdata.getName()).createWorker(pdata, build.getParent().getName());
SendResult sendResult = worker.sendMessage(build, listener, pdata);
String completedMessage = "Sent successfully with messageId: " + sendResult.getMessageId();
log.info(completedMessage);
listener.getLogger().println(completedMessage);
return sendResult;
}
Aggregations