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
45a95850
Commit
45a95850
authored
Jul 16, 2017
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✅
#12319 清理缓存
parent
a1327710
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
src/test/java/org/b3log/solo/AbstractTestCase.java
src/test/java/org/b3log/solo/AbstractTestCase.java
+15
-3
src/test/java/org/b3log/solo/service/OptionMgmtServiceTestCase.java
...ava/org/b3log/solo/service/OptionMgmtServiceTestCase.java
+7
-5
No files found.
src/test/java/org/b3log/solo/AbstractTestCase.java
View file @
45a95850
...
...
@@ -16,6 +16,7 @@
package
org
.
b3log
.
solo
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.cache.CacheFactory
;
import
org.b3log.latke.ioc.LatkeBeanManager
;
import
org.b3log.latke.ioc.Lifecycle
;
import
org.b3log.latke.ioc.config.Discoverer
;
...
...
@@ -35,7 +36,7 @@ import java.util.Locale;
* Abstract test case.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.
2.0.9, Apr 12
, 2017
* @version 2.
3.0.9, Jul 16
, 2017
* @see #beforeClass()
*/
public
abstract
class
AbstractTestCase
{
...
...
@@ -47,12 +48,10 @@ public abstract class AbstractTestCase {
/**
* Before class.
* <p>
* <ol>
* <li>Initializes Latke runtime</li>
* <li>Instantiates repositories</li>
* </ol>
* </p>
*
* @throws Exception exception
*/
...
...
@@ -72,6 +71,19 @@ public abstract class AbstractTestCase {
JdbcRepositories
.
initAllTables
();
}
/**
* After class.
* <ul>
* <li>Clears all caches</li>
* </ul>
*
* @throws Exception
*/
@BeforeClass
public
void
afterClass
()
throws
Exception
{
CacheFactory
.
clearAll
();
}
/**
* Gets category-tag repository.
*
...
...
src/test/java/org/b3log/solo/service/OptionMgmtServiceTestCase.java
View file @
45a95850
...
...
@@ -49,6 +49,9 @@ public class OptionMgmtServiceTestCase extends AbstractTestCase {
final
String
id
=
optionMgmtService
.
addOrUpdateOption
(
option
);
System
.
out
.
println
(
id
);
Assert
.
assertNotNull
(
id
);
final
JSONObject
opt
=
getOptionQueryService
().
getOptionById
(
Option
.
ID_C_BROADCAST_CHANCE_EXPIRATION_TIME
);
Assert
.
assertEquals
(
opt
.
getInt
(
Option
.
OPTION_VALUE
),
0L
);
}
/**
...
...
@@ -78,7 +81,6 @@ public class OptionMgmtServiceTestCase extends AbstractTestCase {
final
JSONObject
opt
=
getOptionQueryService
().
getOptionById
(
Option
.
ID_C_BROADCAST_CHANCE_EXPIRATION_TIME
);
Assert
.
assertEquals
(
opt
.
getInt
(
Option
.
OPTION_VALUE
),
1L
);
}
/**
...
...
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