当前位置: 首页>>代码示例>>Java>>正文


Java ServerName类代码示例

本文整理汇总了Java中org.apache.tajo.master.cluster.ServerName的典型用法代码示例。如果您正苦于以下问题:Java ServerName类的具体用法?Java ServerName怎么用?Java ServerName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ServerName类属于org.apache.tajo.master.cluster包,在下文中一共展示了ServerName类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCompareTo

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testCompareTo() {
	ServerName s1 = new ServerName("ex1.com:50030");
	ServerName s2 = new ServerName("ex1.com:60030");
	
	assertTrue(s1.compareTo(s2) < 0);
	assertTrue(s2.compareTo(s1) > 0);
	
	ServerName s3 = new ServerName("ex1.com:50030");
	assertTrue(s1.compareTo(s3) == 0);
	
	ServerName s4 = new ServerName("ex2.com:50030");
	assertTrue(s1.compareTo(s4) < 0);
	assertTrue(s4.compareTo(s1) > 0);
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:16,代码来源:TestServerName.java

示例2: testServerNameStringInt

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testServerNameStringInt() {
	ServerName server = new ServerName("ex1.com",50030);
	assertEquals("ex1.com", server.getHostname());
	assertEquals(50030, server.getPort());
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:7,代码来源:TestServerName.java

示例3: testServerNameString

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testServerNameString() {
	ServerName server = new ServerName("ex1.com:50030");
	assertEquals("ex1.com", server.getHostname());
	assertEquals(50030, server.getPort());
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:7,代码来源:TestServerName.java

示例4: testParseHostname

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testParseHostname() {
	assertEquals("ex1.com",ServerName.parseHostname("ex1.com:50030"));
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:5,代码来源:TestServerName.java

示例5: testParsePort

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testParsePort() {
	assertEquals(50030,ServerName.parsePort("ex1.com:50030"));
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:5,代码来源:TestServerName.java

示例6: testToString

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testToString() {
	ServerName server = new ServerName("ex1.com",50030);
	assertEquals("ex1.com:50030", server.toString());
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:6,代码来源:TestServerName.java

示例7: testGetServerName

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testGetServerName() {
	ServerName server = new ServerName("ex1.com",50030);
	assertEquals("ex1.com:50030", server.getServerName());
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:6,代码来源:TestServerName.java

示例8: testGetHostname

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testGetHostname() {
	ServerName server = new ServerName("ex1.com",50030);
	assertEquals("ex1.com", server.getHostname());
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:6,代码来源:TestServerName.java

示例9: testGetPort

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testGetPort() {
	ServerName server = new ServerName("ex1.com",50030);
	assertEquals(50030, server.getPort());
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:6,代码来源:TestServerName.java

示例10: testGetServerNameStringInt

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testGetServerNameStringInt() {
	assertEquals("ex2.com:50030",ServerName.getServerName("ex2.com", 50030));
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:5,代码来源:TestServerName.java

示例11: testException

import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test (expected = IllegalArgumentException.class)
public void testException() {
  new ServerName("ex1.com");
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:5,代码来源:TestServerName.java


注:本文中的org.apache.tajo.master.cluster.ServerName类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。