01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 2005 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or 1any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: ResourceUtils.java 7157 2005-08-01 12:55:21Z kemlerp $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas.jonasadmin.test.service.resource;
25:
26: import com.meterware.httpunit.Button;
27: import com.meterware.httpunit.WebForm;
28:
29: /**
30: * Class for filling resource forms.
31: * @author Paul Kemler
32: */
33: public class ResourceUtils {
34:
35: /**
36: * Modify pool properties
37: * @param form the pool property form
38: * @param jdbcConnCheckLevel the value of Checking level
39: * @param connMaxAge the value of Maximum age
40: * @param maxOpentime the value of Maximum open time
41: * @param jdbcTestStatement SQL query for test statement
42: * @param maxSize the value of Pool maximum
43: * @param minSize the value of Pool minimum
44: * @param maxWaitTime the value of Max Wait Time
45: * @param maxWaiters the value of Max Waiters
46: * @param samplingPeriod the value of Sampling Period
47: * @throws Exception if an error occurs when button is clicked
48: */
49: public static void modifyPoolProperties(WebForm form,
50: String jdbcConnCheckLevel, String connMaxAge,
51: String maxOpentime, String jdbcTestStatement,
52: String maxSize, String minSize, String maxWaitTime,
53: String maxWaiters, String samplingPeriod) throws Exception {
54:
55: Button button = null;
56:
57: form.setParameter("jdbcConnCheckLevel", jdbcConnCheckLevel);
58: form.setParameter("connMaxAge", connMaxAge);
59: form.setParameter("maxOpentime", maxOpentime);
60: form.setParameter("jdbcTestStatement", jdbcTestStatement);
61: form.setParameter("maxSize", maxSize);
62: form.setParameter("minSize", minSize);
63: form.setParameter("maxWaitTime", maxWaitTime);
64: form.setParameter("maxWaiters", maxWaiters);
65: form.setParameter("samplingPeriod", samplingPeriod);
66:
67: button = form.getButtons()[0];
68: button.click();
69: }
70: }
|