forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#38642 from karesti/dev-services-improv-i…
…nfinispan Adds config file overload for devservices in Infinispan
- Loading branch information
Showing
8 changed files
with
111 additions
and
5 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
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
29 changes: 29 additions & 0 deletions
29
...st/java/io/quarkus/infinispan/test/CreateADefaultRemoteCacheManagerWithEmptyConfTest.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,29 @@ | ||
|
||
package io.quarkus.infinispan.test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import jakarta.enterprise.inject.Default; | ||
|
||
import org.infinispan.client.hotrod.RemoteCacheManager; | ||
import org.infinispan.counter.api.CounterManager; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.arc.Arc; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class CreateADefaultRemoteCacheManagerWithEmptyConfTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withConfigurationResource("empty-application-infinispan-client.properties"); | ||
|
||
@Test | ||
public void remoteCacheManagerDefaultBeansAccessible() { | ||
assertThat(Arc.container().instance(RemoteCacheManager.class, Default.Literal.INSTANCE).get()).isNotNull(); | ||
assertThat(Arc.container().instance(CounterManager.class, Default.Literal.INSTANCE).get()).isNotNull(); | ||
assertThat(Arc.container().listAll(RemoteCacheManager.class).size()).isEqualTo(1); | ||
assertThat(Arc.container().listAll(CounterManager.class).size()).isEqualTo(1); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...nt/src/test/java/io/quarkus/infinispan/test/OverrideContainerConfigOnDevServicesTest.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,29 @@ | ||
|
||
package io.quarkus.infinispan.test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import jakarta.inject.Inject; | ||
|
||
import org.infinispan.client.hotrod.RemoteCacheManager; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class OverrideContainerConfigOnDevServicesTest { | ||
|
||
@Inject | ||
RemoteCacheManager cacheManager; | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addAsResource("server-config-override.xml")) | ||
.withConfigurationResource("dev-services-adds-server-config.properties"); | ||
|
||
@Test | ||
public void remoteCacheManagerDefaultBeansAccessible() { | ||
assertThat(cacheManager.getCacheNames()).contains("my-local-cache"); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...nfinispan-client/deployment/src/test/resources/dev-services-adds-server-config.properties
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,3 @@ | ||
quarkus.infinispan-client.devservices.enabled=true | ||
quarkus.infinispan-client.devservices.config-files=server-config-override.xml | ||
|
1 change: 0 additions & 1 deletion
1
...ispan-client/deployment/src/test/resources/empty-application-infinispan-client.properties
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 |
---|---|---|
@@ -1 +0,0 @@ | ||
|
||
8 changes: 8 additions & 0 deletions
8
extensions/infinispan-client/deployment/src/test/resources/server-config-override.xml
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,8 @@ | ||
<infinispan> | ||
<cache-container> | ||
<metrics accurate-size="true"/> | ||
<local-cache name="my-local-cache"> | ||
<encoding media-type="application/x-protostream" /> | ||
</local-cache> | ||
</cache-container> | ||
</infinispan> |
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