@@ -0,0 +1,2858 @@
+// $Header$%0A/*%0A * Copyright 2001-2004 The Apache Software Foundation.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * %0A */%0A%0Apackage org.apache.jmeter.junit.protocol.http.config;%0A%0Aimport org.apache.jmeter.config.Arguments;%0Aimport org.apache.jmeter.junit.JMeterTestCase;%0Aimport org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase;%0Aimport org.apache.jmeter.protocol.http.sampler.HTTPNullSampler;%0Aimport org.apache.jmeter.testelement.property.JMeterProperty;%0Aimport org.apache.jmeter.testelement.property.NullProperty;%0Aimport org.apache.jmeter.testelement.property.TestElementProperty;%0A%0A/**%0A * @author Michael Stover%0A * @version $Revision$%0A */%0Apublic class UrlConfigTest extends JMeterTestCase %7B%0A%09HTTPSamplerBase config;%0A%0A%09HTTPSamplerBase defaultConfig;%0A%0A%09HTTPSamplerBase partialConfig;%0A%0A%09public UrlConfigTest(String name) %7B%0A%09%09super(name);%0A%09%7D%0A%0A%09protected void setUp() %7B%0A%09%09Arguments args = new Arguments();%0A%09%09args.addArgument(%22username%22, %22mstover%22);%0A%09%09args.addArgument(%22password%22, %22pass%22);%0A%09%09args.addArgument(%22action%22, %22login%22);%0A%09%09config = new HTTPNullSampler();%0A%09%09config.setName(%22Full Config%22);%0A%09%09config.setProperty(HTTPSamplerBase.DOMAIN, %22www.lazer.com%22);%0A%09%09config.setProperty(HTTPSamplerBase.PATH, %22login.jsp%22);%0A%09%09config.setProperty(HTTPSamplerBase.METHOD, HTTPSamplerBase.POST);%0A%09%09config.setProperty(new TestElementProperty(HTTPSamplerBase.ARGUMENTS, args));%0A%09%09defaultConfig = new HTTPNullSampler();%0A%09%09defaultConfig.setName(%22default%22);%0A%09%09defaultConfig.setProperty(HTTPSamplerBase.DOMAIN, %22www.xerox.com%22);%0A%09%09defaultConfig.setProperty(HTTPSamplerBase.PATH, %22default.html%22);%0A%09%09partialConfig = new HTTPNullSampler();%0A%09%09partialConfig.setProperty(HTTPSamplerBase.PATH, %22main.jsp%22);%0A%09%09partialConfig.setProperty(HTTPSamplerBase.METHOD, HTTPSamplerBase.GET);%0A%09%7D%0A%0A%09public void testSimpleConfig() %7B%0A%09%09assertTrue(config.getName().equals(%22Full Config%22));%0A%09%09assertEquals(config.getDomain(), %22www.lazer.com%22);%0A%09%7D%0A%0A%09public void testOverRide() %7B%0A%09%09JMeterProperty jmp = partialConfig.getProperty(HTTPSamplerBase.DOMAIN);%0A%09%09assertTrue(jmp instanceof NullProperty);%0A%09%09assertTrue(new NullProperty(HTTPSamplerBase.DOMAIN).equals(jmp));%0A%09%09partialConfig.addTestElement(defaultConfig);%0A%09%09assertEquals(partialConfig.getPropertyAsString(HTTPSamplerBase.DOMAIN), %22www.xerox.com%22);%0A%09%09assertEquals(partialConfig.getPropertyAsString(HTTPSamplerBase.PATH), %22main.jsp%22);%0A%09%7D%0A%7D

Move to more suitable package name