1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * 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 /* 20 * Created on May 16, 2004 21 * 22 */ 23 package org.apache.jmeter.protocol.jdbc.sampler; 24 25 import java.beans.PropertyDescriptor; 26 27 import org.apache.jmeter.testbeans.BeanInfoSupport; 28 import org.apache.jmeter.testbeans.gui.TextAreaEditor; 29 30 public class JDBCSamplerBeanInfo extends BeanInfoSupport { 31 32 /** 33 * 34 */ 35 public JDBCSamplerBeanInfo() { 36 super(JDBCSampler.class); 37 38 createPropertyGroup("varName", // $NON-NLS-1$ 39 new String[]{"dataSource" }); // $NON-NLS-1$ 40 41 createPropertyGroup("sql", // $NON-NLS-1$ 42 new String[] { 43 "queryType", // $NON-NLS-1$ 44 "query", // $NON-NLS-1$ 45 "queryArguments", // $NON-NLS-1$ 46 "queryArgumentsTypes", // $NON-NLS-1$ 47 "variableNames", // $NON-NLS-1$ 48 }); 49 50 PropertyDescriptor p = property("dataSource"); // $NON-NLS-1$ 51 p.setValue(NOT_UNDEFINED, Boolean.TRUE); 52 p.setValue(DEFAULT, ""); 53 54 p = property("queryArguments"); // $NON-NLS-1$ 55 p.setValue(NOT_UNDEFINED, Boolean.TRUE); 56 p.setValue(DEFAULT, ""); 57 58 p = property("queryArgumentsTypes"); // $NON-NLS-1$ 59 p.setValue(NOT_UNDEFINED, Boolean.TRUE); 60 p.setValue(DEFAULT, ""); 61 62 p = property("variableNames"); // $NON-NLS-1$ 63 p.setValue(NOT_UNDEFINED, Boolean.TRUE); 64 p.setValue(DEFAULT, ""); 65 66 p = property("queryType"); // $NON-NLS-1$ 67 p.setValue(NOT_UNDEFINED, Boolean.TRUE); 68 p.setValue(DEFAULT, JDBCSampler.SELECT); 69 p.setValue(NOT_OTHER,Boolean.TRUE); 70 p.setValue(TAGS,new String[]{ 71 JDBCSampler.SELECT, 72 JDBCSampler.UPDATE, 73 JDBCSampler.CALLABLE, 74 JDBCSampler.PREPARED_SELECT, 75 JDBCSampler.PREPARED_UPDATE, 76 JDBCSampler.COMMIT, 77 JDBCSampler.ROLLBACK, 78 JDBCSampler.AUTOCOMMIT_FALSE, 79 JDBCSampler.AUTOCOMMIT_TRUE, 80 }); 81 82 p = property("query"); // $NON-NLS-1$ 83 p.setValue(NOT_UNDEFINED, Boolean.TRUE); 84 p.setValue(DEFAULT, ""); 85 p.setPropertyEditorClass(TextAreaEditor.class); 86 87 } 88 }