1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
|
# Copyright 2008 - 2010 Sun Microsystems, Inc. All rights reserved.
#
# The MySQL Connector/C++ is licensed under the terms of the GPL
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptions to the terms and
# conditions of the GPL as it is applied to this software, see the
# FLOSS License Exception
# <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
# Regexps disabled by default. No need to escape regexp characters (like "(.)")
# in the part, there regexps disabled.
# rules applied in order they are defined
# (however currently regexp rules applied after constant rules)
#
#$regexp = enabled
#we don't need to call new for String. Following 2 doesn't work at the moment
= new String\(\) =>
= new Properties\(\) =>
= new HashMap() =>
(\S+)\.getObject\( => getObject($1,
BaseTestCase(?!\.h) => BaseTestFixture
(?<=String)(\s+\w+)\s*=\s*NULL =>$1
(?<!\=|\!)\=\s*NULL => \/*= NULL*\/
#DriverManager.getConnection\((\w+),\s*\)
catch\s*\(SQLException => catch (sql::SQLException *
\bSQLException\b => sql::SQLException
# Not really equal substitution. ...?
\bException\b => std::exception *
# for string concatanation w/ constant 1st operand.
(?<!\+ )("[^"]+")\s*\+ => String( $1 ) +
(\w+)\.equals\(([^\)]+)\) => $1 == $2
(\w+)\s+instanceof\s+(\w+) => /* TODO: Check this --> */ dynamic_cast<$2>( $1 ) != NULL
#$regexp = disabled
# keywords
package => namespace
import => #include
class => class
extends => : public
abstract =>
finally =>
final => const
private => private
public => public
protected => protected
static => static
null => NULL
# don't really need this, but safer to keep it. Or can get hardly catchable bug
this. => this->
#inclusions
java.sql.Connection => "cppconn/connection.h"
java.sql.DriverManager => ACT:COMMENT
java.sql.PreparedStatement=> "cppconn/prepared_statement.h"
java.sql.ResultSet => "cppconn/resultset.h"
java.sql.SQLException => "cppconn/exception.h"
java.sql.Statement => "cppconn/statement.h"
java.sql.DatabaseMetaData => "cppconn/metadata.h"
java.sql.ResultSetMetaData=> "cppconn/resultset_metadata.h"
java.sql.Types => "cppconn/datatype.h"
junit.framework.TestCase => "framework/framework.h"
java.io.BufferedOutputStream => ACT:COMMENT
java.io.File => ACT:COMMENT
java.io.FileOutputStream=> ACT:COMMENT
java.io.FilenameFilter => ACT:COMMENT
java.io.IOException => ACT:COMMENT
java.sql.Blob => ACT:COMMENT
java.util.ArrayList => ACT:COMMENT
java.util.Iterator => ACT:COMMENT
java.util.List => ACT:COMMENT
java.util.Locale => ACT:COMMENT
java.util.Properties => ACT:COMMENT
com.mysql.jdbc.NonRegisteringDriver => ACT:COMMENT
com.mysql.jdbc.StringUtils => ACT:COMMENT
java.io.BufferedInputStream => ACT:COMMENT
java.io.ByteArrayOutputStream => ACT:COMMENT
java.io.FileInputStream => ACT:COMMENT
java.io.InputStream => ACT:COMMENT
java.util.StringTokenizer => ACT:COMMENT
# not sure if this one needed "cppconn/resultset_metadata.h"
# data types
String => String
boolean => bool
StringBuffer => String
void => void
long => long
int => int
String[] => List
# names
testsuite.BaseTestCase => "../BaseTestFixture.h"
com.mysql.jdbc.compliance.common.BaseTestCase => "../BaseTestFixture.h"
testsuite. => testsuite::
TestCase => TestFixture::TestCase
isRunningOnJRockit => ACT:COMMENT
isRunningOnJdk131 => ACT:COMMENT
conn. => conn->
stmt. => stmt->
pstmt. => pstmt->
driver. => driver->
rs. => rs->
dbmd. => dbmd->
createStatement(). => createStatement()->
# this one is for (connection).close. can be wrong
.close() => ->close()
main => ACT:DELETE
keySet(). =>
StringBuffer => String
# unsigned is not keyword in java and thus can be used as variables name (and that happens is some test)
unsigned => isUnsigned
.getMessage() => ->what()
.getString( => ->getString(
.substring( => .substr(
.next() => ->next()
Connection.TRANSACTION_NONE => TRANSACTION_NONE
Connection.TRANSACTION_READ_COMMITTED => TRANSACTION_READ_COMMITTED
Connection.TRANSACTION_READ_UNCOMMITTED => TRANSACTION_READ_UNCOMMITTED
Connection.TRANSACTION_REPEATABLE_READ => TRANSACTION_REPEATABLE_READ
Connection.TRANSACTION_SERIALIZABLE => TRANSACTION_SERIALIZABLE
DatabaseMetaData.bestRowTemporary => sql::DatabaseMetaData::bestRowTemporary
DatabaseMetaData.bestRowTransaction => sql::DatabaseMetaData::bestRowTransaction
DatabaseMetaData.bestRowSession => sql::DatabaseMetaData::bestRowSession
ResultSet.TYPE_FORWARD_ONLY => sql::ResultSet::TYPE_FORWARD_ONLY
ResultSet.TYPE_SCROLL_SENSITIVE => sql::ResultSet::TYPE_SCROLL_SENSITIVE
ResultSet.TYPE_SCROLL_INSENSITIVE => sql::ResultSet::TYPE_SCROLL_INSENSITIVE
ResultSet.CONCUR_READ_ONLY => sql::ResultSet::CONCUR_READ_ONLY
ResultSet.CONCUR_UPDATABLE => sql::ResultSet::CONCUR_UPDATABLE
TRANSACTION_NONE => sql::TRANSACTION_NONE
TRANSACTION_READ_UNCOMMITTED => sql::TRANSACTION_READ_UNCOMMITTED
TRANSACTION_READ_COMMITTED => sql::TRANSACTION_READ_COMMITTED
TRANSACTION_REPEATABLE_READ => sql::TRANSACTION_REPEATABLE_READ
TRANSACTION_SERIALIZABLE => sql::TRANSACTION_SERIALIZABLE
Types.NULL => sql::DataType::SQLNULL
Types. => sql::DataType::
# methods, functions etc
System.out.println => MESSAGE
indexOf => find_first_of
.getMetaData() => ->getMetaData()
.keySet().iterator() => .begin()
# Have to think on introducing regexps here... and more sophisticated parsing
.hasNext() => != /*TODO: */ !!CONTAINER_NAME!!.end()
.toString() =>
#currently will miss one closing parenthesis
.setProperty => .insert(Properties::value_type
.createStatement() => ->createStatement()
.executeQuery() => ->executeStatement
.clientPrepareStatement( => ->prepareStatement
.nativeSQL( => ->nativeSQL(
.isClosed() => ->isClosed()
.getColumnCount() => ->getColumnCount()
.getColumnName( => ->getColumnName(
rsmd. => rsmd->
->getCatalogName => ->getCatalogName
NULLPlusNonNullIsNull => nullPlusNonNullIsNull
NULLsAreSortedAtEnd => nullsAreSortedAtEnd
NULLsAreSortedAtStart => nullsAreSortedAtStart
NULLsAreSortedHigh => nullsAreSortedHigh
NULLsAreSortedLow => nullsAreSortedLow
# tests related
com.mysql.jdbc.compliance.tests => testsuite::compliance
com.mysql.jdbc.compliance.common=> testsuite::compliance
Connection => Connection
List => List
Iterator => Iterator
PreparedStatement => PreparedStatement
ResultSet => ResultSet
Statement => Statement
com.mysql.jdbc.CharsetMapping => "resources.h"
Properties => Properties
Object => Object
File => File
fault( => FAIL(
com.mysql.jdbc.ResultSetMetaData => ResultSetMetaData
com.mysql.jdbc.Connection => Connection
CharsetMapping.STATIC_CHARSET_TO_NUM_BYTES_MAP => resources::CharsetMapping::Instance().GetMap()
ResultSetMetaData.column => sql::ResultSetMetaData::column
# assertEquals overloaded in junit
#assertEquals => ASSERT_EQUALS
super. => super::
assertTrue => ASSERT
|