01: /*
02: * $Id: OtherType.java,v 1.8 2004/09/30 17:27:55 spal Exp $
03: * $Source: /cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/types/OtherType.java,v $
04: * SQLUnit - a test harness for unit testing database stored procedures.
05: * Copyright (C) 2003 The SQLUnit Team
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License
09: * as published by the Free Software Foundation; either version 2
10: * of the License, or (at your option) any later version.
11: *
12: * This program 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
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20: */
21: package net.sourceforge.sqlunit.types;
22:
23: import net.sourceforge.sqlunit.SQLUnitException;
24:
25: /**
26: * Models the OTHER type.
27: * @author Ralph Brendler (rbrendler@users.sourceforge.net)
28: * @author Sujit Pal (spal@users.sourceforge.net)
29: * @version $Revision: 1.8 $
30: * @sqlunit.type name="OtherType" input="No" output="Yes" sortable="No"
31: * wraps="java.lang.Object"
32: * @sqlunit.typename name="OTHER" server="Any"
33: */
34: public class OtherType extends UnsupportedType {
35:
36: /**
37: * Provides a toString wrapper for the Generic type.
38: * @param obj an Object to be converted to the IType interface.
39: * @return the String representation of the object.
40: * @exception SQLUnitException if the formatting failed.
41: */
42: protected String format(final Object obj) throws SQLUnitException {
43: setValue(obj);
44: return (obj == null ? "NULL" : obj.toString());
45: }
46: }
|