@@ -0,0 +1,2474 @@
+// Copyright 2014 Boundary, Inc.%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//     http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0Apackage com.boundary.camel.component.url;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.util.Date;%0A%0Aimport org.junit.After;%0Aimport org.junit.AfterClass;%0Aimport org.junit.Before;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Aimport com.boundary.camel.component.common.ServiceStatus;%0A%0Apublic class UrlResultTest %7B%0A%09%0A%09private UrlResult result;%0A%0A%09@BeforeClass%0A%09public static void setUpBeforeClass() throws Exception %7B%0A%09%7D%0A%0A%09@AfterClass%0A%09public static void tearDownAfterClass() throws Exception %7B%0A%09%7D%0A%0A%09@Before%0A%09public void setUp() throws Exception %7B%0A%09%09result = new UrlResult();%0A%09%7D%0A%0A%09@After%0A%09public void tearDown() throws Exception %7B%0A%09%7D%0A%0A%09@Test%0A%09public void testUrlInfo() %7B%0A%09%09assertNotNull(%22check uri%22,result.getHost());%0A%09%09assertNull(%22check url%22,result.getURL());%0A%09%7D%0A%0A%09@Test%0A%09public void testToString() %7B%0A%09%09String url = %22https://www.google.com/some/path%22;%0A%09%09result.setStatus(ServiceStatus.SUCCESS);%0A%09%09result.setURLStatus(URLStatus.UNKNOWN_HOST);%0A%09%09assertEquals(%22check toString()%22,%22,url=https://www.google.com/some/path,timeout=5000,urlStatus=UNKNOWN_HOST%22,result.toString());%0A%09%7D%0A%0A%0A%09@Test%0A%09public void testStatus() %7B%0A%09%09result.setURLStatus(URLStatus.UNKNOWN_HOST);%0A%09%09assertEquals(%22check status%22,URLStatus.UNKNOWN_HOST,result.getURLStatus());%0A%09%7D%0A%0A%09@Test%0A%09public void testGetStatus() %7B%0A%09%09ServiceStatus status = ServiceStatus.FAIL;%0A%09%09result.setStatus(status);%0A%09%09assertEquals(%22check service status%22,status,result.getStatus());%0A%09%7D%0A%0A%09@Test%0A%09public void testMessage() %7B%0A%09%09String message = %22foobar%22;%0A%09%09result.setMessage(message);%0A%09%09assertEquals(%22check message%22,message,result.getMessage());%0A%09%7D%0A%0A%09@Test%0A%09public void tesHost() %7B%0A%09%09String host = %22myHost%22;%0A%09%09result.setHost(host);%0A%09%09assertEquals(%22check host%22,host,result.getHost());%0A%09%7D%0A%0A%09@Test%0A%09public void testTimestamp() %7B%0A%09%09Date now = new Date();%0A%09%09result.setTimestamp(now);%0A%09%09assertEquals(%22check timestamp%22,now,result.getTimestamp());%0A%09%7D%0A%7D%0A

Rename to be consistent with function