forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More appropriate test application module initialization in QuarkusDev…
…ModeTest
- Loading branch information
Alexey Loubyansky
committed
Nov 28, 2024
1 parent
d4cbdb2
commit 074f1b2
Showing
3 changed files
with
258 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
...-framework/junit5-internal/src/main/java/io/quarkus/test/DevModeTestApplicationModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package io.quarkus.test; | ||
|
||
import java.util.Collection; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
import io.quarkus.bootstrap.model.ApplicationModel; | ||
import io.quarkus.bootstrap.model.ExtensionCapabilities; | ||
import io.quarkus.bootstrap.model.ExtensionDevModeConfig; | ||
import io.quarkus.bootstrap.model.PlatformImports; | ||
import io.quarkus.maven.dependency.ArtifactKey; | ||
import io.quarkus.maven.dependency.ResolvedDependency; | ||
|
||
/** | ||
* {@link ApplicationModel} implementation that allows overriding the application artifact | ||
* of another {@link ApplicationModel} instance. | ||
*/ | ||
class DevModeTestApplicationModel implements ApplicationModel { | ||
|
||
private final ResolvedDependency appArtifact; | ||
private final ApplicationModel delegate; | ||
|
||
DevModeTestApplicationModel(ResolvedDependency testAppArtifact, ApplicationModel delegate) { | ||
this.appArtifact = testAppArtifact; | ||
this.delegate = delegate; | ||
} | ||
|
||
@Override | ||
public ResolvedDependency getAppArtifact() { | ||
return appArtifact; | ||
} | ||
|
||
@Override | ||
public Collection<ResolvedDependency> getDependencies() { | ||
return delegate.getDependencies(); | ||
} | ||
|
||
@Override | ||
public Iterable<ResolvedDependency> getDependencies(int flags) { | ||
return delegate.getDependencies(flags); | ||
} | ||
|
||
@Override | ||
public Iterable<ResolvedDependency> getDependenciesWithAnyFlag(int... flags) { | ||
return delegate.getDependenciesWithAnyFlag(flags); | ||
} | ||
|
||
@Override | ||
public Collection<ResolvedDependency> getRuntimeDependencies() { | ||
return delegate.getRuntimeDependencies(); | ||
} | ||
|
||
@Override | ||
public PlatformImports getPlatforms() { | ||
return delegate.getPlatforms(); | ||
} | ||
|
||
@Override | ||
public Collection<ExtensionCapabilities> getExtensionCapabilities() { | ||
return delegate.getExtensionCapabilities(); | ||
} | ||
|
||
@Override | ||
public Set<ArtifactKey> getParentFirst() { | ||
return delegate.getParentFirst(); | ||
} | ||
|
||
@Override | ||
public Set<ArtifactKey> getRunnerParentFirst() { | ||
return delegate.getRunnerParentFirst(); | ||
} | ||
|
||
@Override | ||
public Set<ArtifactKey> getLowerPriorityArtifacts() { | ||
return delegate.getLowerPriorityArtifacts(); | ||
} | ||
|
||
@Override | ||
public Set<ArtifactKey> getReloadableWorkspaceDependencies() { | ||
return delegate.getReloadableWorkspaceDependencies(); | ||
} | ||
|
||
@Override | ||
public Map<ArtifactKey, Set<String>> getRemovedResources() { | ||
return delegate.getRemovedResources(); | ||
} | ||
|
||
@Override | ||
public Collection<ExtensionDevModeConfig> getExtensionDevModeConfig() { | ||
return delegate.getExtensionDevModeConfig(); | ||
} | ||
} |
Oops, something went wrong.