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

🎨 #12932 调整测试用用例

parent bc6d769f
...@@ -40,7 +40,6 @@ import org.json.JSONArray; ...@@ -40,7 +40,6 @@ import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
......
...@@ -45,7 +45,6 @@ import org.testng.annotations.BeforeMethod; ...@@ -45,7 +45,6 @@ import org.testng.annotations.BeforeMethod;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.sql.Connection; import java.sql.Connection;
import java.util.Collection; import java.util.Collection;
import java.util.Locale;
/** /**
* Abstract test case. * Abstract test case.
...@@ -73,7 +72,6 @@ public abstract class AbstractTestCase { ...@@ -73,7 +72,6 @@ public abstract class AbstractTestCase {
@BeforeClass @BeforeClass
public void beforeClass() throws Exception { public void beforeClass() throws Exception {
Latkes.init(); Latkes.init();
Latkes.setLocale(Locale.SIMPLIFIED_CHINESE);
final Collection<Class<?>> classes = Discoverer.discover("org.b3log.solo"); final Collection<Class<?>> classes = Discoverer.discover("org.b3log.solo");
BeanManager.start(classes); BeanManager.start(classes);
...@@ -115,10 +113,8 @@ public abstract class AbstractTestCase { ...@@ -115,10 +113,8 @@ public abstract class AbstractTestCase {
/** /**
* Init solo in test. * Init solo in test.
*
* @throws Exception exception
*/ */
public void init() throws Exception { public void init() {
final InitService initService = getInitService(); final InitService initService = getInitService();
final JSONObject requestJSONObject = new JSONObject(); final JSONObject requestJSONObject = new JSONObject();
requestJSONObject.put(User.USER_NAME, "Solo"); 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"); * This program is free software: you can redistribute it and/or modify
* you may not use this file except in compliance with the License. * it under the terms of the GNU Affero General Public License as published by
* You may obtain a copy of the License at * 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 * You should have received a copy of the GNU Affero General Public License
* distributed under the License is distributed on an "AS IS" BASIS, * along with this program. If not, see <https://www.gnu.org/licenses/>.
* 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.
*/ */
package org.b3log.solo; 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"); * This program is free software: you can redistribute it and/or modify
* you may not use this file except in compliance with the License. * it under the terms of the GNU Affero General Public License as published by
* You may obtain a copy of the License at * 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 * You should have received a copy of the GNU Affero General Public License
* distributed under the License is distributed on an "AS IS" BASIS, * along with this program. If not, see <https://www.gnu.org/licenses/>.
* 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.
*/ */
package org.b3log.solo; package org.b3log.solo;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse; import io.netty.handler.codec.http.HttpResponse;
import org.b3log.latke.http.Response; import org.b3log.latke.http.Response;
......
...@@ -42,11 +42,9 @@ public class ArticleProcessorTestCase extends AbstractTestCase { ...@@ -42,11 +42,9 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class BlogProcessorTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class BlogProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -40,11 +40,9 @@ public class CategoryProcessorTestCase extends AbstractTestCase { ...@@ -40,11 +40,9 @@ public class CategoryProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -46,11 +46,9 @@ public class CommentProcessorTestCase extends AbstractTestCase { ...@@ -46,11 +46,9 @@ public class CommentProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class ErrorProcessorTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class ErrorProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,17 +36,14 @@ public class FeedProcessorTestCase extends AbstractTestCase { ...@@ -36,17 +36,14 @@ public class FeedProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
/** /**
* blogArticlesAtom. * blogArticlesAtom.
*
*/ */
@Test(dependsOnMethods = "init") @Test(dependsOnMethods = "init")
public void blogArticlesAtom() { public void blogArticlesAtom() {
......
...@@ -54,11 +54,9 @@ public class IndexProcessorTestCase extends AbstractTestCase { ...@@ -54,11 +54,9 @@ public class IndexProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test(dependsOnMethods = "showStart") @Test(dependsOnMethods = "showStart")
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class SearchProcessorTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class SearchProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class SitemapProcessorTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class SitemapProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -38,11 +38,9 @@ public class TagProcessorTestCase extends AbstractTestCase { ...@@ -38,11 +38,9 @@ public class TagProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -38,11 +38,9 @@ public class UserTemplateProcessorTestCase extends AbstractTestCase { ...@@ -38,11 +38,9 @@ public class UserTemplateProcessorTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,21 +36,17 @@ public class AdminConsoleTestCase extends AbstractTestCase { ...@@ -36,21 +36,17 @@ public class AdminConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
/** /**
* showAdminIndex. * showAdminIndex.
*
* @throws Exception exception
*/ */
@Test(dependsOnMethods = "init") @Test(dependsOnMethods = "init")
public void showAdminIndex() throws Exception { public void showAdminIndex() {
final MockRequest request = mockRequest(); final MockRequest request = mockRequest();
request.setRequestURI("/admin-index.do"); request.setRequestURI("/admin-index.do");
mockAdminLogin(request); mockAdminLogin(request);
......
...@@ -40,11 +40,9 @@ public class ArticleConsoleTestCase extends AbstractTestCase { ...@@ -40,11 +40,9 @@ public class ArticleConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -40,11 +40,9 @@ public class CategoryConsoleTestCase extends AbstractTestCase { ...@@ -40,11 +40,9 @@ public class CategoryConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -40,11 +40,9 @@ public class CommentConsoleTestCase extends AbstractTestCase { ...@@ -40,11 +40,9 @@ public class CommentConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -41,11 +41,9 @@ public class LinkConsoleTestCase extends AbstractTestCase { ...@@ -41,11 +41,9 @@ public class LinkConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class OtherConsoleTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class OtherConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -41,11 +41,9 @@ public class PageConsoleTestCase extends AbstractTestCase { ...@@ -41,11 +41,9 @@ public class PageConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class PluginConsoleTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class PluginConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -38,11 +38,9 @@ public class PreferenceConsoleTestCase extends AbstractTestCase { ...@@ -38,11 +38,9 @@ public class PreferenceConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class RepairConsoleTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class RepairConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class TagConsoleTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class TagConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -39,11 +39,9 @@ public class UserConsoleTestCase extends AbstractTestCase { ...@@ -39,11 +39,9 @@ public class UserConsoleTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -38,11 +38,9 @@ public class ArchiveDateQueryServiceTestCase extends AbstractTestCase { ...@@ -38,11 +38,9 @@ public class ArchiveDateQueryServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -40,11 +40,9 @@ public class ArticleMgmtServiceTestCase extends AbstractTestCase { ...@@ -40,11 +40,9 @@ public class ArticleMgmtServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -38,11 +38,9 @@ public class ArticleQueryServiceTestCase extends AbstractTestCase { ...@@ -38,11 +38,9 @@ public class ArticleQueryServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -35,11 +35,9 @@ public class CategoryMgmtServiceTestCase extends AbstractTestCase { ...@@ -35,11 +35,9 @@ public class CategoryMgmtServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class CategoryQueryServiceTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class CategoryQueryServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -40,11 +40,9 @@ public class CommentMgmtServiceTestCase extends AbstractTestCase { ...@@ -40,11 +40,9 @@ public class CommentMgmtServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -43,11 +43,9 @@ public class CommentQueryServiceTestCase extends AbstractTestCase { ...@@ -43,11 +43,9 @@ public class CommentQueryServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -34,11 +34,9 @@ public class LinkMgmtServiceTestCase extends AbstractTestCase { ...@@ -34,11 +34,9 @@ public class LinkMgmtServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -35,11 +35,9 @@ public class LinkQueryServiceTestCase extends AbstractTestCase { ...@@ -35,11 +35,9 @@ public class LinkQueryServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -35,11 +35,9 @@ public class OptionQueryServiceTestCase extends AbstractTestCase { ...@@ -35,11 +35,9 @@ public class OptionQueryServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -35,11 +35,9 @@ public class PageMgmtServiceTestCase extends AbstractTestCase { ...@@ -35,11 +35,9 @@ public class PageMgmtServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class PageQueryServiceTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class PageQueryServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -34,11 +34,9 @@ public class PreferenceMgmtServiceTestCase extends AbstractTestCase { ...@@ -34,11 +34,9 @@ public class PreferenceMgmtServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -31,11 +31,9 @@ public class TagMgmtServiceTestCase extends AbstractTestCase { ...@@ -31,11 +31,9 @@ public class TagMgmtServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -36,11 +36,9 @@ public class TagQueryServiceTestCase extends AbstractTestCase { ...@@ -36,11 +36,9 @@ public class TagQueryServiceTestCase extends AbstractTestCase {
/** /**
* Init. * Init.
*
* @throws Exception exception
*/ */
@Test @Test
public void init() throws Exception { public void init() {
super.init(); super.init();
} }
......
...@@ -22,8 +22,6 @@ import org.testng.Assert; ...@@ -22,8 +22,6 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import java.util.Locale;
/** /**
* {@link org.b3log.solo.util.Markdowns} test case. * {@link org.b3log.solo.util.Markdowns} test case.
* *
...@@ -36,7 +34,6 @@ public final class MarkdownsTestCase { ...@@ -36,7 +34,6 @@ public final class MarkdownsTestCase {
@BeforeClass @BeforeClass
public void beforeClass() { public void beforeClass() {
Latkes.init(); 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