本文整理汇总了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);
}
示例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());
}
示例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());
}
示例4: testParseHostname
import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testParseHostname() {
assertEquals("ex1.com",ServerName.parseHostname("ex1.com:50030"));
}
示例5: testParsePort
import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testParsePort() {
assertEquals(50030,ServerName.parsePort("ex1.com:50030"));
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例10: testGetServerNameStringInt
import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test
public void testGetServerNameStringInt() {
assertEquals("ex2.com:50030",ServerName.getServerName("ex2.com", 50030));
}
示例11: testException
import org.apache.tajo.master.cluster.ServerName; //导入依赖的package包/类
@Test (expected = IllegalArgumentException.class)
public void testException() {
new ServerName("ex1.com");
}