Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2869f880
提交
2869f880
authored
4月 02, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
The API of the tools changed a bit.
上级
4a6e0d2d
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
19 行增加
和
11 行删除
+19
-11
Console.java
h2/src/main/org/h2/tools/Console.java
+13
-3
TestTools.java
h2/src/test/org/h2/test/unit/TestTools.java
+6
-8
没有找到文件。
h2/src/main/org/h2/tools/Console.java
浏览文件 @
2869f880
...
@@ -137,13 +137,17 @@ ShutdownHandler {
...
@@ -137,13 +137,17 @@ ShutdownHandler {
tcpStart
=
true
;
tcpStart
=
true
;
pgStart
=
true
;
pgStart
=
true
;
}
}
SQLException
startException
=
null
;
boolean
webRunning
=
false
;
if
(
webStart
)
{
if
(
webStart
)
{
try
{
try
{
web
=
Server
.
createWebServer
(
args
);
web
=
Server
.
createWebServer
(
args
);
web
.
setShutdownHandler
(
this
);
web
.
setShutdownHandler
(
this
);
web
.
start
();
web
.
start
();
webRunning
=
true
;
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
printProblem
(
e
,
web
);
printProblem
(
e
,
web
);
startException
=
e
;
}
}
}
}
if
(
tcpStart
)
{
if
(
tcpStart
)
{
...
@@ -152,6 +156,9 @@ ShutdownHandler {
...
@@ -152,6 +156,9 @@ ShutdownHandler {
tcp
.
start
();
tcp
.
start
();
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
printProblem
(
e
,
tcp
);
printProblem
(
e
,
tcp
);
if
(
startException
==
null
)
{
startException
=
e
;
}
}
}
}
}
if
(
pgStart
)
{
if
(
pgStart
)
{
...
@@ -160,10 +167,13 @@ ShutdownHandler {
...
@@ -160,10 +167,13 @@ ShutdownHandler {
pg
.
start
();
pg
.
start
();
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
printProblem
(
e
,
pg
);
printProblem
(
e
,
pg
);
if
(
startException
==
null
)
{
startException
=
e
;
}
}
}
}
}
//## AWT begin ##
//## AWT begin ##
if
(
toolStart
&&
!
GraphicsEnvironment
.
isHeadless
())
{
if
(
toolStart
&&
webRunning
&&
!
GraphicsEnvironment
.
isHeadless
())
{
if
(
isWindows
)
{
if
(
isWindows
)
{
font
=
new
Font
(
"Dialog"
,
Font
.
PLAIN
,
11
);
font
=
new
Font
(
"Dialog"
,
Font
.
PLAIN
,
11
);
}
else
{
}
else
{
...
@@ -187,8 +197,8 @@ ShutdownHandler {
...
@@ -187,8 +197,8 @@ ShutdownHandler {
if
(
browserStart
)
{
if
(
browserStart
)
{
StartBrowser
.
openURL
(
web
.
getURL
());
StartBrowser
.
openURL
(
web
.
getURL
());
}
}
if
(
!
web
.
isRunning
(
true
)
)
{
if
(
startException
!=
null
)
{
throw
new
SQLException
(
"The web server is not running"
)
;
throw
startException
;
}
}
}
}
...
...
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
2869f880
...
@@ -93,18 +93,18 @@ public class TestTools extends TestBase {
...
@@ -93,18 +93,18 @@ public class TestTools extends TestBase {
String
result
;
String
result
;
Connection
conn
;
Connection
conn
;
result
=
runServer
(
new
String
[]{
"-?"
},
1
);
result
=
runServer
(
new
String
[]{
"-?"
},
0
);
assertTrue
(
result
.
indexOf
(
"Starts
H2 Servers
"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"Starts
the H2 Console
"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"Unknown option"
)
<
0
);
assertTrue
(
result
.
indexOf
(
"Unknown option"
)
<
0
);
result
=
runServer
(
new
String
[]{
"-xy"
},
1
);
result
=
runServer
(
new
String
[]{
"-xy"
},
1
);
assertTrue
(
result
.
indexOf
(
"Starts
H2 Servers
"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"Starts
the H2 Console
"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"Unsupported option"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"Unsupported option"
)
>=
0
);
result
=
runServer
(
new
String
[]{
"-tcp"
,
"-tcpPort"
,
"9001"
,
"-tcpPassword"
,
"abc"
},
0
);
result
=
runServer
(
new
String
[]{
"-tcp"
,
"-tcpPort"
,
"9001"
,
"-tcpPassword"
,
"abc"
},
0
);
assertTrue
(
result
.
indexOf
(
"tcp://"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"tcp://"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
":9001"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
":9001"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"only local"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"only local"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"Starts
H2 Servers
"
)
<
0
);
assertTrue
(
result
.
indexOf
(
"Starts
the H2 Console
"
)
<
0
);
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://localhost:9001/mem:"
,
"sa"
,
"sa"
);
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://localhost:9001/mem:"
,
"sa"
,
"sa"
);
conn
.
close
();
conn
.
close
();
result
=
runServer
(
new
String
[]{
"-tcpShutdown"
,
"tcp://localhost:9001"
,
"-tcpPassword"
,
"abc"
,
"-tcpShutdownForce"
},
0
);
result
=
runServer
(
new
String
[]{
"-tcpShutdown"
,
"tcp://localhost:9001"
,
"-tcpPassword"
,
"abc"
,
"-tcpShutdownForce"
},
0
);
...
@@ -114,7 +114,7 @@ public class TestTools extends TestBase {
...
@@ -114,7 +114,7 @@ public class TestTools extends TestBase {
assertTrue
(
result
.
indexOf
(
"ssl://"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"ssl://"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
":9001"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
":9001"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"others can"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"others can"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"Starts
H2 Servers
"
)
<
0
);
assertTrue
(
result
.
indexOf
(
"Starts
the H2 Console
"
)
<
0
);
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:ssl://localhost:9001/mem:"
,
"sa"
,
"sa"
);
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:ssl://localhost:9001/mem:"
,
"sa"
,
"sa"
);
conn
.
close
();
conn
.
close
();
...
@@ -130,7 +130,6 @@ public class TestTools extends TestBase {
...
@@ -130,7 +130,6 @@ public class TestTools extends TestBase {
result
=
runServer
(
new
String
[]{
result
=
runServer
(
new
String
[]{
"-web"
,
"-webPort"
,
"9002"
,
"-webAllowOthers"
,
"-webSSL"
,
"-web"
,
"-webPort"
,
"9002"
,
"-webAllowOthers"
,
"-webSSL"
,
"-pg"
,
"-pgAllowOthers"
,
"-pgPort"
,
"9003"
,
"-pg"
,
"-pgAllowOthers"
,
"-pgPort"
,
"9003"
,
"-ftp"
,
"-ftpPort"
,
"9004"
,
"-ftpDir"
,
"."
,
"-ftpRead"
,
"guest"
,
"-ftpWrite"
,
"sa"
,
"-ftpWritePassword"
,
"sa"
,
"-ftpTask"
,
"-tcp"
,
"-tcpAllowOthers"
,
"-tcpPort"
,
"9006"
,
"-tcpPassword"
,
"abc"
},
0
);
"-tcp"
,
"-tcpAllowOthers"
,
"-tcpPort"
,
"9006"
,
"-tcpPassword"
,
"abc"
},
0
);
Server
stop
=
server
;
Server
stop
=
server
;
assertTrue
(
result
.
indexOf
(
"https://"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"https://"
)
>=
0
);
...
@@ -139,8 +138,6 @@ public class TestTools extends TestBase {
...
@@ -139,8 +138,6 @@ public class TestTools extends TestBase {
assertTrue
(
result
.
indexOf
(
":9003"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
":9003"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"others can"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"others can"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"only local"
)
<
0
);
assertTrue
(
result
.
indexOf
(
"only local"
)
<
0
);
assertTrue
(
result
.
indexOf
(
"ftp://"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
":9004"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"tcp://"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"tcp://"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
":9006"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
":9006"
)
>=
0
);
...
@@ -168,6 +165,7 @@ public class TestTools extends TestBase {
...
@@ -168,6 +165,7 @@ public class TestTools extends TestBase {
server
.
run
(
args
);
server
.
run
(
args
);
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
result
=
1
;
result
=
1
;
e
.
printStackTrace
(
ps
);
}
}
assertEquals
(
exitCode
,
result
);
assertEquals
(
exitCode
,
result
);
ps
.
flush
();
ps
.
flush
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论