Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
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
apollo
Commits
202363b5
Commit
202363b5
authored
Feb 07, 2017
by
张乐
Committed by
GitHub
Feb 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #535 from nobodyiam/fix-ut
enlarge sleep interval for ut
parents
3e4ce84c
1b3006be
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/controller/NotificationControllerV2Test.java
...onfigservice/controller/NotificationControllerV2Test.java
+1
-1
apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/service/AppNamespaceServiceWithCacheTest.java
...nfigservice/service/AppNamespaceServiceWithCacheTest.java
+5
-3
apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/service/ReleaseMessageServiceWithCacheTest.java
...igservice/service/ReleaseMessageServiceWithCacheTest.java
+1
-1
No files found.
apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/controller/NotificationControllerV2Test.java
View file @
202363b5
...
@@ -330,7 +330,7 @@ public class NotificationControllerV2Test {
...
@@ -330,7 +330,7 @@ public class NotificationControllerV2Test {
assertTrue
(!
anotherDeferredResult
.
hasResult
());
assertTrue
(!
anotherDeferredResult
.
hasResult
());
TimeUnit
.
MILLISECONDS
.
sleep
(
someBatchInterval
*
5
);
TimeUnit
.
MILLISECONDS
.
sleep
(
someBatchInterval
*
10
);
assertTrue
(
anotherDeferredResult
.
hasResult
());
assertTrue
(
anotherDeferredResult
.
hasResult
());
}
}
...
...
apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/service/AppNamespaceServiceWithCacheTest.java
View file @
202363b5
...
@@ -74,6 +74,8 @@ public class AppNamespaceServiceWithCacheTest {
...
@@ -74,6 +74,8 @@ public class AppNamespaceServiceWithCacheTest {
String
anotherPrivateNamespace
=
"anotherPrivateNamespace"
;
String
anotherPrivateNamespace
=
"anotherPrivateNamespace"
;
long
anotherPrivateNamespaceId
=
3
;
long
anotherPrivateNamespaceId
=
3
;
int
sleepInterval
=
scanInterval
*
10
;
AppNamespace
somePrivateAppNamespace
=
assembleAppNamespace
(
somePrivateNamespaceId
,
AppNamespace
somePrivateAppNamespace
=
assembleAppNamespace
(
somePrivateNamespaceId
,
someAppId
,
somePrivateNamespace
,
false
);
someAppId
,
somePrivateNamespace
,
false
);
AppNamespace
somePublicAppNamespace
=
assembleAppNamespace
(
somePublicNamespaceId
,
AppNamespace
somePublicAppNamespace
=
assembleAppNamespace
(
somePublicNamespaceId
,
...
@@ -116,7 +118,7 @@ public class AppNamespaceServiceWithCacheTest {
...
@@ -116,7 +118,7 @@ public class AppNamespaceServiceWithCacheTest {
somePublicNamespaceId
))).
thenReturn
(
Lists
.
newArrayList
(
somePrivateAppNamespace
,
somePublicNamespaceId
))).
thenReturn
(
Lists
.
newArrayList
(
somePrivateAppNamespace
,
somePublicAppNamespace
));
somePublicAppNamespace
));
scanIntervalTimeUnit
.
sleep
(
s
canInterval
*
3
);
scanIntervalTimeUnit
.
sleep
(
s
leepInterval
);
check
(
Lists
.
newArrayList
(
somePrivateAppNamespace
),
appNamespaceServiceWithCache
check
(
Lists
.
newArrayList
(
somePrivateAppNamespace
),
appNamespaceServiceWithCache
.
findByAppIdAndNamespaces
(
someAppId
,
someAppIdNamespaces
));
.
findByAppIdAndNamespaces
(
someAppId
,
someAppIdNamespaces
));
...
@@ -131,7 +133,7 @@ public class AppNamespaceServiceWithCacheTest {
...
@@ -131,7 +133,7 @@ public class AppNamespaceServiceWithCacheTest {
anotherPublicAppNamespace
));
anotherPublicAppNamespace
));
when
(
appNamespaceRepository
.
findAll
(
appNamespaceIds
)).
thenReturn
(
allAppNamespaces
);
when
(
appNamespaceRepository
.
findAll
(
appNamespaceIds
)).
thenReturn
(
allAppNamespaces
);
scanIntervalTimeUnit
.
sleep
(
s
canInterval
*
3
);
scanIntervalTimeUnit
.
sleep
(
s
leepInterval
);
check
(
Lists
.
newArrayList
(
somePrivateAppNamespace
,
yetAnotherPrivateAppNamespace
,
check
(
Lists
.
newArrayList
(
somePrivateAppNamespace
,
yetAnotherPrivateAppNamespace
,
anotherPublicAppNamespace
),
appNamespaceServiceWithCache
.
findByAppIdAndNamespaces
anotherPublicAppNamespace
),
appNamespaceServiceWithCache
.
findByAppIdAndNamespaces
...
@@ -169,7 +171,7 @@ public class AppNamespaceServiceWithCacheTest {
...
@@ -169,7 +171,7 @@ public class AppNamespaceServiceWithCacheTest {
when
(
appNamespaceRepository
.
findAll
(
appNamespaceIds
)).
thenReturn
(
Lists
.
newArrayList
when
(
appNamespaceRepository
.
findAll
(
appNamespaceIds
)).
thenReturn
(
Lists
.
newArrayList
(
somePrivateAppNamespaceNew
,
yetAnotherPrivateAppNamespaceNew
,
somePublicAppNamespaceNew
));
(
somePrivateAppNamespaceNew
,
yetAnotherPrivateAppNamespaceNew
,
somePublicAppNamespaceNew
));
scanIntervalTimeUnit
.
sleep
(
s
canInterval
*
3
);
scanIntervalTimeUnit
.
sleep
(
s
leepInterval
);
check
(
Collections
.
emptyList
(),
appNamespaceServiceWithCache
check
(
Collections
.
emptyList
(),
appNamespaceServiceWithCache
.
findByAppIdAndNamespaces
(
someAppId
,
someAppIdNamespaces
));
.
findByAppIdAndNamespaces
(
someAppId
,
someAppIdNamespaces
));
...
...
apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/service/ReleaseMessageServiceWithCacheTest.java
View file @
202363b5
...
@@ -177,7 +177,7 @@ public class ReleaseMessageServiceWithCacheTest {
...
@@ -177,7 +177,7 @@ public class ReleaseMessageServiceWithCacheTest {
when
(
releaseMessageRepository
.
findFirst500ByIdGreaterThanOrderByIdAsc
(
someMessageId
)).
thenReturn
(
Lists
when
(
releaseMessageRepository
.
findFirst500ByIdGreaterThanOrderByIdAsc
(
someMessageId
)).
thenReturn
(
Lists
.
newArrayList
(
newMessage
));
.
newArrayList
(
newMessage
));
scanIntervalTimeUnit
.
sleep
(
scanInterval
*
3
);
scanIntervalTimeUnit
.
sleep
(
scanInterval
*
10
);
ReleaseMessage
newLatestReleaseMsg
=
ReleaseMessage
newLatestReleaseMsg
=
releaseMessageServiceWithCache
releaseMessageServiceWithCache
...
...
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