WebAddressTest.java revision 582deec1f3c8f51b431bb2ad685c9217ffd9eaad
1582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block/* 2582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * Copyright (C) 2010 The Android Open Source Project 3582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * 4582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * Licensed under the Apache License, Version 2.0 (the "License"); 5582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * you may not use this file except in compliance with the License. 6582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * You may obtain a copy of the License at 7582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * 8582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * http://www.apache.org/licenses/LICENSE-2.0 9582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * 10582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * Unless required by applicable law or agreed to in writing, software 11582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * distributed under the License is distributed on an "AS IS" BASIS, 12582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * See the License for the specific language governing permissions and 14582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block * limitations under the License. 15582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block */ 16582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block 17582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Blockpackage android.net; 18582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block 19582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Blockimport android.net.WebAddress; 20582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Blockimport android.test.suitebuilder.annotation.SmallTest; 21582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Blockimport junit.framework.TestCase; 22582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block 23582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Blockpublic class WebAddressTest extends TestCase { 24582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block 25582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block @SmallTest 26582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block public void testHostWithTrailingDot() { 27582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block WebAddress webAddress = new WebAddress("http://google.com./b/c/g"); 28582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block assertEquals("google.com.", webAddress.mHost); 29582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block assertEquals("/b/c/g", webAddress.mPath); 30582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block } 31582deec1f3c8f51b431bb2ad685c9217ffd9eaadSteve Block} 32