http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/main/java/org/apache/tamaya/microprofile/converter/BooleanAsIntegerConverterFix.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/main/java/org/apache/tamaya/microprofile/converter/BooleanAsIntegerConverterFix.java b/modules/microprofile/src/main/java/org/apache/tamaya/microprofile/converter/BooleanAsIntegerConverterFix.java deleted file mode 100644 index 1debc71..0000000 --- a/modules/microprofile/src/main/java/org/apache/tamaya/microprofile/converter/BooleanAsIntegerConverterFix.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile.converter; - -import org.apache.tamaya.spi.ConversionContext; -import org.apache.tamaya.spi.PropertyConverter; - -import javax.annotation.Priority; -import java.util.Locale; -import java.util.Objects; -import java.util.logging.Logger; - -/** - * Converter, converting from String to Boolean for 1 = true, otherwise false. - */ -@Priority(-1) -public class BooleanAsIntegerConverterFix implements PropertyConverter<Boolean> { - - private final Logger LOG = Logger.getLogger(getClass().getName()); - - @Override - public Boolean convert(String value, ConversionContext context) { - context.addSupportedFormats(getClass(), "'1' (true), otherwise false."); - try{ - int val = Integer.parseInt(Objects.requireNonNull(value).trim()); - if(val==1) { - return Boolean.TRUE; - } - return Boolean.FALSE; - }catch(Exception e){ - // OK - return Boolean.FALSE; - } - } - - @Override - public boolean equals(Object o){ - return getClass().equals(o.getClass()); - } - - @Override - public int hashCode(){ - return getClass().hashCode(); - } -}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/main/java/org/apache/tamaya/microprofile/converter/ProviderConverter.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/main/java/org/apache/tamaya/microprofile/converter/ProviderConverter.java b/modules/microprofile/src/main/java/org/apache/tamaya/microprofile/converter/ProviderConverter.java deleted file mode 100644 index 163481d..0000000 --- a/modules/microprofile/src/main/java/org/apache/tamaya/microprofile/converter/ProviderConverter.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile.converter; - -import org.apache.tamaya.ConfigException; -import org.apache.tamaya.ConfigQuery; -import org.apache.tamaya.Configuration; -import org.apache.tamaya.TypeLiteral; -import org.apache.tamaya.spi.ConversionContext; -import org.apache.tamaya.spi.PropertyConverter; - -import javax.annotation.Priority; -import javax.inject.Provider; -import java.lang.reflect.Type; -import java.util.List; -import java.util.Objects; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Converter, converting from String to Boolean for 1 = true, otherwise false. - */ -@Priority(-1) -public class ProviderConverter implements PropertyConverter<Provider> { - - private static final Logger LOG = Logger.getLogger(ProviderConverter.class.getName()); - - @Override - public Provider convert(String value, ConversionContext context) { - return () -> { - try{ - Type targetType = context.getTargetType().getType(); - ConvertQuery converter = new ConvertQuery(value, TypeLiteral.of(targetType)); - return context.getConfiguration().query(converter); - }catch(Exception e){ - throw new ConfigException("Error evaluating config value.", e); - } - }; - } - - @Override - public boolean equals(Object o){ - return getClass().equals(o.getClass()); - } - - @Override - public int hashCode(){ - return getClass().hashCode(); - } - - private static final class ConvertQuery<T> implements ConfigQuery<T> { - - private String rawValue; - private TypeLiteral<T> type; - - public ConvertQuery(String rawValue, TypeLiteral<T> type) { - this.rawValue = Objects.requireNonNull(rawValue); - this.type = Objects.requireNonNull(type); - } - - @Override - public T query(Configuration config) { - List<PropertyConverter<T>> converters = config.getContext().getPropertyConverters(type); - ConversionContext context = new ConversionContext.Builder(type).setConfigurationContext(config.getContext()) - .setConfiguration(config).setKey(ConvertQuery.class.getName()).build(); - for(PropertyConverter<?> conv: converters) { - try{ - if(conv instanceof ProviderConverter){ - continue; - } - T result = (T)conv.convert(rawValue, context); - if(result!=null){ - return result; - } - }catch(Exception e){ - LOG.log(Level.FINEST, e, () -> "Converter "+ conv +" failed to convert to " + type); - } - } - return null; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/modules/microprofile/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension deleted file mode 100644 index 21ec9d5..0000000 --- a/modules/microprofile/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -org.apache.tamaya.microprofile.cdi.MicroprofileCDIExtension \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter b/modules/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter deleted file mode 100644 index 2205fa2..0000000 --- a/modules/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter +++ /dev/null @@ -1,21 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -org.apache.tamaya.microprofile.converter.BooleanAsIntegerConverterFix -org.apache.tamaya.microprofile.converter.ProviderConverter \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource b/modules/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource deleted file mode 100644 index 585700b..0000000 --- a/modules/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -org.apache.tamaya.microprofile.MicroprofileDefaultProperties \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigProviderResolver ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigProviderResolver b/modules/microprofile/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigProviderResolver deleted file mode 100644 index 040f5fd..0000000 --- a/modules/microprofile/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigProviderResolver +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -org.apache.tamaya.microprofile.MicroprofileConfigProviderResolver \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/main/resources/beans.xml ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/main/resources/beans.xml b/modules/microprofile/src/main/resources/beans.xml deleted file mode 100644 index 9b07802..0000000 --- a/modules/microprofile/src/main/resources/beans.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy current the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> -<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd"> - - -</beans> - http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/BuildableConfigSource.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/BuildableConfigSource.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/BuildableConfigSource.java deleted file mode 100644 index 751a866..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/BuildableConfigSource.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.apache.tamaya.spi.PropertySource; -import org.apache.tamaya.spi.PropertyValue; -import org.eclipse.microprofile.config.spi.ConfigSource; - -import java.util.*; - -/** - * The Buildable config source. - */ -public class BuildableConfigSource implements ConfigSource{ - - private int ordinal; - private String name = "PropertySource-"+UUID.randomUUID().toString(); - private Map<String,String> properties = new HashMap<>(); - - @Override - public int getOrdinal() { - return ordinal; - } - - @Override - public String getName() { - return name; - } - - @Override - public String getValue(String key) { - return properties.get(key); - } - - @Override - public Map<String, String> getProperties() { - return Collections.unmodifiableMap(properties); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - BuildableConfigSource that = (BuildableConfigSource) o; - - return name.equals(that.name); - } - - @Override - public int hashCode() { - return name.hashCode(); - } - - @Override - public String toString() { - return "BuildableConfigSource{" + - "ordinal=" + ordinal + - ", name='" + name + '\'' + - ", properties=" + properties + - '}'; - } - - /** - * Builder builder. - * - * @return the builder - */ - public static Builder builder() { - return new Builder(); - } - - - /** - * The type Builder. - */ - public static final class Builder { - private int ordinal; - private String source = "<on-the-fly-build>"; - private String name = "ConfigSource-"+ UUID.randomUUID().toString(); - private Map<String,String> properties = new HashMap<>(); - - private Builder() { - } - - /** - * With ordinal builder. - * - * @param ordinal the ordinal - * @return the builder - */ - public Builder withOrdinal(int ordinal) { - this.ordinal = ordinal; - return this; - } - - /** - * With source builder. - * - * @param source the source - * @return the builder - */ - public Builder withSource(String source) { - this.source = Objects.requireNonNull(source); - return this; - } - - /** - * With name builder. - * - * @param name the name - * @return the builder - */ - public Builder withName(String name) { - this.name = Objects.requireNonNull(name); - return this; - } - - /** - * With simple property builder. - * - * @param key the key - * @param value the value - * @return the builder - */ - public Builder withProperty(String key, String value) { - this.properties.put(key, value); - return this; - } - - /** - * With properties builder. - * - * @param values the values - * @return the builder - */ - public Builder withProperties(Map<String,String> values) { - this.properties.putAll(values); - return this; - } - - /** - * But builder. - * - * @return the builder - */ - public Builder but() { - return builder().withOrdinal(ordinal).withName(name).withProperties(properties); - } - - /** - * Build buildable property source. - * - * @return the buildable property source - */ - public BuildableConfigSource build() { - BuildableConfigSource buildableConfigSource = new BuildableConfigSource(); - buildableConfigSource.name = this.name; - buildableConfigSource.properties = this.properties; - buildableConfigSource.ordinal = this.ordinal; - return buildableConfigSource; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/ConfigSourceParis.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/ConfigSourceParis.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/ConfigSourceParis.java deleted file mode 100644 index cb63b10..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/ConfigSourceParis.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.eclipse.microprofile.config.spi.ConfigSource; - -import java.util.Collections; -import java.util.Map; - -public class ConfigSourceParis implements ConfigSource { - @Override - public Map<String, String> getProperties() { - return Collections.emptyMap(); - } - - @Override - public String getValue(String s) { - if (s.equals("config_ordinal")) { - return "5"; - } - - return null; - } - - @Override - public String getName() { - return "paris"; - } -} http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/ConfigSourceProviderMinsk.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/ConfigSourceProviderMinsk.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/ConfigSourceProviderMinsk.java deleted file mode 100644 index ffc4ac8..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/ConfigSourceProviderMinsk.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.eclipse.microprofile.config.spi.ConfigSource; -import org.eclipse.microprofile.config.spi.ConfigSourceProvider; - -import java.util.Collections; - -public class ConfigSourceProviderMinsk implements ConfigSourceProvider { - @Override - public Iterable<ConfigSource> getConfigSources(ClassLoader classLoader) { - return Collections::emptyIterator; - } -} http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileAdapterTest.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileAdapterTest.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileAdapterTest.java deleted file mode 100644 index a8e8488..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileAdapterTest.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.apache.tamaya.*; -import org.apache.tamaya.spi.ConfigurationContext; -import org.apache.tamaya.spi.PropertyConverter; -import org.apache.tamaya.spi.PropertySource; -import org.apache.tamaya.spi.PropertyValue; -import org.apache.tamaya.spisupport.propertysource.BuildablePropertySource; -import org.assertj.core.api.Assertions; -import org.eclipse.microprofile.config.Config; -import org.eclipse.microprofile.config.ConfigProvider; -import org.eclipse.microprofile.config.spi.ConfigBuilder; -import org.eclipse.microprofile.config.spi.ConfigSource; -import org.eclipse.microprofile.config.spi.Converter; -import org.junit.Test; - -import java.util.*; - -import static org.junit.Assert.*; - -public class MicroprofileAdapterTest { - @Test - public void toConfig() throws Exception { - Configuration config = ConfigurationProvider.getConfiguration(); - Config mpConfig = MicroprofileAdapter.toConfig(config); - assertNotNull(mpConfig); - assertEquals(config.getProperties().keySet(), mpConfig.getPropertyNames()); - } - - @Test - public void toConfigWithTamayaConfiguration() throws Exception { - Configuration configuration = new MyConfiguration(); - MicroprofileConfig config = new MicroprofileConfig(configuration); - TamayaConfiguration tamayaConfiguration = new TamayaConfiguration(config); - - Config result = MicroprofileAdapter.toConfig(tamayaConfiguration); - - Assertions.assertThat(result).isNotNull() - .isInstanceOf(MicroprofileConfig.class) - .isSameAs(config); - } - - @Test - public void toConfiguration() throws Exception { - Config mpConfig = ConfigProvider.getConfig(); - Configuration config = MicroprofileAdapter.toConfiguration(mpConfig); - assertNotNull(config); - assertEquals(mpConfig.getPropertyNames(), config.getProperties().keySet()); - } - - @Test - public void toConfigurationWithNoneMicroprofileConfig() throws Exception { - Config config = new MyConfig(); - Configuration result = MicroprofileAdapter.toConfiguration(config); - - Assertions.assertThat(result).isNotNull() - .isInstanceOf(TamayaConfiguration.class); - } - - @Test - public void toConfigSources() throws Exception { - BuildablePropertySource testPropertySource = BuildablePropertySource.builder() - .withSource("toConfigSources") - .withSimpleProperty("string0", "value0") - .withSimpleProperty("int0", "0") - .build(); - List<PropertySource> tamayaSources = new ArrayList<>(); - tamayaSources.add(testPropertySource); - List<ConfigSource> configSources = MicroprofileAdapter.toConfigSources(tamayaSources); - assertNotNull(configSources); - assertEquals(tamayaSources.size(), configSources.size()); - compare(testPropertySource, configSources.get(0)); - } - - private void compare(PropertySource tamayaSource, ConfigSource mpSource) { - assertEquals(mpSource.getName(),tamayaSource.getName()); - assertEquals(mpSource.getOrdinal(), tamayaSource.getOrdinal()); - assertEquals(mpSource.getProperties().keySet(), tamayaSource.getProperties().keySet()); - for(String key:mpSource.getPropertyNames()){ - assertEquals(mpSource.getValue(key), tamayaSource.get(key).getValue()); - } - } - - @Test - public void toPropertySources() throws Exception { - BuildableConfigSource configSource = BuildableConfigSource.builder() - .withSource("toConfigSources") - .withProperty("string0", "value0") - .withProperty("int0", "0") - .build(); - List<ConfigSource> configSources = new ArrayList<>(); - configSources.add(configSource); - List<PropertySource> propertySources = MicroprofileAdapter.toPropertySources(configSources); - assertNotNull(propertySources); - assertEquals(propertySources.size(), configSources.size()); - compare(propertySources.get(0), configSource); - } - - @Test - public void toConfigSource() throws Exception { - BuildablePropertySource tamayaSource = BuildablePropertySource.builder() - .withSource("toConfigSource") - .withSimpleProperty("string0", "value0") - .withSimpleProperty("int0", "0") - .build(); - ConfigSource configSource = MicroprofileAdapter.toConfigSource(tamayaSource); - assertNotNull(configSource); - compare(tamayaSource, configSource); - } - - @Test - public void toPropertySource() throws Exception { - BuildableConfigSource configSource = BuildableConfigSource.builder() - .withSource("toConfigSource") - .withProperty("string0", "value0") - .withProperty("int0", "0") - .build(); - PropertySource tamayaSource = MicroprofileAdapter.toPropertySource(configSource); - assertNotNull(configSource); - compare(tamayaSource, configSource); - } - - @Test - public void toPropertyConverter() throws Exception { - PropertyConverter<String> tamayaConverter = MicroprofileAdapter.toPropertyConverter(new UppercaseConverter()); - assertNotNull(tamayaConverter); - assertEquals("ABC", tamayaConverter.convert("aBC", null)); - } - - @Test - public void toConverter() throws Exception { - Converter<String> mpConverter = MicroprofileAdapter.toConverter(new UppercasePropertyConverter()); - assertNotNull(mpConverter); - assertEquals("ABC", mpConverter.convert("aBC")); - } - - @Test - public void toConfigBuilder() throws Exception { - ConfigBuilder builder = MicroprofileAdapter.toConfigBuilder(ConfigurationProvider.getConfigurationContextBuilder()); - assertNotNull(builder); - } - - @Test - public void toStringMap() throws Exception { - Map<String,PropertyValue> props = new HashMap<>(); - props.put("a", PropertyValue.of("a","b", "toStringMap")); - Map<String, String> mpProps = MicroprofileAdapter.toStringMap(props); - assertNotNull(mpProps); - assertEquals(props.keySet(), mpProps.keySet()); - assertEquals(mpProps.get("a"), "b"); - } - - @Test - public void toPropertyValueMap() throws Exception { - Map<String,String> props = new HashMap<>(); - props.put("a", "b"); - Map<String, PropertyValue> tamayaProps = MicroprofileAdapter.toPropertyValueMap(props, "toPropertyValueMap"); - assertNotNull(tamayaProps); - assertEquals(tamayaProps.keySet(), props.keySet()); - assertEquals(tamayaProps.get("a").getValue(), "b"); - assertEquals("toPropertyValueMap", tamayaProps.get("a").getSource()); - } - - static class MyConfig implements Config { - @Override - public <T> T getValue(String s, Class<T> aClass) { - throw new RuntimeException("Not implemented yet!"); - } - - @Override - public <T> Optional<T> getOptionalValue(String s, Class<T> aClass) { - throw new RuntimeException("Not implemented yet!"); - } - - @Override - public Iterable<String> getPropertyNames() { - throw new RuntimeException("Not implemented yet!"); - } - - @Override - public Iterable<ConfigSource> getConfigSources() { - throw new RuntimeException("Not implemented yet!"); - } - } - - static class MyConfiguration implements Configuration { - @Override - public String get(String key) { - throw new RuntimeException("Not implemented yet!"); - } - - @Override - public String getOrDefault(String key, String defaultValue) { - throw new RuntimeException("Not implemented yet!"); - } - - @Override - public <T> T getOrDefault(String key, Class<T> type, T defaultValue) { - throw new RuntimeException("Not implemented yet!"); - } - - @Override - public <T> T get(String key, Class<T> type) { - throw new RuntimeException("Not implemented yet!"); - } - - @Override - public <T> T get(String key, TypeLiteral<T> type) { - throw new RuntimeException("Not implemented yet!"); - } - - @Override - public <T> T getOrDefault(String key, TypeLiteral<T> type, T defaultValue) { - throw new RuntimeException("Not implemented yet!"); - } - - @Override - public Map<String, String> getProperties() { - throw new RuntimeException("Not implemented yet!"); - } - - @Override - public ConfigurationContext getContext() { - throw new RuntimeException("Not implemented yet!"); - } - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilderTest.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilderTest.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilderTest.java deleted file mode 100644 index 4e9c2d1..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilderTest.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.assertj.core.api.Assertions; -import org.eclipse.microprofile.config.Config; -import org.eclipse.microprofile.config.spi.ConfigBuilder; -import org.eclipse.microprofile.config.spi.ConfigProviderResolver; -import org.eclipse.microprofile.config.spi.ConfigSource; -import org.junit.Ignore; -import org.junit.Test; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.util.stream.StreamSupport; - -import static org.junit.Assert.*; - -/** - * Created by atsticks on 24.03.17. - */ -public class MicroprofileConfigBuilderTest { - - private ConfigSource testSource = new ConfigSource() { - @Override - public Map<String, String> getProperties() { - Map<String,String> map = new HashMap<>(); - map.put("timestamp", String.valueOf(System.currentTimeMillis())); - return map; - } - - @Override - public String getValue(String propertyName) { - if("timestamp".equals(propertyName)){ - return String.valueOf(System.currentTimeMillis()); - } - return null; - } - - @Override - public String getName() { - return "test"; - } - }; - - @Test - public void testBuildEmptyConfig(){ - ConfigBuilder builder = ConfigProviderResolver.instance().getBuilder(); - assertNotNull(builder); - Config config = builder.build(); - assertNotNull(config); - assertFalse(config.getPropertyNames().iterator().hasNext()); - assertFalse(config.getConfigSources().iterator().hasNext()); - } - - @Test - public void testBuildConfig(){ - ConfigBuilder builder = ConfigProviderResolver.instance().getBuilder(); - assertNotNull(builder); - builder.withSources(testSource); - Config config = builder.build(); - assertNotNull(config); - assertTrue(config.getPropertyNames().iterator().hasNext()); - assertTrue(config.getConfigSources().iterator().hasNext()); - assertNotNull(config.getValue("timestamp", String.class)); - ConfigSource src = config.getConfigSources().iterator().next(); - assertNotNull(src); - assertEquals(src, testSource); - } - - @Test - public void testBuildDefaultConfig(){ - ConfigBuilder builder = ConfigProviderResolver.instance().getBuilder(); - assertNotNull(builder); - builder.addDefaultSources(); - Config config = builder.build(); - assertNotNull(config); - assertTrue(config.getPropertyNames().iterator().hasNext()); - assertTrue(config.getConfigSources().iterator().hasNext()); - assertNotNull(config.getValue("java.home", String.class)); - ConfigSource src = config.getConfigSources().iterator().next(); - assertNotNull(src); - } - - @Test - public void addDiscoveredSourcesAddsAllConfigSources() throws Exception { - ConfigBuilder builder = ConfigProviderResolver.instance().getBuilder(); - - Config config = builder.addDiscoveredSources() - .addDefaultSources().build(); - - Iterable<ConfigSource> iterable = config.getConfigSources(); - - List<String> name = StreamSupport.stream(iterable.spliterator(), false) - .map(ConfigSource::getName) - .collect(Collectors.toList()); - - Assertions.assertThat(name).hasSize(4) - .containsExactlyInAnyOrder("paris", - "SystemPropertySource", - "environment-properties", - "META-INF/microprofile-config.properties"); - } - - @Test - public void addDiscoveredSourcesAddsAllConfigSourceProviders() throws Exception { - // throw new RuntimeException("Not implemented yet!"); - } -} http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderResolverTest.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderResolverTest.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderResolverTest.java deleted file mode 100644 index 9b6b554..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderResolverTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.eclipse.microprofile.config.Config; -import org.eclipse.microprofile.config.spi.ConfigBuilder; -import org.eclipse.microprofile.config.spi.ConfigProviderResolver; -import org.junit.Test; - -import java.net.URL; -import java.net.URLClassLoader; - -import static org.junit.Assert.*; - -/** - * Created by atsticks on 24.03.17. - */ -public class MicroprofileConfigProviderResolverTest { - - @Test - public void testInstance(){ - assertNotNull(ConfigProviderResolver.instance()); - } - - @Test - public void testGetBuilder(){ - assertNotNull(ConfigProviderResolver.instance().getBuilder()); - } - - @Test - public void testGetConfig(){ - assertNotNull(ConfigProviderResolver.instance().getConfig()); - } - - @Test - public void testGetConfig_CL(){ - assertNotNull(ConfigProviderResolver.instance().getConfig(ClassLoader.getSystemClassLoader())); - } - - @Test - public void testRegisterAndReleaseConfig(){ - ClassLoader cl = new URLClassLoader(new URL[]{}); - Config emptyConfig = ConfigProviderResolver.instance().getBuilder().build(); - assertNotNull(emptyConfig); - Config cfg = ConfigProviderResolver.instance().getConfig(cl); - assertNotNull(cfg); - ConfigProviderResolver.instance().registerConfig(emptyConfig, cl); - cfg = ConfigProviderResolver.instance().getConfig(cl); - assertNotNull(cfg); - assertEquals(cfg, emptyConfig); - ConfigProviderResolver.instance().releaseConfig(emptyConfig); - cfg = ConfigProviderResolver.instance().getConfig(cl); - assertNotNull(cfg); - assertNotSame(cfg, emptyConfig); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderTest.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderTest.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderTest.java deleted file mode 100644 index 039145d..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.apache.tamaya.ConfigurationProvider; -import org.eclipse.microprofile.config.Config; -import org.eclipse.microprofile.config.ConfigProvider; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -/** - * Created by atsticks on 24.03.17. - */ -public class MicroprofileConfigProviderTest { - - @Test - public void testDefaultConfigAccess(){ - Config config = ConfigProvider.getConfig(); - assertNotNull(config); - Iterable<String> names = config.getPropertyNames(); - assertNotNull(names); - int count = 0; - for(String name:names){ - count++; - System.out.println(count + ": " +name); - } - assertTrue(ConfigurationProvider.getConfiguration().getProperties().size() <= count); - } - - @Test - public void testClassloaderAccess(){ - Config config = ConfigProvider.getConfig(Thread.currentThread().getContextClassLoader()); - assertNotNull(config); - Iterable<String> names = config.getPropertyNames(); - assertNotNull(names); - int count = 0; - for(String name:names){ - count++; - } - assertTrue(count>0); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigSourceProviderTest.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigSourceProviderTest.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigSourceProviderTest.java deleted file mode 100644 index ab792aa..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigSourceProviderTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.apache.tamaya.spisupport.propertysource.BuildablePropertySource; -import org.apache.tamaya.spisupport.propertysource.BuildablePropertySourceProvider; -import org.eclipse.microprofile.config.spi.ConfigSource; -import org.junit.Test; - -import static org.junit.Assert.*; - -public class MicroprofileConfigSourceProviderTest { - @Test - public void getPropertySourceProvider() throws Exception { - BuildablePropertySourceProvider prov = BuildablePropertySourceProvider.builder() - .withPropertySourcs( - BuildablePropertySource.builder() - .withSimpleProperty("a", "b").build()) - .build(); - MicroprofileConfigSourceProvider provider = new MicroprofileConfigSourceProvider(prov); - assertNotNull(provider); - Iterable<ConfigSource> configSources = provider.getConfigSources(null); - assertNotNull(configSources); - assertTrue(configSources.iterator().hasNext()); - assertEquals("b", configSources.iterator().next().getValue("a")); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java deleted file mode 100644 index 5d61c8c..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.eclipse.microprofile.config.Config; -import org.eclipse.microprofile.config.ConfigProvider; -import org.eclipse.microprofile.config.spi.ConfigSource; -import org.junit.Test; - -import java.util.NoSuchElementException; -import java.util.Optional; - -import static org.junit.Assert.*; - -/** - * Created by atsticks on 24.03.17. - */ -public class MicroprofileConfigTest { - - @Test - public void testDefaultConfigAccess() { - Config config = ConfigProvider.getConfig(); - Iterable<ConfigSource> sources = config.getConfigSources(); - int count = 0; - for (ConfigSource cs : sources) { - count++; - } - assertEquals(4, count); - } - - @Test - public void testOptionalAccess(){ - Config config = ConfigProvider.getConfig(); - int count = 0; - for(String key:config.getPropertyNames()){ - Optional<String> val = config.getOptionalValue(key, String.class); - assertNotNull(val); - val = config.getOptionalValue(key + System.currentTimeMillis(), String.class); - assertNotNull(val); - assertFalse(val.isPresent()); - } - } - - @Test - public void testGetValue(){ - Config config = ConfigProvider.getConfig(); - int count = 0; - for(String key:config.getPropertyNames()){ - String val = config.getValue(key, String.class); - assertNotNull(val); - } - } - - @Test(expected = NoSuchElementException.class) - public void testGetValue_NoValue(){ - Config config = ConfigProvider.getConfig(); - config.getValue("fooBar", String.class); - } - - @Test(expected = IllegalArgumentException.class) - public void testGetValue_InvalidType(){ - Config config = ConfigProvider.getConfig(); - config.getValue("java.version", Integer.class); - } - - @Test - public void testEmptySystemProperty(){ - System.setProperty("my.empty.property", ""); - Config config = ConfigProvider.getConfig(); - assertEquals("", config.getValue("my.empty.property", String.class)); - } - - @Test - public void testEmptyConfigProperty(){ - Config config = ConfigProvider.getConfig(); - assertEquals("", config.getValue("my.empty.property.in.config.file", String.class)); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConverterTest.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConverterTest.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConverterTest.java deleted file mode 100644 index 35819bc..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConverterTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.apache.tamaya.microprofile.converter.ProviderConverter; -import org.apache.tamaya.spi.PropertyConverter; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.assertj.core.api.Assertions.assertThat; - -@RunWith(MockitoJUnitRunner.class) -public class MicroprofileConverterTest { - - @Mock - private PropertyConverter<String> converter; - - @Test - public void returnedPropertyConverterIsTheOneOfTheDelegate() throws Exception { - MicroprofileConverter<String> mpConverter = new MicroprofileConverter<>(converter); - - assertThat(mpConverter.getPropertyConverter()).isSameAs(converter); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileDefaultPropertiesTest.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileDefaultPropertiesTest.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileDefaultPropertiesTest.java deleted file mode 100644 index ec60e8d..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileDefaultPropertiesTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.junit.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -public class MicroprofileDefaultPropertiesTest { - @Test - public void hasOrdinalOf100() throws Exception { - MicroprofileDefaultProperties properties = new MicroprofileDefaultProperties(); - - assertThat(properties.getOrdinal()).isEqualTo(100); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/TamayaPropertySourceTest.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/TamayaPropertySourceTest.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/TamayaPropertySourceTest.java deleted file mode 100644 index 47567d2..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/TamayaPropertySourceTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.eclipse.microprofile.config.spi.ConfigSource; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class TamayaPropertySourceTest { - @Mock - private ConfigSource configSource; - - @Test - public void isScannable() throws Exception { - TamayaPropertySource source = new TamayaPropertySource(configSource); - - assertThat(source.isScannable()).isTrue(); - } - - @Test - public void ordinalIsTheSameAsOfTheConfigSource() throws Exception { - when(configSource.getOrdinal()).thenReturn(44); - - TamayaPropertySource source = new TamayaPropertySource(configSource); - - assertThat(source.getOrdinal()).isEqualTo(44); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/UppercaseConverter.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/UppercaseConverter.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/UppercaseConverter.java deleted file mode 100644 index 08623be..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/UppercaseConverter.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.eclipse.microprofile.config.spi.Converter; - -import java.util.Locale; - -public class UppercaseConverter implements Converter<String> { - - @Override - public String convert(String s) { - if(s==null){ - return null; - } - return s.toUpperCase(Locale.ENGLISH); - } -} http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/UppercasePropertyConverter.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/UppercasePropertyConverter.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/UppercasePropertyConverter.java deleted file mode 100644 index de2d551..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/UppercasePropertyConverter.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile; - -import org.apache.tamaya.spi.ConversionContext; -import org.apache.tamaya.spi.PropertyConverter; -import org.eclipse.microprofile.config.spi.Converter; - -import java.util.Locale; - -public class UppercasePropertyConverter implements PropertyConverter<String> { - - @Override - public String convert(String s, ConversionContext context) { - if(s==null){ - return null; - } - return s.toUpperCase(Locale.ENGLISH); - } -} http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigArchiveProcessor.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigArchiveProcessor.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigArchiveProcessor.java deleted file mode 100644 index 61cd11c..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigArchiveProcessor.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile.tck; - -import org.apache.tamaya.core.internal.converters.OptionalConverter; -import org.apache.tamaya.microprofile.MicroprofileAdapter; -import org.apache.tamaya.microprofile.MicroprofileConfigProviderResolver; -import org.apache.tamaya.microprofile.cdi.MicroprofileCDIExtension; -import org.apache.tamaya.microprofile.converter.BooleanAsIntegerConverterFix; -import org.apache.tamaya.spi.PropertyConverter; -import org.eclipse.microprofile.config.spi.ConfigProviderResolver; -import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; -import org.jboss.arquillian.test.spi.TestClass; -import org.jboss.shrinkwrap.api.Archive; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.resolver.api.maven.Maven; - -import javax.enterprise.inject.spi.Extension; -import java.io.File; - -/** - * Adds the whole Config implementation classes and resources to the - * Arquillian deployment archive. This is needed to have the container - * pick up the beans from within the impl for the TCK tests. - * - * @author <a href="mailto:[email protected]">Mark Struberg</a> - */ -public class TamayaConfigArchiveProcessor implements ApplicationArchiveProcessor { - - @Override - public void process(Archive<?> applicationArchive, TestClass testClass) { - if (applicationArchive instanceof WebArchive) { - File[] coreLibs = Maven.resolver() - .loadPomFromFile("pom.xml").resolve("org.apache.tamaya:tamaya-core") - .withTransitivity().asFile(); - File[] apiLibs = Maven.resolver() - .loadPomFromFile("pom.xml").resolve("org.apache.tamaya:tamaya-api") - .withTransitivity().asFile(); - File[] functionsLib = Maven.resolver() - .loadPomFromFile("pom.xml").resolve("org.apache.tamaya.ext:tamaya-functions") - .withTransitivity().asFile(); - - JavaArchive configJar = ShrinkWrap - .create(JavaArchive.class, "tamaya-config-impl.jar") - .addPackage(MicroprofileAdapter.class.getPackage()) - .addPackage(MicroprofileCDIExtension.class.getPackage()) - .addPackage(BooleanAsIntegerConverterFix.class.getPackage()) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") - .addAsServiceProvider(ConfigProviderResolver.class, MicroprofileConfigProviderResolver.class) - .addAsServiceProvider(PropertyConverter.class, BooleanAsIntegerConverterFix.class) - .addAsServiceProvider(PropertyConverter.class, OptionalConverter.class) - .addAsServiceProvider(Extension.class, MicroprofileCDIExtension.class); - ((WebArchive) applicationArchive).addAsLibraries( - configJar) - .addAsLibraries(apiLibs) - .addAsLibraries(coreLibs) - .addAsLibraries(functionsLib); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigExtension.java ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigExtension.java b/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigExtension.java deleted file mode 100644 index 9c0dfd3..0000000 --- a/modules/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigExtension.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tamaya.microprofile.tck; - -import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; -import org.jboss.arquillian.core.spi.LoadableExtension; - -/** - * Arquillian extension to load Tamaya into Arquillian context. - * @author <a href="mailto:[email protected]">Anatole Tresch</a> - */ -public class TamayaConfigExtension implements LoadableExtension { - - @Override - public void register(ExtensionBuilder extensionBuilder) { - extensionBuilder.service( - ApplicationArchiveProcessor.class, - TamayaConfigArchiveProcessor.class); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/resources/META-INF/beans.xml ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/resources/META-INF/beans.xml b/modules/microprofile/src/test/resources/META-INF/beans.xml deleted file mode 100644 index adee378..0000000 --- a/modules/microprofile/src/test/resources/META-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy current the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> -<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd"> - -</beans> - http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/resources/META-INF/microprofile-config.properties ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/resources/META-INF/microprofile-config.properties b/modules/microprofile/src/test/resources/META-INF/microprofile-config.properties deleted file mode 100644 index 2e63bf8..0000000 --- a/modules/microprofile/src/test/resources/META-INF/microprofile-config.properties +++ /dev/null @@ -1,105 +0,0 @@ -# -# Copyright (c) 2016-2017 Contributors to the Eclipse Foundation -# -# See the NOTICES file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -my.optional.int.property=1234 -my.optional.string.property=hello - -tck.config.test.javaconfig.properties.key1=VALue1 - - -tck.config.test.overwritten.in.custompropertyfile.key1=value from microprofile-config.properties - - -tck.config.test.javaconfig.converter.integervalue = 1234 -tck.config.test.javaconfig.converter.integervalue.broken = xxx - -tck.config.test.javaconfig.converter.longvalue = 1234567890 -tck.config.test.javaconfig.converter.longvalue.broken = xxx - -tck.config.test.javaconfig.converter.floatvalue = 12.34 -tck.config.test.javaconfig.converter.floatvalue.broken = alfasdf - -tck.config.test.javaconfig.converter.doublevalue = 12.34 -tck.config.test.javaconfig.converter.doublevalue.broken = alfasdf - -tck.config.test.javaconfig.converter.durationvalue = PT15M -tck.config.test.javaconfig.converter.durationvalue.broken = alfasdf - -tck.config.test.javaconfig.converter.localtimevalue = 10:37 -tck.config.test.javaconfig.converter.localtimevalue.broken = alfasdf - -tck.config.test.javaconfig.converter.localdatevalue = 2017-12-24 -tck.config.test.javaconfig.converter.localdatevalue.broken = alfasdf - -tck.config.test.javaconfig.converter.localdatetimevalue = 2017-12-24T10:25:30 -tck.config.test.javaconfig.converter.localdatetimevalue.broken = alfasdf - -tck.config.test.javaconfig.converter.offsetdatetimevalue = 2007-12-03T10:15:30+01:00 -tck.config.test.javaconfig.converter.offsetdatetimevalue.broken = alfasdf - -tck.config.test.javaconfig.converter.offsettimevalue = 13:45:30.123456789+02:00 -tck.config.test.javaconfig.converter.offsettimevalue.broken = alfasdf - -tck.config.test.javaconfig.converter.instantvalue = 2015-06-02T21:34:33.616Z -tck.config.test.javaconfig.converter.instantvalue.broken = alfasdf - -tck.config.test.javaconfig.configvalue.key1=value1 - -# test BooleanConverter START -tck.config.test.javaconfig.configvalue.boolean.true=true -tck.config.test.javaconfig.configvalue.boolean.true_uppercase=TRUE -tck.config.test.javaconfig.configvalue.boolean.true_mixedcase=TruE -tck.config.test.javaconfig.configvalue.boolean.false=false - -tck.config.test.javaconfig.configvalue.boolean.one=1 -tck.config.test.javaconfig.configvalue.boolean.zero=0 -tck.config.test.javaconfig.configvalue.boolean.seventeen=17 - -tck.config.test.javaconfig.configvalue.boolean.yes=yes -tck.config.test.javaconfig.configvalue.boolean.yes_uppercase=YES -tck.config.test.javaconfig.configvalue.boolean.yes_mixedcase=Yes -tck.config.test.javaconfig.configvalue.boolean.no=no - -tck.config.test.javaconfig.configvalue.boolean.y=y -tck.config.test.javaconfig.configvalue.boolean.y_uppercase=Y -tck.config.test.javaconfig.configvalue.boolean.n=n - -tck.config.test.javaconfig.configvalue.boolean.on=on -tck.config.test.javaconfig.configvalue.boolean.on_uppercase=ON -tck.config.test.javaconfig.configvalue.boolean.on_mixedcase=oN -tck.config.test.javaconfig.configvalue.boolean.off=off - -# test BooleanConverter END - -# various other converter -tck.config.test.javaconfig.configvalue.integer=1234 -tck.config.test.javaconfig.configvalue.long=1234567890123456 -tck.config.test.javaconfig.configvalue.float=12.34 -tck.config.test.javaconfig.configvalue.double=12.34567890123456 - -# Custom Converter tests -tck.config.test.javaconfig.converter.duckname=Hannelore - -# URL Converter tests -tck.config.test.javaconfig.converter.urlvalue=http://microprofile.io -tck.config.test.javaconfig.converter.urlvalue.broken=tt:--location$ - -# Empty values -my.empty.property.in.config.file= \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource b/modules/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource deleted file mode 100644 index b1ef0c2..0000000 --- a/modules/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy current the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -org.apache.tamaya.microprofile.ConfigSourceParis http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider b/modules/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider deleted file mode 100644 index dd554df..0000000 --- a/modules/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy current the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -org.apache.tamaya.microprofile.ConfigSourceProviderMinsk \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/modules/microprofile/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension deleted file mode 100644 index b2af25c..0000000 --- a/modules/microprofile/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -org.apache.tamaya.microprofile.tck.TamayaConfigExtension \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/resources/sampleconfig.yaml ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/resources/sampleconfig.yaml b/modules/microprofile/src/test/resources/sampleconfig.yaml deleted file mode 100644 index 27f2392..0000000 --- a/modules/microprofile/src/test/resources/sampleconfig.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2016-2017 Mark Struberg and others -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# just needed as a trigger for the ConfigSource pickup. -# Content is hardcoded in SampleYamlConfigSource \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/microprofile/src/test/tck-suite.xml ---------------------------------------------------------------------- diff --git a/modules/microprofile/src/test/tck-suite.xml b/modules/microprofile/src/test/tck-suite.xml deleted file mode 100644 index 84d36ad..0000000 --- a/modules/microprofile/src/test/tck-suite.xml +++ /dev/null @@ -1,27 +0,0 @@ -<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy current the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> -<suite name="microprofile-config-TCK" verbose="2" configfailurepolicy="continue" > - <test name="microprofile-config 1.1 TCK"> - <packages> - <package name="org.eclipse.microprofile.config.tck.*"> - </package> - </packages> - </test> -</suite> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/mutable-config/pom.xml ---------------------------------------------------------------------- diff --git a/modules/mutable-config/pom.xml b/modules/mutable-config/pom.xml index ecbf767..874fca5 100644 --- a/modules/mutable-config/pom.xml +++ b/modules/mutable-config/pom.xml @@ -34,12 +34,7 @@ under the License. <dependencies> <dependency> <groupId>org.apache.tamaya</groupId> - <artifactId>tamaya-api</artifactId> - <version>${tamaya-apicore.version}</version> - </dependency> - <dependency> - <groupId>org.apache.tamaya</groupId> - <artifactId>tamaya-spisupport</artifactId> + <artifactId>tamaya-base</artifactId> <version>${project.version}</version> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ChangePropagationPolicy.java ---------------------------------------------------------------------- diff --git a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ChangePropagationPolicy.java b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ChangePropagationPolicy.java index 0cfd8b8..06eb43a 100644 --- a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ChangePropagationPolicy.java +++ b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ChangePropagationPolicy.java @@ -18,15 +18,15 @@ */ package org.apache.tamaya.mutableconfig; -import org.apache.tamaya.spi.PropertySource; +import org.apache.tamaya.mutableconfig.spi.MutableConfigSource; -import java.util.Collection; +import javax.config.spi.ConfigSource; /** * Policy that defines how changes are applied to the available - * {@link org.apache.tamaya.mutableconfig.spi.MutablePropertySource} instances, e.g. + * {@link MutableConfigSource} instances, e.g. * <ul> - * <li><b>ALL: </b>Changes are propagated to all {@link org.apache.tamaya.mutableconfig.spi.MutablePropertySource} + * <li><b>ALL: </b>Changes are propagated to all {@link MutableConfigSource} * instances in order of significance. This means that a key added, updated or removed in each instance, if the key * is writable/removable.</li> * <li><b>SIGNIFICANT_ONLY: </b>A change (creation, update) is only applied, if @@ -48,6 +48,6 @@ public interface ChangePropagationPolicy { * never null. * @param configChange the configuration change, not null. */ - void applyChange(ConfigChangeRequest configChange, Collection<PropertySource> propertySources); + void applyChange(ConfigChangeRequest configChange, Iterable<ConfigSource> propertySources); } http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/cfb364cd/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ConfigChangeRequest.java ---------------------------------------------------------------------- diff --git a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ConfigChangeRequest.java b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ConfigChangeRequest.java index a592d58..254109a 100644 --- a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ConfigChangeRequest.java +++ b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ConfigChangeRequest.java @@ -18,6 +18,8 @@ */ package org.apache.tamaya.mutableconfig; +import org.apache.tamaya.mutableconfig.spi.MutableConfigSource; + import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -28,7 +30,7 @@ import java.util.Set; /** * Change context used for managing configuration changes within an - * {@link org.apache.tamaya.mutableconfig.spi.MutablePropertySource}. + * {@link MutableConfigSource}. */ public final class ConfigChangeRequest { /**
