當前位置: 首頁>>代碼示例>>Java>>正文


Java ServerProperties.setPort方法代碼示例

本文整理匯總了Java中org.springframework.boot.autoconfigure.web.ServerProperties.setPort方法的典型用法代碼示例。如果您正苦於以下問題:Java ServerProperties.setPort方法的具體用法?Java ServerProperties.setPort怎麽用?Java ServerProperties.setPort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.boot.autoconfigure.web.ServerProperties的用法示例。


在下文中一共展示了ServerProperties.setPort方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: serverProperties

import org.springframework.boot.autoconfigure.web.ServerProperties; //導入方法依賴的package包/類
@Bean
public ServerProperties serverProperties() {
	ServerProperties properties = new ServerProperties() {
		@Override
		public void customize(ConfigurableEmbeddedServletContainer container) {
			ServerPortConfig.this.count++;
			super.customize(container);
		}
	};
	properties.setPort(server.getPort());
	properties.setContextPath(server.getContextPath());
	return properties;
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:14,代碼來源:EndpointWebMvcAutoConfigurationTests.java

示例2: portFromServerProperties

import org.springframework.boot.autoconfigure.web.ServerProperties; //導入方法依賴的package包/類
@Test
public void portFromServerProperties() {
	ServerProperties properties = new ServerProperties();
	properties.setPort(1234);

	ServerPropertiesEndpointLocator locator = new ServerPropertiesEndpointLocator(
			properties, "unknown");

	assertThat(locator.local().port).isEqualTo((short) 1234);
}
 
開發者ID:reshmik,項目名稱:Zipkin,代碼行數:11,代碼來源:ServerPropertiesEndpointLocatorTests.java

示例3: portFromServerProperties

import org.springframework.boot.autoconfigure.web.ServerProperties; //導入方法依賴的package包/類
@Test
public void portFromServerProperties() {
	ServerProperties properties = new ServerProperties();
	properties.setPort(1234);

	ServerPropertiesHostLocator locator = new ServerPropertiesHostLocator(properties,
			"unknown");

	assertThat(locator.locate(this.span).getPort()).isEqualTo((short) 1234);
}
 
開發者ID:reshmik,項目名稱:Zipkin,代碼行數:11,代碼來源:ServerPropertiesHostLocatorTests.java

示例4: serverProperties

import org.springframework.boot.autoconfigure.web.ServerProperties; //導入方法依賴的package包/類
@Bean
public ServerProperties serverProperties() {
	ServerProperties properties = new ServerProperties() {
		@Override
		public void customize(ConfigurableEmbeddedServletContainer container) {
			ServerPortConfig.this.count++;
			super.customize(container);
		}
	};
	properties.setPort(ports.get().server);
	return properties;
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:13,代碼來源:EndpointWebMvcAutoConfigurationTests.java

示例5: portFromServerProperties

import org.springframework.boot.autoconfigure.web.ServerProperties; //導入方法依賴的package包/類
@Test
public void portFromServerProperties() throws UnknownHostException {
	ServerProperties properties = new ServerProperties();
	properties.setPort(1234);

	DefaultEndpointLocator locator = new DefaultEndpointLocator(null,
			properties, environment, new ZipkinProperties(),localAddress(ADDRESS1234));

	assertThat(locator.local().port()).isEqualTo(1234);
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-sleuth,代碼行數:11,代碼來源:DefaultEndpointLocatorConfigurationTest.java

示例6: negativePortFromServerProperties

import org.springframework.boot.autoconfigure.web.ServerProperties; //導入方法依賴的package包/類
@Test
public void negativePortFromServerProperties() throws UnknownHostException {
	ServerProperties properties = new ServerProperties();
	properties.setPort(-1);

	DefaultEndpointLocator locator = new DefaultEndpointLocator(null,
			properties, environment, new ZipkinProperties(),localAddress(ADDRESS1234));

	assertThat(locator.local().port()).isEqualTo(8080);
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-sleuth,代碼行數:11,代碼來源:DefaultEndpointLocatorConfigurationTest.java

示例7: portFromServerProperties

import org.springframework.boot.autoconfigure.web.ServerProperties; //導入方法依賴的package包/類
@Test
public void portFromServerProperties() throws UnknownHostException {
	ServerProperties properties = new ServerProperties();
	properties.setPort(1234);

	ServerPropertiesHostLocator locator = new ServerPropertiesHostLocator(properties,
			new MockEnvironment(), new ZipkinProperties(),localAddress(ADR1234));

	assertThat(locator.locate(this.span).getPort()).isEqualTo((short) 1234);
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-sleuth,代碼行數:11,代碼來源:ServerPropertiesHostLocatorTests.java

示例8: negativePortFromServerProperties

import org.springframework.boot.autoconfigure.web.ServerProperties; //導入方法依賴的package包/類
@Test
public void negativePortFromServerProperties() throws UnknownHostException {
	ServerProperties properties = new ServerProperties();
	properties.setPort(-1);

	ServerPropertiesHostLocator locator = new ServerPropertiesHostLocator(properties,
			new MockEnvironment(), new ZipkinProperties(),localAddress(ADR1234));

	assertThat(locator.locate(this.span).getPort()).isEqualTo((short) 8080);
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-sleuth,代碼行數:11,代碼來源:ServerPropertiesHostLocatorTests.java

示例9: serverProperties

import org.springframework.boot.autoconfigure.web.ServerProperties; //導入方法依賴的package包/類
@Bean
public ServerProperties serverProperties() {
    ServerProperties properties = new ServerProperties();
    properties.setPort(0);
    return properties;
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:7,代碼來源:RestApiAutoConfigurationTest.java


注:本文中的org.springframework.boot.autoconfigure.web.ServerProperties.setPort方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。