Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wrr-cat
apollo
提交
32f5fc8b
apollo
项目概览
wrr-cat
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
32f5fc8b
编写于
6月 12, 2017
作者:
张
张乐
提交者:
GitHub
6月 12, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #638 from nobodyiam/misc-change-merge
misc changes
上级
58bd26e3
f30ab9c9
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
225 addition
and
22 deletion
+225
-22
apollo-adminservice/src/main/resources/logback.xml
apollo-adminservice/src/main/resources/logback.xml
+2
-0
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigLongPollService.java
...amework/apollo/internals/RemoteConfigLongPollService.java
+9
-0
apollo-client/src/main/java/com/ctrip/framework/apollo/util/ConfigUtil.java
...main/java/com/ctrip/framework/apollo/util/ConfigUtil.java
+17
-19
apollo-client/src/test/java/com/ctrip/framework/apollo/AllTests.java
...nt/src/test/java/com/ctrip/framework/apollo/AllTests.java
+2
-1
apollo-client/src/test/java/com/ctrip/framework/apollo/BaseIntegrationTest.java
.../java/com/ctrip/framework/apollo/BaseIntegrationTest.java
+5
-0
apollo-client/src/test/java/com/ctrip/framework/apollo/internals/RemoteConfigLongPollServiceTest.java
...ork/apollo/internals/RemoteConfigLongPollServiceTest.java
+6
-1
apollo-client/src/test/java/com/ctrip/framework/apollo/internals/RemoteConfigRepositoryTest.java
...ramework/apollo/internals/RemoteConfigRepositoryTest.java
+5
-0
apollo-client/src/test/java/com/ctrip/framework/apollo/util/ConfigUtilTest.java
.../java/com/ctrip/framework/apollo/util/ConfigUtilTest.java
+176
-0
apollo-configservice/src/main/resources/logback.xml
apollo-configservice/src/main/resources/logback.xml
+2
-0
apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/service/AppNamespaceServiceWithCacheTest.java
...nfigservice/service/AppNamespaceServiceWithCacheTest.java
+1
-1
未找到文件。
apollo-adminservice/src/main/resources/logback.xml
浏览文件 @
32f5fc8b
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
<property
name=
"LOG_FILE"
<property
name=
"LOG_FILE"
value=
"${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}apollo-adminservice.log}"
/>
value=
"${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}apollo-adminservice.log}"
/>
<include
resource=
"org/springframework/boot/logging/logback/file-appender.xml"
/>
<include
resource=
"org/springframework/boot/logging/logback/file-appender.xml"
/>
<include
resource=
"org/springframework/boot/logging/logback/console-appender.xml"
/>
<root
level=
"INFO"
>
<root
level=
"INFO"
>
<appender-ref
ref=
"FILE"
/>
<appender-ref
ref=
"FILE"
/>
<appender-ref
ref=
"CONSOLE"
/>
</root>
</root>
</configuration>
</configuration>
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigLongPollService.java
浏览文件 @
32f5fc8b
...
@@ -103,9 +103,18 @@ public class RemoteConfigLongPollService {
...
@@ -103,9 +103,18 @@ public class RemoteConfigLongPollService {
final
String
appId
=
m_configUtil
.
getAppId
();
final
String
appId
=
m_configUtil
.
getAppId
();
final
String
cluster
=
m_configUtil
.
getCluster
();
final
String
cluster
=
m_configUtil
.
getCluster
();
final
String
dataCenter
=
m_configUtil
.
getDataCenter
();
final
String
dataCenter
=
m_configUtil
.
getDataCenter
();
final
long
longPollingInitialDelayInMills
=
m_configUtil
.
getLongPollingInitialDelayInMills
();
m_longPollingService
.
submit
(
new
Runnable
()
{
m_longPollingService
.
submit
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
if
(
longPollingInitialDelayInMills
>
0
)
{
try
{
logger
.
debug
(
"Long polling will start in {} ms."
,
longPollingInitialDelayInMills
);
TimeUnit
.
MILLISECONDS
.
sleep
(
longPollingInitialDelayInMills
);
}
catch
(
InterruptedException
e
)
{
//ignore
}
}
doLongPollingRefresh
(
appId
,
cluster
,
dataCenter
);
doLongPollingRefresh
(
appId
,
cluster
,
dataCenter
);
}
}
});
});
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/util/ConfigUtil.java
浏览文件 @
32f5fc8b
...
@@ -18,7 +18,6 @@ import com.google.common.base.Strings;
...
@@ -18,7 +18,6 @@ import com.google.common.base.Strings;
*/
*/
public
class
ConfigUtil
{
public
class
ConfigUtil
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ConfigUtil
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ConfigUtil
.
class
);
private
static
final
String
TOOLING_CLUSTER
=
"tooling"
;
private
int
refreshInterval
=
5
;
private
int
refreshInterval
=
5
;
private
TimeUnit
refreshIntervalTimeUnit
=
TimeUnit
.
MINUTES
;
private
TimeUnit
refreshIntervalTimeUnit
=
TimeUnit
.
MINUTES
;
private
int
connectTimeout
=
1000
;
//1 second
private
int
connectTimeout
=
1000
;
//1 second
...
@@ -33,6 +32,7 @@ public class ConfigUtil {
...
@@ -33,6 +32,7 @@ public class ConfigUtil {
private
long
maxConfigCacheSize
=
500
;
//500 cache key
private
long
maxConfigCacheSize
=
500
;
//500 cache key
private
long
configCacheExpireTime
=
1
;
//1 minute
private
long
configCacheExpireTime
=
1
;
//1 minute
private
TimeUnit
configCacheExpireTimeUnit
=
TimeUnit
.
MINUTES
;
//1 minute
private
TimeUnit
configCacheExpireTimeUnit
=
TimeUnit
.
MINUTES
;
//1 minute
private
long
longPollingInitialDelayInMills
=
2000
;
//2 seconds
public
ConfigUtil
()
{
public
ConfigUtil
()
{
initRefreshInterval
();
initRefreshInterval
();
...
@@ -41,6 +41,7 @@ public class ConfigUtil {
...
@@ -41,6 +41,7 @@ public class ConfigUtil {
initCluster
();
initCluster
();
initQPS
();
initQPS
();
initMaxConfigCacheSize
();
initMaxConfigCacheSize
();
initLongPollingInitialDelayInMills
();
}
}
/**
/**
...
@@ -71,19 +72,6 @@ public class ConfigUtil {
...
@@ -71,19 +72,6 @@ public class ConfigUtil {
//Load data center from system property
//Load data center from system property
cluster
=
System
.
getProperty
(
ConfigConsts
.
APOLLO_CLUSTER_KEY
);
cluster
=
System
.
getProperty
(
ConfigConsts
.
APOLLO_CLUSTER_KEY
);
String
env
=
Foundation
.
server
().
getEnvType
();
//LPT and DEV will be treated as a cluster(lower case)
if
(
Strings
.
isNullOrEmpty
(
cluster
)
&&
(
Env
.
DEV
.
name
().
equalsIgnoreCase
(
env
)
||
Env
.
LPT
.
name
().
equalsIgnoreCase
(
env
))
)
{
cluster
=
env
.
toLowerCase
();
}
//Use TOOLING cluster if tooling=true in server.properties
if
(
Strings
.
isNullOrEmpty
(
cluster
)
&&
isToolingZone
())
{
cluster
=
TOOLING_CLUSTER
;
}
//Use data center as cluster
//Use data center as cluster
if
(
Strings
.
isNullOrEmpty
(
cluster
))
{
if
(
Strings
.
isNullOrEmpty
(
cluster
))
{
cluster
=
getDataCenter
();
cluster
=
getDataCenter
();
...
@@ -95,11 +83,6 @@ public class ConfigUtil {
...
@@ -95,11 +83,6 @@ public class ConfigUtil {
}
}
}
}
private
boolean
isToolingZone
()
{
//do not use the new isTooling method since it might not be available in the client side
return
"true"
.
equalsIgnoreCase
(
Foundation
.
server
().
getProperty
(
"tooling"
,
"false"
).
trim
());
}
/**
/**
* Get the cluster name for the current application.
* Get the cluster name for the current application.
*
*
...
@@ -265,4 +248,19 @@ public class ConfigUtil {
...
@@ -265,4 +248,19 @@ public class ConfigUtil {
public
TimeUnit
getConfigCacheExpireTimeUnit
()
{
public
TimeUnit
getConfigCacheExpireTimeUnit
()
{
return
configCacheExpireTimeUnit
;
return
configCacheExpireTimeUnit
;
}
}
private
void
initLongPollingInitialDelayInMills
()
{
String
customizedLongPollingInitialDelay
=
System
.
getProperty
(
"apollo.longPollingInitialDelayInMills"
);
if
(!
Strings
.
isNullOrEmpty
(
customizedLongPollingInitialDelay
))
{
try
{
longPollingInitialDelayInMills
=
Long
.
valueOf
(
customizedLongPollingInitialDelay
);
}
catch
(
Throwable
ex
)
{
logger
.
error
(
"Config for apollo.longPollingInitialDelayInMills is invalid: {}"
,
customizedLongPollingInitialDelay
);
}
}
}
public
long
getLongPollingInitialDelayInMills
()
{
return
longPollingInitialDelayInMills
;
}
}
}
apollo-client/src/test/java/com/ctrip/framework/apollo/AllTests.java
浏览文件 @
32f5fc8b
...
@@ -22,6 +22,7 @@ import com.ctrip.framework.apollo.spring.JavaConfigAnnotationTest;
...
@@ -22,6 +22,7 @@ import com.ctrip.framework.apollo.spring.JavaConfigAnnotationTest;
import
com.ctrip.framework.apollo.spring.JavaConfigPlaceholderTest
;
import
com.ctrip.framework.apollo.spring.JavaConfigPlaceholderTest
;
import
com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest
;
import
com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest
;
import
com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest
;
import
com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest
;
import
com.ctrip.framework.apollo.util.ConfigUtilTest
;
import
com.ctrip.framework.apollo.util.ExceptionUtilTest
;
import
com.ctrip.framework.apollo.util.ExceptionUtilTest
;
import
com.ctrip.framework.apollo.util.parser.DateParserTest
;
import
com.ctrip.framework.apollo.util.parser.DateParserTest
;
import
com.ctrip.framework.apollo.util.parser.DurationParserTest
;
import
com.ctrip.framework.apollo.util.parser.DurationParserTest
;
...
@@ -34,7 +35,7 @@ import com.ctrip.framework.apollo.util.parser.DurationParserTest;
...
@@ -34,7 +35,7 @@ import com.ctrip.framework.apollo.util.parser.DurationParserTest;
ConfigIntegrationTest
.
class
,
ExceptionUtilTest
.
class
,
XmlConfigFileTest
.
class
,
PropertiesConfigFileTest
.
class
,
ConfigIntegrationTest
.
class
,
ExceptionUtilTest
.
class
,
XmlConfigFileTest
.
class
,
PropertiesConfigFileTest
.
class
,
RemoteConfigLongPollServiceTest
.
class
,
DateParserTest
.
class
,
DurationParserTest
.
class
,
JsonConfigFileTest
.
class
,
RemoteConfigLongPollServiceTest
.
class
,
DateParserTest
.
class
,
DurationParserTest
.
class
,
JsonConfigFileTest
.
class
,
XmlConfigPlaceholderTest
.
class
,
JavaConfigPlaceholderTest
.
class
,
XMLConfigAnnotationTest
.
class
,
XmlConfigPlaceholderTest
.
class
,
JavaConfigPlaceholderTest
.
class
,
XMLConfigAnnotationTest
.
class
,
JavaConfigAnnotationTest
.
class
JavaConfigAnnotationTest
.
class
,
ConfigUtilTest
.
class
})
})
public
class
AllTests
{
public
class
AllTests
{
...
...
apollo-client/src/test/java/com/ctrip/framework/apollo/BaseIntegrationTest.java
浏览文件 @
32f5fc8b
...
@@ -191,6 +191,11 @@ public abstract class BaseIntegrationTest{
...
@@ -191,6 +191,11 @@ public abstract class BaseIntegrationTest{
public
TimeUnit
getOnErrorRetryIntervalTimeUnit
()
{
public
TimeUnit
getOnErrorRetryIntervalTimeUnit
()
{
return
TimeUnit
.
MILLISECONDS
;
return
TimeUnit
.
MILLISECONDS
;
}
}
@Override
public
long
getLongPollingInitialDelayInMills
()
{
return
0
;
}
}
}
/**
/**
...
...
apollo-client/src/test/java/com/ctrip/framework/apollo/internals/RemoteConfigLongPollServiceTest.java
浏览文件 @
32f5fc8b
...
@@ -62,6 +62,7 @@ public class RemoteConfigLongPollServiceTest {
...
@@ -62,6 +62,7 @@ public class RemoteConfigLongPollServiceTest {
MockInjector
.
setInstance
(
HttpUtil
.
class
,
httpUtil
);
MockInjector
.
setInstance
(
HttpUtil
.
class
,
httpUtil
);
someServerUrl
=
"http://someServer"
;
ServiceDTO
serviceDTO
=
mock
(
ServiceDTO
.
class
);
ServiceDTO
serviceDTO
=
mock
(
ServiceDTO
.
class
);
when
(
serviceDTO
.
getHomepageUrl
()).
thenReturn
(
someServerUrl
);
when
(
serviceDTO
.
getHomepageUrl
()).
thenReturn
(
someServerUrl
);
when
(
configServiceLocator
.
getConfigServices
()).
thenReturn
(
Lists
.
newArrayList
(
serviceDTO
));
when
(
configServiceLocator
.
getConfigServices
()).
thenReturn
(
Lists
.
newArrayList
(
serviceDTO
));
...
@@ -74,7 +75,6 @@ public class RemoteConfigLongPollServiceTest {
...
@@ -74,7 +75,6 @@ public class RemoteConfigLongPollServiceTest {
responseType
=
responseType
=
(
Type
)
ReflectionTestUtils
.
getField
(
remoteConfigLongPollService
,
"m_responseType"
);
(
Type
)
ReflectionTestUtils
.
getField
(
remoteConfigLongPollService
,
"m_responseType"
);
someServerUrl
=
"http://someServer"
;
someAppId
=
"someAppId"
;
someAppId
=
"someAppId"
;
someCluster
=
"someCluster"
;
someCluster
=
"someCluster"
;
}
}
...
@@ -367,6 +367,11 @@ public class RemoteConfigLongPollServiceTest {
...
@@ -367,6 +367,11 @@ public class RemoteConfigLongPollServiceTest {
public
int
getLongPollQPS
()
{
public
int
getLongPollQPS
()
{
return
200
;
return
200
;
}
}
@Override
public
long
getLongPollingInitialDelayInMills
()
{
return
0
;
}
}
}
}
}
apollo-client/src/test/java/com/ctrip/framework/apollo/internals/RemoteConfigRepositoryTest.java
浏览文件 @
32f5fc8b
...
@@ -250,6 +250,11 @@ public class RemoteConfigRepositoryTest {
...
@@ -250,6 +250,11 @@ public class RemoteConfigRepositoryTest {
public
TimeUnit
getOnErrorRetryIntervalTimeUnit
()
{
public
TimeUnit
getOnErrorRetryIntervalTimeUnit
()
{
return
TimeUnit
.
MILLISECONDS
;
return
TimeUnit
.
MILLISECONDS
;
}
}
@Override
public
long
getLongPollingInitialDelayInMills
()
{
return
0
;
}
}
}
public
static
class
MockHttpUtil
extends
HttpUtil
{
public
static
class
MockHttpUtil
extends
HttpUtil
{
...
...
apollo-client/src/test/java/com/ctrip/framework/apollo/util/ConfigUtilTest.java
0 → 100644
浏览文件 @
32f5fc8b
package
com.ctrip.framework.apollo.util
;
import
com.ctrip.framework.apollo.core.ConfigConsts
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public
class
ConfigUtilTest
{
@After
public
void
tearDown
()
throws
Exception
{
System
.
clearProperty
(
ConfigConsts
.
APOLLO_CLUSTER_KEY
);
System
.
clearProperty
(
"apollo.connectTimeout"
);
System
.
clearProperty
(
"apollo.readTimeout"
);
System
.
clearProperty
(
"apollo.refreshInterval"
);
System
.
clearProperty
(
"apollo.loadConfigQPS"
);
System
.
clearProperty
(
"apollo.longPollQPS"
);
System
.
clearProperty
(
"apollo.configCacheSize"
);
System
.
clearProperty
(
"apollo.longPollingInitialDelayInMills"
);
}
@Test
public
void
testApolloCluster
()
throws
Exception
{
String
someCluster
=
"someCluster"
;
System
.
setProperty
(
ConfigConsts
.
APOLLO_CLUSTER_KEY
,
someCluster
);
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertEquals
(
someCluster
,
configUtil
.
getCluster
());
}
@Test
public
void
testCustomizeConnectTimeout
()
throws
Exception
{
int
someConnectTimeout
=
1
;
System
.
setProperty
(
"apollo.connectTimeout"
,
String
.
valueOf
(
someConnectTimeout
));
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertEquals
(
someConnectTimeout
,
configUtil
.
getConnectTimeout
());
}
@Test
public
void
testCustomizeInvalidConnectTimeout
()
throws
Exception
{
String
someInvalidConnectTimeout
=
"a"
;
System
.
setProperty
(
"apollo.connectTimeout"
,
someInvalidConnectTimeout
);
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertTrue
(
configUtil
.
getConnectTimeout
()
>
0
);
}
@Test
public
void
testCustomizeReadTimeout
()
throws
Exception
{
int
someReadTimeout
=
1
;
System
.
setProperty
(
"apollo.readTimeout"
,
String
.
valueOf
(
someReadTimeout
));
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertEquals
(
someReadTimeout
,
configUtil
.
getReadTimeout
());
}
@Test
public
void
testCustomizeInvalidReadTimeout
()
throws
Exception
{
String
someInvalidReadTimeout
=
"a"
;
System
.
setProperty
(
"apollo.readTimeout"
,
someInvalidReadTimeout
);
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertTrue
(
configUtil
.
getReadTimeout
()
>
0
);
}
@Test
public
void
testCustomizeRefreshInterval
()
throws
Exception
{
int
someRefreshInterval
=
1
;
System
.
setProperty
(
"apollo.refreshInterval"
,
String
.
valueOf
(
someRefreshInterval
));
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertEquals
(
someRefreshInterval
,
configUtil
.
getRefreshInterval
());
}
@Test
public
void
testCustomizeInvalidRefreshInterval
()
throws
Exception
{
String
someInvalidRefreshInterval
=
"a"
;
System
.
setProperty
(
"apollo.refreshInterval"
,
someInvalidRefreshInterval
);
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertTrue
(
configUtil
.
getRefreshInterval
()
>
0
);
}
@Test
public
void
testCustomizeLoadConfigQPS
()
throws
Exception
{
int
someQPS
=
1
;
System
.
setProperty
(
"apollo.loadConfigQPS"
,
String
.
valueOf
(
someQPS
));
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertEquals
(
someQPS
,
configUtil
.
getLoadConfigQPS
());
}
@Test
public
void
testCustomizeInvalidLoadConfigQPS
()
throws
Exception
{
String
someInvalidQPS
=
"a"
;
System
.
setProperty
(
"apollo.loadConfigQPS"
,
someInvalidQPS
);
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertTrue
(
configUtil
.
getLoadConfigQPS
()
>
0
);
}
@Test
public
void
testCustomizeLongPollQPS
()
throws
Exception
{
int
someQPS
=
1
;
System
.
setProperty
(
"apollo.longPollQPS"
,
String
.
valueOf
(
someQPS
));
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertEquals
(
someQPS
,
configUtil
.
getLongPollQPS
());
}
@Test
public
void
testCustomizeInvalidLongPollQPS
()
throws
Exception
{
String
someInvalidQPS
=
"a"
;
System
.
setProperty
(
"apollo.longPollQPS"
,
someInvalidQPS
);
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertTrue
(
configUtil
.
getLongPollQPS
()
>
0
);
}
@Test
public
void
testCustomizeMaxConfigCacheSize
()
throws
Exception
{
long
someCacheSize
=
1
;
System
.
setProperty
(
"apollo.configCacheSize"
,
String
.
valueOf
(
someCacheSize
));
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertEquals
(
someCacheSize
,
configUtil
.
getMaxConfigCacheSize
());
}
@Test
public
void
testCustomizeInvalidMaxConfigCacheSize
()
throws
Exception
{
String
someInvalidCacheSize
=
"a"
;
System
.
setProperty
(
"apollo.configCacheSize"
,
someInvalidCacheSize
);
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertTrue
(
configUtil
.
getMaxConfigCacheSize
()
>
0
);
}
@Test
public
void
testCustomizeLongPollingInitialDelayInMills
()
throws
Exception
{
long
someLongPollingDelayInMills
=
1
;
System
.
setProperty
(
"apollo.longPollingInitialDelayInMills"
,
String
.
valueOf
(
someLongPollingDelayInMills
));
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertEquals
(
someLongPollingDelayInMills
,
configUtil
.
getLongPollingInitialDelayInMills
());
}
@Test
public
void
testCustomizeInvalidLongPollingInitialDelayInMills
()
throws
Exception
{
String
someInvalidLongPollingDelayInMills
=
"a"
;
System
.
setProperty
(
"apollo.longPollingInitialDelayInMills"
,
someInvalidLongPollingDelayInMills
);
ConfigUtil
configUtil
=
new
ConfigUtil
();
assertTrue
(
configUtil
.
getLongPollingInitialDelayInMills
()
>
0
);
}
}
\ No newline at end of file
apollo-configservice/src/main/resources/logback.xml
浏览文件 @
32f5fc8b
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
<property
name=
"LOG_FILE"
<property
name=
"LOG_FILE"
value=
"${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}apollo-configservice.log}"
/>
value=
"${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}apollo-configservice.log}"
/>
<include
resource=
"org/springframework/boot/logging/logback/file-appender.xml"
/>
<include
resource=
"org/springframework/boot/logging/logback/file-appender.xml"
/>
<include
resource=
"org/springframework/boot/logging/logback/console-appender.xml"
/>
<root
level=
"INFO"
>
<root
level=
"INFO"
>
<appender-ref
ref=
"FILE"
/>
<appender-ref
ref=
"FILE"
/>
<appender-ref
ref=
"CONSOLE"
/>
</root>
</root>
</configuration>
</configuration>
apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/service/AppNamespaceServiceWithCacheTest.java
浏览文件 @
32f5fc8b
...
@@ -50,7 +50,7 @@ public class AppNamespaceServiceWithCacheTest {
...
@@ -50,7 +50,7 @@ public class AppNamespaceServiceWithCacheTest {
appNamespaceRepository
);
appNamespaceRepository
);
ReflectionTestUtils
.
setField
(
appNamespaceServiceWithCache
,
"bizConfig"
,
bizConfig
);
ReflectionTestUtils
.
setField
(
appNamespaceServiceWithCache
,
"bizConfig"
,
bizConfig
);
scanInterval
=
1
0
;
scanInterval
=
5
0
;
scanIntervalTimeUnit
=
TimeUnit
.
MILLISECONDS
;
scanIntervalTimeUnit
=
TimeUnit
.
MILLISECONDS
;
when
(
bizConfig
.
appNamespaceCacheRebuildInterval
()).
thenReturn
(
scanInterval
);
when
(
bizConfig
.
appNamespaceCacheRebuildInterval
()).
thenReturn
(
scanInterval
);
when
(
bizConfig
.
appNamespaceCacheRebuildIntervalTimeUnit
()).
thenReturn
(
scanIntervalTimeUnit
);
when
(
bizConfig
.
appNamespaceCacheRebuildIntervalTimeUnit
()).
thenReturn
(
scanIntervalTimeUnit
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录