• 大小: 767KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-01
  • 语言: 其他
  • 标签: Spring  cloud  

资源简介

Spring微服务实战一书源码,从异步图书免费获取,本书以一个实际项目为主线,介绍云、微服务等概念以及Spring Boot和Spring Cloud等诸多Spring项目,并介绍如何将该项目一步一步地从单体架构重构成微服务架构,最终将这个项目拆分成众多微服务,让它们运行在各自的Docker容器中,实现持续集成/持续部署,并最终自动部署到云环境(亚马逊云)中。

资源截图

代码片段和文件信息

import unittest
import logging
import json
import string
import argparse
import os
from httplib2 import Http

class TestConfigServer(unittest.TestCase):

    def call_config_service(selfserviceNameserviceEnv):
         targetUri = “http://{}:8888/{}/{}“.format(containerIPserviceNameserviceEnv)
         http_obj = Http(“.cache“)
         (resp content) = http_obj.request(
         uri=targetUri
         method=‘GET‘
         headers={‘Content-Type‘: ‘application/json; charset=UTF-8‘ ‘connection‘: ‘close‘})
         return respcontent


    def test_licensingservice_aws_dev(self):
         http_obj = Http(“.cache“)
         (resp content) = self.call_config_service(“licensingservice““aws-dev“)
         results = json.loads(content.decode(“utf-8“))
         self.assertEqual(resp.status 200)
         self.assertEquals(“https://github.com/carnellj/config-repo/licensingservice/licensingservice-aws-dev.yml“
                           results[“propertySources“][0][“name“])

    def test_licensingservice_default(self):
         http_obj = Http(“.cache“)
         (resp content) = self.call_config_service(“licensingservice““default“)
         results = json.loads(content.decode(“utf-8“))
         self.assertEqual(resp.status 200)
         self.assertEquals(“https://github.com/carnellj/config-repo/licensingservice/licensingservice.yml“
                           results[“propertySources“][0][“name“])

    def test_organizationservice_default(self):
         http_obj = Http(“.cache“)
         (resp content) = self.call_config_service(“organizationservice““default“)
         results = json.loads(content.decode(“utf-8“))
         self.assertEqual(resp.status 200)
         self.assertEquals(“https://github.com/carnellj/config-repo/organizationservice/organizationservice.yml“
                           results[“propertySources“][0][“name“])

    def test_organizationservice_aws_dev(self):
         http_obj = Http(“.cache“)
         (resp content) = self.call_config_service(“organizationservice““aws-dev“)
         results = json.loads(content.decode(“utf-8“))
         self.assertEqual(resp.status 200)
         self.assertEquals(“https://github.com/carnellj/config-repo/organizationservice/organizationservice-aws-dev.yml“
                           results[“propertySources“][0][“name“])




if __name__ == ‘__main__‘:
    containerIP = os.getenv(‘CONTAINER_IP‘“192.168.99.100“)
    print “Running config service platform tests against container ip: {}“.format(containerIP)
    unittest.main()

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-06-02 04:42  final_code\
     目录           0  2017-04-08 15:05  final_code\chapter10-platform-tests-master\
     文件         201  2017-04-08 15:05  final_code\chapter10-platform-tests-master\.gitignore
     文件        1936  2017-04-08 15:05  final_code\chapter10-platform-tests-master\.travis.yml
     文件         130  2017-04-08 15:05  final_code\chapter10-platform-tests-master\run_all.sh
     文件        2540  2017-04-08 15:05  final_code\chapter10-platform-tests-master\test_config_server.py
     文件        1597  2017-04-08 15:05  final_code\chapter10-platform-tests-master\test_eureka_server.py
     文件        4037  2017-04-08 15:05  final_code\chapter10-platform-tests-master\test_zuul_service.py
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\
     文件          17  2017-04-28 09:05  final_code\spmia-chapter1-master\.gitattributes
     文件         194  2017-04-28 09:05  final_code\spmia-chapter1-master\.gitignore
     文件        2034  2017-04-28 09:05  final_code\spmia-chapter1-master\.travis.yml
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\docker\
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\docker\common\
     文件         128  2017-04-28 09:05  final_code\spmia-chapter1-master\docker\common\docker-compose.yml
     文件        1111  2017-04-28 09:05  final_code\spmia-chapter1-master\pom.xml
     文件        2084  2017-04-28 09:05  final_code\spmia-chapter1-master\README.md
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\
     文件        2816  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\pom.xml
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\src\
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\src\main\
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\src\main\docker\
     文件         234  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\src\main\docker\Dockerfile
     文件         236  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\src\main\docker\run.sh
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\src\main\java\
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\src\main\java\com\
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\src\main\java\com\thoughtmechanix\
     目录           0  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\src\main\java\com\thoughtmechanix\simpleservice\
     文件         933  2017-04-28 09:05  final_code\spmia-chapter1-master\simpleservice\src\main\java\com\thoughtmechanix\simpleservice\Application.java
     目录           0  2017-05-13 11:36  final_code\spmia-chapter10-master\
     文件         194  2017-05-13 11:36  final_code\spmia-chapter10-master\.gitignore
............此处省略1492个文件信息

评论

共有 条评论