/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

package org.jboss.test.jca.xads;

import java.io.PrintWriter;
import java.sql.SQLException;

import javax.sql.XAConnection;
import javax.sql.XADataSource;

/**
 * Test XA DataSource
 *
 * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
 * @version $Revision: 1.1.6.3 $
 */
public class TestXADataSource implements XADataSource
{
   public void setSomeProperty(String someProperty)
   {
      if (someProperty == null)
         throw new NullPointerException("someProperty is null");
      if (someProperty.equals("${org.jboss.test.jca.xads.SomeProperty2}") == false)
         throw new IllegalArgumentException("Wrong value: " + someProperty);
   }
   public void setBackSlash(String backslash)
   {
      if (backslash == null)
         throw new NullPointerException("backslash is null");
      if (backslash.equals("\\") == false)
         throw new IllegalArgumentException("Wrong value: " + backslash);
   }
   
	public int getLoginTimeout() throws SQLException
	{
		return 0;
	}
	public PrintWriter getLogWriter() throws SQLException
	{
		return null;
	}
	public XAConnection getXAConnection() throws SQLException
	{
        throw new SQLException("expected");
	}
	public XAConnection getXAConnection(String user, String password) throws SQLException
	{
		return null;
	}
	public void setLoginTimeout(int seconds) throws SQLException
	{
	}
	public void setLogWriter(PrintWriter out) throws SQLException
	{
	}
}
