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
2e05fb70
Commit
2e05fb70
authored
Apr 07, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate EurekaServer into AdminSerivce Test, and update sample test data
parent
0d9d990c
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
122 additions
and
24 deletions
+122
-24
pom.xml
apollo-adminservice/pom.xml
+41
-0
SampleAdminServiceApplication.java
.../java/com/ctrip/apollo/SampleAdminServiceApplication.java
+2
-2
application.yml
apollo-adminservice/src/test/resources/application.yml
+14
-0
bootstrap.yml
apollo-adminservice/src/test/resources/bootstrap.yml
+9
-0
import.sql
apollo-adminservice/src/test/resources/import.sql
+5
-5
App.java
...lo-biz/src/main/java/com/ctrip/apollo/biz/entity/App.java
+1
-1
AppNamespace.java
...c/main/java/com/ctrip/apollo/biz/entity/AppNamespace.java
+2
-2
Cluster.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Cluster.java
+1
-1
Item.java
...o-biz/src/main/java/com/ctrip/apollo/biz/entity/Item.java
+1
-1
Namespace.java
.../src/main/java/com/ctrip/apollo/biz/entity/Namespace.java
+1
-1
Privilege.java
.../src/main/java/com/ctrip/apollo/biz/entity/Privilege.java
+1
-1
Release.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Release.java
+1
-3
import.sql
apollo-biz/src/test/resources/import.sql
+5
-5
application.properties
...o-configservice/src/test/resources/application.properties
+7
-0
application.yml
apollo-configservice/src/test/resources/application.yml
+0
-2
import.sql
apollo-configservice/src/test/resources/import.sql
+31
-0
No files found.
apollo-adminservice/pom.xml
View file @
2e05fb70
...
...
@@ -23,6 +23,47 @@
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
<!-- end of eureka -->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka-server
</artifactId>
<scope>
test
</scope>
<exclusions>
<exclusion>
<artifactId>
spring-cloud-starter-archaius
</artifactId>
<groupId>
org.springframework.cloud
</groupId>
</exclusion>
<exclusion>
<artifactId>
spring-cloud-starter-ribbon
</artifactId>
<groupId>
org.springframework.cloud
</groupId>
</exclusion>
<exclusion>
<artifactId>
ribbon-eureka
</artifactId>
<groupId>
com.netflix.ribbon
</groupId>
</exclusion>
<exclusion>
<artifactId>
aws-java-sdk-core
</artifactId>
<groupId>
com.amazonaws
</groupId>
</exclusion>
<exclusion>
<artifactId>
aws-java-sdk-ec2
</artifactId>
<groupId>
com.amazonaws
</groupId>
</exclusion>
<exclusion>
<artifactId>
aws-java-sdk-autoscaling
</artifactId>
<groupId>
com.amazonaws
</groupId>
</exclusion>
<exclusion>
<artifactId>
aws-java-sdk-sts
</artifactId>
<groupId>
com.amazonaws
</groupId>
</exclusion>
<exclusion>
<artifactId>
aws-java-sdk-route53
</artifactId>
<groupId>
com.amazonaws
</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
...
...
apollo-adminservice/src/test/java/com/ctrip/apollo/SampleAdminServiceApplication.java
View file @
2e05fb70
...
...
@@ -2,10 +2,10 @@ package com.ctrip.apollo;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.cloud.netflix.eureka.
EnableEurekaClient
;
import
org.springframework.cloud.netflix.eureka.
server.EnableEurekaServer
;
@SpringBootApplication
@EnableEureka
Client
@EnableEureka
Server
public
class
SampleAdminServiceApplication
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
SampleAdminServiceApplication
.
class
).
run
(
args
);
...
...
apollo-adminservice/src/test/resources/application.yml
0 → 100644
View file @
2e05fb70
spring
:
application
:
name
:
apollo-adminservice
server
:
port
:
${port:8090}
logging
:
level
:
org.springframework.cloud
:
'
DEBUG'
file
:
/opt/logs/${ctrip.appid}/apollo-adminservice.log
ctrip
:
appid
:
100003172
apollo-adminservice/src/test/resources/bootstrap.yml
0 → 100644
View file @
2e05fb70
eureka
:
instance
:
hostname
:
${hostname:localhost}
client
:
serviceUrl
:
defaultZone
:
http://${eureka.instance.hostname}:8090/eureka/
healthcheck
:
enabled
:
true
\ No newline at end of file
apollo-adminservice/src/test/resources/import.sql
View file @
2e05fb70
...
...
@@ -22,10 +22,10 @@ INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (3, '100003
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
4
,
'100003173'
,
'default'
,
'application'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
5
,
'100003171'
,
'default'
,
'application'
);
INSERT
INTO
Item
(
Group
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k1'
,
'v1'
,
'comment1'
);
INSERT
INTO
Item
(
Group
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k2'
,
'v2'
,
'comment2'
);
INSERT
INTO
Item
(
Group
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
2
,
'k3'
,
'v3'
,
'comment3'
);
INSERT
INTO
Item
(
Group
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
5
,
'k3'
,
'v4'
,
'comment4'
);
INSERT
INTO
Item
(
Namespace
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k1'
,
'v1'
,
'comment1'
);
INSERT
INTO
Item
(
Namespace
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k2'
,
'v2'
,
'comment2'
);
INSERT
INTO
Item
(
Namespace
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
2
,
'k3'
,
'v3'
,
'comment3'
);
INSERT
INTO
Item
(
Namespace
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
5
,
'k3'
,
'v4'
,
'comment4'
);
INSERT
INTO
`RELEASE`
(
Name
,
Comment
,
AppId
,
ClusterName
,
NamespaceName
,
Configurations
)
VALUES
(
'REV1'
,
'First Release'
,
'100003171'
,
'default'
,
'application'
,
'{"k1":"v1"}'
);
INSERT
INTO
RELEASE
(
Name
,
Comment
,
AppId
,
ClusterName
,
NamespaceName
,
Configurations
)
VALUES
(
'REV1'
,
'First Release'
,
'100003171'
,
'default'
,
'application'
,
'{"k1":"v1"}'
);
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/App.java
View file @
2e05fb70
...
...
@@ -8,7 +8,7 @@ import org.hibernate.annotations.Where;
@Entity
@SQLDelete
(
sql
=
"Update App set isDeleted = 'false' where id = ?"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
@Where
(
clause
=
"isDeleted =
0
"
)
public
class
App
extends
BaseEntity
{
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/AppNamespace.java
View file @
2e05fb70
...
...
@@ -8,10 +8,10 @@ import org.hibernate.annotations.Where;
@Entity
@SQLDelete
(
sql
=
"Update AppNamespace set isDeleted = 'false' where id = ?"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
@Where
(
clause
=
"isDeleted =
0
"
)
public
class
AppNamespace
extends
BaseEntity
{
@Column
(
nullable
=
false
,
unique
=
true
)
@Column
(
nullable
=
false
)
private
String
name
;
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Cluster.java
View file @
2e05fb70
...
...
@@ -11,7 +11,7 @@ import org.hibernate.annotations.Where;
*/
@Entity
@SQLDelete
(
sql
=
"Update Cluster set isDeleted = 'false' where id = ?"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
@Where
(
clause
=
"isDeleted =
0
"
)
public
class
Cluster
extends
BaseEntity
{
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Item.java
View file @
2e05fb70
...
...
@@ -8,7 +8,7 @@ import org.hibernate.annotations.Where;
@Entity
@SQLDelete
(
sql
=
"Update Item set isDeleted = 'false' where id = ?"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
@Where
(
clause
=
"isDeleted =
0
"
)
public
class
Item
extends
BaseEntity
{
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Namespace.java
View file @
2e05fb70
...
...
@@ -8,7 +8,7 @@ import org.hibernate.annotations.Where;
@Entity
@SQLDelete
(
sql
=
"Update Namespace set isDeleted = 'false' where id = ?"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
@Where
(
clause
=
"isDeleted =
0
"
)
public
class
Namespace
extends
BaseEntity
{
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Privilege.java
View file @
2e05fb70
...
...
@@ -8,7 +8,7 @@ import org.hibernate.annotations.Where;
@Entity
@SQLDelete
(
sql
=
"Update Privilege set isDeleted = 'false' where id = ?"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
@Where
(
clause
=
"isDeleted =
0
"
)
public
class
Privilege
extends
BaseEntity
{
@Column
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Release.java
View file @
2e05fb70
...
...
@@ -3,7 +3,6 @@ package com.ctrip.apollo.biz.entity;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Lob
;
import
javax.persistence.Table
;
import
org.hibernate.annotations.SQLDelete
;
import
org.hibernate.annotations.Where
;
...
...
@@ -12,9 +11,8 @@ import org.hibernate.annotations.Where;
* @author Jason Song(song_s@ctrip.com)
*/
@Entity
@Table
(
name
=
"\"Release\""
)
@SQLDelete
(
sql
=
"Update Release set isDeleted = 'false' where id = ?"
)
@Where
(
clause
=
"isDeleted =
'false'
"
)
@Where
(
clause
=
"isDeleted =
0
"
)
public
class
Release
extends
BaseEntity
{
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/test/resources/import.sql
View file @
2e05fb70
...
...
@@ -22,10 +22,10 @@ INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (3, '100003
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
4
,
'100003173'
,
'default'
,
'application'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
5
,
'100003171'
,
'default'
,
'application'
);
INSERT
INTO
Item
(
Group
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k1'
,
'v1'
,
'comment1'
);
INSERT
INTO
Item
(
Group
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k2'
,
'v2'
,
'comment2'
);
INSERT
INTO
Item
(
Group
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
2
,
'k3'
,
'v3'
,
'comment3'
);
INSERT
INTO
Item
(
Group
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
5
,
'k3'
,
'v4'
,
'comment4'
);
INSERT
INTO
Item
(
Namespace
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k1'
,
'v1'
,
'comment1'
);
INSERT
INTO
Item
(
Namespace
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k2'
,
'v2'
,
'comment2'
);
INSERT
INTO
Item
(
Namespace
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
2
,
'k3'
,
'v3'
,
'comment3'
);
INSERT
INTO
Item
(
Namespace
Id
,
`Key`
,
Value
,
Comment
)
VALUES
(
5
,
'k3'
,
'v4'
,
'comment4'
);
INSERT
INTO
`RELEASE`
(
Name
,
Comment
,
AppId
,
ClusterName
,
NamespaceName
,
Configurations
)
VALUES
(
'REV1'
,
'First Release'
,
'100003171'
,
'default'
,
'application'
,
'{"k1":"v1"}'
);
INSERT
INTO
RELEASE
(
Name
,
Comment
,
AppId
,
ClusterName
,
NamespaceName
,
Configurations
)
VALUES
(
'REV1'
,
'First Release'
,
'100003171'
,
'default'
,
'application'
,
'{"k1":"v1"}'
);
apollo-configservice/src/test/resources/application.properties
0 → 100644
View file @
2e05fb70
spring.datasource.url
=
jdbc:h2:mem:~/fxapolloconfigdb;mode=mysql
spring.jpa.hibernate.naming_strategy
=
org.hibernate.cfg.EJB3NamingStrategy
spring.h2.console.enabled
=
true
spring.h2.console.settings.web-allow-others
=
true
hibernate.globally_quoted_identifiers
=
true
hibernate.show_sql
=
true
\ No newline at end of file
apollo-configservice/src/test/resources/application.yml
View file @
2e05fb70
spring
:
application
:
name
:
apollo-configservice
datasource
:
url
:
jdbc:h2:mem:~/fxapolloconfigdb;DB_CLOSE_ON_EXIT=FALSE
server
:
port
:
${port:8080}
...
...
apollo-configservice/src/test/resources/import.sql
0 → 100644
View file @
2e05fb70
INSERT
INTO
App
(
AppId
,
Name
,
OwnerName
,
OwnerEmail
)
VALUES
(
'100003171'
,
'apollo-config-service'
,
'刘一鸣'
,
'liuym@ctrip.com'
);
INSERT
INTO
App
(
AppId
,
Name
,
OwnerName
,
OwnerEmail
)
VALUES
(
'100003172'
,
'apollo-admin-service'
,
'宋顺'
,
'song_s@ctrip.com'
);
INSERT
INTO
App
(
AppId
,
Name
,
OwnerName
,
OwnerEmail
)
VALUES
(
'100003173'
,
'apollo-portal'
,
'张乐'
,
'zhanglea@ctrip.com'
);
INSERT
INTO
App
(
AppId
,
Name
,
OwnerName
,
OwnerEmail
)
VALUES
(
'fxhermesproducer'
,
'fx-hermes-producer'
,
'梁锦华'
,
'jhliang@ctrip.com'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003171'
,
'default'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003171'
,
'cluster1'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003172'
,
'default'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003172'
,
'cluster2'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003173'
,
'default'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'100003173'
,
'cluster3'
);
INSERT
INTO
Cluster
(
AppId
,
Name
)
VALUES
(
'fxhermesproducer'
,
'default'
);
INSERT
INTO
AppNamespace
(
AppId
,
Name
)
VALUES
(
'100003171'
,
'application'
);
INSERT
INTO
AppNamespace
(
AppId
,
Name
)
VALUES
(
'100003172'
,
'application'
);
INSERT
INTO
AppNamespace
(
AppId
,
Name
)
VALUES
(
'100003173'
,
'application'
);
INSERT
INTO
AppNamespace
(
AppID
,
Name
)
VALUES
(
'fxhermesproducer'
,
'application'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
1
,
'100003171'
,
'default'
,
'application'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
2
,
'fxhermesproducer'
,
'default'
,
'application'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
3
,
'100003172'
,
'default'
,
'application'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
4
,
'100003173'
,
'default'
,
'application'
);
INSERT
INTO
Namespace
(
Id
,
AppId
,
ClusterName
,
NamespaceName
)
VALUES
(
5
,
'100003171'
,
'default'
,
'application'
);
INSERT
INTO
Item
(
NamespaceId
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k1'
,
'v1'
,
'comment1'
);
INSERT
INTO
Item
(
NamespaceId
,
`Key`
,
Value
,
Comment
)
VALUES
(
1
,
'k2'
,
'v2'
,
'comment2'
);
INSERT
INTO
Item
(
NamespaceId
,
`Key`
,
Value
,
Comment
)
VALUES
(
2
,
'k3'
,
'v3'
,
'comment3'
);
INSERT
INTO
Item
(
NamespaceId
,
`Key`
,
Value
,
Comment
)
VALUES
(
5
,
'k3'
,
'v4'
,
'comment4'
);
INSERT
INTO
RELEASE
(
Name
,
Comment
,
AppId
,
ClusterName
,
NamespaceName
,
Configurations
)
VALUES
(
'REV1'
,
'First Release'
,
'100003171'
,
'default'
,
'application'
,
'{"k1":"v1"}'
);
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