From: Chris Jaekl Date: Sat, 3 Oct 2015 07:56:54 +0000 (+0900) Subject: Add some unit testing of the CfbSchema. X-Git-Url: https://jaekl.net/gitweb/?a=commitdiff_plain;h=acd090d811c44ce74d0728d2a478f4c174f4ef49;p=cfb.git Add some unit testing of the CfbSchema. --- diff --git a/prod/net/jaekl/cfb/CFB.java b/prod/net/jaekl/cfb/CFB.java index a830b12..81c30ea 100644 --- a/prod/net/jaekl/cfb/CFB.java +++ b/prod/net/jaekl/cfb/CFB.java @@ -200,6 +200,11 @@ public class CFB { String cannotConnectFormat = trans(CfbBundle.CANNOT_CONNECT); String cannotConnect = MessageFormat.format(cannotConnectFormat, m_host, ""+m_port, m_dbName, m_user); exc.printStackTrace(pw); + SQLException next = exc.getNextException(); + while (null != next) { + next.printStackTrace(pw); + next = next.getNextException(); + } pw.println(cannotConnect); } diff --git a/prod/net/jaekl/cfb/analyze/MessageMap.java b/prod/net/jaekl/cfb/analyze/MessageMap.java index b0f0b67..ae389ad 100644 --- a/prod/net/jaekl/cfb/analyze/MessageMap.java +++ b/prod/net/jaekl/cfb/analyze/MessageMap.java @@ -116,7 +116,7 @@ public class MessageMap { } // Parse the FindBugs messages.xml file - void parse(InputSource xml) throws FileNotFoundException, IOException, SAXException + public void parse(InputSource xml) throws FileNotFoundException, IOException, SAXException { m_msgColl = new MessageCollection(); diff --git a/prod/net/jaekl/cfb/db/CfbSchema.java b/prod/net/jaekl/cfb/db/CfbSchema.java index 9a6cc3b..230133b 100644 --- a/prod/net/jaekl/cfb/db/CfbSchema.java +++ b/prod/net/jaekl/cfb/db/CfbSchema.java @@ -50,7 +50,7 @@ public class CfbSchema extends Schema { private static final Column[] BUGS_COLS = { BUGID, TYPE }; private static final Column[] CATEGORIES_COLS = { CATEGORYID, CATEGORY }; - private static final Column[] FOUND_COLS = { FOUNDID, BUGID, CATEGORYID, FIRSTLOCID, SECONDLOCID, THIRDLOCID, VARID_FK }; + private static final Column[] FOUND_COLS = { FOUNDID, RUNID, BUGID, CATEGORYID, FIRSTLOCID, SECONDLOCID, THIRDLOCID, VARID_FK }; private static final Column[] LOCATIONS_COLS = { LOCID, CLASSNAME, METHODNAME, METHODROLE, STARTLINE, ENDLINE }; private static final Column[] RUNS_COLS = { RUNID, VERSION, STARTTIME, ENDTIME }; private static final Column[] VARIABLES_COLS = { VARID_PK, NAME, VARROLE }; @@ -62,7 +62,7 @@ public class CfbSchema extends Schema { public static final Table RUNS = new Table("RUNS", RUNS_COLS); public static final Table VARIABLES = new Table("VARIABLES", VARIABLES_COLS); - private static final Sequence[] SEQUENCES = { + static final Sequence[] SEQUENCES = { BUG_SEQ, CATEGORY_SEQ, FOUND_SEQ, @@ -71,7 +71,7 @@ public class CfbSchema extends Schema { VARIABLE_SEQ }; - private static final Table[] TABLES = { + static final Table[] TABLES = { BUGS, CATEGORIES, FOUND, diff --git a/prod/net/jaekl/cfb/db/Column.java b/prod/net/jaekl/cfb/db/Column.java index db748b2..8fc723d 100644 --- a/prod/net/jaekl/cfb/db/Column.java +++ b/prod/net/jaekl/cfb/db/Column.java @@ -1,5 +1,7 @@ package net.jaekl.cfb.db; +import net.jaekl.cfb.util.Util; + // Copyright (C) 2015 Christian Jaekl public class Column { @@ -45,4 +47,40 @@ public class Column { return new Column(name, type, width.intValue(), canBeNull); } + + @Override + public boolean equals(Object obj) + { + if (null == obj) { + return false; + } + if (! (obj instanceof Column)) { + return false; + } + Column other = (Column)obj; + + if (! Util.objsAreEqual(this.getName(), other.getName())) { + return false; + } + if (! Util.objsAreEqual(this.getType(), other.getType())) { + return false; + } + if (this.getWidth() != other.getWidth()) { + return false; + } + if (! Util.objsAreEqual(this.getNull(), other.getNull())) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int code = Util.objHashCode(getName()) + ^ Util.objHashCode(getType()) + ^ getWidth() + ^ Util.objHashCode(getNull()); + return code; + } } diff --git a/prod/net/jaekl/cfb/db/Row.java b/prod/net/jaekl/cfb/db/Row.java index f25b0ae..fa3de99 100644 --- a/prod/net/jaekl/cfb/db/Row.java +++ b/prod/net/jaekl/cfb/db/Row.java @@ -12,6 +12,7 @@ public class Row { } public int getNumColumns() { return m_columns.length; } + public Column getColumn(int idx) { return m_columns[idx]; } public String getString(int index) throws TypeMismatchException { checkType(index, Column.Type.VARCHAR); diff --git a/prod/net/jaekl/cfb/db/driver/PostgresqlDriver.java b/prod/net/jaekl/cfb/db/driver/PostgresqlDriver.java index 8e19fc4..fbb3285 100644 --- a/prod/net/jaekl/cfb/db/driver/PostgresqlDriver.java +++ b/prod/net/jaekl/cfb/db/driver/PostgresqlDriver.java @@ -8,6 +8,7 @@ import java.sql.SQLException; import java.util.Properties; import net.jaekl.cfb.db.Sequence; +import net.jaekl.cfb.db.Column.Type; public class PostgresqlDriver extends DbDriver { @@ -34,4 +35,16 @@ public class PostgresqlDriver extends DbDriver { { return " SELECT NEXTVAL('" + seq.getName() + "') "; } -} + + @Override + protected String typeName(Type type) { + // Special case: TIMESTAMPTZ stored as INTEGER (milliseconds since the epoch) + // Reading a TIMESTAMPTZ back from the DB, and converting it to a java.util.Date, + // is fraught with peril. The best way around this is to store the dates in + // milliseconds-since-the-epoch (01.01.1970 00:00:00.000 UTC). + if (Type.TIMESTAMPTZ.equals(type)) { + return "BIGINT"; + } + + return type.toString(); + }} diff --git a/prod/net/jaekl/cfb/store/DbStore.java b/prod/net/jaekl/cfb/store/DbStore.java index 37a3898..fed1f9d 100644 --- a/prod/net/jaekl/cfb/store/DbStore.java +++ b/prod/net/jaekl/cfb/store/DbStore.java @@ -318,7 +318,7 @@ public class DbStore { return prior; } - BugCollection getBugCollection(Long priorId) throws SQLException, TypeMismatchException + BugCollection getBugCollection(Long runId) throws SQLException, TypeMismatchException { throw new UnsupportedOperationException("Not yet implemented"); } diff --git a/prod/net/jaekl/cfb/xml/LocalVariable.java b/prod/net/jaekl/cfb/xml/LocalVariable.java index 277bf2d..42c282a 100644 --- a/prod/net/jaekl/cfb/xml/LocalVariable.java +++ b/prod/net/jaekl/cfb/xml/LocalVariable.java @@ -78,6 +78,6 @@ public class LocalVariable extends ParseResult { @Override public int hashCode() { - return ( (1 + Util.objHashCode(m_name)) * (1 + Util.objHashCode(m_role)) ); + return ( (Util.objHashCode(m_name)) ^ (Util.objHashCode(m_role)) ); } } diff --git a/test/net/jaekl/cfb/db/CfbSchemaTest.java b/test/net/jaekl/cfb/db/CfbSchemaTest.java new file mode 100644 index 0000000..9d32151 --- /dev/null +++ b/test/net/jaekl/cfb/db/CfbSchemaTest.java @@ -0,0 +1,53 @@ +package net.jaekl.cfb.db; + +import static org.junit.Assert.*; + +import java.io.ByteArrayInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.sql.SQLException; +import java.util.List; + +import net.jaekl.cfb.analyze.MessageMap; +import net.jaekl.cfb.db.driver.ConnectionMock; +import net.jaekl.cfb.db.driver.DbDriverMock; +import net.jaekl.cfb.xml.MessagesXmlData; + +import org.junit.Test; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +public class CfbSchemaTest { + @Test + public void testEnsureDbInitialized() throws SQLException, FileNotFoundException, IOException, SAXException { + ConnectionMock con; + DbDriverMock dbDriver; + CfbSchema schema; + con = new ConnectionMock(); + dbDriver = new DbDriverMock(); + schema = new CfbSchema(dbDriver); + + MessageMap msgMap = new MessageMap(); + msgMap.parse(new InputSource(new ByteArrayInputStream(MessagesXmlData.XML.getBytes("UTF-8")))); + + schema.setMessageMap(msgMap); + schema.ensureDbInitialized(con); + + for (Table table : CfbSchema.TABLES) { + assertTablePresent(con, dbDriver, table); + } + } + + private void assertTablePresent(ConnectionMock con, DbDriverMock dbDriver, Table table) + throws SQLException + { + Column[] columns = new Column[table.getNumColumns()]; + Table[] tables = new Table[] { table }; + + for (int i = 0; i < table.getNumColumns(); ++i) { + columns[i] = table.getColumn(i); + } + List result = dbDriver.select(con, columns, tables, null); + assertNotNull(result); + } +} diff --git a/test/net/jaekl/cfb/db/ResultSetMock.java b/test/net/jaekl/cfb/db/ResultSetMock.java new file mode 100644 index 0000000..4592272 --- /dev/null +++ b/test/net/jaekl/cfb/db/ResultSetMock.java @@ -0,0 +1,1208 @@ +package net.jaekl.cfb.db; + +import java.io.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Map; + +public class ResultSetMock implements ResultSet { + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public T unwrap(Class iface) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean absolute(int arg0) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public void afterLast() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void beforeFirst() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void cancelRowUpdates() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void clearWarnings() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void close() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void deleteRow() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public int findColumn(String arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public boolean first() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public Array getArray(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Array getArray(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public InputStream getAsciiStream(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public InputStream getAsciiStream(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public BigDecimal getBigDecimal(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public BigDecimal getBigDecimal(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public BigDecimal getBigDecimal(int arg0, int arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public BigDecimal getBigDecimal(String arg0, int arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public InputStream getBinaryStream(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public InputStream getBinaryStream(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Blob getBlob(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Blob getBlob(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean getBoolean(int arg0) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean getBoolean(String arg0) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public byte getByte(int arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public byte getByte(String arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public byte[] getBytes(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public byte[] getBytes(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Reader getCharacterStream(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Reader getCharacterStream(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Clob getClob(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Clob getClob(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getConcurrency() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public String getCursorName() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Date getDate(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Date getDate(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Date getDate(int arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Date getDate(String arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public double getDouble(int arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public double getDouble(String arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getFetchDirection() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getFetchSize() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public float getFloat(int arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public float getFloat(String arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getHoldability() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getInt(int arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getInt(String arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getLong(int arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getLong(String arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Reader getNCharacterStream(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Reader getNCharacterStream(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public NClob getNClob(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public NClob getNClob(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getNString(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getNString(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getObject(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getObject(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getObject(int arg0, Map> arg1) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getObject(String arg0, Map> arg1) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public T getObject(int arg0, Class arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public T getObject(String arg0, Class arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Ref getRef(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Ref getRef(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getRow() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public RowId getRowId(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public RowId getRowId(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public SQLXML getSQLXML(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public SQLXML getSQLXML(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public short getShort(int arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public short getShort(String arg0) throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public Statement getStatement() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getString(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getString(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Time getTime(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Time getTime(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Time getTime(int arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Time getTime(String arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Timestamp getTimestamp(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Timestamp getTimestamp(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Timestamp getTimestamp(int arg0, Calendar arg1) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Timestamp getTimestamp(String arg0, Calendar arg1) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getType() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public URL getURL(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public URL getURL(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public InputStream getUnicodeStream(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public InputStream getUnicodeStream(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public SQLWarning getWarnings() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void insertRow() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public boolean isAfterLast() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isBeforeFirst() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isClosed() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isFirst() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isLast() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean last() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public void moveToCurrentRow() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void moveToInsertRow() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public boolean next() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean previous() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public void refreshRow() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public boolean relative(int arg0) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean rowDeleted() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean rowInserted() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean rowUpdated() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public void setFetchDirection(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setFetchSize(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateArray(int arg0, Array arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateArray(String arg0, Array arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateAsciiStream(int arg0, InputStream arg1) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateAsciiStream(String arg0, InputStream arg1) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateAsciiStream(int arg0, InputStream arg1, int arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateAsciiStream(String arg0, InputStream arg1, int arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateAsciiStream(int arg0, InputStream arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateAsciiStream(String arg0, InputStream arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBigDecimal(int arg0, BigDecimal arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBigDecimal(String arg0, BigDecimal arg1) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBinaryStream(int arg0, InputStream arg1) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBinaryStream(String arg0, InputStream arg1) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBinaryStream(int arg0, InputStream arg1, int arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBinaryStream(String arg0, InputStream arg1, int arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBinaryStream(int arg0, InputStream arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBinaryStream(String arg0, InputStream arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBlob(int arg0, Blob arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBlob(String arg0, Blob arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBlob(int arg0, InputStream arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBlob(String arg0, InputStream arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBlob(int arg0, InputStream arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBlob(String arg0, InputStream arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBoolean(int arg0, boolean arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBoolean(String arg0, boolean arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateByte(int arg0, byte arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateByte(String arg0, byte arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBytes(int arg0, byte[] arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateBytes(String arg0, byte[] arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateCharacterStream(int arg0, Reader arg1) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateCharacterStream(String arg0, Reader arg1) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateCharacterStream(int arg0, Reader arg1, int arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateCharacterStream(String arg0, Reader arg1, int arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateCharacterStream(int arg0, Reader arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateCharacterStream(String arg0, Reader arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateClob(int arg0, Clob arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateClob(String arg0, Clob arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateClob(int arg0, Reader arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateClob(String arg0, Reader arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateClob(int arg0, Reader arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateClob(String arg0, Reader arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateDate(int arg0, Date arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateDate(String arg0, Date arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateDouble(int arg0, double arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateDouble(String arg0, double arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateFloat(int arg0, float arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateFloat(String arg0, float arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateInt(int arg0, int arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateInt(String arg0, int arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateLong(int arg0, long arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateLong(String arg0, long arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNCharacterStream(int arg0, Reader arg1) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNCharacterStream(String arg0, Reader arg1) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNCharacterStream(int arg0, Reader arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNCharacterStream(String arg0, Reader arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNClob(int arg0, NClob arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNClob(String arg0, NClob arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNClob(int arg0, Reader arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNClob(String arg0, Reader arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNClob(int arg0, Reader arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNClob(String arg0, Reader arg1, long arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNString(int arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNString(String arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNull(int arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateNull(String arg0) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateObject(int arg0, Object arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateObject(String arg0, Object arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateObject(int arg0, Object arg1, int arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateObject(String arg0, Object arg1, int arg2) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateRef(int arg0, Ref arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateRef(String arg0, Ref arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateRow() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateRowId(int arg0, RowId arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateRowId(String arg0, RowId arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateSQLXML(int arg0, SQLXML arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateSQLXML(String arg0, SQLXML arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateShort(int arg0, short arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateShort(String arg0, short arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateString(int arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateString(String arg0, String arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateTime(int arg0, Time arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateTime(String arg0, Time arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateTimestamp(int arg0, Timestamp arg1) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void updateTimestamp(String arg0, Timestamp arg1) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public boolean wasNull() throws SQLException { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/test/net/jaekl/cfb/db/SequenceMock.java b/test/net/jaekl/cfb/db/SequenceMock.java new file mode 100644 index 0000000..c2208b2 --- /dev/null +++ b/test/net/jaekl/cfb/db/SequenceMock.java @@ -0,0 +1,20 @@ +package net.jaekl.cfb.db; + +public class SequenceMock extends Sequence { + + long m_val; + + public SequenceMock(String name) { + super(name); + m_val = 0; + } + + public SequenceMock(Sequence seq) { + this(seq.getName()); + } + + public long mock_nextVal() { + m_val += 1; + return m_val; + } +} diff --git a/test/net/jaekl/cfb/db/TableMock.java b/test/net/jaekl/cfb/db/TableMock.java new file mode 100644 index 0000000..1c91115 --- /dev/null +++ b/test/net/jaekl/cfb/db/TableMock.java @@ -0,0 +1,42 @@ +package net.jaekl.cfb.db; + +import java.util.ArrayList; + +import static org.junit.Assert.*; + +public class TableMock extends Table { + + private ArrayList m_rows; + + public TableMock(String name, Column[] columns) { + super(name, columns); + m_rows = new ArrayList(); + } + + public TableMock(Table table) { + this(table.m_name, table.m_columns.toArray(new Column[table.m_columns.size()])); + } + + protected ArrayList mock_getRows() { return m_rows; } + + public boolean mock_hasColumn(Column expectedCol) { + for (Column col : m_columns) { + if (col.equals(expectedCol)) { + return true; + } + } + return false; + } + + public Column[] mock_getColumns() { + return m_columns.toArray(new Column[m_columns.size()]); + } + + public void mock_insert(Row row) { + assertEquals(getNumColumns(), row.getNumColumns()); + for (int i = 0; i < getNumColumns(); ++i) { + assertEquals(getColumn(i).getType(), row.getColumn(i).getType()); + } + m_rows.add(row); + } +} diff --git a/test/net/jaekl/cfb/db/driver/ConnectionMock.java b/test/net/jaekl/cfb/db/driver/ConnectionMock.java new file mode 100644 index 0000000..b25a3fc --- /dev/null +++ b/test/net/jaekl/cfb/db/driver/ConnectionMock.java @@ -0,0 +1,365 @@ +package net.jaekl.cfb.db.driver; + +import java.sql.Array; +import java.sql.Blob; +import java.sql.CallableStatement; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.NClob; +import java.sql.PreparedStatement; +import java.sql.SQLClientInfoException; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Savepoint; +import java.sql.Statement; +import java.sql.Struct; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.Executor; + +public class ConnectionMock implements Connection { + + @Override + public boolean isWrapperFor(Class arg0) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public T unwrap(Class arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void abort(Executor executor) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void clearWarnings() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void close() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void commit() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public Array createArrayOf(String typeName, Object[] elements) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Blob createBlob() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Clob createClob() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public NClob createNClob() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public SQLXML createSQLXML() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Statement createStatement() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Statement createStatement(int resultSetType, int resultSetConcurrency) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Statement createStatement(int resultSetType, + int resultSetConcurrency, int resultSetHoldability) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Struct createStruct(String typeName, Object[] attributes) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean getAutoCommit() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getCatalog() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Properties getClientInfo() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getClientInfo(String name) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getHoldability() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public DatabaseMetaData getMetaData() throws SQLException { + DatabaseMetaData result = new DatabaseMetaDataMock(); + return result; + } + + @Override + public int getNetworkTimeout() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public String getSchema() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getTransactionIsolation() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public Map> getTypeMap() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public SQLWarning getWarnings() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean isClosed() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isReadOnly() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isValid(int timeout) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public String nativeSQL(String sql) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public CallableStatement prepareCall(String sql) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public CallableStatement prepareCall(String sql, int resultSetType, + int resultSetConcurrency) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public CallableStatement prepareCall(String sql, int resultSetType, + int resultSetConcurrency, int resultSetHoldability) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public PreparedStatement prepareStatement(String sql) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public PreparedStatement prepareStatement(String sql, int[] columnIndexes) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public PreparedStatement prepareStatement(String sql, String[] columnNames) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public PreparedStatement prepareStatement(String sql, int resultSetType, + int resultSetConcurrency) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public PreparedStatement prepareStatement(String sql, int resultSetType, + int resultSetConcurrency, int resultSetHoldability) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void releaseSavepoint(Savepoint savepoint) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void rollback() throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void rollback(Savepoint savepoint) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setAutoCommit(boolean autoCommit) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setCatalog(String catalog) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setClientInfo(Properties properties) + throws SQLClientInfoException { + // TODO Auto-generated method stub + + } + + @Override + public void setClientInfo(String name, String value) + throws SQLClientInfoException { + // TODO Auto-generated method stub + + } + + @Override + public void setHoldability(int holdability) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setNetworkTimeout(Executor executor, int milliseconds) + throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setReadOnly(boolean readOnly) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public Savepoint setSavepoint() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Savepoint setSavepoint(String name) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setSchema(String schema) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTransactionIsolation(int level) throws SQLException { + // TODO Auto-generated method stub + + } + + @Override + public void setTypeMap(Map> map) throws SQLException { + // TODO Auto-generated method stub + + } + +} diff --git a/test/net/jaekl/cfb/db/driver/DatabaseMetaDataMock.java b/test/net/jaekl/cfb/db/driver/DatabaseMetaDataMock.java new file mode 100644 index 0000000..265fc1a --- /dev/null +++ b/test/net/jaekl/cfb/db/driver/DatabaseMetaDataMock.java @@ -0,0 +1,1103 @@ +package net.jaekl.cfb.db.driver; + +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.RowIdLifetime; +import java.sql.SQLException; + +import net.jaekl.cfb.db.ResultSetMock; + +public class DatabaseMetaDataMock implements DatabaseMetaData { + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public T unwrap(Class iface) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean allProceduresAreCallable() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean allTablesAreSelectable() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean autoCommitFailureClosesAllResultSets() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean dataDefinitionCausesTransactionCommit() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean dataDefinitionIgnoredInTransactions() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean deletesAreDetected(int type) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean doesMaxRowSizeIncludeBlobs() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean generatedKeyAlwaysReturned() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public ResultSet getAttributes(String catalog, String schemaPattern, + String typeNamePattern, String attributeNamePattern) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getBestRowIdentifier(String catalog, String schema, + String table, int scope, boolean nullable) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getCatalogSeparator() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getCatalogTerm() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getCatalogs() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getClientInfoProperties() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getColumnPrivileges(String catalog, String schema, + String table, String columnNamePattern) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getColumns(String catalog, String schemaPattern, + String tableNamePattern, String columnNamePattern) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Connection getConnection() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getCrossReference(String parentCatalog, + String parentSchema, String parentTable, String foreignCatalog, + String foreignSchema, String foreignTable) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getDatabaseMajorVersion() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getDatabaseMinorVersion() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public String getDatabaseProductName() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getDatabaseProductVersion() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getDefaultTransactionIsolation() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getDriverMajorVersion() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getDriverMinorVersion() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public String getDriverName() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getDriverVersion() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getExportedKeys(String catalog, String schema, String table) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getExtraNameCharacters() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getFunctionColumns(String catalog, String schemaPattern, + String functionNamePattern, String columnNamePattern) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getFunctions(String catalog, String schemaPattern, + String functionNamePattern) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getIdentifierQuoteString() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getImportedKeys(String catalog, String schema, String table) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getIndexInfo(String catalog, String schema, String table, + boolean unique, boolean approximate) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getJDBCMajorVersion() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getJDBCMinorVersion() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxBinaryLiteralLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxCatalogNameLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxCharLiteralLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxColumnNameLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxColumnsInGroupBy() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxColumnsInIndex() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxColumnsInOrderBy() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxColumnsInSelect() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxColumnsInTable() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxConnections() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxCursorNameLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxIndexLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxProcedureNameLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxRowSize() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxSchemaNameLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxStatementLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxStatements() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxTableNameLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxTablesInSelect() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getMaxUserNameLength() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public String getNumericFunctions() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getPrimaryKeys(String catalog, String schema, String table) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getProcedureColumns(String catalog, String schemaPattern, + String procedureNamePattern, String columnNamePattern) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getProcedureTerm() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getProcedures(String catalog, String schemaPattern, + String procedureNamePattern) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getPseudoColumns(String catalog, String schemaPattern, + String tableNamePattern, String columnNamePattern) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getResultSetHoldability() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public RowIdLifetime getRowIdLifetime() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getSQLKeywords() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getSQLStateType() throws SQLException { + // TODO Auto-generated method stub + return 0; + } + + @Override + public String getSchemaTerm() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getSchemas() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getSchemas(String catalog, String schemaPattern) + throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getSearchStringEscape() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getStringFunctions() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getSuperTables(String catalog, String schemaPattern, + String tableNamePattern) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getSuperTypes(String catalog, String schemaPattern, + String typeNamePattern) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getSystemFunctions() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getTablePrivileges(String catalog, String schemaPattern, + String tableNamePattern) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getTableTypes() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) + throws SQLException + { + ResultSetMock result = new ResultSetMock(); + return result; + } + + @Override + public String getTimeDateFunctions() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getTypeInfo() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getUDTs(String catalog, String schemaPattern, + String typeNamePattern, int[] types) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getURL() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getUserName() throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ResultSet getVersionColumns(String catalog, String schema, + String table) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean insertsAreDetected(int type) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isCatalogAtStart() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isReadOnly() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean locatorsUpdateCopy() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean nullPlusNonNullIsNull() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean nullsAreSortedAtEnd() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean nullsAreSortedAtStart() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean nullsAreSortedHigh() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean nullsAreSortedLow() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean othersDeletesAreVisible(int type) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean othersInsertsAreVisible(int type) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean othersUpdatesAreVisible(int type) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean ownDeletesAreVisible(int type) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean ownInsertsAreVisible(int type) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean ownUpdatesAreVisible(int type) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean storesLowerCaseIdentifiers() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean storesLowerCaseQuotedIdentifiers() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean storesMixedCaseIdentifiers() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean storesMixedCaseQuotedIdentifiers() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean storesUpperCaseIdentifiers() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean storesUpperCaseQuotedIdentifiers() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsANSI92EntryLevelSQL() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsANSI92FullSQL() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsANSI92IntermediateSQL() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsAlterTableWithAddColumn() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsAlterTableWithDropColumn() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsBatchUpdates() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsCatalogsInDataManipulation() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsCatalogsInIndexDefinitions() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsCatalogsInProcedureCalls() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsCatalogsInTableDefinitions() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsColumnAliasing() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsConvert() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsConvert(int fromType, int toType) + throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsCoreSQLGrammar() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsCorrelatedSubqueries() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsDataDefinitionAndDataManipulationTransactions() + throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsDataManipulationTransactionsOnly() + throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsDifferentTableCorrelationNames() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsExpressionsInOrderBy() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsExtendedSQLGrammar() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsFullOuterJoins() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsGetGeneratedKeys() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsGroupBy() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsGroupByBeyondSelect() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsGroupByUnrelated() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsIntegrityEnhancementFacility() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsLikeEscapeClause() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsLimitedOuterJoins() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsMinimumSQLGrammar() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsMixedCaseIdentifiers() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsMultipleOpenResults() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsMultipleResultSets() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsMultipleTransactions() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsNamedParameters() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsNonNullableColumns() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsOpenCursorsAcrossCommit() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsOpenCursorsAcrossRollback() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsOpenStatementsAcrossCommit() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsOpenStatementsAcrossRollback() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsOrderByUnrelated() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsOuterJoins() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsPositionedDelete() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsPositionedUpdate() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsResultSetConcurrency(int type, int concurrency) + throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsResultSetHoldability(int holdability) + throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsResultSetType(int type) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSavepoints() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSchemasInDataManipulation() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSchemasInIndexDefinitions() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSchemasInProcedureCalls() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSchemasInTableDefinitions() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSelectForUpdate() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsStatementPooling() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsStoredProcedures() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSubqueriesInComparisons() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSubqueriesInExists() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSubqueriesInIns() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsSubqueriesInQuantifieds() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsTableCorrelationNames() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsTransactionIsolationLevel(int level) + throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsTransactions() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsUnion() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean supportsUnionAll() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean updatesAreDetected(int type) throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean usesLocalFilePerTable() throws SQLException { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean usesLocalFiles() throws SQLException { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/test/net/jaekl/cfb/db/driver/DbDriverMock.java b/test/net/jaekl/cfb/db/driver/DbDriverMock.java new file mode 100644 index 0000000..833df82 --- /dev/null +++ b/test/net/jaekl/cfb/db/driver/DbDriverMock.java @@ -0,0 +1,151 @@ +package net.jaekl.cfb.db.driver; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import net.jaekl.cfb.db.Column; +import net.jaekl.cfb.db.Condition; +import net.jaekl.cfb.db.Row; +import net.jaekl.cfb.db.Sequence; +import net.jaekl.cfb.db.SequenceMock; +import net.jaekl.cfb.db.Sort; +import net.jaekl.cfb.db.Table; +import net.jaekl.cfb.db.TableMock; + +public class DbDriverMock extends DbDriver { + + private HashMap m_tables; + private HashMap m_sequences; + + public DbDriverMock() { + super(); + m_tables = new HashMap(); + m_sequences = new HashMap(); + } + + @Override + public void load() throws ClassNotFoundException { + // no-op + } + + @Override + public Connection connect(String host, int port, String dbName, String user, String pass) + throws SQLException + { + return null; + } + + @Override + public boolean createTable(Connection con, Table table) throws SQLException + { + assertNotNull(con); + assertNotNull(table); + assertFalse(m_tables.containsKey(table.getName())); + + TableMock tm = new TableMock(table); + m_tables.put(table.getName(), tm); + return true; + } + + @Override + public void dropTable(Connection con, Table table) throws SQLException + { + assertNotNull(con); + assertNotNull(table); + assertTrue(table instanceof TableMock); + + if (m_tables.containsKey(table.getName())) { + m_tables.remove(table.getName()); + } + else { + throw new SQLException("Table " + table.getName() + " does not exist."); + } + } + + @Override + public boolean createSequence(Connection con, Sequence seq) throws SQLException + { + assertNotNull(con); + assertNotNull(seq); + assertFalse(m_sequences.containsKey(seq.getName())); + + SequenceMock sm = (seq instanceof SequenceMock) ? (SequenceMock)seq : new SequenceMock(seq); + + m_sequences.put(seq.getName(), sm); + return true; + } + + public void dropSequence(Connection con, Sequence seq) throws SQLException + { + assertNotNull(con); + assertNotNull(seq); + assertTrue(seq instanceof SequenceMock); + + if (m_sequences.containsKey(seq.getName())) { + m_sequences.remove(seq.getName()); + } + else { + throw new SQLException("Sequence " + seq.getName() + " does not exist."); + } + } + + public List select(Connection con, Column[] columns, Table[] tables, Condition[] conditions, Sort[] sorts, int limit) + throws SQLException + { + assertNotNull(con); + assertNotNull(columns); + assertNotNull(tables); + + // TODO: produce sensible output + return new ArrayList(); + } + + // Returns the number of rows inserted + @Override + public int insert(Connection con, Table table, Object[][] values) throws SQLException + { + assertNotNull(con); + assertNotNull(table); + assertNotNull(values); + + TableMock tm = m_tables.get(table.getName()); + if (null == tm) { + throw new SQLException("Table " + table.getName() + " does not exist."); + } + Column[] columns = tm.mock_getColumns(); + + for (Object[] rowVals : values) { + assertNotNull(rowVals); + assertEquals(table.getNumColumns(), rowVals.length); + + tm.mock_insert(new Row(columns, rowVals)); + } + + return values.length; + } + + + public long nextVal(Connection con, Sequence seq) throws SQLException + { + assertNotNull(con); + assertNotNull(seq); + + SequenceMock sm = m_sequences.get(seq.getName()); + return sm.mock_nextVal(); + } + + + @Override + protected String nextValSql(Sequence seq) + { + return ""; + } +} diff --git a/test/net/jaekl/cfb/xml/MessagesXmlData.java b/test/net/jaekl/cfb/xml/MessagesXmlData.java new file mode 100644 index 0000000..5b81dca --- /dev/null +++ b/test/net/jaekl/cfb/xml/MessagesXmlData.java @@ -0,0 +1,227 @@ +package net.jaekl.cfb.xml; + +public class MessagesXmlData { + public static final String XML = + "\n" + + "\n" + + "\n" + + " Correctness\n" + + " C\n" + + "
Probable bug - an apparent coding mistake\n" + + " resulting in code that was probably not what the\n" + + " developer intended. We strive for a low false positive rate.
\n" + + "
\n" + + " \n" + + " Bogus random noise\n" + + " N\n" + + "
Bogus random noise: intended to be useful\n" + + " as a control in data mining experiments, not in finding actual bugs in software\n" + + "
\n" + + "
\n" + + " \n" + + " Security\n" + + " S\n" + + "
A use of untrusted input in a way that could create a remotely exploitable security vulnerability.\n" + + "
\n" + + "
\n" + + " \n" + + " Bad practice\n" + + " B\n" + + "
Violations of recommended and essential\n" + + " coding practice. Examples include hash code and equals\n" + + " problems, cloneable idiom, dropped exceptions,\n" + + " Serializable problems, and misuse of finalize.\n" + + " We strive to make this analysis accurate,\n" + + " although some groups may\n" + + " not care about some of the bad practices.
\n" + + "
\n" + + " \n" + + " Dodgy code\n" + + " D\n" + + "
code that is confusing, anomalous, or\n" + + " written in a way that leads itself to errors.\n" + + " Examples include dead local stores, switch fall through,\n" + + " unconfirmed casts, and redundant null check of value\n" + + " known to be null.\n" + + " More false positives accepted.\n" + + " In previous versions of FindBugs, this category was known as Style.\n" + + "
\n" + + "
\n" + + " \n" + + " Performance\n" + + " P\n" + + "
code that is not necessarily incorrect but may be inefficient
\n" + + "
\n" + + " \n" + + " Malicious code vulnerability\n" + + " V\n" + + "
code that is vulnerable to attacks from untrusted code
\n" + + "
\n" + + " \n" + + " Multithreaded correctness\n" + + " M\n" + + "
code flaws having to do with threads, locks, and volatiles
\n" + + "
\n" + + " \n" + + " Internationalization\n" + + " I\n" + + "
code flaws having to do with internationalization and locale
\n" + + " \n" + + "
\n" + + " \n" + + " Experimental\n" + + " X\n" + + "
Experimental and not fully vetted bug patterns
\n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " Rough value of known constant found\n" + + " Rough value of {3} found: {2}\n" + + "
\n" + + " It's recommended to use the predefined library constant for code clarity and better precision.

\n" + + " ]]>\n" + + "
\n" + + "
\n" + + " \n" + + " Class too big for analysis\n" + + " {0} is too big for analysis\n" + + "
\n" + + " This class is bigger than can be effectively handled, and was not fully analyzed for errors.\n" + + "

\n" + + "\n" + + " ]]>\n" + + "
\n" + + "
\n" + + " \n" + + " Bogus warning about a null pointer dereference\n" + + " Bogus warning about a null pointer dereference in {1}\n" + + "
\n" + + " Bogus warning.

\n" + + " ]]>\n" + + "
\n" + + "
\n" + + " \n" + + " Bogus warning about a method call\n" + + " Bogus warning about a method call {2} in {1}\n" + + "
\n" + + " Bogus warning.

\n" + + " ]]>\n" + + "
\n" + + "
\n" + + " \n" + + " Bogus warning about a field reference\n" + + " Bogus warning about a reference to {2} in {1}\n" + + "
\n" + + " Bogus warning.

\n" + + " ]]>\n" + + "
\n" + + "
\n" + + " \n" + + " Bogus warning about an operation\n" + + " Bogus warning about an operation {1}\n" + + "
\n" + + " Bogus warning.

\n" + + " ]]>\n" + + "
\n" + + "
\n" + + " \n" + + " BigDecimal constructed from double that isn't represented precisely\n" + + " BigDecimal constructed from {4} in {1}\n" + + "
\n" + + " \n" + + " This code creates a BigDecimal from a double value that doesn't translate well to a\n" + + " decimal number.\n" + + " For example, one might assume that writing new BigDecimal(0.1) in Java creates a BigDecimal which is exactly equal to 0.1 (an unscaled value of 1, with a scale of 1), but it is actually equal to 0.1000000000000000055511151231257827021181583404541015625.\n" + + " You probably want to use the BigDecimal.valueOf(double d) method, which uses the String representation\n" + + " of the double to create the BigDecimal (e.g., BigDecimal.valueOf(0.1) gives 0.1).\n" + + "

\n" + + "\n" + + " ]]>\n" + + "
\n" + + "
\n" + + "\n" + + " \n" + + " D'oh! A nonsensical method invocation\n" + + " D'oh! A nonsensical invocation of {2.nameAndSignature} in {1}\n" + + "
\n" + + " \n" + + " This partical method invocation doesn't make sense, for reasons that should be apparent from inspection.\n" + + "

\n" + + "\n" + + " ]]>\n" + + "
\n" + + "
\n" + + "\n" + + " " + + " Useless/vacuous call to EasyMock method" + + " Useless/vacuous call to {2} in {1}" + + "
" + + " This call doesn't pass any objects to the EasyMock method, so the call doesn't do anything." + + "

" + + "" + + " ]]>" + + "
" + + "
" + + " " + + " Creation of ScheduledThreadPoolExecutor with zero core threads" + + " Creation of ScheduledThreadPoolExecutor with zero core threads in {1}" + + "
" + + " (Javadoc)" + + " A ScheduledThreadPoolExecutor with zero core threads will never execute anything; changes to the max pool size are ignored." + + "

" + + "" + + " ]]>" + + "
" + + "
" + + " " + + " Futile attempt to change max pool size of ScheduledThreadPoolExecutor" + + " Futile attempt to change max pool size of ScheduledThreadPoolExecutor in {1}" + + "
" + + " (Javadoc)" + + " While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments to maximumPoolSize have no useful effect." + + "

" + + "" + + " ]]>" + + "
" + + "
" + + " " + + " Call to unsupported method" + + " Call to unsupported method {2} in {1}" + + "
" + + " All targets of this method invocation throw an UnsupportedOperationException." + + "

" + + "" + + " ]]>" + + "
" + + "
" + + " " + + " Empty database password" + + " Empty database password in {1}" + + "
" + + " This code creates a database connect using a blank or empty password. This indicates that the database is not protected by a password." + + "

" + + "" + + " ]]>" + + "
" + + "
" + + "
"; +}