Commit 6997e041 authored by Liang Ding's avatar Liang Ding

🎨 #12932 调整测试用用例

parent bc6d769f
......@@ -40,7 +40,6 @@ import org.json.JSONArray;
import org.json.JSONObject;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
......
......@@ -45,7 +45,6 @@ import org.testng.annotations.BeforeMethod;
import java.lang.reflect.Method;
import java.sql.Connection;
import java.util.Collection;
import java.util.Locale;
/**
* Abstract test case.
......@@ -73,7 +72,6 @@ public abstract class AbstractTestCase {
@BeforeClass
public void beforeClass() throws Exception {
Latkes.init();
Latkes.setLocale(Locale.SIMPLIFIED_CHINESE);
final Collection<Class<?>> classes = Discoverer.discover("org.b3log.solo");
BeanManager.start(classes);
......@@ -115,10 +113,8 @@ public abstract class AbstractTestCase {
/**
* Init solo in test.
*
* @throws Exception exception
*/
public void init() throws Exception {
public void init() {
final InitService initService = getInitService();
final JSONObject requestJSONObject = new JSONObject();
requestJSONObject.put(User.USER_NAME, "Solo");
......
/*
* Copyright (c) 2009-present, b3log.org
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* http://www.apache.org/licenses/LICENSE-2.0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.b3log.solo;
......
/*
* Copyright (c) 2009-present, b3log.org
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* http://www.apache.org/licenses/LICENSE-2.0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.b3log.solo;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse;
import org.b3log.latke.http.Response;
......
......@@ -42,11 +42,9 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class BlogProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -40,11 +40,9 @@ public class CategoryProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -46,11 +46,9 @@ public class CommentProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class ErrorProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,17 +36,14 @@ public class FeedProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
/**
* blogArticlesAtom.
*
*/
@Test(dependsOnMethods = "init")
public void blogArticlesAtom() {
......
......@@ -54,11 +54,9 @@ public class IndexProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test(dependsOnMethods = "showStart")
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class SearchProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class SitemapProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -38,11 +38,9 @@ public class TagProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -38,11 +38,9 @@ public class UserTemplateProcessorTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,21 +36,17 @@ public class AdminConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
/**
* showAdminIndex.
*
* @throws Exception exception
*/
@Test(dependsOnMethods = "init")
public void showAdminIndex() throws Exception {
public void showAdminIndex() {
final MockRequest request = mockRequest();
request.setRequestURI("/admin-index.do");
mockAdminLogin(request);
......
......@@ -40,11 +40,9 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -40,11 +40,9 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -40,11 +40,9 @@ public class CommentConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -41,11 +41,9 @@ public class LinkConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class OtherConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -41,11 +41,9 @@ public class PageConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class PluginConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -38,11 +38,9 @@ public class PreferenceConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class RepairConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class TagConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -39,11 +39,9 @@ public class UserConsoleTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -38,11 +38,9 @@ public class ArchiveDateQueryServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -40,11 +40,9 @@ public class ArticleMgmtServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -38,11 +38,9 @@ public class ArticleQueryServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -35,11 +35,9 @@ public class CategoryMgmtServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class CategoryQueryServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -40,11 +40,9 @@ public class CommentMgmtServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -43,11 +43,9 @@ public class CommentQueryServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -34,11 +34,9 @@ public class LinkMgmtServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -35,11 +35,9 @@ public class LinkQueryServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -35,11 +35,9 @@ public class OptionQueryServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -35,11 +35,9 @@ public class PageMgmtServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class PageQueryServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -34,11 +34,9 @@ public class PreferenceMgmtServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -31,11 +31,9 @@ public class TagMgmtServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -36,11 +36,9 @@ public class TagQueryServiceTestCase extends AbstractTestCase {
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
public void init() {
super.init();
}
......
......@@ -22,8 +22,6 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.Locale;
/**
* {@link org.b3log.solo.util.Markdowns} test case.
*
......@@ -36,7 +34,6 @@ public final class MarkdownsTestCase {
@BeforeClass
public void beforeClass() {
Latkes.init();
Latkes.setLocale(Locale.SIMPLIFIED_CHINESE);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment