JAMES-1759 Removed unused class
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/42c4e1c3 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/42c4e1c3 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/42c4e1c3 Branch: refs/heads/master Commit: 42c4e1c35f62c530f95009ac9cbf3753c0e5f215 Parents: 6275dc3 Author: Benoit Tellier <[email protected]> Authored: Fri Jun 17 09:36:58 2016 +0700 Committer: Benoit Tellier <[email protected]> Committed: Wed Jun 22 15:34:19 2016 +0700 ---------------------------------------------------------------------- .../apache/james/utils/PropertiesReader.java | 43 ------------------- .../apache/james/utils/PropertiesReadTest.java | 44 -------------------- 2 files changed, 87 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/42c4e1c3/server/container/guice/guice-common/src/main/java/org/apache/james/utils/PropertiesReader.java ---------------------------------------------------------------------- diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/PropertiesReader.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/PropertiesReader.java deleted file mode 100644 index cbf981d..0000000 --- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/PropertiesReader.java +++ /dev/null @@ -1,43 +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.james.utils; - -import java.io.IOException; -import java.util.Properties; - -import com.google.common.base.Throwables; - -public class PropertiesReader { - - private final Properties properties; - - public PropertiesReader(String fileName) { - properties = new Properties(); - try { - properties.load(ClassLoader.getSystemResourceAsStream(fileName)); - } catch (IOException e) { - throw Throwables.propagate(e); - } - } - - public String getProperty(String key) { - return properties.getProperty(key); - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/42c4e1c3/server/container/guice/guice-common/src/test/java/org/apache/james/utils/PropertiesReadTest.java ---------------------------------------------------------------------- diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/utils/PropertiesReadTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/utils/PropertiesReadTest.java deleted file mode 100644 index 1d3de34..0000000 --- a/server/container/guice/guice-common/src/test/java/org/apache/james/utils/PropertiesReadTest.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.james.utils; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.Test; - -public class PropertiesReadTest { - - @Test - public void getPropertyShouldWork() throws Exception { - PropertiesReader propertiesReader = new PropertiesReader("test.properties"); - assertThat(propertiesReader.getProperty("cassandra.ip")).isEqualTo("127.0.0.1"); - } - - @Test - public void getAbsentPropertyShouldReturnNull() throws Exception { - PropertiesReader propertiesReader = new PropertiesReader("test.properties"); - assertThat(propertiesReader.getProperty("cassandra.isslow")).isNull(); - } - - @Test(expected = RuntimeException.class) - public void buildingAPropertiesReaderOnNonExistingValuesShouldThrow() throws Exception { - new PropertiesReader("fake.properties"); - } -} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
