Search in sources :

Example 31 with Description

use of io.qameta.allure.Description in project mule by mulesoft.

the class ExtensionsClientTestCase method executeVoidOperation.

@Test
@Description("Executes a void operation using the client")
public void executeVoidOperation() throws Throwable {
    OperationParameters params = builder().configName(HEISENBERG_CONFIG).build();
    Result<Object, Object> result = doExecute(HEISENBERG_EXT_NAME, "die", params);
    assertThat(result.getOutput(), is(nullValue()));
    assertThat(result.getAttributes().isPresent(), is(false));
}
Also used : OperationParameters(org.mule.runtime.extension.api.client.OperationParameters) Description(io.qameta.allure.Description) Test(org.junit.Test)

Example 32 with Description

use of io.qameta.allure.Description in project mule by mulesoft.

the class ExtensionsClientTestCase method executeOperationWithParameterGroup.

@Test
@Description("Executes an operation that has a parameter group using the client and checks the output")
public void executeOperationWithParameterGroup() throws Throwable {
    OperationParameters params = builder().configName(HEISENBERG_CONFIG).addParameter("greeting", "jeje").addParameter("age", 23).addParameter("name", "Juani").addParameter("knownAddresses", emptyList()).build();
    Result<String, Object> result = doExecute(HEISENBERG_EXT_NAME, "alias", params);
    assertThat(result.getOutput(), is(ALIAS_OUTPUT));
}
Also used : OperationParameters(org.mule.runtime.extension.api.client.OperationParameters) Description(io.qameta.allure.Description) Test(org.junit.Test)

Example 33 with Description

use of io.qameta.allure.Description in project mule by mulesoft.

the class ExtensionsClientTestCase method nonExistentOperation.

@Test
@Description("Tries to execute an operation that does not exist")
public void nonExistentOperation() throws Throwable {
    exception.expect(MuleRuntimeException.class);
    exception.expectMessage("No Operation [operationDontExist] Found");
    OperationParameters params = builder().configName("config").build();
    doExecute(VEGAN, "operationDontExist", params);
}
Also used : OperationParameters(org.mule.runtime.extension.api.client.OperationParameters) Description(io.qameta.allure.Description) Test(org.junit.Test)

Example 34 with Description

use of io.qameta.allure.Description in project mule by mulesoft.

the class DirectProcessingStrategyTestCase method tx.

@Override
@Description("Regardless of processor type, when the DirectProcessingStrategy is configured, the pipeline is executed " + "synchronously in a caller thread.")
public void tx() throws Exception {
    flow = flowBuilder.get().processors(cpuLightProcessor, cpuIntensiveProcessor, blockingProcessor).build();
    flow.initialise();
    flow.start();
    TransactionCoordination.getInstance().bindTransaction(new TestTransaction(muleContext));
    processFlow(testEvent());
    assertSynchronous(1);
}
Also used : TestTransaction(org.mule.tck.testmodels.mule.TestTransaction) Description(io.qameta.allure.Description)

Example 35 with Description

use of io.qameta.allure.Description in project mule by mulesoft.

the class ProactorStreamProcessingStrategyTestCase method cpuIntensiveRejectedExecution.

@Test
@Description("If CPU INTENSIVE pool is busy OVERLOAD error is thrown")
public void cpuIntensiveRejectedExecution() throws Exception {
    Scheduler cpuIntensiveSchedulerSpy = spy(cpuIntensive);
    Scheduler rejectingSchedulerSpy = spy(new RejectingScheduler(cpuIntensiveSchedulerSpy));
    flow = flowBuilder.get().processors(cpuIntensiveProcessor).processingStrategyFactory((context, prefix) -> new ProactorStreamProcessingStrategy(() -> ringBuffer, DEFAULT_BUFFER_SIZE, 1, DEFAULT_WAIT_STRATEGY, () -> cpuLight, () -> blocking, () -> rejectingSchedulerSpy, 1, 2)).build();
    flow.initialise();
    flow.start();
    processFlow(testEvent());
    verify(rejectingSchedulerSpy, times(11)).submit(any(Callable.class));
    verify(cpuIntensiveSchedulerSpy, times(1)).submit(any(Callable.class));
    assertThat(threads, hasSize(1));
    assertThat(threads.stream().filter(name -> name.startsWith(CPU_INTENSIVE)).count(), equalTo(1l));
    assertThat(threads, not(hasItem(startsWith(CPU_LIGHT))));
    assertThat(threads, not(hasItem(startsWith(IO))));
    assertThat(threads, not(hasItem(startsWith(CUSTOM))));
}
Also used : ProactorStreamProcessingStrategy(org.mule.runtime.core.internal.processor.strategy.ProactorStreamProcessingStrategyFactory.ProactorStreamProcessingStrategy) Scheduler(org.mule.runtime.api.scheduler.Scheduler) Callable(java.util.concurrent.Callable) Description(io.qameta.allure.Description) Test(org.junit.Test)

Aggregations

Description (io.qameta.allure.Description)123 Test (org.junit.Test)111 CoreEvent (org.mule.runtime.core.api.event.CoreEvent)41 Matchers.containsString (org.hamcrest.Matchers.containsString)15 Message (org.mule.runtime.api.message.Message)13 TypedValue (org.mule.runtime.api.metadata.TypedValue)13 RoutingPair (org.mule.runtime.core.internal.routing.ForkJoinStrategy.RoutingPair)12 MessageProcessorChain (org.mule.runtime.core.privileged.processor.chain.MessageProcessorChain)12 OperationParameters (org.mule.runtime.extension.api.client.OperationParameters)12 Issue (io.qameta.allure.Issue)10 Matchers.anyString (org.mockito.Matchers.anyString)8 List (java.util.List)7 MavenConfiguration (org.mule.maven.client.api.model.MavenConfiguration)7 Processor (org.mule.runtime.core.api.processor.Processor)7 PlainCommand (com.axibase.tsd.api.model.command.PlainCommand)6 PropertyCommand (com.axibase.tsd.api.model.command.PropertyCommand)6 Property (com.axibase.tsd.api.model.property.Property)6 RemoteRepository (org.mule.maven.client.api.model.RemoteRepository)6 Event (org.mule.runtime.api.event.Event)6 ReactiveProcessor (org.mule.runtime.core.api.processor.ReactiveProcessor)6