diff options
author | Andrew Donald Kennedy <grkvlt@apache.org> | 2010-08-13 16:16:16 +0000 |
---|---|---|
committer | Andrew Donald Kennedy <grkvlt@apache.org> | 2010-08-13 16:16:16 +0000 |
commit | 28f390f7fc5e0d271b467bbf8c7bd94c02659562 (patch) | |
tree | 17a2c7ef8725a3c5ef52b3dbf14da7ee250fd77f /java/common/src | |
parent | 48956072b60c7ef08b5fb5df5d91d5bb0d9e0f25 (diff) | |
download | qpid-python-28f390f7fc5e0d271b467bbf8c7bd94c02659562.tar.gz |
Tidy up various badly named tests
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@985259 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/src')
-rw-r--r-- | java/common/src/test/java/org/apache/qpid/util/PropertyUtilsTest.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/java/common/src/test/java/org/apache/qpid/util/PropertyUtilsTest.java b/java/common/src/test/java/org/apache/qpid/util/PropertyUtilsTest.java new file mode 100644 index 0000000000..9fd18d461a --- /dev/null +++ b/java/common/src/test/java/org/apache/qpid/util/PropertyUtilsTest.java @@ -0,0 +1,48 @@ +/* + * + * 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.qpid.util; + +import org.apache.qpid.configuration.PropertyException; +import org.apache.qpid.configuration.PropertyUtils; +import org.apache.qpid.test.utils.QpidTestCase; + +public class PropertyUtilsTest extends QpidTestCase +{ + public void testSimpleExpansion() throws PropertyException + { + System.setProperty("banana", "fruity"); + String expandedProperty = PropertyUtils.replaceProperties("${banana}"); + assertEquals(expandedProperty, "fruity"); + } + + public void testDualExpansion() throws PropertyException + { + System.setProperty("banana", "fruity"); + System.setProperty("concrete", "horrible"); + String expandedProperty = PropertyUtils.replaceProperties("${banana}xyz${concrete}"); + assertEquals(expandedProperty, "fruityxyzhorrible"); + } + + public static junit.framework.Test suite() + { + return new junit.framework.TestSuite(PropertyUtilsTest.class); + } +} |