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
ac0e32ed
Commit
ac0e32ed
authored
Mar 15, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ServiceDiscovery based on ZK
parent
047000dc
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
347 additions
and
26 deletions
+347
-26
apollo-configserver/pom.xml
apollo-configserver/pom.xml
+13
-0
apollo-configserver/src/main/java/com/ctrip/apollo/configserver/ConfigServerApplication.java
...om/ctrip/apollo/configserver/ConfigServerApplication.java
+3
-1
apollo-configserver/src/main/resources/application.yml
apollo-configserver/src/main/resources/application.yml
+2
-0
apollo-configserver/src/main/resources/bootstrap.yml
apollo-configserver/src/main/resources/bootstrap.yml
+3
-2
apollo-configserver/src/test/java/com/ctrip/apollo/configserver/AbstractConfigServerTest.java
...m/ctrip/apollo/configserver/AbstractConfigServerTest.java
+31
-0
apollo-configserver/src/test/java/com/ctrip/apollo/configserver/AllTests.java
...src/test/java/com/ctrip/apollo/configserver/AllTests.java
+13
-0
apollo-configserver/src/test/java/com/ctrip/apollo/configserver/ConfigServerApplicationTestConfiguration.java
...onfigserver/ConfigServerApplicationTestConfiguration.java
+8
-0
apollo-configserver/src/test/resources/application.properties
...lo-configserver/src/test/resources/application.properties
+0
-3
apollo-configserver/src/test/resources/application.yml
apollo-configserver/src/test/resources/application.yml
+14
-0
apollo-configserver/src/test/resources/bootstrap.yml
apollo-configserver/src/test/resources/bootstrap.yml
+7
-0
apollo-core/src/main/java/com/ctrip/apollo/core/ServiceIdConsts.java
.../src/main/java/com/ctrip/apollo/core/ServiceIdConsts.java
+10
-0
apollo-metaserver/pom.xml
apollo-metaserver/pom.xml
+14
-2
apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/MetaServerApplication.java
...va/com/ctrip/apollo/metaserver/MetaServerApplication.java
+13
-1
apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/service/DiscoveryService.java
...com/ctrip/apollo/metaserver/service/DiscoveryService.java
+29
-0
apollo-metaserver/src/main/resources/application.yml
apollo-metaserver/src/main/resources/application.yml
+8
-0
apollo-metaserver/src/main/resources/bootstrap.yml
apollo-metaserver/src/main/resources/bootstrap.yml
+4
-0
apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/AbstractMetaServerTest.java
...a/com/ctrip/apollo/metaserver/AbstractMetaServerTest.java
+31
-0
apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/AllTests.java
...r/src/test/java/com/ctrip/apollo/metaserver/AllTests.java
+13
-0
apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/MetaServerApplicationTestConfiguration.java
...lo/metaserver/MetaServerApplicationTestConfiguration.java
+10
-0
apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/service/ServiceDiscoveryTest.java
...ctrip/apollo/metaserver/service/ServiceDiscoveryTest.java
+21
-0
apollo-metaserver/src/test/resources/application.yml
apollo-metaserver/src/test/resources/application.yml
+8
-0
apollo-metaserver/src/test/resources/bootstrap.yml
apollo-metaserver/src/test/resources/bootstrap.yml
+4
-0
apollo-portal/src/main/java/com/ctrip/apollo/portal/repository/PrivilegeRepository.java
...m/ctrip/apollo/portal/repository/PrivilegeRepository.java
+3
-1
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/PrivilegeService.java
...ava/com/ctrip/apollo/portal/service/PrivilegeService.java
+19
-10
apollo-portal/src/test/java/com/ctrip/apollo/portal/service/PrivilegeServiceTest.java
...com/ctrip/apollo/portal/service/PrivilegeServiceTest.java
+11
-6
framework-parent/pom.xml
framework-parent/pom.xml
+48
-0
pom.xml
pom.xml
+7
-0
No files found.
apollo-configserver/pom.xml
View file @
ac0e32ed
...
...
@@ -19,6 +19,14 @@
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-config-server
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-zookeeper-discovery
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.curator
</groupId>
<artifactId>
curator-x-discovery
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
...
...
@@ -40,6 +48,11 @@
<artifactId>
mysql-connector-java
</artifactId>
<scope>
runtime
</scope>
</dependency>
<dependency>
<groupId>
org.apache.curator
</groupId>
<artifactId>
curator-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
...
...
apollo-configserver/src/main/java/com/ctrip/apollo/server/ConfigServerApplication.java
→
apollo-configserver/src/main/java/com/ctrip/apollo/
config
server/ConfigServerApplication.java
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
server
;
package
com
.
ctrip
.
apollo
.
config
server
;
import
com.jcraft.jsch.JSch
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.config.server.EnableConfigServer
;
@SpringBootApplication
@EnableConfigServer
@EnableDiscoveryClient
public
class
ConfigServerApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
apollo-configserver/src/main/resources/application.yml
View file @
ac0e32ed
spring
:
application
:
name
:
apollo-configserver
cloud
:
config
:
server
:
...
...
apollo-configserver/src/main/resources/bootstrap.yml
View file @
ac0e32ed
spring
:
application
:
name
:
apollo-server
\ No newline at end of file
cloud
:
zookeeper
:
connectString
:
10.3.2.57:2181,10.3.2.58:2181,10.3.2.59:2181
\ No newline at end of file
apollo-configserver/src/test/java/com/ctrip/apollo/configserver/AbstractConfigServerTest.java
0 → 100644
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
configserver
;
import
java.io.IOException
;
import
org.apache.curator.test.TestingServer
;
import
org.junit.AfterClass
;
import
org.junit.BeforeClass
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
(
classes
=
ConfigServerApplicationTestConfiguration
.
class
)
public
abstract
class
AbstractConfigServerTest
{
private
static
TestingServer
zkTestServer
;
@BeforeClass
public
static
void
beforeClass
()
throws
Exception
{
zkTestServer
=
new
TestingServer
(
2181
,
false
);
zkTestServer
.
start
();
System
.
out
.
format
(
"embedded zookeeper is up %s%n"
,
zkTestServer
.
getConnectString
());
}
@AfterClass
public
static
void
afterClass
()
throws
IOException
{
if
(
zkTestServer
!=
null
)
{
zkTestServer
.
close
();
}
}
}
apollo-configserver/src/test/java/com/ctrip/apollo/configserver/AllTests.java
0 → 100644
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
configserver
;
import
org.junit.runner.RunWith
;
import
org.junit.runners.Suite
;
import
org.junit.runners.Suite.SuiteClasses
;
@RunWith
(
Suite
.
class
)
@SuiteClasses
({
})
public
class
AllTests
{
}
apollo-configserver/src/test/java/com/ctrip/apollo/configserver/ConfigServerApplicationTestConfiguration.java
0 → 100644
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
configserver
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
ConfigServerApplicationTestConfiguration
{
}
apollo-configserver/src/test/resources/application.properties
deleted
100644 → 0
View file @
047000dc
spring.datasource.url
=
jdbc:h2:file:~/fxapolloconfigdb;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.username
=
sa
spring.datasource.password
=
sa
apollo-configserver/src/test/resources/application.yml
0 → 100644
View file @
ac0e32ed
server
:
port
:
8888
logging
:
level
:
org.springframework.cloud
:
'
DEBUG'
spring
:
profiles
:
active
:
native
datasource
:
url
:
jdbc:h2:file:~/fxapolloconfigdb;DB_CLOSE_ON_EXIT=FALSE
username
:
sa
password
:
apollo-configserver/src/test/resources/bootstrap.yml
0 → 100644
View file @
ac0e32ed
spring
:
application
:
name
:
apollo-configserver
cloud
:
zookeeper
:
connectString:localhost:2181
\ No newline at end of file
apollo-core/src/main/java/com/ctrip/apollo/core/ServiceIdConsts.java
0 → 100644
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
core
;
public
class
ServiceIdConsts
{
public
static
final
String
APOLLO_METASERVER
=
"apollo-metaserver"
;
public
static
final
String
APOLLO_CONFIGSERVER
=
"apollo-configserver"
;
public
static
final
String
APOLLO_PORTAL
=
"apollo-portal"
;
}
apollo-metaserver/pom.xml
View file @
ac0e32ed
...
...
@@ -15,13 +15,25 @@
<groupId>
com.ctrip.apollo
</groupId>
<artifactId>
apollo-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-config
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-zookeeper-discovery
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.curator
</groupId>
<artifactId>
curator-x-discovery
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.
springframework.boot
</groupId>
<artifactId>
spring-boot-starte
r-test
</artifactId>
<groupId>
org.
apache.curator
</groupId>
<artifactId>
curato
r-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
...
...
apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/MetaServerApplication.java
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
metaserver
;
import
java.util.List
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.context.ApplicationContext
;
import
com.ctrip.apollo.metaserver.service.DiscoveryService
;
@SpringBootApplication
@EnableDiscoveryClient
public
class
MetaServerApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
MetaServerApplication
.
class
,
args
);
ApplicationContext
context
=
SpringApplication
.
run
(
MetaServerApplication
.
class
,
args
);
List
<
ServiceInstance
>
metaServerServiceInstances
=
context
.
getBean
(
DiscoveryService
.
class
).
getMetaServerServiceInstances
();
System
.
out
.
println
(
metaServerServiceInstances
);
}
}
apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/service/DiscoveryService.java
0 → 100644
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
metaserver
.
service
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.stereotype.Service
;
import
com.ctrip.apollo.core.ServiceIdConsts
;
@Service
public
class
DiscoveryService
{
@Autowired
private
DiscoveryClient
discoveryClient
;
public
List
<
ServiceInstance
>
getConfigServerServiceInstances
()
{
List
<
ServiceInstance
>
instances
=
discoveryClient
.
getInstances
(
ServiceIdConsts
.
APOLLO_CONFIGSERVER
);
return
instances
;
}
public
List
<
ServiceInstance
>
getMetaServerServiceInstances
()
{
List
<
ServiceInstance
>
instances
=
discoveryClient
.
getInstances
(
ServiceIdConsts
.
APOLLO_METASERVER
);
return
instances
;
}
}
apollo-metaserver/src/main/resources/application.yml
0 → 100644
View file @
ac0e32ed
server
:
port
:
80
spring
:
application
:
name
:
apollo-metaserver
profiles
:
active
:
native
apollo-metaserver/src/main/resources/bootstrap.yml
0 → 100644
View file @
ac0e32ed
spring
:
cloud
:
zookeeper
:
connectString
:
10.3.2.57:2181,10.3.2.58:2181,10.3.2.59:2181
\ No newline at end of file
apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/AbstractMetaServerTest.java
0 → 100644
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
metaserver
;
import
java.io.IOException
;
import
org.apache.curator.test.TestingServer
;
import
org.junit.AfterClass
;
import
org.junit.BeforeClass
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
(
classes
=
MetaServerApplicationTestConfiguration
.
class
)
public
abstract
class
AbstractMetaServerTest
{
private
static
TestingServer
zkTestServer
;
@BeforeClass
public
static
void
beforeClass
()
throws
Exception
{
zkTestServer
=
new
TestingServer
(
2181
,
false
);
zkTestServer
.
start
();
System
.
out
.
format
(
"embedded zookeeper is up %s%n"
,
zkTestServer
.
getConnectString
());
}
@AfterClass
public
static
void
afterClass
()
throws
IOException
{
if
(
zkTestServer
!=
null
)
{
zkTestServer
.
close
();
}
}
}
apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/AllTests.java
0 → 100644
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
metaserver
;
import
org.junit.runner.RunWith
;
import
org.junit.runners.Suite
;
import
org.junit.runners.Suite.SuiteClasses
;
@RunWith
(
Suite
.
class
)
@SuiteClasses
({
})
public
class
AllTests
{
}
apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/MetaServerApplicationTestConfiguration.java
0 → 100644
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
metaserver
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
@SpringBootApplication
//@EnableDiscoveryClient
public
class
MetaServerApplicationTestConfiguration
{
}
apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/service/ServiceDiscoveryTest.java
0 → 100644
View file @
ac0e32ed
package
com
.
ctrip
.
apollo
.
metaserver
.
service
;
import
java.util.List
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.client.ServiceInstance
;
import
com.ctrip.apollo.metaserver.AbstractMetaServerTest
;
public
class
ServiceDiscoveryTest
extends
AbstractMetaServerTest
{
@Autowired
private
DiscoveryService
discoveryService
;
@Test
public
void
testGetLocalMetaServerServices
()
{
List
<
ServiceInstance
>
instances
=
discoveryService
.
getMetaServerServiceInstances
();
System
.
out
.
println
(
instances
);
}
}
apollo-metaserver/src/test/resources/application.yml
0 → 100644
View file @
ac0e32ed
server
:
port
:
80
spring
:
application
:
name
:
apollo-metaserver
profiles
:
active
:
native
apollo-metaserver/src/test/resources/bootstrap.yml
0 → 100644
View file @
ac0e32ed
spring
:
cloud
:
zookeeper
:
connectString
:
localhost:2181
\ No newline at end of file
apollo-portal/src/main/java/com/ctrip/apollo/portal/repository/PrivilegeRepository.java
View file @
ac0e32ed
...
...
@@ -10,5 +10,7 @@ public interface PrivilegeRepository extends PagingAndSortingRepository<Privileg
List
<
Privilege
>
findByAppId
(
String
appId
);
Privilege
findByAppIdAndPrivilType
(
String
appId
,
String
privilType
);
List
<
Privilege
>
findByAppIdAndPrivilType
(
String
appId
,
String
privilType
);
Privilege
findByAppIdAndNameAndPrivilType
(
String
appId
,
String
name
,
String
privilType
);
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/PrivilegeService.java
View file @
ac0e32ed
...
...
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
com.ctrip.apollo.portal.entity.Privilege
;
import
com.ctrip.apollo.portal.exception.NotFoundException
;
import
com.ctrip.apollo.portal.repository.PrivilegeRepository
;
@Service
...
...
@@ -18,24 +19,32 @@ public class PrivilegeService {
@Autowired
private
PrivilegeRepository
privilRepo
;
public
Privilege
addPrivilege
(
String
appId
,
String
name
,
PrivilType
privilType
)
{
Privilege
privil
=
privilRepo
.
findByAppIdAndNameAndPrivilType
(
appId
,
name
,
privilType
.
name
());
if
(
privil
==
null
)
{
privil
=
new
Privilege
();
privil
.
setAppId
(
appId
);
privil
.
setPrivilType
(
privilType
.
name
());
privil
.
setName
(
name
);
privilRepo
.
save
(
privil
);
}
return
privil
;
}
public
boolean
hasPrivilege
(
String
appId
,
String
name
,
PrivilType
privilType
)
{
Privilege
privil
=
privilRepo
.
findByAppIdAndPrivilType
(
appId
,
privilType
.
name
());
if
(
privil
!=
null
&&
privil
.
getName
().
equals
(
name
))
return
true
;
return
false
;
Privilege
privil
=
privilRepo
.
findByAppIdAndNameAndPrivilType
(
appId
,
name
,
privilType
.
name
());
return
(
privil
!=
null
)
?
true
:
false
;
}
public
List
<
Privilege
>
listPrivileges
(
String
appId
)
{
return
privilRepo
.
findByAppId
(
appId
);
}
public
Privilege
set
Privilege
(
String
appId
,
String
name
,
PrivilType
privilType
)
{
Privilege
privil
=
privilRepo
.
findByAppIdAnd
PrivilType
(
appId
,
privilType
.
name
());
public
void
remove
Privilege
(
String
appId
,
String
name
,
PrivilType
privilType
)
{
Privilege
privil
=
privilRepo
.
findByAppIdAnd
NameAndPrivilType
(
appId
,
name
,
privilType
.
name
());
if
(
privil
==
null
)
{
privil
=
new
Privilege
();
privil
.
setAppId
(
appId
);
privil
.
setPrivilType
(
privilType
.
name
());
throw
new
NotFoundException
();
}
privil
.
setName
(
name
);
return
privilRepo
.
save
(
privil
);
privilRepo
.
delete
(
privil
);
}
}
apollo-portal/src/test/java/com/ctrip/apollo/portal/service/PrivilegeServiceTest.java
View file @
ac0e32ed
...
...
@@ -19,19 +19,24 @@ public class PrivilegeServiceTest extends AbstractPortalTest {
PrivilegeService
privilService
;
@Test
public
void
testAddPrivilege
()
{
public
void
testAdd
AndRemove
Privilege
()
{
App
newApp
=
new
App
();
newApp
.
setAppId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
newApp
.
setName
(
"new app "
+
System
.
currentTimeMillis
());
newApp
.
setOwner
(
"owner "
+
System
.
currentTimeMillis
());
appService
.
save
(
newApp
);
privilService
.
set
Privilege
(
newApp
.
getAppId
(),
newApp
.
getOwner
(),
privilService
.
add
Privilege
(
newApp
.
getAppId
(),
newApp
.
getOwner
(),
PrivilegeService
.
PrivilType
.
EDIT
);
List
<
Privilege
>
privileges
=
privilService
.
listPrivileges
(
newApp
.
getAppId
());
Assert
.
assertEquals
(
1
,
privileges
.
size
());
Assert
.
assertEquals
(
PrivilegeService
.
PrivilType
.
EDIT
.
name
(),
privileges
.
get
(
0
).
getPrivilType
());
Assert
.
assertEquals
(
newApp
.
getOwner
(),
privileges
.
get
(
0
).
getName
());
privilService
.
removePrivilege
(
newApp
.
getAppId
(),
newApp
.
getOwner
(),
PrivilegeService
.
PrivilType
.
EDIT
);
privileges
=
privilService
.
listPrivileges
(
newApp
.
getAppId
());
Assert
.
assertEquals
(
0
,
privileges
.
size
());
}
@Test
...
...
@@ -42,7 +47,7 @@ public class PrivilegeServiceTest extends AbstractPortalTest {
newApp
.
setOwner
(
"owner "
+
System
.
currentTimeMillis
());
appService
.
save
(
newApp
);
privilService
.
set
Privilege
(
newApp
.
getAppId
(),
newApp
.
getOwner
(),
privilService
.
add
Privilege
(
newApp
.
getAppId
(),
newApp
.
getOwner
(),
PrivilegeService
.
PrivilType
.
EDIT
);
Assert
.
assertTrue
(
privilService
.
hasPrivilege
(
newApp
.
getAppId
(),
newApp
.
getOwner
(),
PrivilegeService
.
PrivilType
.
EDIT
));
...
...
@@ -51,13 +56,13 @@ public class PrivilegeServiceTest extends AbstractPortalTest {
Assert
.
assertFalse
(
privilService
.
hasPrivilege
(
newApp
.
getAppId
(),
newApp
.
getOwner
(),
PrivilegeService
.
PrivilType
.
RELEASE
));
privilService
.
set
Privilege
(
newApp
.
getAppId
(),
"nobody"
,
PrivilegeService
.
PrivilType
.
EDIT
);
privilService
.
add
Privilege
(
newApp
.
getAppId
(),
"nobody"
,
PrivilegeService
.
PrivilType
.
EDIT
);
Assert
.
assertTrue
(
privilService
.
hasPrivilege
(
newApp
.
getAppId
(),
"nobody"
,
PrivilegeService
.
PrivilType
.
EDIT
));
Assert
.
assert
Fals
e
(
privilService
.
hasPrivilege
(
newApp
.
getAppId
(),
newApp
.
getOwner
(),
Assert
.
assert
Tru
e
(
privilService
.
hasPrivilege
(
newApp
.
getAppId
(),
newApp
.
getOwner
(),
PrivilegeService
.
PrivilType
.
EDIT
));
privilService
.
set
Privilege
(
newApp
.
getAppId
(),
"nobody"
,
PrivilegeService
.
PrivilType
.
RELEASE
);
privilService
.
add
Privilege
(
newApp
.
getAppId
(),
"nobody"
,
PrivilegeService
.
PrivilType
.
RELEASE
);
Assert
.
assertTrue
(
privilService
.
hasPrivilege
(
newApp
.
getAppId
(),
"nobody"
,
PrivilegeService
.
PrivilType
.
RELEASE
));
}
...
...
framework-parent/pom.xml
View file @
ac0e32ed
...
...
@@ -15,7 +15,55 @@
<properties>
<java.version>
1.7
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<junit.version>
4.12
</junit.version>
<guava.version>
19.0
</guava.version>
<slf4j-api.version>
1.7.19
</slf4j-api.version>
<httpclient.version>
4.5.2
</httpclient.version>
<httpcore.version>
4.4.4
</httpcore.version>
<fastjson.version>
1.2.8
</fastjson.version>
<netty-all.version>
4.0.34.Final
</netty-all.version>
<commons-codec.version>
1.10
</commons-codec.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
${junit.version}
</version>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<version>
${guava.version}
</version>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
<version>
${slf4j-api.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
${httpclient.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpcore
</artifactId>
<version>
${httpcore.version}
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
${fastjson.version}
</version>
</dependency>
<dependency>
<groupId>
io.netty
</groupId>
<artifactId>
netty-all
</artifactId>
<version>
${netty-all.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
...
...
pom.xml
View file @
ac0e32ed
...
...
@@ -116,6 +116,13 @@
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-zookeeper
</artifactId>
<version>
1.0.0.M5
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
...
...
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