Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
30dbb194
提交
30dbb194
authored
5月 20, 2016
作者:
Thomas Mueller Graf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Formatting and Javadocs
上级
11c11898
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
810 行增加
和
832 行删除
+810
-832
help.csv
h2/src/main/org/h2/res/help.csv
+4
-0
TestAllJunit.java
h2/src/test/org/h2/test/TestAllJunit.java
+4
-1
TestConnection.java
h2/src/test/org/h2/test/jdbc/TestConnection.java
+7
-5
CalculateHashConstantLong.java
h2/src/test/org/h2/test/store/CalculateHashConstantLong.java
+1
-1
testScript.sql
h2/src/test/org/h2/test/testScript.sql
+6
-6
TestMode.java
h2/src/test/org/h2/test/unit/TestMode.java
+21
-13
TestNetUtils.java
h2/src/test/org/h2/test/unit/TestNetUtils.java
+14
-4
TestSecurity.java
h2/src/test/org/h2/test/unit/TestSecurity.java
+4
-4
TestTimeStampWithTimeZone.java
h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java
+1
-1
TestValueMemory.java
h2/src/test/org/h2/test/unit/TestValueMemory.java
+1
-1
H2Platform.java.txt
.../toplink/essentials/platform/database/H2Platform.java.txt
+1
-1
Build.java
h2/src/tools/org/h2/build/Build.java
+2
-1
CheckJavadoc.java
h2/src/tools/org/h2/build/code/CheckJavadoc.java
+11
-8
SpellChecker.java
h2/src/tools/org/h2/build/doc/SpellChecker.java
+12
-4
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+721
-782
没有找到文件。
h2/src/main/org/h2/res/help.csv
浏览文件 @
30dbb194
...
...
@@ -92,6 +92,10 @@ Adds a new column to a table."
ALTER TABLE tableName ADD constraint [ CHECK | NOCHECK ]
","
Adds a constraint to a table."
"Commands (DDL)","ALTER TABLE RENAME CONSTRAINT","
ALTER TABLE tableName RENAME oldConstraintName TO newConstraintName
","
Renames a constraint."
"Commands (DDL)","ALTER TABLE ALTER COLUMN","
ALTER TABLE tableName ALTER COLUMN columnName
{ { dataType [ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ] }
...
...
h2/src/test/org/h2/test/TestAllJunit.java
浏览文件 @
30dbb194
...
...
@@ -13,6 +13,9 @@ import org.junit.Test;
*/
public
class
TestAllJunit
{
/**
* Run all the fast tests.
*/
@Test
public
void
testFast
()
throws
Exception
{
TestAll
.
main
(
"fast"
);
...
...
h2/src/test/org/h2/test/jdbc/TestConnection.java
浏览文件 @
30dbb194
...
...
@@ -37,7 +37,8 @@ public class TestConnection extends TestBase {
}
private
void
testSetInternalProperty
()
throws
SQLException
{
// Use MySQL-mode since this allows all property names (apart from h2 internal names).
// Use MySQL-mode since this allows all property names
// (apart from h2 internal names).
Connection
conn
=
getConnection
(
"clientInfoMySQL;MODE=MySQL"
);
assertThrows
(
SQLClientInfoException
.
class
,
conn
).
setClientInfo
(
"numServers"
,
"SomeValue"
);
...
...
@@ -48,7 +49,7 @@ public class TestConnection extends TestBase {
Connection
conn
=
getConnection
(
"clientInfo"
);
Properties
properties
=
new
Properties
();
properties
.
put
(
"ClientUser"
,
"some
u
ser"
);
properties
.
put
(
"ClientUser"
,
"some
U
ser"
);
assertThrows
(
SQLClientInfoException
.
class
,
conn
).
setClientInfo
(
properties
);
}
...
...
@@ -58,12 +59,12 @@ public class TestConnection extends TestBase {
conn
.
setClientInfo
(
"ApplicationName"
,
"Connection Test"
);
Properties
properties
=
new
Properties
();
properties
.
put
(
"ClientUser"
,
"some
u
ser"
);
properties
.
put
(
"ClientUser"
,
"some
U
ser"
);
conn
.
setClientInfo
(
properties
);
// old property should have been removed
assertNull
(
conn
.
getClientInfo
(
"ApplicationName"
));
// new property has been set
assertEquals
(
conn
.
getClientInfo
(
"ClientUser"
),
"some
u
ser"
);
assertEquals
(
conn
.
getClientInfo
(
"ClientUser"
),
"some
U
ser"
);
}
private
void
testSetSupportedClientInfo
()
throws
SQLException
{
...
...
@@ -75,7 +76,8 @@ public class TestConnection extends TestBase {
private
void
testSetUnsupportedClientInfo
()
throws
SQLException
{
Connection
conn
=
getConnection
(
"clientInfoDB2;MODE=DB2"
);
assertThrows
(
SQLClientInfoException
.
class
,
conn
).
setClientInfo
(
"UnsupportedName"
,
"SomeValue"
);
assertThrows
(
SQLClientInfoException
.
class
,
conn
).
setClientInfo
(
"UnsupportedName"
,
"SomeValue"
);
}
private
void
testGetUnsupportedClientInfo
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/store/CalculateHashConstantLong.java
浏览文件 @
30dbb194
...
...
@@ -132,7 +132,7 @@ public class CalculateHashConstantLong implements Runnable {
System
.
out
.
println
(
"Collisions: "
+
collisions
);
}
static
void
printQuality
(
CalculateHashConstantLong
test
,
long
[]
randomValues
)
{
private
static
void
printQuality
(
CalculateHashConstantLong
test
,
long
[]
randomValues
)
{
int
finalCount
=
randomValues
.
length
*
10
;
System
.
out
.
println
(
"Quality of "
+
test
);
int
[]
minMax
;
...
...
h2/src/test/org/h2/test/testScript.sql
浏览文件 @
30dbb194
h2/src/test/org/h2/test/unit/TestMode.java
浏览文件 @
30dbb194
...
...
@@ -36,12 +36,17 @@ public class TestMode extends TestBase {
private
void
testDb2ClientInfo
()
{
Mode
db2Mode
=
Mode
.
getInstance
(
"DB2"
);
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ApplicationName"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientAccountingInformation"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientUser"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientCorrelationToken"
).
matches
());
assertFalse
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyOtherValue"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ApplicationName"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientAccountingInformation"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientUser"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientCorrelationToken"
).
matches
());
assertFalse
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyOtherValue"
).
matches
());
}
private
void
testDerbyClientInfo
()
{
...
...
@@ -61,22 +66,25 @@ public class TestMode extends TestBase {
private
void
testMySqlClientInfo
()
{
Mode
mySqlMode
=
Mode
.
getInstance
(
"MySQL"
);
assertTrue
(
mySqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyString"
).
matches
());
assertTrue
(
mySqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyString"
).
matches
());
}
private
void
testOracleClientInfo
()
{
Mode
oracleMode
=
Mode
.
getInstance
(
"Oracle"
);
assertTrue
(
oracleMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"anythingContaining.aDot"
).
matches
());
assertFalse
(
oracleMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"anythingContainingNoDot"
).
matches
());
assertTrue
(
oracleMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"anythingContaining.aDot"
).
matches
());
assertFalse
(
oracleMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"anythingContainingNoDot"
).
matches
());
}
private
void
testPostgresqlClientInfo
()
{
Mode
postgresqlMode
=
Mode
.
getInstance
(
"PostgreSQL"
);
assertTrue
(
postgresqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ApplicationName"
).
matches
());
assertFalse
(
postgresqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyOtherValue"
).
matches
());
assertTrue
(
postgresqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ApplicationName"
).
matches
());
assertFalse
(
postgresqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyOtherValue"
).
matches
());
}
}
h2/src/test/org/h2/test/unit/TestNetUtils.java
浏览文件 @
30dbb194
...
...
@@ -155,7 +155,12 @@ public class TestNetUtils extends TestBase {
return
task
;
}
private
void
closeSilently
(
Socket
socket
)
{
/**
* Close a socket, ignoring errors
*
* @param socket the socket
*/
void
closeSilently
(
Socket
socket
)
{
try
{
socket
.
close
();
}
catch
(
Exception
e
)
{
...
...
@@ -163,7 +168,12 @@ public class TestNetUtils extends TestBase {
}
}
private
void
closeSilently
(
ServerSocket
socket
)
{
/**
* Close a server socket, ignoring errors
*
* @param socket the server socket
*/
void
closeSilently
(
ServerSocket
socket
)
{
try
{
socket
.
close
();
}
catch
(
Exception
e
)
{
...
...
h2/src/test/org/h2/test/unit/TestSecurity.java
浏览文件 @
30dbb194
...
...
@@ -36,7 +36,7 @@ public class TestSecurity extends TestBase {
testSHA
();
testAES
();
testBlockCiphers
();
testRemoveAnonFromLegacyAlgos
();
testRemoveAnonFromLegacyAlgo
rithm
s
();
//testResetLegacyAlgos();
}
...
...
@@ -254,7 +254,7 @@ public class TestSecurity extends TestBase {
return
len
*
r
<
len
*
120
;
}
private
void
testRemoveAnonFromLegacyAlgos
()
{
private
void
testRemoveAnonFromLegacyAlgo
rithm
s
()
{
String
legacyAlgos
=
"K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT"
+
", DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, DH_RSA_EXPORT, RSA_EXPORT"
+
", DH_anon, ECDH_anon, RC4_128, RC4_40, DES_CBC, DES40_CBC"
;
...
...
@@ -282,13 +282,13 @@ public class TestSecurity extends TestBase {
*/
@SuppressWarnings
(
"unused"
)
private
void
testResetLegacyAlgos
()
{
String
legacyAlgorithmsBefore
=
CipherFactory
.
getLegacyAlgoritmsSilently
();
String
legacyAlgorithmsBefore
=
CipherFactory
.
getLegacyAlgorit
h
msSilently
();
assertEquals
(
"Failed assumption: jdk.tls.legacyAlgorithms"
+
" has been modified from its initial setting"
,
CipherFactory
.
DEFAULT_LEGACY_ALGORITHMS
,
legacyAlgorithmsBefore
);
CipherFactory
.
removeAnonFromLegacyAlgorithms
();
CipherFactory
.
resetDefaultLegacyAlgorithms
();
String
legacyAlgorithmsAfter
=
CipherFactory
.
getLegacyAlgoritmsSilently
();
String
legacyAlgorithmsAfter
=
CipherFactory
.
getLegacyAlgorit
h
msSilently
();
assertEquals
(
CipherFactory
.
DEFAULT_LEGACY_ALGORITHMS
,
legacyAlgorithmsAfter
);
}
...
...
h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java
浏览文件 @
30dbb194
...
...
@@ -39,7 +39,7 @@ public class TestTimeStampWithTimeZone extends TestBase {
stat
.
execute
(
"insert into test(t1) values('1970-01-01 12:00:00.00+00:15')"
);
ResultSet
rs
=
stat
.
executeQuery
(
"select t1 from test"
);
rs
.
next
();
assertTrue
(
new
TimestampWithTimeZone
(
36000000
,
00
,
(
short
)
15
).
equals
(
rs
.
getTimestamp
(
1
)));
assertTrue
(
new
TimestampWithTimeZone
(
36000000
,
00
,
(
short
)
15
).
equals
(
rs
.
getTimestamp
(
1
)));
conn
.
close
();
}
...
...
h2/src/test/org/h2/test/unit/TestValueMemory.java
浏览文件 @
30dbb194
...
...
@@ -167,7 +167,7 @@ public class TestValueMemory extends TestBase implements DataHandler {
case
Value
.
TIMESTAMP_UTC
:
return
ValueTimestampUtc
.
fromMillis
(
random
.
nextLong
());
case
Value
.
TIMESTAMP_TZ
:
return
ValueTimestampTimeZone
.
fromMillis
(
random
.
nextLong
(),
(
short
)
0
);
return
ValueTimestampTimeZone
.
fromMillis
(
random
.
nextLong
(),
(
short
)
0
);
case
Value
.
BYTES
:
return
ValueBytes
.
get
(
randomBytes
(
random
.
nextInt
(
1000
)));
case
Value
.
STRING
:
...
...
h2/src/tools/oracle/toplink/essentials/platform/database/H2Platform.java.txt
浏览文件 @
30dbb194
...
...
@@ -6,7 +6,7 @@
*
* You can obtain a copy of the license at
* glassfish/bootstrap/legal/CDDLv1.0.txt or
* https://glassfish.dev.java.net/public/CDDLv1.0.html.
* https://glassfish.dev.java.net/public/CDDLv1.0.html
.
* See the License for the specific language governing
* permissions and limitations under the License.
*
...
...
h2/src/tools/org/h2/build/Build.java
浏览文件 @
30dbb194
...
...
@@ -238,7 +238,8 @@ public class Build extends BuildBase {
if
(!
clientOnly
)
{
files
=
files
(
"src/test"
);
files
.
addAll
(
files
(
"src/tools"
));
files
=
files
.
exclude
(
"src/test/org/h2/test/TestAllJunit.java"
);
//we don't use Junit for this test framework
//we don't use Junit for this test framework
files
=
files
.
exclude
(
"src/test/org/h2/test/TestAllJunit.java"
);
args
=
args
(
"-Xlint:unchecked"
,
"-Xlint:deprecation"
,
"-d"
,
"temp"
,
"-sourcepath"
,
"src/test"
+
File
.
pathSeparator
+
"src/tools"
,
"-classpath"
,
classpath
);
...
...
h2/src/tools/org/h2/build/code/CheckJavadoc.java
浏览文件 @
30dbb194
...
...
@@ -99,8 +99,9 @@ public class CheckJavadoc {
}
if
(
inComment
)
{
if
(
rawLine
.
length
()
>
MAX_COMMENT_LINE_SIZE
&&
!
line
.
trim
().
startsWith
(
"* http://"
))
{
System
.
out
.
println
(
"Long line : "
+
file
.
getAbsolutePath
()
&&
!
line
.
trim
().
startsWith
(
"* http://"
)
&&
!
line
.
trim
().
startsWith
(
"* https://"
))
{
System
.
out
.
println
(
"Long line: "
+
file
.
getAbsolutePath
()
+
" ("
+
file
.
getName
()
+
":"
+
lineNumber
+
")"
);
errorCount
++;
}
...
...
@@ -108,12 +109,14 @@ public class CheckJavadoc {
inComment
=
false
;
}
}
if
(!
inComment
&&
line
.
startsWith
(
"//"
)
&&
rawLine
.
length
()
>
MAX_COMMENT_LINE_SIZE
&&
!
line
.
trim
().
startsWith
(
"// http://"
))
{
if
(!
inComment
&&
line
.
startsWith
(
"//"
))
{
if
(
rawLine
.
length
()
>
MAX_COMMENT_LINE_SIZE
&&
!
line
.
trim
().
startsWith
(
"// http://"
)
&&
!
line
.
trim
().
startsWith
(
"// https://"
))
{
System
.
out
.
println
(
"Long line: "
+
file
.
getAbsolutePath
()
+
" ("
+
file
.
getName
()
+
":"
+
lineNumber
+
")"
);
errorCount
++;
}
}
else
if
(!
inComment
&&
rawLine
.
length
()
>
MAX_SOURCE_LINE_SIZE
)
{
System
.
out
.
println
(
"Long line: "
+
file
.
getAbsolutePath
()
+
" ("
+
file
.
getName
()
+
":"
+
lineNumber
+
")"
);
...
...
h2/src/tools/org/h2/build/doc/SpellChecker.java
浏览文件 @
30dbb194
...
...
@@ -11,6 +11,8 @@ import java.util.Arrays;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.StringTokenizer
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
org.h2.build.BuildBase
;
import
org.h2.util.StringUtils
;
...
...
@@ -72,6 +74,11 @@ public class SpellChecker {
private
void
run
(
String
dictionaryFileName
,
String
dir
)
throws
IOException
{
process
(
new
File
(
dictionaryFileName
));
process
(
new
File
(
dir
));
HashSet
<
String
>
unused
=
new
HashSet
<
String
>();
unused
.
addAll
(
dictionary
);
unused
.
removeAll
(
used
);
// System.out.println("UNUSED WORDS");
// System.out.println(unused);
if
(
printDictionary
)
{
System
.
out
.
println
(
"USED WORDS"
);
String
[]
list
=
new
String
[
used
.
size
()];
...
...
@@ -190,19 +197,20 @@ public class SpellChecker {
}
private
String
removeLinks
(
String
fileName
,
String
text
)
{
Pattern
linkPattern
=
Pattern
.
compile
(
"http[s]?://"
);
StringBuilder
buff
=
new
StringBuilder
(
text
.
length
());
int
pos
=
0
,
last
=
0
;
if
(
fileName
.
endsWith
(
".properties"
))
{
text
=
StringUtils
.
replaceAll
(
text
,
"\\:"
,
":"
);
}
while
(
true
)
{
pos
=
text
.
indexOf
(
"http://"
,
pos
);
if
(
pos
<
0
)
{
Matcher
m
=
linkPattern
.
matcher
(
text
.
substring
(
pos
)
);
if
(
!
m
.
find
()
)
{
break
;
}
int
start
=
pos
;
int
start
=
m
.
start
()
+
pos
;
pos
=
m
.
end
()
+
pos
;
buff
.
append
(
text
.
substring
(
last
,
start
));
pos
+=
"http://"
.
length
();
while
(
true
)
{
char
c
=
text
.
charAt
(
pos
);
if
(!
Character
.
isJavaIdentifierPart
(
c
)
&&
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
30dbb194
This source diff could not be displayed because it is too large. You can
view the blob
instead.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论