Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
3aaedd1d
Unverified
Commit
3aaedd1d
authored
Nov 11, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
⬆
升级框架
parent
16714569
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
86 additions
and
98 deletions
+86
-98
pom.xml
pom.xml
+1
-1
src/main/java/org/b3log/solo/processor/console/AdminConsole.java
...n/java/org/b3log/solo/processor/console/AdminConsole.java
+3
-3
src/test/java/org/b3log/solo/processor/ArticleProcessorTestCase.java
...va/org/b3log/solo/processor/ArticleProcessorTestCase.java
+10
-10
src/test/java/org/b3log/solo/processor/BlogProcessorTestCase.java
.../java/org/b3log/solo/processor/BlogProcessorTestCase.java
+2
-2
src/test/java/org/b3log/solo/processor/CategoryProcessorTestCase.java
...a/org/b3log/solo/processor/CategoryProcessorTestCase.java
+1
-1
src/test/java/org/b3log/solo/processor/CommentProcessorTestCase.java
...va/org/b3log/solo/processor/CommentProcessorTestCase.java
+1
-1
src/test/java/org/b3log/solo/processor/ErrorProcessorTestCase.java
...java/org/b3log/solo/processor/ErrorProcessorTestCase.java
+1
-1
src/test/java/org/b3log/solo/processor/FeedProcessorTestCase.java
.../java/org/b3log/solo/processor/FeedProcessorTestCase.java
+2
-2
src/test/java/org/b3log/solo/processor/IndexProcessorTestCase.java
...java/org/b3log/solo/processor/IndexProcessorTestCase.java
+3
-3
src/test/java/org/b3log/solo/processor/SearchProcessorTestCase.java
...ava/org/b3log/solo/processor/SearchProcessorTestCase.java
+2
-2
src/test/java/org/b3log/solo/processor/SitemapProcessorTestCase.java
...va/org/b3log/solo/processor/SitemapProcessorTestCase.java
+1
-1
src/test/java/org/b3log/solo/processor/TagProcessorTestCase.java
...t/java/org/b3log/solo/processor/TagProcessorTestCase.java
+1
-1
src/test/java/org/b3log/solo/processor/UserTemplateProcessorTestCase.java
...g/b3log/solo/processor/UserTemplateProcessorTestCase.java
+1
-1
src/test/java/org/b3log/solo/processor/console/AdminConsoleTestCase.java
...rg/b3log/solo/processor/console/AdminConsoleTestCase.java
+11
-21
src/test/java/org/b3log/solo/processor/console/ArticleConsoleTestCase.java
.../b3log/solo/processor/console/ArticleConsoleTestCase.java
+10
-10
src/test/java/org/b3log/solo/processor/console/CategoryConsoleTestCase.java
...b3log/solo/processor/console/CategoryConsoleTestCase.java
+6
-6
src/test/java/org/b3log/solo/processor/console/CommentConsoleTestCase.java
.../b3log/solo/processor/console/CommentConsoleTestCase.java
+3
-3
src/test/java/org/b3log/solo/processor/console/LinkConsoleTestCase.java
...org/b3log/solo/processor/console/LinkConsoleTestCase.java
+6
-6
src/test/java/org/b3log/solo/processor/console/OtherConsoleTestCase.java
...rg/b3log/solo/processor/console/OtherConsoleTestCase.java
+1
-1
src/test/java/org/b3log/solo/processor/console/PageConsoleTestCase.java
...org/b3log/solo/processor/console/PageConsoleTestCase.java
+6
-6
src/test/java/org/b3log/solo/processor/console/PluginConsoleTestCase.java
...g/b3log/solo/processor/console/PluginConsoleTestCase.java
+1
-1
src/test/java/org/b3log/solo/processor/console/PreferenceConsoleTestCase.java
...log/solo/processor/console/PreferenceConsoleTestCase.java
+3
-3
src/test/java/org/b3log/solo/processor/console/RepairConsoleTestCase.java
...g/b3log/solo/processor/console/RepairConsoleTestCase.java
+1
-1
src/test/java/org/b3log/solo/processor/console/TagConsoleTestCase.java
.../org/b3log/solo/processor/console/TagConsoleTestCase.java
+4
-6
src/test/java/org/b3log/solo/processor/console/UserConsoleTestCase.java
...org/b3log/solo/processor/console/UserConsoleTestCase.java
+5
-5
No files found.
pom.xml
View file @
3aaedd1d
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
</scm>
</scm>
<properties>
<properties>
<org.b3log.latke.version>
3.0.1
2
</org.b3log.latke.version>
<org.b3log.latke.version>
3.0.1
3
</org.b3log.latke.version>
<slf4j.version>
1.7.28
</slf4j.version>
<slf4j.version>
1.7.28
</slf4j.version>
<jsoup.version>
1.12.1
</jsoup.version>
<jsoup.version>
1.12.1
</jsoup.version>
...
...
src/main/java/org/b3log/solo/processor/console/AdminConsole.java
View file @
3aaedd1d
...
@@ -325,7 +325,7 @@ public class AdminConsole {
...
@@ -325,7 +325,7 @@ public class AdminConsole {
response
.
setContentType
(
"application/zip"
);
response
.
setContentType
(
"application/zip"
);
final
String
fileName
=
"solo-sql-"
+
date
+
".zip"
;
final
String
fileName
=
"solo-sql-"
+
date
+
".zip"
;
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename=\""
+
fileName
+
"\""
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename=\""
+
fileName
+
"\""
);
response
.
send
Content
(
zipData
);
response
.
send
Bytes
(
zipData
);
// 导出 SQL 包后清理临时文件 https://github.com/b3log/solo/issues/12770
// 导出 SQL 包后清理临时文件 https://github.com/b3log/solo/issues/12770
localFile
.
delete
();
localFile
.
delete
();
...
@@ -376,7 +376,7 @@ public class AdminConsole {
...
@@ -376,7 +376,7 @@ public class AdminConsole {
response
.
setContentType
(
"application/zip"
);
response
.
setContentType
(
"application/zip"
);
final
String
fileName
=
"solo-json-"
+
date
+
".zip"
;
final
String
fileName
=
"solo-json-"
+
date
+
".zip"
;
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename=\""
+
fileName
+
"\""
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename=\""
+
fileName
+
"\""
);
response
.
send
Content
(
zipData
);
response
.
send
Bytes
(
zipData
);
}
}
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Export failed"
,
e
);
LOGGER
.
log
(
Level
.
ERROR
,
"Export failed"
,
e
);
...
@@ -443,7 +443,7 @@ public class AdminConsole {
...
@@ -443,7 +443,7 @@ public class AdminConsole {
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename=\""
+
fileName
+
"\""
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename=\""
+
fileName
+
"\""
);
}
}
response
.
send
Content
(
zipData
);
response
.
send
Bytes
(
zipData
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Export failed"
,
e
);
LOGGER
.
log
(
Level
.
ERROR
,
"Export failed"
,
e
);
context
.
renderJSON
().
renderMsg
(
"Export failed, please check log"
);
context
.
renderJSON
().
renderMsg
(
"Export failed, please check log"
);
...
...
src/test/java/org/b3log/solo/processor/ArticleProcessorTestCase.java
View file @
3aaedd1d
...
@@ -59,7 +59,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
...
@@ -59,7 +59,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"sc\":true"
));
}
}
...
@@ -79,7 +79,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
...
@@ -79,7 +79,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"Solo 博客系统已经初始化完毕"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"Solo 博客系统已经初始化完毕"
));
}
}
...
@@ -94,7 +94,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
...
@@ -94,7 +94,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"sc\":true"
));
}
}
...
@@ -114,7 +114,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
...
@@ -114,7 +114,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"sc\":true"
));
}
}
...
@@ -129,7 +129,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
...
@@ -129,7 +129,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"randomArticles"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"randomArticles"
));
}
}
...
@@ -148,7 +148,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
...
@@ -148,7 +148,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"relevantArticles\""
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"relevantArticles\""
));
}
}
...
@@ -163,7 +163,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
...
@@ -163,7 +163,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"{\"sc\":true"
));
}
}
...
@@ -179,7 +179,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
...
@@ -179,7 +179,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"Solo 的个人博客</title>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"Solo 的个人博客</title>"
));
}
}
...
@@ -199,7 +199,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
...
@@ -199,7 +199,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"Solo 的个人博客</title>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"Solo 的个人博客</title>"
));
}
}
...
@@ -220,7 +220,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
...
@@ -220,7 +220,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>访问密码 - Solo 的个人博客</title>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>访问密码 - Solo 的个人博客</title>"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/BlogProcessorTestCase.java
View file @
3aaedd1d
...
@@ -52,7 +52,7 @@ public class BlogProcessorTestCase extends AbstractTestCase {
...
@@ -52,7 +52,7 @@ public class BlogProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"{\"staticServePath\":\"http://localhost:8080\""
));
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"{\"staticServePath\":\"http://localhost:8080\""
));
}
}
...
@@ -67,7 +67,7 @@ public class BlogProcessorTestCase extends AbstractTestCase {
...
@@ -67,7 +67,7 @@ public class BlogProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"{\"data\":"
));
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"{\"data\":"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/CategoryProcessorTestCase.java
View file @
3aaedd1d
...
@@ -73,7 +73,7 @@ public class CategoryProcessorTestCase extends AbstractTestCase {
...
@@ -73,7 +73,7 @@ public class CategoryProcessorTestCase extends AbstractTestCase {
response
=
mockResponse
();
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>分类1 - Solo 的个人博客</title>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>分类1 - Solo 的个人博客</title>"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/CommentProcessorTestCase.java
View file @
3aaedd1d
...
@@ -77,7 +77,7 @@ public class CommentProcessorTestCase extends AbstractTestCase {
...
@@ -77,7 +77,7 @@ public class CommentProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
}
}
...
...
src/test/java/org/b3log/solo/processor/ErrorProcessorTestCase.java
View file @
3aaedd1d
...
@@ -52,7 +52,7 @@ public class ErrorProcessorTestCase extends AbstractTestCase {
...
@@ -52,7 +52,7 @@ public class ErrorProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>403 Forbidden! - Solo 的个人博客</title>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>403 Forbidden! - Solo 的个人博客</title>"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/FeedProcessorTestCase.java
View file @
3aaedd1d
...
@@ -52,7 +52,7 @@ public class FeedProcessorTestCase extends AbstractTestCase {
...
@@ -52,7 +52,7 @@ public class FeedProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
}
}
...
@@ -66,7 +66,7 @@ public class FeedProcessorTestCase extends AbstractTestCase {
...
@@ -66,7 +66,7 @@ public class FeedProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
}
}
}
}
src/test/java/org/b3log/solo/processor/IndexProcessorTestCase.java
View file @
3aaedd1d
...
@@ -48,7 +48,7 @@ public class IndexProcessorTestCase extends AbstractTestCase {
...
@@ -48,7 +48,7 @@ public class IndexProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>欢迎使用! - Solo</title>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>欢迎使用! - Solo</title>"
));
}
}
...
@@ -70,7 +70,7 @@ public class IndexProcessorTestCase extends AbstractTestCase {
...
@@ -70,7 +70,7 @@ public class IndexProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>Solo 的个人博客</title>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>Solo 的个人博客</title>"
));
}
}
...
@@ -84,7 +84,7 @@ public class IndexProcessorTestCase extends AbstractTestCase {
...
@@ -84,7 +84,7 @@ public class IndexProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>Kill IE! - Solo 的个人博客</title>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>Kill IE! - Solo 的个人博客</title>"
));
}
}
...
...
src/test/java/org/b3log/solo/processor/SearchProcessorTestCase.java
View file @
3aaedd1d
...
@@ -52,7 +52,7 @@ public class SearchProcessorTestCase extends AbstractTestCase {
...
@@ -52,7 +52,7 @@ public class SearchProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
));
}
}
...
@@ -68,7 +68,7 @@ public class SearchProcessorTestCase extends AbstractTestCase {
...
@@ -68,7 +68,7 @@ public class SearchProcessorTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"Solo 的个人博客搜索"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"Solo 的个人博客搜索"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/SitemapProcessorTestCase.java
View file @
3aaedd1d
...
@@ -52,7 +52,7 @@ public class SitemapProcessorTestCase extends AbstractTestCase {
...
@@ -52,7 +52,7 @@ public class SitemapProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
}
}
}
}
src/test/java/org/b3log/solo/processor/TagProcessorTestCase.java
View file @
3aaedd1d
...
@@ -55,7 +55,7 @@ public class TagProcessorTestCase extends AbstractTestCase {
...
@@ -55,7 +55,7 @@ public class TagProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>Solo 标签 - Solo 的个人博客</title>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>Solo 标签 - Solo 的个人博客</title>"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/UserTemplateProcessorTestCase.java
View file @
3aaedd1d
...
@@ -55,7 +55,7 @@ public class UserTemplateProcessorTestCase extends AbstractTestCase {
...
@@ -55,7 +55,7 @@ public class UserTemplateProcessorTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>友情链接 - Solo 的个人博客</title>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<title>友情链接 - Solo 的个人博客</title>"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/AdminConsoleTestCase.java
View file @
3aaedd1d
...
@@ -54,17 +54,15 @@ public class AdminConsoleTestCase extends AbstractTestCase {
...
@@ -54,17 +54,15 @@ public class AdminConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"后台管理 - Solo 的个人博客"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"后台管理 - Solo 的个人博客"
));
}
}
/**
/**
* showAdminFunctions.
* showAdminFunctions.
*
* @throws Exception exception
*/
*/
@Test
(
dependsOnMethods
=
"init"
)
@Test
(
dependsOnMethods
=
"init"
)
public
void
showAdminFunctions
()
throws
Exception
{
public
void
showAdminFunctions
()
{
final
MockRequest
request
=
mockRequest
();
final
MockRequest
request
=
mockRequest
();
request
.
setRequestURI
(
"/admin-article.do"
);
request
.
setRequestURI
(
"/admin-article.do"
);
mockAdminLogin
(
request
);
mockAdminLogin
(
request
);
...
@@ -72,17 +70,15 @@ public class AdminConsoleTestCase extends AbstractTestCase {
...
@@ -72,17 +70,15 @@ public class AdminConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<div class=\"form\">"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<div class=\"form\">"
));
}
}
/**
/**
* showAdminPreferenceFunction.
* showAdminPreferenceFunction.
*
* @throws Exception exception
*/
*/
@Test
(
dependsOnMethods
=
"init"
)
@Test
(
dependsOnMethods
=
"init"
)
public
void
showAdminPreferenceFunction
()
throws
Exception
{
public
void
showAdminPreferenceFunction
()
{
final
MockRequest
request
=
mockRequest
();
final
MockRequest
request
=
mockRequest
();
request
.
setRequestURI
(
"/admin-preference.do"
);
request
.
setRequestURI
(
"/admin-preference.do"
);
mockAdminLogin
(
request
);
mockAdminLogin
(
request
);
...
@@ -90,17 +86,15 @@ public class AdminConsoleTestCase extends AbstractTestCase {
...
@@ -90,17 +86,15 @@ public class AdminConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"信息配置"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"信息配置"
));
}
}
/**
/**
* exportSQL.
* exportSQL.
*
* @throws Exception exception
*/
*/
@Test
(
dependsOnMethods
=
"init"
)
@Test
(
dependsOnMethods
=
"init"
)
public
void
exportSQL
()
throws
Exception
{
public
void
exportSQL
()
{
final
MockRequest
request
=
mockRequest
();
final
MockRequest
request
=
mockRequest
();
request
.
setRequestURI
(
"/console/export/sql"
);
request
.
setRequestURI
(
"/console/export/sql"
);
mockAdminLogin
(
request
);
mockAdminLogin
(
request
);
...
@@ -108,17 +102,15 @@ public class AdminConsoleTestCase extends AbstractTestCase {
...
@@ -108,17 +102,15 @@ public class AdminConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
long
outputBytes
=
response
.
get
Content
().
length
;
final
long
outputBytes
=
response
.
get
Bytes
().
length
;
Assert
.
assertTrue
(
0
<
outputBytes
);
Assert
.
assertTrue
(
0
<
outputBytes
);
}
}
/**
/**
* exportJSON.
* exportJSON.
*
* @throws Exception exception
*/
*/
@Test
(
dependsOnMethods
=
"init"
)
@Test
(
dependsOnMethods
=
"init"
)
public
void
exportJSON
()
throws
Exception
{
public
void
exportJSON
()
{
final
MockRequest
request
=
mockRequest
();
final
MockRequest
request
=
mockRequest
();
request
.
setRequestURI
(
"/console/export/json"
);
request
.
setRequestURI
(
"/console/export/json"
);
mockAdminLogin
(
request
);
mockAdminLogin
(
request
);
...
@@ -126,17 +118,15 @@ public class AdminConsoleTestCase extends AbstractTestCase {
...
@@ -126,17 +118,15 @@ public class AdminConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
long
outputBytes
=
response
.
get
Content
().
length
;
final
long
outputBytes
=
response
.
get
Bytes
().
length
;
Assert
.
assertTrue
(
0
<
outputBytes
);
Assert
.
assertTrue
(
0
<
outputBytes
);
}
}
/**
/**
* exportHexo.
* exportHexo.
*
* @throws Exception exception
*/
*/
@Test
(
dependsOnMethods
=
"init"
)
@Test
(
dependsOnMethods
=
"init"
)
public
void
exportHexo
()
throws
Exception
{
public
void
exportHexo
()
{
final
MockRequest
request
=
mockRequest
();
final
MockRequest
request
=
mockRequest
();
request
.
setRequestURI
(
"/console/export/hexo"
);
request
.
setRequestURI
(
"/console/export/hexo"
);
mockAdminLogin
(
request
);
mockAdminLogin
(
request
);
...
@@ -144,7 +134,7 @@ public class AdminConsoleTestCase extends AbstractTestCase {
...
@@ -144,7 +134,7 @@ public class AdminConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
long
outputBytes
=
response
.
get
Content
().
length
;
final
long
outputBytes
=
response
.
get
Bytes
().
length
;
Assert
.
assertTrue
(
0
<
outputBytes
);
Assert
.
assertTrue
(
0
<
outputBytes
);
}
}
}
}
src/test/java/org/b3log/solo/processor/console/ArticleConsoleTestCase.java
View file @
3aaedd1d
...
@@ -60,7 +60,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
...
@@ -60,7 +60,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
}
}
...
@@ -83,7 +83,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
...
@@ -83,7 +83,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<p><strong>Solo<\\/strong><\\/p>"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"<p><strong>Solo<\\/strong><\\/p>"
));
}
}
...
@@ -104,7 +104,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
...
@@ -104,7 +104,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
}
}
...
@@ -122,7 +122,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
...
@@ -122,7 +122,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
}
}
...
@@ -144,7 +144,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
...
@@ -144,7 +144,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
}
}
...
@@ -166,7 +166,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
...
@@ -166,7 +166,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
}
}
...
@@ -188,7 +188,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
...
@@ -188,7 +188,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
}
}
...
@@ -210,7 +210,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
...
@@ -210,7 +210,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
}
}
...
@@ -235,7 +235,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
...
@@ -235,7 +235,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
}
}
...
@@ -262,7 +262,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
...
@@ -262,7 +262,7 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"\"sc\":true"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/CategoryConsoleTestCase.java
View file @
3aaedd1d
...
@@ -66,7 +66,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
...
@@ -66,7 +66,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -88,7 +88,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
...
@@ -88,7 +88,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -114,7 +114,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
...
@@ -114,7 +114,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
category
=
getCategoryQueryService
().
getByTitle
(
"分类1"
);
category
=
getCategoryQueryService
().
getByTitle
(
"分类1"
);
...
@@ -141,7 +141,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
...
@@ -141,7 +141,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -167,7 +167,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
...
@@ -167,7 +167,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -189,7 +189,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
...
@@ -189,7 +189,7 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/CommentConsoleTestCase.java
View file @
3aaedd1d
...
@@ -61,7 +61,7 @@ public class CommentConsoleTestCase extends AbstractTestCase {
...
@@ -61,7 +61,7 @@ public class CommentConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -84,7 +84,7 @@ public class CommentConsoleTestCase extends AbstractTestCase {
...
@@ -84,7 +84,7 @@ public class CommentConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -108,7 +108,7 @@ public class CommentConsoleTestCase extends AbstractTestCase {
...
@@ -108,7 +108,7 @@ public class CommentConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/LinkConsoleTestCase.java
View file @
3aaedd1d
...
@@ -71,7 +71,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
...
@@ -71,7 +71,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -103,7 +103,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
...
@@ -103,7 +103,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -130,7 +130,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
...
@@ -130,7 +130,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -152,7 +152,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
...
@@ -152,7 +152,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -171,7 +171,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
...
@@ -171,7 +171,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -194,7 +194,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
...
@@ -194,7 +194,7 @@ public class LinkConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/OtherConsoleTestCase.java
View file @
3aaedd1d
...
@@ -58,7 +58,7 @@ public class OtherConsoleTestCase extends AbstractTestCase {
...
@@ -58,7 +58,7 @@ public class OtherConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/PageConsoleTestCase.java
View file @
3aaedd1d
...
@@ -71,7 +71,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
...
@@ -71,7 +71,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -96,7 +96,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
...
@@ -96,7 +96,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -123,7 +123,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
...
@@ -123,7 +123,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -145,7 +145,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
...
@@ -145,7 +145,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -164,7 +164,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
...
@@ -164,7 +164,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -187,7 +187,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
...
@@ -187,7 +187,7 @@ public class PageConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/PluginConsoleTestCase.java
View file @
3aaedd1d
...
@@ -57,7 +57,7 @@ public class PluginConsoleTestCase extends AbstractTestCase {
...
@@ -57,7 +57,7 @@ public class PluginConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/PreferenceConsoleTestCase.java
View file @
3aaedd1d
...
@@ -57,7 +57,7 @@ public class PreferenceConsoleTestCase extends AbstractTestCase {
...
@@ -57,7 +57,7 @@ public class PreferenceConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -76,7 +76,7 @@ public class PreferenceConsoleTestCase extends AbstractTestCase {
...
@@ -76,7 +76,7 @@ public class PreferenceConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -99,7 +99,7 @@ public class PreferenceConsoleTestCase extends AbstractTestCase {
...
@@ -99,7 +99,7 @@ public class PreferenceConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/RepairConsoleTestCase.java
View file @
3aaedd1d
...
@@ -57,7 +57,7 @@ public class RepairConsoleTestCase extends AbstractTestCase {
...
@@ -57,7 +57,7 @@ public class RepairConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"Restore signs succeeded."
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"Restore signs succeeded."
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/TagConsoleTestCase.java
View file @
3aaedd1d
...
@@ -57,7 +57,7 @@ public class TagConsoleTestCase extends AbstractTestCase {
...
@@ -57,7 +57,7 @@ public class TagConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -76,17 +76,15 @@ public class TagConsoleTestCase extends AbstractTestCase {
...
@@ -76,17 +76,15 @@ public class TagConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
/**
/**
* removeUnusedTags.
* removeUnusedTags.
*
* @throws Exception exception
*/
*/
@Test
(
dependsOnMethods
=
"getUnusedTags"
)
@Test
(
dependsOnMethods
=
"getUnusedTags"
)
public
void
removeUnusedTags
()
throws
Exception
{
public
void
removeUnusedTags
()
{
final
MockRequest
request
=
mockRequest
();
final
MockRequest
request
=
mockRequest
();
request
.
setRequestURI
(
"/console/tag/unused"
);
request
.
setRequestURI
(
"/console/tag/unused"
);
request
.
setMethod
(
"DELETE"
);
request
.
setMethod
(
"DELETE"
);
...
@@ -96,7 +94,7 @@ public class TagConsoleTestCase extends AbstractTestCase {
...
@@ -96,7 +94,7 @@ public class TagConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
}
}
src/test/java/org/b3log/solo/processor/console/UserConsoleTestCase.java
View file @
3aaedd1d
...
@@ -64,7 +64,7 @@ public class UserConsoleTestCase extends AbstractTestCase {
...
@@ -64,7 +64,7 @@ public class UserConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -86,7 +86,7 @@ public class UserConsoleTestCase extends AbstractTestCase {
...
@@ -86,7 +86,7 @@ public class UserConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -105,7 +105,7 @@ public class UserConsoleTestCase extends AbstractTestCase {
...
@@ -105,7 +105,7 @@ public class UserConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -127,7 +127,7 @@ public class UserConsoleTestCase extends AbstractTestCase {
...
@@ -127,7 +127,7 @@ public class UserConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
...
@@ -150,7 +150,7 @@ public class UserConsoleTestCase extends AbstractTestCase {
...
@@ -150,7 +150,7 @@ public class UserConsoleTestCase extends AbstractTestCase {
final
MockResponse
response
=
mockResponse
();
final
MockResponse
response
=
mockResponse
();
mockDispatcher
(
request
,
response
);
mockDispatcher
(
request
,
response
);
final
String
content
=
response
.
get
ContentStr
();
final
String
content
=
response
.
get
String
();
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
Assert
.
assertTrue
(
StringUtils
.
contains
(
content
,
"sc\":true"
));
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment