Commit 33600fb2 authored by Liang Ding's avatar Liang Ding

🎨 默认博客标题调整

parent ad1c23c4
...@@ -27,7 +27,7 @@ import org.json.JSONObject; ...@@ -27,7 +27,7 @@ import org.json.JSONObject;
* This class defines option model relevant keys. * This class defines option model relevant keys.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.0.5, Jan 31, 2018 * @version 1.3.0.6, May 29, 2018
* @since 0.6.0 * @since 0.6.0
*/ */
public final class Option { public final class Option {
...@@ -372,15 +372,10 @@ public final class Option { ...@@ -372,15 +372,10 @@ public final class Option {
*/ */
public static final int DEFAULT_MOST_COMMENT_ARTICLE_DISPLAY_COUNT = 5; public static final int DEFAULT_MOST_COMMENT_ARTICLE_DISPLAY_COUNT = 5;
/**
* Default blog title.
*/
public static final String DEFAULT_BLOG_TITLE = "Solo 示例";
/** /**
* Default blog subtitle. * Default blog subtitle.
*/ */
public static final String DEFAULT_BLOG_SUBTITLE = "Java 开源博客"; public static final String DEFAULT_BLOG_SUBTITLE = "记录精彩的程序人生";
/** /**
* Default skin directory name. * Default skin directory name.
...@@ -412,12 +407,12 @@ public final class Option { ...@@ -412,12 +407,12 @@ public final class Option {
/** /**
* Default meta keywords.. * Default meta keywords..
*/ */
public static final String DEFAULT_META_KEYWORDS = "Solo,Java 博客,开源"; public static final String DEFAULT_META_KEYWORDS = "Solo,Java,博客,开源";
/** /**
* Default meta description.. * Default meta description..
*/ */
public static final String DEFAULT_META_DESCRIPTION = "An open source blog with Java. Java 开源博客"; public static final String DEFAULT_META_DESCRIPTION = "A beautiful, simple, stable, fast Java blogging system. 一款漂亮、简约、稳定、极速的 Java 博客系统。";
/** /**
* Default HTML head to append. * Default HTML head to append.
......
...@@ -60,7 +60,7 @@ import java.util.Set; ...@@ -60,7 +60,7 @@ import java.util.Set;
* Solo initialization service. * Solo initialization service.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.5.2.18, Mar 11, 2018 * @version 1.5.2.19, May 29, 2018
* @since 0.4.0 * @since 0.4.0
*/ */
@Service @Service
...@@ -680,7 +680,7 @@ public class InitService { ...@@ -680,7 +680,7 @@ public class InitService {
final JSONObject blogTitleOpt = new JSONObject(); final JSONObject blogTitleOpt = new JSONObject();
blogTitleOpt.put(Keys.OBJECT_ID, Option.ID_C_BLOG_TITLE); blogTitleOpt.put(Keys.OBJECT_ID, Option.ID_C_BLOG_TITLE);
blogTitleOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE); blogTitleOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE);
blogTitleOpt.put(Option.OPTION_VALUE, DefaultPreference.DEFAULT_BLOG_TITLE); blogTitleOpt.put(Option.OPTION_VALUE, requestJSONObject.optString(User.USER_NAME) + " 的个人博客");
optionRepository.add(blogTitleOpt); optionRepository.add(blogTitleOpt);
final JSONObject blogSubtitleOpt = new JSONObject(); final JSONObject blogSubtitleOpt = new JSONObject();
......
...@@ -47,7 +47,7 @@ import static org.mockito.Mockito.when; ...@@ -47,7 +47,7 @@ import static org.mockito.Mockito.when;
* {@link ArticleProcessor} test case. * {@link ArticleProcessor} test case.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.1.1, Jan 31, 2018 * @version 1.0.1.2, May 29, 2018
* @since 1.7.0 * @since 1.7.0
*/ */
@Test(suiteName = "processor") @Test(suiteName = "processor")
...@@ -314,7 +314,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase { ...@@ -314,7 +314,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
dispatcherServlet.service(request, response); dispatcherServlet.service(request, response);
final String content = stringWriter.toString(); final String content = stringWriter.toString();
Assert.assertTrue(StringUtils.contains(content, "Solo 示例</title>")); Assert.assertTrue(StringUtils.contains(content, "Admin 的个人博客</title>"));
} }
/** /**
......
...@@ -17,11 +17,6 @@ ...@@ -17,11 +17,6 @@
*/ */
package org.b3log.solo.processor; package org.b3log.solo.processor;
import java.io.PrintWriter;
import java.io.StringWriter;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.b3log.latke.Keys; import org.b3log.latke.Keys;
import org.b3log.latke.model.User; import org.b3log.latke.model.User;
...@@ -30,15 +25,23 @@ import org.b3log.solo.model.Option; ...@@ -30,15 +25,23 @@ import org.b3log.solo.model.Option;
import org.b3log.solo.service.InitService; import org.b3log.solo.service.InitService;
import org.b3log.solo.service.UserQueryService; import org.b3log.solo.service.UserQueryService;
import org.json.JSONObject; import org.json.JSONObject;
import static org.mockito.Mockito.*;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.io.StringWriter;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
/** /**
* {@link ErrorProcessor} test case. * {@link ErrorProcessor} test case.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.1.0, Feb 18, 2017 * @version 1.0.1.1, May 29, 2018
* @since 1.7.0 * @since 1.7.0
*/ */
@Test(suiteName = "processor") @Test(suiteName = "processor")
...@@ -90,6 +93,6 @@ public class ErrorProcessorTestCase extends AbstractTestCase { ...@@ -90,6 +93,6 @@ public class ErrorProcessorTestCase extends AbstractTestCase {
dispatcherServlet.service(request, response); dispatcherServlet.service(request, response);
final String content = stringWriter.toString(); final String content = stringWriter.toString();
Assert.assertTrue(StringUtils.contains(content, "<title>Solo 示例 - 403 Forbidden!</title>")); Assert.assertTrue(StringUtils.contains(content, "<title>Admin 的个人博客 - 403 Forbidden!</title>"));
} }
} }
...@@ -17,11 +17,6 @@ ...@@ -17,11 +17,6 @@
*/ */
package org.b3log.solo.processor; package org.b3log.solo.processor;
import java.io.PrintWriter;
import java.io.StringWriter;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.b3log.latke.Keys; import org.b3log.latke.Keys;
import org.b3log.latke.model.User; import org.b3log.latke.model.User;
...@@ -30,15 +25,23 @@ import org.b3log.solo.model.Option; ...@@ -30,15 +25,23 @@ import org.b3log.solo.model.Option;
import org.b3log.solo.service.InitService; import org.b3log.solo.service.InitService;
import org.b3log.solo.service.UserQueryService; import org.b3log.solo.service.UserQueryService;
import org.json.JSONObject; import org.json.JSONObject;
import static org.mockito.Mockito.*;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.io.StringWriter;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
/** /**
* {@link IndexProcessor} test case. * {@link IndexProcessor} test case.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.1.0, Feb 18, 2017 * @version 1.0.1.1, May 29, 2018
* @since 1.7.0 * @since 1.7.0
*/ */
@Test(suiteName = "processor") @Test(suiteName = "processor")
...@@ -90,7 +93,7 @@ public class IndexProcessorTestCase extends AbstractTestCase { ...@@ -90,7 +93,7 @@ public class IndexProcessorTestCase extends AbstractTestCase {
dispatcherServlet.service(request, response); dispatcherServlet.service(request, response);
final String content = stringWriter.toString(); final String content = stringWriter.toString();
Assert.assertTrue(StringUtils.contains(content, "<title>Solo 示例</title>")); Assert.assertTrue(StringUtils.contains(content, "<title>Admin 的个人博客</title>"));
} }
/** /**
...@@ -119,7 +122,7 @@ public class IndexProcessorTestCase extends AbstractTestCase { ...@@ -119,7 +122,7 @@ public class IndexProcessorTestCase extends AbstractTestCase {
dispatcherServlet.service(request, response); dispatcherServlet.service(request, response);
final String content = stringWriter.toString(); final String content = stringWriter.toString();
Assert.assertTrue(StringUtils.contains(content, "<title>Solo 示例</title>")); Assert.assertTrue(StringUtils.contains(content, "<title>Admin 的个人博客</title>"));
} }
/** /**
...@@ -148,6 +151,6 @@ public class IndexProcessorTestCase extends AbstractTestCase { ...@@ -148,6 +151,6 @@ public class IndexProcessorTestCase extends AbstractTestCase {
dispatcherServlet.service(request, response); dispatcherServlet.service(request, response);
final String content = stringWriter.toString(); final String content = stringWriter.toString();
Assert.assertTrue(StringUtils.contains(content, "<title>Solo 示例</title>")); Assert.assertTrue(StringUtils.contains(content, "<title>Admin 的个人博客</title>"));
} }
} }
...@@ -38,7 +38,7 @@ import org.testng.annotations.Test; ...@@ -38,7 +38,7 @@ import org.testng.annotations.Test;
* {@link TagProcessor} test case. * {@link TagProcessor} test case.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.1.0, Feb 18, 2017 * @version 1.0.1.1, May 29, 2018
* @since 1.7.0 * @since 1.7.0
*/ */
@Test(suiteName = "processor") @Test(suiteName = "processor")
...@@ -90,6 +90,6 @@ public class TagProcessorTestCase extends AbstractTestCase { ...@@ -90,6 +90,6 @@ public class TagProcessorTestCase extends AbstractTestCase {
dispatcherServlet.service(request, response); dispatcherServlet.service(request, response);
final String content = stringWriter.toString(); final String content = stringWriter.toString();
Assert.assertTrue(StringUtils.contains(content, "<title>Solo - Solo 示例</title>")); Assert.assertTrue(StringUtils.contains(content, "<title>Solo - Admin 的个人博客</title>"));
} }
} }
...@@ -28,7 +28,7 @@ import org.testng.annotations.Test; ...@@ -28,7 +28,7 @@ import org.testng.annotations.Test;
* {@link PreferenceMgmtService} test case. * {@link PreferenceMgmtService} test case.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.3, Nov 23, 2015 * @version 1.0.0.4, May 29, 2018
*/ */
@Test(suiteName = "service") @Test(suiteName = "service")
public class PreferenceMgmtServiceTestCase extends AbstractTestCase { public class PreferenceMgmtServiceTestCase extends AbstractTestCase {
...@@ -64,8 +64,7 @@ public class PreferenceMgmtServiceTestCase extends AbstractTestCase { ...@@ -64,8 +64,7 @@ public class PreferenceMgmtServiceTestCase extends AbstractTestCase {
final PreferenceQueryService preferenceQueryService = getPreferenceQueryService(); final PreferenceQueryService preferenceQueryService = getPreferenceQueryService();
JSONObject preference = preferenceQueryService.getPreference(); JSONObject preference = preferenceQueryService.getPreference();
Assert.assertEquals(preference.getString(Option.ID_C_BLOG_TITLE), Assert.assertEquals(preference.getString(Option.ID_C_BLOG_TITLE), "Admin 的个人博客");
Option.DefaultPreference.DEFAULT_BLOG_TITLE);
preference.put(Option.ID_C_BLOG_TITLE, "updated blog title"); preference.put(Option.ID_C_BLOG_TITLE, "updated blog title");
preferenceMgmtService.updatePreference(preference); preferenceMgmtService.updatePreference(preference);
......
...@@ -28,7 +28,7 @@ import org.testng.annotations.Test; ...@@ -28,7 +28,7 @@ import org.testng.annotations.Test;
* {@link PreferenceQueryService} test case. * {@link PreferenceQueryService} test case.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.3, Nov 23, 2015 * @version 1.0.0.4, May 29, 2018
*/ */
@Test(suiteName = "service") @Test(suiteName = "service")
public class PreferenceQueryServiceTestCase extends AbstractTestCase { public class PreferenceQueryServiceTestCase extends AbstractTestCase {
...@@ -63,7 +63,7 @@ public class PreferenceQueryServiceTestCase extends AbstractTestCase { ...@@ -63,7 +63,7 @@ public class PreferenceQueryServiceTestCase extends AbstractTestCase {
final PreferenceQueryService preferenceQueryService = getPreferenceQueryService(); final PreferenceQueryService preferenceQueryService = getPreferenceQueryService();
final JSONObject preference = preferenceQueryService.getPreference(); final JSONObject preference = preferenceQueryService.getPreference();
Assert.assertEquals(preference.getString(Option.ID_C_BLOG_TITLE), Option.DefaultPreference.DEFAULT_BLOG_TITLE); Assert.assertEquals(preference.getString(Option.ID_C_BLOG_TITLE), "Admin 的个人博客");
} }
/** /**
......
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