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, WITHOUT
13: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14: * License for the specific language governing permissions and limitations
15: * under the License.
16: *
17: */
18:
19: /*
20: * Created on May 15, 2004
21: */
22: package org.apache.jmeter.protocol.jdbc.config;
23:
24: import java.beans.PropertyDescriptor;
25:
26: import org.apache.jmeter.testbeans.BeanInfoSupport;
27: import org.apache.jorphan.logging.LoggingManager;
28: import org.apache.log.Logger;
29:
30: /**
31: * @author mstover
32: *
33: */
34: public class DataSourceElementBeanInfo extends BeanInfoSupport {
35: Logger log = LoggingManager.getLoggerForClass();
36:
37: public DataSourceElementBeanInfo() {
38: super (DataSourceElement.class);
39: createPropertyGroup("varName", new String[] { "dataSource" });
40:
41: createPropertyGroup("pool", new String[] { "poolMax",
42: "timeout", "trimInterval", "autocommit" });
43:
44: createPropertyGroup("keep-alive", new String[] { "keepAlive",
45: "connectionAge", "checkQuery" });
46:
47: createPropertyGroup("database", new String[] { "dbUrl",
48: "driver", "username", "password" });
49:
50: PropertyDescriptor p = property("dataSource");
51: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
52: p.setValue(DEFAULT, "");
53: p = property("poolMax");
54: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
55: p.setValue(DEFAULT, "10");
56: p = property("timeout");
57: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
58: p.setValue(DEFAULT, "10000");
59: p = property("trimInterval");
60: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
61: p.setValue(DEFAULT, "60000");
62: p = property("autocommit");
63: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
64: p.setValue(DEFAULT, Boolean.TRUE);
65: p = property("keepAlive");
66: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
67: p.setValue(DEFAULT, Boolean.TRUE);
68: p = property("connectionAge");
69: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
70: p.setValue(DEFAULT, "5000");
71: p = property("checkQuery");
72: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
73: p.setValue(DEFAULT, "Select 1");
74: p = property("dbUrl");
75: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
76: p.setValue(DEFAULT, "");
77: p = property("driver");
78: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
79: p.setValue(DEFAULT, "");
80: p = property("username");
81: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
82: p.setValue(DEFAULT, "");
83: p = property("password");
84: p.setValue(NOT_UNDEFINED, Boolean.TRUE);
85: p.setValue(DEFAULT, "");
86: }
87: }
|