Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
openSource
apollo
Commits
9fe11a24
Commit
9fe11a24
authored
May 19, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #208 from nobodyiam/namespace-field-rename
rename field namespace to namespaceName since namespace is a reserved…
parents
f0011004
60530492
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
30 deletions
+30
-30
ConfigIntegrationTest.java
...a/com/ctrip/apollo/integration/ConfigIntegrationTest.java
+1
-1
ConfigControllerTest.java
...apollo/configservice/controller/ConfigControllerTest.java
+5
-5
NotificationControllerTest.java
.../configservice/controller/NotificationControllerTest.java
+2
-2
ConfigControllerIntegrationTest.java
...gservice/integration/ConfigControllerIntegrationTest.java
+4
-4
NotificationControllerIntegrationTest.java
...ce/integration/NotificationControllerIntegrationTest.java
+3
-3
ApolloConfig.java
...src/main/java/com/ctrip/apollo/core/dto/ApolloConfig.java
+8
-8
ApolloConfigNotification.java
...a/com/ctrip/apollo/core/dto/ApolloConfigNotification.java
+7
-7
No files found.
apollo-client/src/test/java/com/ctrip/apollo/integration/ConfigIntegrationTest.java
View file @
9fe11a24
...
...
@@ -242,7 +242,7 @@ public class ConfigIntegrationTest extends BaseIntegrationTest {
ContextHandler
configHandler
=
mockConfigServerHandler
(
HttpServletResponse
.
SC_OK
,
apolloConfig
);
ContextHandler
pollHandler
=
mockPollNotificationHandler
(
pollTimeoutInMS
,
HttpServletResponse
.
SC_OK
,
new
ApolloConfigNotification
(
apolloConfig
.
getNamespace
()),
false
);
new
ApolloConfigNotification
(
apolloConfig
.
getNamespace
Name
()),
false
);
startServerWithHandlers
(
configHandler
,
pollHandler
);
...
...
apollo-configservice/src/test/java/com/ctrip/apollo/configservice/controller/ConfigControllerTest.java
View file @
9fe11a24
...
...
@@ -88,7 +88,7 @@ public class ConfigControllerTest {
verify
(
configService
,
times
(
1
)).
findRelease
(
someAppId
,
someClusterName
,
defaultNamespaceName
);
assertEquals
(
someAppId
,
result
.
getAppId
());
assertEquals
(
someClusterName
,
result
.
getCluster
());
assertEquals
(
defaultNamespaceName
,
result
.
getNamespace
());
assertEquals
(
defaultNamespaceName
,
result
.
getNamespace
Name
());
assertEquals
(
someServerSideNewReleaseKey
,
result
.
getReleaseKey
());
}
...
...
@@ -151,7 +151,7 @@ public class ConfigControllerTest {
assertEquals
(
someServerSideReleaseKey
,
result
.
getReleaseKey
());
assertEquals
(
someAppId
,
result
.
getAppId
());
assertEquals
(
someClusterName
,
result
.
getCluster
());
assertEquals
(
someAppOwnNamespaceName
,
result
.
getNamespace
());
assertEquals
(
someAppOwnNamespaceName
,
result
.
getNamespace
Name
());
assertEquals
(
"foo"
,
result
.
getConfigurations
().
get
(
"apollo.bar"
));
}
...
...
@@ -180,7 +180,7 @@ public class ConfigControllerTest {
assertEquals
(
someServerSideReleaseKey
,
result
.
getReleaseKey
());
assertEquals
(
someAppId
,
result
.
getAppId
());
assertEquals
(
someClusterName
,
result
.
getCluster
());
assertEquals
(
somePublicNamespaceName
,
result
.
getNamespace
());
assertEquals
(
somePublicNamespaceName
,
result
.
getNamespace
Name
());
assertEquals
(
"foo"
,
result
.
getConfigurations
().
get
(
"apollo.public.bar"
));
}
...
...
@@ -212,7 +212,7 @@ public class ConfigControllerTest {
assertEquals
(
someServerSideReleaseKey
,
result
.
getReleaseKey
());
assertEquals
(
someAppId
,
result
.
getAppId
());
assertEquals
(
someClusterName
,
result
.
getCluster
());
assertEquals
(
somePublicNamespaceName
,
result
.
getNamespace
());
assertEquals
(
somePublicNamespaceName
,
result
.
getNamespace
Name
());
assertEquals
(
"foo"
,
result
.
getConfigurations
().
get
(
"apollo.public.bar"
));
}
...
...
@@ -249,7 +249,7 @@ public class ConfigControllerTest {
result
.
getReleaseKey
());
assertEquals
(
someAppId
,
result
.
getAppId
());
assertEquals
(
someClusterName
,
result
.
getCluster
());
assertEquals
(
somePublicNamespaceName
,
result
.
getNamespace
());
assertEquals
(
somePublicNamespaceName
,
result
.
getNamespace
Name
());
assertEquals
(
"foo-override"
,
result
.
getConfigurations
().
get
(
"apollo.public.foo"
));
assertEquals
(
"bar"
,
result
.
getConfigurations
().
get
(
"apollo.public.bar"
));
}
...
...
apollo-configservice/src/test/java/com/ctrip/apollo/configservice/controller/NotificationControllerTest.java
View file @
9fe11a24
...
...
@@ -122,7 +122,7 @@ public class NotificationControllerTest {
ApolloConfigNotification
notification
=
response
.
getBody
();
assertEquals
(
HttpStatus
.
OK
,
response
.
getStatusCode
());
assertEquals
(
defaultNamespace
,
notification
.
getNamespace
());
assertEquals
(
defaultNamespace
,
notification
.
getNamespace
Name
());
}
@Test
...
...
@@ -149,7 +149,7 @@ public class NotificationControllerTest {
ApolloConfigNotification
notification
=
response
.
getBody
();
assertEquals
(
HttpStatus
.
OK
,
response
.
getStatusCode
());
assertEquals
(
somePublicNamespace
,
notification
.
getNamespace
());
assertEquals
(
somePublicNamespace
,
notification
.
getNamespace
Name
());
}
...
...
apollo-configservice/src/test/java/com/ctrip/apollo/configservice/integration/ConfigControllerIntegrationTest.java
View file @
9fe11a24
...
...
@@ -103,7 +103,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
assertEquals
(
"TEST-RELEASE-KEY4"
,
result
.
getReleaseKey
());
assertEquals
(
someAppId
,
result
.
getAppId
());
assertEquals
(
someCluster
,
result
.
getCluster
());
assertEquals
(
somePublicNamespace
,
result
.
getNamespace
());
assertEquals
(
somePublicNamespace
,
result
.
getNamespace
Name
());
assertEquals
(
"someDC-v1"
,
result
.
getConfigurations
().
get
(
"k1"
));
assertEquals
(
"someDC-v2"
,
result
.
getConfigurations
().
get
(
"k2"
));
}
...
...
@@ -121,7 +121,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
assertEquals
(
"TEST-RELEASE-KEY5"
+
ConfigConsts
.
CLUSTER_NAMESPACE_SEPARATOR
+
"TEST-RELEASE-KEY4"
,
result
.
getReleaseKey
());
assertEquals
(
someAppId
,
result
.
getAppId
());
assertEquals
(
someDefaultCluster
,
result
.
getCluster
());
assertEquals
(
somePublicNamespace
,
result
.
getNamespace
());
assertEquals
(
somePublicNamespace
,
result
.
getNamespace
Name
());
assertEquals
(
"override-v1"
,
result
.
getConfigurations
().
get
(
"k1"
));
assertEquals
(
"someDC-v2"
,
result
.
getConfigurations
().
get
(
"k2"
));
}
...
...
@@ -140,7 +140,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
assertEquals
(
"TEST-RELEASE-KEY3"
,
result
.
getReleaseKey
());
assertEquals
(
someAppId
,
result
.
getAppId
());
assertEquals
(
someCluster
,
result
.
getCluster
());
assertEquals
(
somePublicNamespace
,
result
.
getNamespace
());
assertEquals
(
somePublicNamespace
,
result
.
getNamespace
Name
());
assertEquals
(
"default-v1"
,
result
.
getConfigurations
().
get
(
"k1"
));
assertEquals
(
"default-v2"
,
result
.
getConfigurations
().
get
(
"k2"
));
}
...
...
@@ -159,7 +159,7 @@ public class ConfigControllerIntegrationTest extends AbstractBaseIntegrationTest
assertEquals
(
"TEST-RELEASE-KEY5"
+
ConfigConsts
.
CLUSTER_NAMESPACE_SEPARATOR
+
"TEST-RELEASE-KEY3"
,
result
.
getReleaseKey
());
assertEquals
(
someAppId
,
result
.
getAppId
());
assertEquals
(
someDefaultCluster
,
result
.
getCluster
());
assertEquals
(
somePublicNamespace
,
result
.
getNamespace
());
assertEquals
(
somePublicNamespace
,
result
.
getNamespace
Name
());
assertEquals
(
"override-v1"
,
result
.
getConfigurations
().
get
(
"k1"
));
assertEquals
(
"default-v2"
,
result
.
getConfigurations
().
get
(
"k2"
));
...
...
apollo-configservice/src/test/java/com/ctrip/apollo/configservice/integration/NotificationControllerIntegrationTest.java
View file @
9fe11a24
...
...
@@ -59,7 +59,7 @@ public class NotificationControllerIntegrationTest extends AbstractBaseIntegrati
ApolloConfigNotification
notification
=
result
.
getBody
();
assertEquals
(
HttpStatus
.
OK
,
result
.
getStatusCode
());
assertEquals
(
defaultNamespace
,
notification
.
getNamespace
());
assertEquals
(
defaultNamespace
,
notification
.
getNamespace
Name
());
}
@Test
(
timeout
=
5000L
)
...
...
@@ -81,7 +81,7 @@ public class NotificationControllerIntegrationTest extends AbstractBaseIntegrati
ApolloConfigNotification
notification
=
result
.
getBody
();
assertEquals
(
HttpStatus
.
OK
,
result
.
getStatusCode
());
assertEquals
(
somePublicNamespace
,
notification
.
getNamespace
());
assertEquals
(
somePublicNamespace
,
notification
.
getNamespace
Name
());
}
@Test
(
timeout
=
5000L
)
...
...
@@ -104,7 +104,7 @@ public class NotificationControllerIntegrationTest extends AbstractBaseIntegrati
ApolloConfigNotification
notification
=
result
.
getBody
();
assertEquals
(
HttpStatus
.
OK
,
result
.
getStatusCode
());
assertEquals
(
somePublicNamespace
,
notification
.
getNamespace
());
assertEquals
(
somePublicNamespace
,
notification
.
getNamespace
Name
());
}
private
String
assembleKey
(
String
appId
,
String
cluster
,
String
namespace
)
{
...
...
apollo-core/src/main/java/com/ctrip/apollo/core/dto/ApolloConfig.java
View file @
9fe11a24
...
...
@@ -13,7 +13,7 @@ public class ApolloConfig {
private
String
cluster
;
private
String
namespace
;
private
String
namespace
Name
;
private
Map
<
String
,
String
>
configurations
;
...
...
@@ -24,11 +24,11 @@ public class ApolloConfig {
public
ApolloConfig
(
String
appId
,
String
cluster
,
String
namespace
,
String
namespace
Name
,
String
releaseKey
)
{
this
.
appId
=
appId
;
this
.
cluster
=
cluster
;
this
.
namespace
=
namespac
e
;
this
.
namespace
Name
=
namespaceNam
e
;
this
.
releaseKey
=
releaseKey
;
}
...
...
@@ -40,8 +40,8 @@ public class ApolloConfig {
return
cluster
;
}
public
String
getNamespace
()
{
return
namespace
;
public
String
getNamespace
Name
()
{
return
namespace
Name
;
}
public
String
getReleaseKey
()
{
...
...
@@ -60,8 +60,8 @@ public class ApolloConfig {
this
.
cluster
=
cluster
;
}
public
void
setNamespace
(
String
namespac
e
)
{
this
.
namespace
=
namespac
e
;
public
void
setNamespace
Name
(
String
namespaceNam
e
)
{
this
.
namespace
Name
=
namespaceNam
e
;
}
public
void
setReleaseKey
(
String
releaseKey
)
{
...
...
@@ -78,7 +78,7 @@ public class ApolloConfig {
.
omitNullValues
()
.
add
(
"appId"
,
appId
)
.
add
(
"cluster"
,
cluster
)
.
add
(
"namespace
"
,
namespac
e
)
.
add
(
"namespace
Name"
,
namespaceNam
e
)
.
add
(
"releaseKey"
,
releaseKey
)
.
add
(
"configurations"
,
configurations
)
.
toString
();
...
...
apollo-core/src/main/java/com/ctrip/apollo/core/dto/ApolloConfigNotification.java
View file @
9fe11a24
...
...
@@ -4,21 +4,21 @@ package com.ctrip.apollo.core.dto;
* @author Jason Song(song_s@ctrip.com)
*/
public
class
ApolloConfigNotification
{
private
String
namespace
;
private
String
namespace
Name
;
//for json converter
public
ApolloConfigNotification
()
{
}
public
ApolloConfigNotification
(
String
namespace
)
{
this
.
namespace
=
namespac
e
;
public
ApolloConfigNotification
(
String
namespace
Name
)
{
this
.
namespace
Name
=
namespaceNam
e
;
}
public
String
getNamespace
()
{
return
namespace
;
public
String
getNamespace
Name
()
{
return
namespace
Name
;
}
public
void
setNamespace
(
String
namespac
e
)
{
this
.
namespace
=
namespac
e
;
public
void
setNamespace
Name
(
String
namespaceNam
e
)
{
this
.
namespace
Name
=
namespaceNam
e
;
}
}
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