Skip to content

Commit aba5d5c

Browse files
committed
Formatting
1 parent 8f88f8a commit aba5d5c

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/CustomLauncherInterceptor.java

+44-44
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class CustomLauncherInterceptor implements LauncherInterceptor {
3434
public CustomLauncherInterceptor() throws Exception {
3535
System.out.println("HOLLY interceipt construct" + getClass().getClassLoader());
3636
ClassLoader parent = Thread.currentThread()
37-
.getContextClassLoader();
37+
.getContextClassLoader();
3838
System.out.println("HOLLY CCL is " + parent);
3939

4040
customClassLoader = parent;
@@ -46,7 +46,7 @@ public <T> T intercept(Invocation<T> invocation) {
4646
// We visit this several times
4747
System.out.println("HOLLY interceipt doing" + invocation);
4848
System.out.println("HOLLY interceipt support is " + TestSupport.instance()
49-
.isPresent());
49+
.isPresent());
5050
System.out.println("HOLLY interceipt holder is " + StartupActionHolder.getStored());
5151

5252
// This class sets a Thead Context Classloader, which JUnit uses to load classes.
@@ -69,13 +69,13 @@ public <T> T intercept(Invocation<T> invocation) {
6969
if (invocation instanceof LauncherSession) {
7070
LauncherSession sess = (LauncherSession) invocation;
7171
sess.getLauncher()
72-
.registerLauncherDiscoveryListeners(new LauncherDiscoveryListener() {
73-
@Override
74-
public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) {
75-
System.out.println("YOYO discovery started " + request);
76-
LauncherDiscoveryListener.super.launcherDiscoveryStarted(request);
77-
}
78-
});
72+
.registerLauncherDiscoveryListeners(new LauncherDiscoveryListener() {
73+
@Override
74+
public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) {
75+
System.out.println("YOYO discovery started " + request);
76+
LauncherDiscoveryListener.super.launcherDiscoveryStarted(request);
77+
}
78+
});
7979
}
8080

8181
Thread currentThread = Thread.currentThread();
@@ -98,8 +98,8 @@ public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) {
9898

9999
System.out.println("HOLLY before launch mode is " + LaunchMode.current());
100100
System.out.println("HOLLY other way us " + ConfigProvider.getConfig()
101-
.unwrap(SmallRyeConfig.class)
102-
.getProfiles());
101+
.unwrap(SmallRyeConfig.class)
102+
.getProfiles());
103103
try {
104104
System.out.println("HOLLY interceipt original" + originalClassLoader);
105105
CoreQuarkusTestExtension coreQuarkusTestExtension = new CoreQuarkusTestExtension();
@@ -112,8 +112,8 @@ public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) {
112112
// TODO massi ve assumptions, completely ignoring multi module projects
113113
// Assume the test class lives in the first element on the classpath
114114
Path projectRoot = Paths.get("")
115-
.normalize()
116-
.toAbsolutePath();
115+
.normalize()
116+
.toAbsolutePath();
117117

118118
// TODO can we be more elegant about this? What about multi-module?
119119
// TODO should we cross-reference against the classpath?
@@ -135,7 +135,7 @@ public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) {
135135
}
136136

137137
String[] ses = System.getProperty("java.class.path")
138-
.split(":");
138+
.split(":");
139139
for (String s : ses) {
140140
Path path = Paths.get(s);
141141
if (path.normalize()
@@ -165,34 +165,34 @@ public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) {
165165
System.out.println("An alternate root we couuld do is " + projectRoot);
166166
System.out.println(
167167
"That gives gradlle " + getGradleAppModelForIDE(Paths.get("")
168-
.normalize()
169-
.toAbsolutePath()));
168+
.normalize()
169+
.toAbsolutePath()));
170170

171171
curatedApplication = QuarkusBootstrap.builder()
172-
//.setExistingModel(gradleAppModel)
173-
// unfortunately this model is not
174-
// re-usable
175-
// due
176-
// to PathTree serialization by Gradle
177-
.setIsolateDeployment(true)
178-
.setMode(
179-
QuarkusBootstrap.Mode.TEST) //
180-
// Even in continuous testing, we set
181-
// the mode to test - here, if we go
182-
// down this path we know it's normal mode
183-
// is this always right?
184-
.setTest(true)
185-
186-
.setApplicationRoot(applicationRoot)
187-
188-
// .setTargetDirectory(
189-
// PathTestHelper
190-
// .getProjectBuildDir(
191-
// projectRoot, testClassLocation))
192-
.setProjectRoot(projectRoot)
193-
// .setApplicationRoot(rootBuilder.build())
194-
.build()
195-
.bootstrap();
172+
//.setExistingModel(gradleAppModel)
173+
// unfortunately this model is not
174+
// re-usable
175+
// due
176+
// to PathTree serialization by Gradle
177+
.setIsolateDeployment(true)
178+
.setMode(
179+
QuarkusBootstrap.Mode.TEST) //
180+
// Even in continuous testing, we set
181+
// the mode to test - here, if we go
182+
// down this path we know it's normal mode
183+
// is this always right?
184+
.setTest(true)
185+
186+
.setApplicationRoot(applicationRoot)
187+
188+
// .setTargetDirectory(
189+
// PathTestHelper
190+
// .getProjectBuildDir(
191+
// projectRoot, testClassLocation))
192+
.setProjectRoot(projectRoot)
193+
// .setApplicationRoot(rootBuilder.build())
194+
.build()
195+
.bootstrap();
196196

197197
// QuarkusClassLoader tcl = curatedApplication
198198
// .createDeploymentClassLoader();
@@ -212,7 +212,7 @@ public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) {
212212

213213
System.out.println("HOLLY after launch mode is " + LaunchMode.current());
214214
final QuarkusBootstrap.Mode currentMode = curatedApplication.getQuarkusBootstrap()
215-
.getMode();
215+
.getMode();
216216
ClassLoader loader = coreQuarkusTestExtension.doJavaStart(applicationRoot,
217217
curatedApplication);
218218
currentThread.setContextClassLoader(loader);
@@ -230,10 +230,10 @@ public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) {
230230
} else {
231231
// TODO should we be unsetting the classloader somewhere?
232232
Thread.currentThread()
233-
.setContextClassLoader(StartupActionHolder.getStored()
234-
.getClassLoader());
233+
.setContextClassLoader(StartupActionHolder.getStored()
234+
.getClassLoader());
235235
System.out.println("HOLLY NOW TCCL IS " + Thread.currentThread()
236-
.getContextClassLoader());
236+
.getContextClassLoader());
237237
return invocation.proceed();
238238
}
239239
}

0 commit comments

Comments
 (0)