Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client integration test and integrate foundation framework
- Loading branch information
Showing
55 changed files
with
912 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,69 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<parent> | ||
<groupId>com.ctrip.apollo</groupId> | ||
<artifactId>apollo</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>apollo-client</artifactId> | ||
<name>Apollo Client</name> | ||
<properties> | ||
<java.version>1.7</java.version> | ||
</properties> | ||
<dependencies> | ||
<!-- apollo --> | ||
<dependency> | ||
<groupId>com.ctrip.apollo</groupId> | ||
<artifactId>apollo-core</artifactId> | ||
</dependency> | ||
<!-- end of apollo --> | ||
<dependency> | ||
<groupId>com.ctrip.framework</groupId> | ||
<artifactId>framework-foundation</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.dianping.cat</groupId> | ||
<artifactId>cat-client</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-slf4j-impl</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-core</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<parent> | ||
<groupId>com.ctrip.apollo</groupId> | ||
<artifactId>apollo</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>apollo-client</artifactId> | ||
<name>Apollo Client</name> | ||
<properties> | ||
<java.version>1.7</java.version> | ||
</properties> | ||
<dependencies> | ||
<!-- apollo --> | ||
<dependency> | ||
<groupId>com.ctrip.apollo</groupId> | ||
<artifactId>apollo-core</artifactId> | ||
</dependency> | ||
<!-- end of apollo --> | ||
<!-- foundation service --> | ||
<dependency> | ||
<groupId>com.ctrip.framework</groupId> | ||
<artifactId>framework-foundation</artifactId> | ||
</dependency> | ||
<!-- end of foundation service --> | ||
<!-- cat --> | ||
<dependency> | ||
<groupId>com.dianping.cat</groupId> | ||
<artifactId>cat-client</artifactId> | ||
</dependency> | ||
<!-- end of cat --> | ||
<!-- log --> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-slf4j-impl</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-core</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<!-- end of log --> | ||
<!-- test --> | ||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-server</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- end of test --> | ||
</dependencies> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
apollo-client/src/main/java/com/ctrip/apollo/constants/Constants.java
This file was deleted.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
apollo-client/src/main/java/com/ctrip/apollo/env/Apollo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package com.ctrip.apollo.env; | ||
|
||
import com.google.common.base.Strings; | ||
|
||
import com.ctrip.apollo.core.enums.Env; | ||
import com.ctrip.framework.foundation.Foundation; | ||
|
||
public class Apollo { | ||
private static Env s_env; | ||
private static String s_appId; | ||
private static String s_cluster; | ||
|
||
static { | ||
setEnv(Foundation.server().getEnvType()); | ||
|
||
s_appId = Foundation.app().getAppId(); | ||
|
||
s_cluster = System.getProperty("apollo.cluster"); | ||
} | ||
|
||
public static String getAppId() { | ||
return s_appId; | ||
} | ||
|
||
public static Env getEnv() { | ||
return s_env; | ||
} | ||
|
||
public static String getCluster() { | ||
return s_cluster; | ||
} | ||
|
||
private static void setEnv(String envName) { | ||
if (Strings.isNullOrEmpty(envName)) { | ||
return; | ||
} | ||
switch (envName.toUpperCase()) { | ||
case "LPT": | ||
s_env = Env.LPT; | ||
break; | ||
case "FAT": | ||
s_env = Env.FAT; | ||
break; | ||
case "UAT": | ||
s_env = Env.UAT; | ||
break; | ||
case "PRO": | ||
s_env = Env.PRO; | ||
break; | ||
case "DEV": | ||
s_env = Env.DEV; | ||
break; | ||
case "LOCAL": | ||
s_env = Env.LOCAL; | ||
break; | ||
default: | ||
//do nothing | ||
break; | ||
} | ||
} | ||
|
||
} |
59 changes: 0 additions & 59 deletions
59
apollo-client/src/main/java/com/ctrip/apollo/env/ClientEnvironment.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.