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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? messageformattertest.java

?? Java開發(fā)最新的日志記錄工具slf4j的源碼
?? JAVA
字號:
/* 
 * Copyright (c) 2004-2005 SLF4J.ORG
 * Copyright (c) 2004-2005 QOS.CH
 * 
 * All rights reserved.
 * 
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to  deal in  the Software without  restriction, including
 * without limitation  the rights to  use, copy, modify,  merge, publish,
 * distribute, and/or sell copies of  the Software, and to permit persons
 * to whom  the Software is furnished  to do so, provided  that the above
 * copyright notice(s) and this permission notice appear in all copies of
 * the  Software and  that both  the above  copyright notice(s)  and this
 * permission notice appear in supporting documentation.
 * 
 * THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
 * EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR  A PARTICULAR PURPOSE AND NONINFRINGEMENT
 * OF  THIRD PARTY  RIGHTS. IN  NO EVENT  SHALL THE  COPYRIGHT  HOLDER OR
 * HOLDERS  INCLUDED IN  THIS  NOTICE BE  LIABLE  FOR ANY  CLAIM, OR  ANY
 * SPECIAL INDIRECT  OR CONSEQUENTIAL DAMAGES, OR  ANY DAMAGES WHATSOEVER
 * RESULTING FROM LOSS  OF USE, DATA OR PROFITS, WHETHER  IN AN ACTION OF
 * CONTRACT, NEGLIGENCE  OR OTHER TORTIOUS  ACTION, ARISING OUT OF  OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 * 
 * Except as  contained in  this notice, the  name of a  copyright holder
 * shall not be used in advertising or otherwise to promote the sale, use
 * or other dealings in this Software without prior written authorization
 * of the copyright holder.
 *
 */

package org.slf4j.helpers;

import junit.framework.TestCase;

/**
 * @author Ceki Gulcu
 * 
 */
public class MessageFormatterTest extends TestCase {

  Integer i1 = new Integer(1);
  Integer i2 = new Integer(2);
  Integer i3 = new Integer(3);
  Integer[] ia0 = new Integer[] { i1, i2, i3 };
  Integer[] ia1 = new Integer[] { new Integer(10), new Integer(20),
      new Integer(30) };

  public void testNull() {
    String result;
    result = MessageFormatter.format(null, i1);
    assertEquals(null, result);
  }

  public void testNullParam() {
    String result;

    result = MessageFormatter.format("Value is {}.", null);
    assertEquals("Value is null.", result);

    result = MessageFormatter.format("Val1 is {}, val2 is {}.", null, null);
    assertEquals("Val1 is null, val2 is null.", result);

    result = MessageFormatter.format("Val1 is {}, val2 is {}.", i1, null);
    assertEquals("Val1 is 1, val2 is null.", result);

    result = MessageFormatter.format("Val1 is {}, val2 is {}.", null, i2);
    assertEquals("Val1 is null, val2 is 2.", result);

    result = MessageFormatter.arrayFormat("Val1 is {}, val2 is {}, val3 is {}",
        new Integer[] { null, null, null });
    assertEquals("Val1 is null, val2 is null, val3 is null", result);

    result = MessageFormatter.arrayFormat("Val1 is {}, val2 is {}, val3 is {}",
        new Integer[] { null, i2, i3 });
    assertEquals("Val1 is null, val2 is 2, val3 is 3", result);

    result = MessageFormatter.arrayFormat("Val1 is {}, val2 is {}, val3 is {}",
        new Integer[] { null, null, i3 });
    assertEquals("Val1 is null, val2 is null, val3 is 3", result);
  }

  public void testOneParameter() {
    String result;

    result = MessageFormatter.format("Value is {}.", i3);
    assertEquals("Value is 3.", result);

    result = MessageFormatter.format("Value is {", i3);
    assertEquals("Value is {", result);

    result = MessageFormatter.format("{} is larger than 2.", i3);
    assertEquals("3 is larger than 2.", result);

    result = MessageFormatter.format("No subst", i3);
    assertEquals("No subst", result);

    result = MessageFormatter.format("Incorrect {subst", i3);
    assertEquals("Incorrect {subst", result);

    result = MessageFormatter.format("Value is {bla} {}", i3);
    assertEquals("Value is {bla} 3", result);

    result = MessageFormatter.format("Escaped \\{} subst", i3);
    assertEquals("Escaped {} subst", result);

    result = MessageFormatter.format("{Escaped", i3);
    assertEquals("{Escaped", result);

    result = MessageFormatter.format("\\{}Escaped", i3);
    assertEquals("{}Escaped", result);

    result = MessageFormatter.format("File name is {{}}.", "App folder.zip");
    assertEquals("File name is {App folder.zip}.", result);

    // escaping the escape character
    result = MessageFormatter
        .format("File name is C:\\\\{}.", "App folder.zip");
    assertEquals("File name is C:\\App folder.zip.", result);
  }

  public void testTwoParameters() {
    String result;

    result = MessageFormatter.format("Value {} is smaller than {}.", i1, i2);
    assertEquals("Value 1 is smaller than 2.", result);

    result = MessageFormatter.format("Value {} is smaller than {}", i1, i2);
    assertEquals("Value 1 is smaller than 2", result);

    result = MessageFormatter.format("{}{}", i1, i2);
    assertEquals("12", result);

    result = MessageFormatter.format("Val1={}, Val2={", i1, i2);
    assertEquals("Val1=1, Val2={", result);

    result = MessageFormatter.format("Value {} is smaller than \\{}", i1, i2);
    assertEquals("Value 1 is smaller than {}", result);

    result = MessageFormatter.format("Value {} is smaller than \\{} tail", i1,
        i2);
    assertEquals("Value 1 is smaller than {} tail", result);

    result = MessageFormatter.format("Value {} is smaller than \\{", i1, i2);
    assertEquals("Value 1 is smaller than \\{", result);

    result = MessageFormatter
        .format("Value {} is smaller than {tail", i1, i2);
    assertEquals("Value 1 is smaller than {tail", result);

    result = MessageFormatter.format("Value \\{} is smaller than {}", i1, i2);
    assertEquals("Value {} is smaller than 1", result);
  }

  public void testNullArray() {
    String result;

    String msg0 = "msg0";
    String msg1 = "msg1 {}";
    String msg2 = "msg2 {} {}";
    String msg3 = "msg3 {} {} {}";

    Object[] args = null;

    result = MessageFormatter.arrayFormat(msg0, args);
    assertEquals(msg0, result);

    result = MessageFormatter.arrayFormat(msg1, args);
    assertEquals(msg1, result);

    result = MessageFormatter.arrayFormat(msg2, args);
    assertEquals(msg2, result);

    result = MessageFormatter.arrayFormat(msg3, args);
    assertEquals(msg3, result);
  }

  // tests the case when the parameters are supplied in a single array
  public void testArrayFormat() {
    String result;

    result = MessageFormatter.arrayFormat(
        "Value {} is smaller than {} and {}.", ia0);
    assertEquals("Value 1 is smaller than 2 and 3.", result);

    result = MessageFormatter.arrayFormat("{}{}{}", ia0);
    assertEquals("123", result);

    result = MessageFormatter.arrayFormat("Value {} is smaller than {}.", ia0);
    assertEquals("Value 1 is smaller than 2.", result);

    result = MessageFormatter.arrayFormat("Value {} is smaller than {}", ia0);
    assertEquals("Value 1 is smaller than 2", result);

    result = MessageFormatter.arrayFormat("Val={}, {, Val={}", ia0);
    assertEquals("Val=1, {, Val=2", result);

    result = MessageFormatter.arrayFormat("Val={}, {, Val={}", ia0);
    assertEquals("Val=1, {, Val=2", result);

    result = MessageFormatter.arrayFormat("Val1={}, Val2={", ia0);
    assertEquals("Val1=1, Val2={", result);
  }

  public void testArrayValues() {
    String result;
    Integer p0 = i1;
    Integer[] p1 = new Integer[] { i2, i3 };

    result = MessageFormatter.format("{}{}", p0, p1);
    assertEquals("1[2, 3]", result);

    // Integer[]
    result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", p1 });
    assertEquals("a[2, 3]", result);

    // byte[]
    result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a",
        new byte[] { 1, 2 } });
    assertEquals("a[1, 2]", result);

    // int[]
    result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a",
        new int[] { 1, 2 } });
    assertEquals("a[1, 2]", result);

    // float[]
    result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a",
        new float[] { 1, 2 } });
    assertEquals("a[1.0, 2.0]", result);

    // double[]
    result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a",
        new double[] { 1, 2 } });
    assertEquals("a[1.0, 2.0]", result);

  }

  public void testMultiDimensionalArrayValues() {
    String result;

    Integer[][] multiIntegerA = new Integer[][] { ia0, ia1 };
    result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a",
        multiIntegerA });
    assertEquals("a[[1, 2, 3], [10, 20, 30]]", result);

    int[][] multiIntA = new int[][] { { 1, 2 }, { 10, 20 } };
    result = MessageFormatter.arrayFormat("{}{}",
        new Object[] { "a", multiIntA });
    assertEquals("a[[1, 2], [10, 20]]", result);

    float[][] multiFloatA = new float[][] { { 1, 2 }, { 10, 20 } };
    result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a",
        multiFloatA });
    assertEquals("a[[1.0, 2.0], [10.0, 20.0]]", result);

    Object[][] multiOA = new Object[][] { ia0, ia1 };
    result = MessageFormatter
        .arrayFormat("{}{}", new Object[] { "a", multiOA });
    assertEquals("a[[1, 2, 3], [10, 20, 30]]", result);

    Object[][][] _3DOA = new Object[][][] { multiOA, multiOA };
    result = MessageFormatter.arrayFormat("{}{}", new Object[] { "a", _3DOA });
    assertEquals("a[[[1, 2, 3], [10, 20, 30]], [[1, 2, 3], [10, 20, 30]]]",
        result);
  }

  public void testCyclicArrays() {
    {
      Object[] cyclicA = new Object[1];
      cyclicA[0] = cyclicA;
      assertEquals("[[...]]", MessageFormatter.arrayFormat("{}", cyclicA));
    }
    {
      Object[] a = new Object[2];
      a[0] = i1;
      Object[] c = new Object[] {i3, a};
      Object[] b = new Object[] {i2, c};
      a[1] = b;
      assertEquals("1[2, [3, [1, [...]]]]", MessageFormatter.arrayFormat("{}{}", a));
    }
  }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品视频在线观看免费| 成人欧美一区二区三区小说| 亚洲女性喷水在线观看一区| 久久精品99久久久| 99国产精品久| 久久久久久电影| 午夜欧美在线一二页| 成人avav在线| 久久毛片高清国产| 免费久久精品视频| 色一情一乱一乱一91av| 国产亚洲综合性久久久影院| 日韩1区2区3区| 欧美亚洲愉拍一区二区| 国产精品免费视频观看| 国产又粗又猛又爽又黄91精品| 精品视频免费在线| 中文字幕一区二区三区在线不卡 | 亚洲日本护士毛茸茸| 精品午夜久久福利影院| 91精品国产综合久久小美女| 一区二区视频在线| 成人avav影音| 国产精品美女久久久久久久网站| 精品一区二区三区免费| 777xxx欧美| 午夜不卡av在线| 在线观看一区二区精品视频| 综合久久久久久久| 欧美日韩一卡二卡| 亚洲一区二区三区美女| 色综合久久99| 中文字幕亚洲一区二区av在线| 国产成人免费av在线| 久久久午夜精品理论片中文字幕| 久久激情五月婷婷| 精品捆绑美女sm三区| 久久精品免费观看| 日韩三级中文字幕| 蜜桃91丨九色丨蝌蚪91桃色| 欧美一级国产精品| 蜜臀久久99精品久久久画质超高清| 欧美日韩国产在线播放网站| 亚洲va欧美va人人爽午夜 | 免费一级片91| 欧美系列日韩一区| 亚洲国产sm捆绑调教视频| 欧美亚洲尤物久久| 日韩精品亚洲专区| 日韩免费在线观看| 国产剧情一区二区| 国产欧美精品区一区二区三区| 国产成人免费视频网站| 国产精品私人影院| 91免费小视频| 亚洲尤物在线视频观看| 欧美日韩高清一区二区三区| 首页欧美精品中文字幕| 日韩欧美国产综合| 国产精品一区三区| 亚洲欧洲另类国产综合| 日本精品一级二级| 亚洲成人精品影院| 日韩欧美一卡二卡| 国产激情偷乱视频一区二区三区| 中文字幕一区二区三区蜜月| 色综合亚洲欧洲| 亚洲高清视频中文字幕| 欧美一级二级在线观看| 丁香亚洲综合激情啪啪综合| 综合精品久久久| 欧美少妇一区二区| 精品一区二区三区在线视频| 国产欧美一区二区三区鸳鸯浴 | 美女久久久精品| 久久久欧美精品sm网站| av毛片久久久久**hd| 亚洲国产中文字幕| xvideos.蜜桃一区二区| 99久久久精品| 日韩精品三区四区| 国产欧美一区二区精品忘忧草 | 99视频精品在线| 亚洲国产精品久久不卡毛片| 亚洲精品一区二区三区在线观看| 成人开心网精品视频| 亚洲电影一区二区| www国产成人| 一本大道久久a久久精品综合| 亚洲成av人片在www色猫咪| www久久精品| 91豆麻精品91久久久久久| 久久精品国产一区二区三 | 久久久综合激的五月天| 一本高清dvd不卡在线观看| 免播放器亚洲一区| 国产精品国产自产拍高清av| 欧美精品乱码久久久久久按摩 | 日本不卡视频在线| 国产精品久久777777| 91精品国产高清一区二区三区| 成人综合婷婷国产精品久久蜜臀| 亚洲一级二级三级在线免费观看| 久久久久久久网| 91福利资源站| 国产成人精品免费网站| 天天爽夜夜爽夜夜爽精品视频| 久久青草欧美一区二区三区| 欧美色图第一页| 国产a级毛片一区| 日本中文字幕一区二区有限公司| 亚洲人成网站在线| 欧美精品一区二| 欧美日韩成人在线| 不卡在线视频中文字幕| 久久99精品国产麻豆婷婷| 一区二区三区欧美视频| 国产日韩欧美一区二区三区综合| 欧美日韩精品欧美日韩精品一综合| 福利电影一区二区三区| 蜜臀av性久久久久av蜜臀妖精| 亚洲乱码国产乱码精品精小说| 久久亚洲欧美国产精品乐播 | 欧美亚洲另类激情小说| av成人免费在线| 国产一区视频网站| 免费av网站大全久久| 性久久久久久久久久久久| 国产精品国产三级国产aⅴ中文| 精品久久久久久综合日本欧美| 欧美午夜不卡视频| 91视频com| 成人avav影音| 成人av资源在线观看| 国产老妇另类xxxxx| 激情久久五月天| 麻豆精品一区二区三区| 天天色图综合网| 亚洲午夜久久久久中文字幕久| 亚洲日本丝袜连裤袜办公室| 中文字幕av一区二区三区高| 欧美精品一区视频| 欧美变态口味重另类| 91麻豆精品国产91久久久 | 国产综合色视频| 美脚の诱脚舐め脚责91 | 亚洲午夜一区二区三区| 亚洲黄色尤物视频| 亚洲你懂的在线视频| 最新热久久免费视频| 国产精品久久久一本精品 | 欧美一区二区福利视频| 欧美日韩国产一级片| 欧美日韩午夜在线| 欧美三级电影在线看| 欧美三级蜜桃2在线观看| 欧美日韩激情在线| 7777精品伊人久久久大香线蕉超级流畅| 欧洲精品在线观看| 欧美亚洲综合一区| 在线电影一区二区三区| 9191精品国产综合久久久久久| 欧美精品乱人伦久久久久久| 3d动漫精品啪啪1区2区免费| 欧美精品在线视频| 欧美一区二区三区爱爱| 日韩视频不卡中文| 久久精品欧美日韩精品 | 欧美成人伊人久久综合网| 日韩精品一区二区三区视频 | 久久久精品黄色| 日本一区二区三区国色天香| 国产精品美女久久久久高潮 | 日韩三级视频在线看| 337p日本欧洲亚洲大胆色噜噜| 国产欧美日产一区| 中文字幕一区二区视频| 亚洲综合男人的天堂| 视频一区二区三区在线| 美女视频免费一区| 国产成人免费9x9x人网站视频| 99久久夜色精品国产网站| 欧美视频一二三区| 精品国产污污免费网站入口| 国产天堂亚洲国产碰碰| 亚洲色图19p| 首页国产丝袜综合| 国产福利91精品一区| 成人av综合在线| 欧美日韩激情一区二区| 久久人人爽人人爽| 亚洲男人的天堂在线aⅴ视频| 午夜精品久久久久久久99樱桃 | 最新国产の精品合集bt伙计| 亚洲午夜在线观看视频在线| 久草精品在线观看| 不卡一区二区三区四区| 欧美视频在线不卡| www激情久久| 亚洲精品日产精品乱码不卡|