Skip to content

Commit 93cfe88

Browse files
committed
JBTM-3987 automated formatting change
1 parent b983356 commit 93cfe88

File tree

3 files changed

+52
-40
lines changed

3 files changed

+52
-40
lines changed

test/crash/src/test/java/io/narayana/lra/arquillian/Deployer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public static WebArchive createDeployment(String appName, Class<?>... classes) {
3131
.withoutTransitivity().asFile())
3232
// Support libraries from the local store of Maven
3333
.addAsLibraries(Maven.configureResolver()
34-
.workOffline()
35-
.withMavenCentralRepo(false)
36-
.withClassPathResolution(true)
37-
.resolve("org.jboss.narayana.lra:lra-service-base:" + projectVersion,
34+
.workOffline()
35+
.withMavenCentralRepo(false)
36+
.withClassPathResolution(true)
37+
.resolve("org.jboss.narayana.lra:lra-service-base:" + projectVersion,
3838
"org.jboss.narayana.lra:lra-proxy-api:" + projectVersion,
3939
"org.jboss.narayana.lra:lra-client:" + projectVersion,
4040
"org.jboss.narayana.lra:narayana-lra:" + projectVersion)
@@ -44,6 +44,6 @@ public static WebArchive createDeployment(String appName, Class<?>... classes) {
4444
new StringAsset("Dependencies: org.jboss.jandex, org.jboss.logging\n"),
4545
"MANIFEST.MF")
4646
// Adds an empty beans.xml to activate the bean in discovery-mode set to "all"
47-
.addAsWebInfResource(EmptyAsset.INSTANCE,"beans.xml");
47+
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
4848
}
4949
}

test/crash/src/test/java/io/narayana/lra/arquillian/LRACoordinatorRecoveryIT.java

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,17 @@
55

66
package io.narayana.lra.arquillian;
77

8+
import static io.narayana.lra.arquillian.resource.LRAListener.LRA_LISTENER_UNTIMED_ACTION;
9+
import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_CONTEXT_HEADER;
10+
import static org.junit.Assert.assertEquals;
11+
import static org.junit.Assert.assertNotNull;
12+
import static org.junit.Assert.fail;
13+
814
import io.narayana.lra.LRAData;
915
import io.narayana.lra.arquillian.resource.LRAListener;
1016
import io.narayana.lra.client.internal.NarayanaLRAClient;
1117
import io.narayana.lra.coordinator.domain.model.LongRunningAction;
1218
import io.narayana.lra.logging.LRALogger;
13-
import org.eclipse.microprofile.lra.annotation.LRAStatus;
14-
import org.jboss.arquillian.container.test.api.Deployment;
15-
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
16-
import org.jboss.arquillian.container.test.api.RunAsClient;
17-
import org.jboss.arquillian.container.test.api.TargetsContainer;
18-
import org.jboss.arquillian.test.api.ArquillianResource;
19-
import org.jboss.shrinkwrap.api.spec.WebArchive;
20-
import org.junit.After;
21-
import org.junit.Assert;
22-
import org.junit.Before;
23-
import org.junit.BeforeClass;
24-
import org.junit.Rule;
25-
import org.junit.Test;
26-
import org.junit.rules.TestName;
27-
2819
import jakarta.ws.rs.NotFoundException;
2920
import jakarta.ws.rs.client.Client;
3021
import jakarta.ws.rs.client.ClientBuilder;
@@ -47,12 +38,20 @@
4738
import java.util.Map;
4839
import java.util.Optional;
4940
import java.util.stream.Stream;
50-
51-
import static io.narayana.lra.arquillian.resource.LRAListener.LRA_LISTENER_UNTIMED_ACTION;
52-
import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_CONTEXT_HEADER;
53-
import static org.junit.Assert.assertEquals;
54-
import static org.junit.Assert.assertNotNull;
55-
import static org.junit.Assert.fail;
41+
import org.eclipse.microprofile.lra.annotation.LRAStatus;
42+
import org.jboss.arquillian.container.test.api.Deployment;
43+
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
44+
import org.jboss.arquillian.container.test.api.RunAsClient;
45+
import org.jboss.arquillian.container.test.api.TargetsContainer;
46+
import org.jboss.arquillian.test.api.ArquillianResource;
47+
import org.jboss.shrinkwrap.api.spec.WebArchive;
48+
import org.junit.After;
49+
import org.junit.Assert;
50+
import org.junit.Before;
51+
import org.junit.BeforeClass;
52+
import org.junit.Rule;
53+
import org.junit.Test;
54+
import org.junit.rules.TestName;
5655

5756
/**
5857
* This test class testes that an LRA is cancelled after lra-coordinator is restarted.
@@ -141,7 +140,8 @@ public static WebArchive deploy() {
141140
}
142141

143142
@Test
144-
public void lraCoordinatorShortTimeoutLRA(@ArquillianResource @OperateOnDeployment(LRA_PARTICIPANT_DEPLOYMENT_QUALIFIER) URL baseURL)
143+
public void lraCoordinatorShortTimeoutLRA(
144+
@ArquillianResource @OperateOnDeployment(LRA_PARTICIPANT_DEPLOYMENT_QUALIFIER) URL baseURL)
145145
throws URISyntaxException {
146146

147147
String lraId;
@@ -180,12 +180,15 @@ public void lraCoordinatorShortTimeoutLRA(@ArquillianResource @OperateOnDeployme
180180
// Verifies that the resource was notified that the LRA finished
181181
String listenerStatus = getStatusFromListener(lraListenerURI);
182182

183-
assertEquals(String.format("The service lra-listener should have been told that the final state of the LRA %s was cancelled", lraId),
183+
assertEquals(
184+
String.format("The service lra-listener should have been told that the final state of the LRA %s was cancelled",
185+
lraId),
184186
LRAStatus.Cancelled.name(), listenerStatus);
185187
}
186188

187189
@Test
188-
public void lraCoordinatorRecoveryTwoLRAs(@ArquillianResource @OperateOnDeployment(LRA_PARTICIPANT_DEPLOYMENT_QUALIFIER) URL deploymentUrl)
190+
public void lraCoordinatorRecoveryTwoLRAs(
191+
@ArquillianResource @OperateOnDeployment(LRA_PARTICIPANT_DEPLOYMENT_QUALIFIER) URL deploymentUrl)
189192
throws URISyntaxException {
190193

191194
URI lraListenerURI = UriBuilder.fromUri(deploymentUrl.toURI()).path(LRAListener.LRA_LISTENER_PATH).build();
@@ -235,7 +238,8 @@ private void doWait(long millis) {
235238
try {
236239
Thread.sleep(millis);
237240
} catch (InterruptedException ex) {
238-
LRALogger.logger.errorf("An exception has been thrown while the test was trying to wait for %d milliseconds", millis);
241+
LRALogger.logger.errorf("An exception has been thrown while the test was trying to wait for %d milliseconds",
242+
millis);
239243
Assert.fail();
240244
}
241245
}
@@ -252,7 +256,8 @@ private int recover() {
252256
.request()
253257
.get()) {
254258

255-
Assert.assertEquals("Unexpected status from recovery call to " + lraClient.getRecoveryUrl(), 200, response.getStatus());
259+
Assert.assertEquals("Unexpected status from recovery call to " + lraClient.getRecoveryUrl(), 200,
260+
response.getStatus());
256261

257262
// The result will be a List<LRAStatusHolder> of recovering LRAs but we just need the count
258263
String recoveringLRAs = response.readEntity(String.class);
@@ -289,7 +294,10 @@ private String getStatusFromListener(URI lraListenerURI) {
289294
}
290295

291296
/**
292-
* <p>This method fetches the first LRA transaction from the File-System Object Store (ShadowNoFileLockStore).</p>
297+
* <p>
298+
* This method fetches the first LRA transaction from the File-System Object Store (ShadowNoFileLockStore).
299+
* </p>
300+
*
293301
* @return The ID of the first LRA transaction
294302
*/
295303
String getFirstLRAFromFS() {
@@ -305,7 +313,10 @@ String getFirstLRAFromFS() {
305313
}
306314

307315
/**
308-
* <p>This method fetches the last LRA transaction from lra-coordinator.</p>
316+
* <p>
317+
* This method fetches the last LRA transaction from lra-coordinator.
318+
* </p>
319+
*
309320
* @return The ID of the last LRA transaction
310321
*/
311322
String getLastLRAFromObjectStore() {
@@ -322,7 +333,8 @@ String getLastLRAFromObjectStore() {
322333
}
323334

324335
/**
325-
* <p>This method physically deletes the folder (and all its content) where the File-System Object Store is used.
336+
* <p>
337+
* This method physically deletes the folder (and all its content) where the File-System Object Store is used.
326338
*/
327339
private void clearRecoveryLogFromFS() {
328340
try (Stream<Path> recoveryLogFiles = Files.walk(storeDir)) {
@@ -332,12 +344,13 @@ private void clearRecoveryLogFromFS() {
332344
.forEach(File::delete);
333345
} catch (IOException ioe) {
334346
// transaction logs will only exists after there has been a previous run
335-
LRALogger.logger.debugf(ioe,"Cannot finish delete operation on recovery log dir '%s'", storeDir);
347+
LRALogger.logger.debugf(ioe, "Cannot finish delete operation on recovery log dir '%s'", storeDir);
336348
}
337349
}
338350

339351
/**
340-
* <p>This method deletes LRA transactions through lra-coordinator.
352+
* <p>
353+
* This method deletes LRA transactions through lra-coordinator.
341354
*/
342355
private void clearRecoveryLogFromObjectStore() {
343356

test/crash/src/test/java/io/narayana/lra/arquillian/resource/LRAListener.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@
55

66
package io.narayana.lra.arquillian.resource;
77

8+
import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_CONTEXT_HEADER;
9+
810
import jakarta.ws.rs.GET;
911
import jakarta.ws.rs.HeaderParam;
1012
import jakarta.ws.rs.PUT;
1113
import jakarta.ws.rs.Path;
1214
import jakarta.ws.rs.Produces;
1315
import jakarta.ws.rs.core.Response;
16+
import java.net.URI;
1417
import org.eclipse.microprofile.lra.annotation.AfterLRA;
1518
import org.eclipse.microprofile.lra.annotation.LRAStatus;
1619
import org.eclipse.microprofile.lra.annotation.ws.rs.LRA;
1720

18-
import java.net.URI;
19-
20-
import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_CONTEXT_HEADER;
21-
2221
@Path(LRAListener.LRA_LISTENER_PATH)
2322
public class LRAListener {
2423
public static final String LRA_LISTENER_PATH = "lra-listener";

0 commit comments

Comments
 (0)