亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gposrecordtest.java

?? DNS Java 是java實現的DNS
?? JAVA
字號:
// -*- Java -*-//// Copyright (c) 2005, Matthew J. Rutherford <rutherfo@cs.colorado.edu>// Copyright (c) 2005, University of Colorado at Boulder// All rights reserved.// // Redistribution and use in source and binary forms, with or without// modification, are permitted provided that the following conditions are// met:// // * Redistributions of source code must retain the above copyright//   notice, this list of conditions and the following disclaimer.// // * Redistributions in binary form must reproduce the above copyright//   notice, this list of conditions and the following disclaimer in the//   documentation and/or other materials provided with the distribution.// // * Neither the name of the University of Colorado at Boulder nor the//   names of its contributors may be used to endorse or promote//   products derived from this software without specific prior written//   permission.// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.//package org.xbill.DNS;import	java.io.IOException;import	java.util.Arrays;import	junit.framework.Test;import	junit.framework.TestCase;import	junit.framework.TestSuite;public class GPOSRecordTest extends TestCase{    public void test_ctor_0arg()    {	GPOSRecord gr = new GPOSRecord();	assertNull(gr.getName());	assertEquals(0, gr.getType());	assertEquals(0, gr.getDClass());	assertEquals(0, gr.getTTL());    }        public void test_getObject()    {	GPOSRecord gr = new GPOSRecord();	Record r = gr.getObject();	assertTrue(r instanceof GPOSRecord);    }    public static class Test_Ctor_6arg_doubles extends TestCase    {	private Name	m_n;	private long	m_ttl;	private double	m_lat, m_long, m_alt;	protected void setUp() throws TextParseException	{	    m_n = Name.fromString("The.Name.");	    m_ttl = 0xABCDL;	    m_lat = -10.43;	    m_long = 76.12;	    m_alt = 100.101;	}		public void test_basic() throws TextParseException	{	    GPOSRecord gr = new GPOSRecord(m_n, DClass.IN, m_ttl,					   m_long, m_lat, m_alt);	    assertEquals(m_n, gr.getName());	    assertEquals(DClass.IN, gr.getDClass());	    assertEquals(Type.GPOS, gr.getType());	    assertEquals(m_ttl, gr.getTTL());	    assertEquals(new Double(m_long), new Double(gr.getLongitude()));	    assertEquals(new Double(m_lat), new Double(gr.getLatitude()));	    assertEquals(new Double(m_alt), new Double(gr.getAltitude()));	    assertEquals(new Double(m_long).toString(), gr.getLongitudeString());	    assertEquals(new Double(m_lat).toString(), gr.getLatitudeString());	    assertEquals(new Double(m_alt).toString(), gr.getAltitudeString());	}	public void test_toosmall_longitude() throws TextParseException	{	    try {		new GPOSRecord(m_n, DClass.IN, m_ttl,			       -90.001, m_lat, m_alt);		fail("IllegalArgumentException not thrown");	    }	    catch(IllegalArgumentException e){}	}	public void test_toobig_longitude() throws TextParseException	{	    try {		new GPOSRecord(m_n, DClass.IN, m_ttl,			       90.001, m_lat, m_alt);		fail("IllegalArgumentException not thrown");	    }	    catch(IllegalArgumentException e){}	}	public void test_toosmall_latitude() throws TextParseException	{	    try {		new GPOSRecord(m_n, DClass.IN, m_ttl,			       m_long, -180.001, m_alt);		fail("IllegalArgumentException not thrown");	    }	    catch(IllegalArgumentException e){}	}	public void test_toobig_latitude() throws TextParseException	{	    try {		new GPOSRecord(m_n, DClass.IN, m_ttl,			       m_long, 180.001, m_alt);		fail("IllegalArgumentException not thrown");	    }	    catch(IllegalArgumentException e){}	}	public void test_invalid_string()	{	    try {		new GPOSRecord(m_n, DClass.IN, m_ttl,			       new Double(m_long).toString(),			       "120.\\00ABC", new Double(m_alt).toString());		fail("IllegalArgumentException not thrown");	    }	    catch(IllegalArgumentException e){}	}    }    public static class Test_Ctor_6arg_Strings extends TestCase    {	private Name	m_n;	private long	m_ttl;	private double	m_lat, m_long, m_alt;	protected void setUp() throws TextParseException	{	    m_n = Name.fromString("The.Name.");	    m_ttl = 0xABCDL;	    m_lat = -10.43;	    m_long = 76.12;	    m_alt = 100.101;	}		public void test_basic() throws TextParseException	{	    GPOSRecord gr = new GPOSRecord(m_n, DClass.IN, m_ttl,					   new Double(m_long).toString(),					   new Double(m_lat).toString(),					   new Double(m_alt).toString());	    assertEquals(m_n, gr.getName());	    assertEquals(DClass.IN, gr.getDClass());	    assertEquals(Type.GPOS, gr.getType());	    assertEquals(m_ttl, gr.getTTL());	    assertEquals(new Double(m_long), new Double(gr.getLongitude()));	    assertEquals(new Double(m_lat), new Double(gr.getLatitude()));	    assertEquals(new Double(m_alt), new Double(gr.getAltitude()));	    assertEquals(new Double(m_long).toString(), gr.getLongitudeString());	    assertEquals(new Double(m_lat).toString(), gr.getLatitudeString());	    assertEquals(new Double(m_alt).toString(), gr.getAltitudeString());	}	public void test_toosmall_longitude() throws TextParseException	{	    try {		new GPOSRecord(m_n, DClass.IN, m_ttl,			       "-90.001", new Double(m_lat).toString(),			       new Double(m_alt).toString());		fail("IllegalArgumentException not thrown");	    }	    catch(IllegalArgumentException e){}	}	public void test_toobig_longitude() throws TextParseException	{	    try {		new GPOSRecord(m_n, DClass.IN, m_ttl,			       "90.001", new Double(m_lat).toString(),			       new Double(m_alt).toString());		fail("IllegalArgumentException not thrown");	    }	    catch(IllegalArgumentException e){}	}	public void test_toosmall_latitude() throws TextParseException	{	    try {		new GPOSRecord(m_n, DClass.IN, m_ttl,			       new Double(m_long).toString(), "-180.001",			       new Double(m_alt).toString());		fail("IllegalArgumentException not thrown");	    }	    catch(IllegalArgumentException e){}	}	public void test_toobig_latitude() throws TextParseException	{	    try {		new GPOSRecord(m_n, DClass.IN, m_ttl,			       new Double(m_long).toString(), "180.001", new Double(m_alt).toString());		fail("IllegalArgumentException not thrown");	    }	    catch(IllegalArgumentException e){}	}    }    public static class Test_rrFromWire extends TestCase    {	public void test_basic() throws IOException	{	    byte[] raw = new byte[] { 5, '-', '8', '.', '1', '2',				      6, '1', '2', '3', '.', '0', '7',				      3, '0', '.', '0' };	    DNSInput in = new DNSInput(raw);	    	    GPOSRecord gr = new GPOSRecord();	    gr.rrFromWire(in);	    assertEquals(new Double(-8.12), new Double(gr.getLongitude()));	    assertEquals(new Double(123.07), new Double(gr.getLatitude()));	    assertEquals(new Double(0.0), new Double(gr.getAltitude()));	}		public void test_longitude_toosmall() throws IOException	{	    byte[] raw = new byte[] { 5, '-', '9', '5', '.', '0',				      6, '1', '2', '3', '.', '0', '7',				      3, '0', '.', '0' };	    DNSInput in = new DNSInput(raw);	    	    GPOSRecord gr = new GPOSRecord();	    try {		gr.rrFromWire(in);		fail("WireParseException not thrown");	    }	    catch(WireParseException e){}	}	public void test_longitude_toobig() throws IOException	{	    byte[] raw = new byte[] { 5, '1', '8', '5', '.', '0',				      6, '1', '2', '3', '.', '0', '7',				      3, '0', '.', '0' };	    DNSInput in = new DNSInput(raw);	    GPOSRecord gr = new GPOSRecord();	    try {		gr.rrFromWire(in);		fail("WireParseException not thrown");	    }	    catch(WireParseException e){}	}	public void test_latitude_toosmall() throws IOException	{	    byte[] raw = new byte[] { 5, '-', '8', '5', '.', '0',				      6, '-', '1', '9', '0', '.', '0',				      3, '0', '.', '0' };	    DNSInput in = new DNSInput(raw);	    GPOSRecord gr = new GPOSRecord();	    try {		gr.rrFromWire(in);		fail("WireParseException not thrown");	    }	    catch(WireParseException e){}	}	public void test_latitude_toobig() throws IOException	{	    byte[] raw = new byte[] { 5, '-', '8', '5', '.', '0',				      6, '2', '1', '9', '0', '.', '0',				      3, '0', '.', '0' };	    DNSInput in = new DNSInput(raw);	    GPOSRecord gr = new GPOSRecord();	    try {		gr.rrFromWire(in);		fail("WireParseException not thrown");	    }	    catch(WireParseException e){}	}    }    public static class Test_rdataFromString extends TestCase    {	public void test_basic() throws IOException	{	    Tokenizer t = new Tokenizer("10.45 171.121212 1010787");	    	    GPOSRecord gr = new GPOSRecord();	    gr.rdataFromString(t, null);	    assertEquals(new Double(10.45), new Double(gr.getLongitude()));	    assertEquals(new Double(171.121212), new Double(gr.getLatitude()));	    assertEquals(new Double(1010787), new Double(gr.getAltitude()));	}	public void test_longitude_toosmall() throws IOException	{	    Tokenizer t = new Tokenizer("-100.390 171.121212 1010787");	    	    GPOSRecord gr = new GPOSRecord();	    try {		gr.rdataFromString(t, null);		fail("IOException not thrown");	    }	    catch(IOException e){}	}	public void test_longitude_toobig() throws IOException	{	    Tokenizer t = new Tokenizer("90.00001 171.121212 1010787");	    	    GPOSRecord gr = new GPOSRecord();	    try {		gr.rdataFromString(t, null);		fail("IOException not thrown");	    }	    catch(IOException e){}	}	public void test_latitude_toosmall() throws IOException	{	    Tokenizer t = new Tokenizer("0.0 -180.01 1010787");	    	    GPOSRecord gr = new GPOSRecord();	    try {		gr.rdataFromString(t, null);		fail("IOException not thrown");	    }	    catch(IOException e){}	}	public void test_latitude_toobig() throws IOException	{	    Tokenizer t = new Tokenizer("0.0 180.01 1010787");	    	    GPOSRecord gr = new GPOSRecord();	    try {		gr.rdataFromString(t, null);		fail("IOException not thrown");	    }	    catch(IOException e){}	}	public void test_invalid_string() throws IOException	{	    Tokenizer t = new Tokenizer("1.0 2.0 \\435");	    try {		GPOSRecord gr = new GPOSRecord();		gr.rdataFromString(t, null);	    }	    catch(TextParseException e){}}    }    public void test_rrToString() throws TextParseException    {	String exp = "\"10.45\" \"171.121212\" \"1010787.0\"";	    	GPOSRecord gr = new GPOSRecord(Name.fromString("The.Name."), DClass.IN, 0x123,				       10.45, 171.121212, 1010787);	assertEquals(exp, gr.rrToString());    }    public void test_rrToWire() throws TextParseException    {	GPOSRecord gr = new GPOSRecord(Name.fromString("The.Name."), DClass.IN, 0x123,				       -10.45, 120.0, 111.0);	byte[] exp = new byte[] { 6, '-', '1', '0', '.', '4', '5',				  5, '1', '2', '0', '.', '0',				  5, '1', '1', '1', '.', '0' };		DNSOutput out = new DNSOutput();	gr.rrToWire(out, null, true);	byte[] bar = out.toByteArray();	assertEquals(exp.length, bar.length);	for( int i=0; i<exp.length; ++i){	    assertEquals("i=" + i, exp[i], bar[i]);	}    }    public static Test suite()    {	TestSuite s = new TestSuite();	s.addTestSuite(Test_Ctor_6arg_doubles.class);	s.addTestSuite(Test_Ctor_6arg_Strings.class);	s.addTestSuite(Test_rrFromWire.class);	s.addTestSuite(Test_rdataFromString.class);	s.addTestSuite(GPOSRecordTest.class);	return s;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久综合精品| 天涯成人国产亚洲精品一区av| 国产福利不卡视频| 国产成人午夜精品5599 | 国精产品一区一区三区mba视频| 免费观看91视频大全| 成人性视频网站| 色综合色综合色综合色综合色综合| 欧美色精品在线视频| 日韩欧美专区在线| 欧美一级淫片007| 国产三级久久久| 亚洲男人的天堂av| 免费看欧美女人艹b| 成人黄色777网| 欧美性感一区二区三区| 欧美一区二区三区思思人| 国产午夜精品一区二区三区嫩草| 亚洲素人一区二区| 一区二区三区电影在线播| 三级不卡在线观看| 99亚偷拍自图区亚洲| 日韩免费视频一区二区| 亚洲日穴在线视频| 国产尤物一区二区| 欧美日韩视频在线第一区| 久久九九99视频| 丝袜脚交一区二区| 国产一区视频网站| 欧美蜜桃一区二区三区| 国产精品麻豆网站| 成人免费av在线| 国产日韩在线不卡| 国产一区二区三区四区五区美女| 日韩一区二区三区视频在线观看| 亚洲成av人片在线观看| 欧美性色综合网| 亚洲一级电影视频| 欧美高清视频www夜色资源网| 亚洲图片欧美色图| 欧美日韩一区二区三区在线| 1024成人网| 91福利资源站| 亚洲自拍偷拍av| 在线不卡a资源高清| 午夜国产精品一区| 日韩三级av在线播放| 蜜臀av一区二区| 精品国产欧美一区二区| 国产中文字幕一区| 国产精品国产三级国产专播品爱网 | 一区二区三区日韩精品视频| 91久久精品一区二区| 一个色在线综合| 宅男在线国产精品| 久久精品国产精品亚洲综合| 2023国产精品自拍| 成人性生交大片免费看视频在线 | 成人av先锋影音| 综合av第一页| 777亚洲妇女| 国产精品一区二区免费不卡| 中文字幕欧美日本乱码一线二线| www.亚洲精品| 日日摸夜夜添夜夜添精品视频| 日韩一区和二区| 成人性色生活片| 亚洲影院理伦片| 精品成人免费观看| 99久久精品免费| 蜜桃视频一区二区| 日本一区二区久久| 欧美日韩精品专区| 激情图片小说一区| 亚洲制服丝袜在线| 国产午夜精品理论片a级大结局| 91在线小视频| 久久狠狠亚洲综合| 亚洲日本va午夜在线影院| 欧美一区二区三区在线视频| 国产成人免费9x9x人网站视频| 亚洲精品成a人| 久久综合久久综合久久| 在线免费观看一区| 成人国产在线观看| 久久91精品国产91久久小草| 一区二区三区免费| 国产日韩欧美精品综合| 欧美伦理视频网站| 成人国产视频在线观看| 麻豆视频一区二区| 亚洲综合免费观看高清完整版| 26uuu欧美| 欧美高清视频在线高清观看mv色露露十八 | 91丨porny丨蝌蚪视频| 欧美日韩三级一区| 亚洲免费电影在线| 欧洲激情一区二区| 午夜一区二区三区视频| 国产一区不卡在线| 精品久久久久久亚洲综合网| 精品在线一区二区三区| 国产欧美日韩三级| 国产在线视频一区二区三区| 亚洲一级片在线观看| 亚洲天堂2014| 日本一区二区在线不卡| 欧美mv日韩mv国产网站app| 欧美日韩在线精品一区二区三区激情 | 国产91精品精华液一区二区三区| 天使萌一区二区三区免费观看| 亚洲桃色在线一区| 国产精品久久久久影院老司| 久久久久久久综合日本| 日韩欧美电影一区| 日韩一区二区三区四区五区六区| 欧美日韩成人综合天天影院 | 亚洲欧美一区二区三区国产精品| 国产日本亚洲高清| 国产午夜精品在线观看| 国产日韩欧美精品一区| 国产亚洲精品精华液| 久久奇米777| 久久久91精品国产一区二区三区| 欧美精品一区二区三区蜜桃视频| 日韩精品一区二区三区视频| 日韩久久久精品| 日韩你懂的电影在线观看| 精品国产网站在线观看| 精品美女一区二区| 久久久久88色偷偷免费| 国产偷国产偷精品高清尤物| 国产日韩欧美麻豆| 亚洲欧美激情在线| 亚洲综合色噜噜狠狠| 亚洲不卡一区二区三区| 美女视频黄频大全不卡视频在线播放| 麻豆国产91在线播放| 国产高清在线精品| 91女人视频在线观看| 欧美三级韩国三级日本一级| 欧美老年两性高潮| 亚洲精品一区二区三区四区高清| 久久久久99精品一区| 亚洲视频 欧洲视频| 日韩精品乱码av一区二区| 久久精品国产精品亚洲红杏| 懂色一区二区三区免费观看| 91同城在线观看| 欧美精品三级日韩久久| 精品国产91乱码一区二区三区| 中文字幕av一区二区三区高| 一区二区三区四区不卡在线| 日韩高清一级片| 国产98色在线|日韩| 色欧美片视频在线观看在线视频| 欧美男生操女生| 国产精品人成在线观看免费| 亚洲国产成人porn| 国产一区二区看久久| 一本久久综合亚洲鲁鲁五月天| 777久久久精品| 中文字幕一区二区三区在线播放| 亚洲国产综合人成综合网站| 国产一区二区按摩在线观看| 在线视频欧美精品| 国产丝袜美腿一区二区三区| 亚洲资源中文字幕| 成人a级免费电影| 日韩视频在线一区二区| 亚洲男同性视频| 国产伦精品一区二区三区在线观看 | 欧美日韩中字一区| 久久精品亚洲乱码伦伦中文| 亚洲国产成人av网| 成人v精品蜜桃久久一区| 日韩一级二级三级| 一区二区三区欧美| 成人毛片老司机大片| 欧美一级精品大片| 亚洲一区二区三区四区的| 成人综合婷婷国产精品久久免费| 欧美日韩二区三区| 国产精品对白交换视频| 亚洲国产视频在线| jlzzjlzz亚洲女人18| 欧美成人官网二区| 午夜精品免费在线| 东方欧美亚洲色图在线| 精品国产电影一区二区| 人妖欧美一区二区| 正在播放一区二区| 亚洲高清不卡在线观看| 色一情一乱一乱一91av| 国产精品久久久久久久第一福利| 国产成人亚洲综合a∨婷婷| 欧美v亚洲v综合ⅴ国产v| 亚洲电影你懂得| 欧美日本一区二区三区| 亚洲国产一区在线观看|