Package com.dianping.cat.broker

Source Code of com.dianping.cat.broker.RequestUtilsTest

package com.dianping.cat.broker;

import junit.framework.Assert;

import org.junit.Test;

import com.dianping.cat.broker.api.page.RequestUtils;

public class RequestUtilsTest {

  @Test
  public void test(){
    RequestUtils utils = new RequestUtils();
   
    Assert.assertEquals(null, utils.filterXForwardedForIP("10.1.6.128,10.1.6.128"));
    Assert.assertEquals(null, utils.filterXForwardedForIP("172.16.6.128,172.16.6.128"));
    Assert.assertEquals(null, utils.filterXForwardedForIP("172.31.6.128,172.31.6.128"));
    Assert.assertEquals(null, utils.filterXForwardedForIP("192.168.0.1,192.168.0.1"));
    Assert.assertEquals("172.32.6.128", utils.filterXForwardedForIP("172.32.6.128,172.32.6.128"));
  }

}
TOP

Related Classes of com.dianping.cat.broker.RequestUtilsTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.