Commit d20c6e4f authored by Liang Ding's avatar Liang Ding

测试用例 work

parent e7da5f08
......@@ -49,7 +49,6 @@ import org.b3log.solo.repository.TagArticleRepository;
import org.b3log.solo.repository.TagRepository;
import org.b3log.solo.repository.UserRepository;
import org.b3log.solo.util.Comments;
import org.b3log.solo.util.Tags;
import org.b3log.solo.util.TimeZones;
import org.json.JSONArray;
import org.json.JSONException;
......@@ -142,11 +141,6 @@ public final class ArticleMgmtService {
@Inject
private LangPropsService langPropsService;
/**
* Tag utilities.
*/
private static Tags tagUtils = Tags.getInstance();
/**
* Statistic management service.
*/
......@@ -1354,4 +1348,13 @@ public final class ArticleMgmtService {
public void setCommentRepository(final CommentRepository commentRepository) {
this.commentRepository = commentRepository;
}
/**
* Sets the language service with the specified language service.
*
* @param langPropsService the specified language service
*/
public void setLangPropsService(final LangPropsService langPropsService) {
this.langPropsService = langPropsService;
}
}
......@@ -798,4 +798,13 @@ public final class CommentMgmtService {
public void setCommentRepository(final CommentRepository commentRepository) {
this.commentRepository = commentRepository;
}
/**
* Sets the language service with the specified language service.
*
* @param langPropsService the specified language service
*/
public void setLangPropsService(final LangPropsService langPropsService) {
this.langPropsService = langPropsService;
}
}
......@@ -674,4 +674,13 @@ public final class InitService {
public void setCommentRepository(final CommentRepository commentRepository) {
this.commentRepository = commentRepository;
}
/**
* Sets the language service with the specified language service.
*
* @param langPropsService the specified language service
*/
public void setLangPropsService(final LangPropsService langPropsService) {
this.langPropsService = langPropsService;
}
}
......@@ -462,4 +462,13 @@ public final class PageMgmtService {
public void setCommentRepository(final CommentRepository commentRepository) {
this.commentRepository = commentRepository;
}
/**
* Sets the language service with the specified language service.
*
* @param langPropsService the specified language service
*/
public void setLangPropsService(final LangPropsService langPropsService) {
this.langPropsService = langPropsService;
}
}
......@@ -259,4 +259,13 @@ public final class PluginMgmtService {
public void setPluginRepository(final PluginRepository pluginRepository) {
this.pluginRepository = pluginRepository;
}
/**
* Sets the language service with the specified language service.
*
* @param langPropsService the specified language service
*/
public void setLangPropsService(final LangPropsService langPropsService) {
this.langPropsService = langPropsService;
}
}
......@@ -325,5 +325,13 @@ public final class PreferenceMgmtService {
public void setPreferenceRepository(final PreferenceRepository preferenceRepository) {
this.preferenceRepository = preferenceRepository;
}
/**
* Sets the language service with the specified language service.
*
* @param langPropsService the specified language service
*/
public void setLangPropsService(final LangPropsService langPropsService) {
this.langPropsService = langPropsService;
}
}
......@@ -504,4 +504,13 @@ public final class StatisticMgmtService {
public void setStatisticRepository(final StatisticRepository statisticRepository) {
this.statisticRepository = statisticRepository;
}
/**
* Sets the language service with the specified language service.
*
* @param langPropsService the specified language service
*/
public void setLangPropsService(final LangPropsService langPropsService) {
this.langPropsService = langPropsService;
}
}
......@@ -353,4 +353,13 @@ public final class UserMgmtService {
public void setUserRepository(final UserRepository userRepository) {
this.userRepository = userRepository;
}
/**
* Sets the language service with the specified language service.
*
* @param langPropsService the specified language service
*/
public void setLangPropsService(final LangPropsService langPropsService) {
this.langPropsService = langPropsService;
}
}
......@@ -19,6 +19,7 @@ import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestC
import com.google.appengine.tools.development.testing.LocalServiceTestHelper;
import java.util.Locale;
import org.b3log.latke.Latkes;
import org.b3log.latke.service.LangPropsService;
import org.b3log.solo.repository.ArchiveDateArticleRepository;
import org.b3log.solo.repository.ArchiveDateRepository;
import org.b3log.solo.repository.ArticleRepository;
......@@ -130,6 +131,16 @@ public abstract class AbstractTestCase {
*/
private OptionRepository optionRepository;
/**
* Language service.
*/
private LangPropsService langPropsService;
/**
* Plugin management service.
*/
private PluginMgmtService pluginMgmtService;
/**
* Initialization service.
*/
......@@ -250,7 +261,7 @@ public abstract class AbstractTestCase {
Latkes.initRuntimeEnv();
Latkes.setLocale(Locale.SIMPLIFIED_CHINESE);
// Repositories
userRepository = new UserRepositoryImpl();
linkRepository = new LinkRepositoryImpl();
......@@ -269,6 +280,12 @@ public abstract class AbstractTestCase {
optionRepository = new OptionRepositoryImpl();
// Services
langPropsService = new LangPropsService();
pluginMgmtService = new PluginMgmtService();
pluginMgmtService.setPluginRepository(pluginRepository);
pluginMgmtService.setLangPropsService(langPropsService);
preferenceQueryService = new PreferenceQueryService();
preferenceQueryService.setPreferenceRepository(preferenceRepository);
......@@ -282,9 +299,11 @@ public abstract class AbstractTestCase {
initService.setTagArticleRepository(tagArticleRepository);
initService.setTagRepository(tagRepository);
initService.setCommentRepository(commentRepository);
initService.setLangPropsService(langPropsService);
userMgmtService = new UserMgmtService();
userMgmtService.setUserRepository(userRepository);
userMgmtService.setLangPropsService(langPropsService);
userQueryService = new UserQueryService();
userQueryService.setUserMgmtService(userMgmtService);
......@@ -296,6 +315,7 @@ public abstract class AbstractTestCase {
statisticMgmtService = new StatisticMgmtService();
statisticMgmtService.setStatisticRepository(statisticRepository);
statisticMgmtService.setLangPropsService(langPropsService);
statisticQueryService = new StatisticQueryService();
statisticQueryService.setStatisticRepository(statisticRepository);
......@@ -331,6 +351,7 @@ public abstract class AbstractTestCase {
articleMgmtService.setTagRepository(tagRepository);
articleMgmtService.setTagMgmtService(tagMgmtService);
articleMgmtService.setCommentRepository(commentRepository);
articleMgmtService.setLangPropsService(langPropsService);
pageMgmtService = new PageMgmtService();
pageMgmtService.setPermalinkQueryService(permalinkQueryService);
......@@ -339,6 +360,7 @@ public abstract class AbstractTestCase {
pageMgmtService.setStatisticQueryService(statisticQueryService);
pageMgmtService.setStatisticMgmtService(statisticMgmtService);
pageMgmtService.setCommentRepository(commentRepository);
pageMgmtService.setLangPropsService(langPropsService);
pageQueryService = new PageQueryService();
pageQueryService.setPageRepository(pageRepository);
......@@ -351,6 +373,7 @@ public abstract class AbstractTestCase {
preferenceMgmtService = new PreferenceMgmtService();
preferenceMgmtService.setPreferenceRepository(preferenceRepository);
preferenceMgmtService.setLangPropsService(langPropsService);
commentQueryService = new CommentQueryService();
commentQueryService.setArticleRepository(articleRepository);
......@@ -364,6 +387,7 @@ public abstract class AbstractTestCase {
commentMgmtService.setPreferenceQueryService(preferenceQueryService);
commentMgmtService.setStatisticMgmtService(statisticMgmtService);
commentMgmtService.setCommentRepository(commentRepository);
commentMgmtService.setLangPropsService(langPropsService);
archiveDateQueryService = new ArchiveDateQueryService();
archiveDateQueryService.setArchiveDateRepository(archiveDateRepository);
......
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