Skip to content

Commit

Permalink
Revert #295 and add @experimental. (#300)
Browse files Browse the repository at this point in the history
* Revert "Moved API classes to their own module. (#295)"

This reverts commit 8581174

* Added Experimental annotation.

* Fixed tests.
  • Loading branch information
radcortez committed May 6, 2020
1 parent c0828e9 commit 45749d8
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 110 deletions.
100 changes: 0 additions & 100 deletions api/pom.xml

This file was deleted.

4 changes: 2 additions & 2 deletions implementation/pom.xml
Expand Up @@ -46,8 +46,8 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config-api</artifactId>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-annotation</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.config</groupId>
Expand Down
Expand Up @@ -314,8 +314,7 @@ private static class ConfigSources implements Serializable {
ConfigSources(final List<ConfigSource> sources, final ConfigSources configSources) {
sources.sort(CONFIG_SOURCE_COMPARATOR);

SmallRyeConfigSourceInterceptorContext current = new SmallRyeConfigSourceInterceptorContext(
EMPTY, null);
SmallRyeConfigSourceInterceptorContext current = new SmallRyeConfigSourceInterceptorContext(EMPTY, null);

for (int i = sources.size() - 1; i >= 0; i--) {
current = new SmallRyeConfigSourceInterceptorContext(configSourceInterceptor(sources.get(i)), current);
Expand Down
Expand Up @@ -5,6 +5,7 @@
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;

import java.io.IOException;
import java.util.AbstractMap;
import java.util.Collection;
import java.util.HashMap;
Expand Down Expand Up @@ -98,6 +99,20 @@ public void values() {
assertThrows(UnsupportedOperationException.class, () -> values.remove("1234"));
}

@Test
public void configSourceMap() throws IOException {
final ConfigValuePropertiesConfigSource configSource = new ConfigValuePropertiesConfigSource(
ConfigValueMapViewTest.class.getResource("/config-values.properties"));
final Map<String, String> properties = configSource.getProperties();

assertEquals("abc", properties.get("my.prop"));
assertEquals("abc", properties.get("my.prop"));
assertThrows(UnsupportedOperationException.class, () -> properties.remove("x"));
assertThrows(UnsupportedOperationException.class, () -> properties.put("x", "x"));
assertThrows(UnsupportedOperationException.class, () -> properties.putAll(new HashMap<>()));
assertThrows(UnsupportedOperationException.class, properties::clear);
}

private ConfigValueMapView sampleMap() {
final Map<String, ConfigValue> configValueMap = new HashMap<>();
configValueMap.put("my.prop", ConfigValue.builder().withName("my.prop").withValue("1234").build());
Expand Down
6 changes: 0 additions & 6 deletions pom.xml
Expand Up @@ -65,7 +65,6 @@

<modules>
<module>common</module>
<module>api</module>
<module>implementation</module>
<module>sources/hocon</module>
<module>sources/file-system</module>
Expand Down Expand Up @@ -133,11 +132,6 @@
</dependency>

<!-- Dependencies provided by the project -->
<dependency>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config-common</artifactId>
Expand Down

0 comments on commit 45749d8

Please sign in to comment.