KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > jca > xads > TestXADataSource


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.jca.xads;
23
24 import java.io.PrintWriter JavaDoc;
25 import java.sql.SQLException JavaDoc;
26
27 import javax.sql.XAConnection JavaDoc;
28 import javax.sql.XADataSource JavaDoc;
29
30 /**
31  * Test XA DataSource
32  *
33  * @author <a HREF="mailto:adrian@jboss.com">Adrian Brock</a>
34  * @version $Revision: 37406 $
35  */

36 public class TestXADataSource implements XADataSource JavaDoc
37 {
38    public void setSomeProperty(String JavaDoc someProperty)
39    {
40       if (someProperty == null)
41          throw new NullPointerException JavaDoc("someProperty is null");
42       if (someProperty.equals("${org.jboss.test.jca.xads.SomeProperty2}") == false)
43          throw new IllegalArgumentException JavaDoc("Wrong value: " + someProperty);
44    }
45    public void setBackSlash(String JavaDoc backslash)
46    {
47       if (backslash == null)
48          throw new NullPointerException JavaDoc("backslash is null");
49       if (backslash.equals("\\") == false)
50          throw new IllegalArgumentException JavaDoc("Wrong value: " + backslash);
51    }
52    
53     public int getLoginTimeout() throws SQLException JavaDoc
54     {
55         return 0;
56     }
57     public PrintWriter JavaDoc getLogWriter() throws SQLException JavaDoc
58     {
59         return null;
60     }
61     public XAConnection JavaDoc getXAConnection() throws SQLException JavaDoc
62     {
63         throw new SQLException JavaDoc("expected");
64     }
65     public XAConnection JavaDoc getXAConnection(String JavaDoc user, String JavaDoc password) throws SQLException JavaDoc
66     {
67         return null;
68     }
69     public void setLoginTimeout(int seconds) throws SQLException JavaDoc
70     {
71     }
72     public void setLogWriter(PrintWriter JavaDoc out) throws SQLException JavaDoc
73     {
74     }
75 }
76
Popular Tags