Browse Source

modify gateway's test unit

tags/1.1.10
shaozhuguang 5 years ago
parent
commit
baad0876f5
2 changed files with 22 additions and 6 deletions
  1. +10
    -3
      source/gateway/src/test/java/test/com/jd/blockchain/gateway/GatewayConfigPropertiesTest.java
  2. +12
    -3
      source/gateway/src/test/resources/gateway.conf

+ 10
- 3
source/gateway/src/test/java/test/com/jd/blockchain/gateway/GatewayConfigPropertiesTest.java View File

@@ -7,7 +7,9 @@ import static org.junit.Assert.assertTrue;

import java.io.IOException;
import java.io.InputStream;
import java.util.Set;

import com.jd.blockchain.utils.net.NetworkAddress;
import org.junit.Test;
import org.springframework.core.io.ClassPathResource;

@@ -27,9 +29,14 @@ public class GatewayConfigPropertiesTest {
assertEquals(8081, configProps.http().getPort());
assertNull(configProps.http().getContextPath());

assertEquals("127.0.0.1", configProps.masterPeerAddress().getHost());
assertEquals(12000, configProps.masterPeerAddress().getPort());
assertTrue(configProps.masterPeerAddress().isSecure());
Set<NetworkAddress> networkAddresses = configProps.masterPeerAddresses();
assertEquals(2, networkAddresses.size());

for(NetworkAddress networkAddress : networkAddresses) {
assertEquals("127.0.0.1", networkAddress.getHost());
assertEquals(12000, networkAddress.getPort());
assertTrue(networkAddress.isSecure());
}

assertEquals("http://127.0.0.1:10001", configProps.dataRetrievalUrl());



+ 12
- 3
source/gateway/src/test/resources/gateway.conf View File

@@ -5,12 +5,21 @@ http.port=8081
#网关的HTTP服务上下文路径,可选;
#http.context-path=

#对端Peer节点的数量
peer.size=2
#共识节点的服务地址(与该网关节点连接的Peer节点的IP地址);
peer.host=127.0.0.1
peer.0.host=127.0.0.1
#共识节点的服务端口(与该网关节点连接的Peer节点的端口);
peer.port=12000
peer.0.port=12000
#共识节点的服务是否启用安全证书;
peer.secure=true
peer.0.secure=true
#共识节点的服务地址(与该网关节点连接的Peer节点的IP地址);
peer.1.host=127.0.0.1
#共识节点的服务端口(与该网关节点连接的Peer节点的端口);
peer.1.port=12000
#共识节点的服务是否启用安全证书;
peer.1.secure=true

#共识节点的服务提供解析器
#BftSmart共识Provider:com.jd.blockchain.consensus.bftsmart.BftsmartConsensusProvider
#简单消息共识Provider:com.jd.blockchain.consensus.mq.MsgQueueConsensusProvider


Loading…
Cancel
Save