01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18:
19: package org.apache.jmeter.config.gui;
20:
21: import junit.framework.TestCase;
22:
23: import org.apache.jmeter.config.Argument;
24: import org.apache.jmeter.config.Arguments;
25:
26: /**
27: * A GUI panel allowing the user to enter name-value argument pairs. These
28: * arguments (or parameters) are usually used to provide configuration values
29: * for some other component.
30: *
31: * @version $Revision: 493796 $ on $Date: 2007-01-07 18:31:05 +0000 (Sun, 07 Jan 2007) $
32: */
33: public class TestArgumentsPanel extends TestCase {
34: /**
35: * Create a new test.
36: *
37: * @param name
38: * the name of the test
39: */
40: public TestArgumentsPanel(String name) {
41: super (name);
42: }
43:
44: /**
45: * Test that adding an argument to the table results in an appropriate
46: * TestElement being created.
47: *
48: * @throws Exception
49: * if an exception occurred during the test
50: */
51: public void testArgumentCreation() throws Exception {
52: ArgumentsPanel gui = new ArgumentsPanel();
53: gui.tableModel.addRow(new Argument());
54: gui.tableModel.setValueAt("howdy", 0, 0);
55: gui.tableModel.addRow(new Argument());
56: gui.tableModel.setValueAt("doody", 0, 1);
57:
58: assertEquals("=", ((Argument) ((Arguments) gui
59: .createTestElement()).getArguments().get(0)
60: .getObjectValue()).getMetaData());
61: }
62: }
|