Package org.nutz.lang.segment

Examples of org.nutz.lang.segment.Segment


  }

  @Test
  public void testChineseChar() {
    String s = new StringBuilder().append((char) Integer.parseInt("6211", 16)).toString();
    Segment seg = Segments.create(s);
    assertTrue(s.equals(seg.toString()));
  }
View Full Code Here


    Segment seg = Segments.create(s);
    assertTrue(s.equals(seg.toString()));
  }

  public void test_blankKeys() {
    Segment seg = Segments.create("1${A}2${B}3${C}4${D}5");
    // assertEquals(4, seg.blankKeys().size());

    seg.set("A", 34);
    seg.set("D", "GG");
    // assertEquals(2, seg.blankKeys().size());
  }
View Full Code Here

          }

          // 将本地化字符串增加到当前语言
          for (String key : p.keySet()) {
            String str = p.get(key);
            Segment seg = (new CharSegment()).valueOf(str);
            if (seg.keys().isEmpty())
              msgs.put(key, str);
            else
              msgs.put(key, seg);
          }
View Full Code Here

        ResultSetMetaData rsmd = null;
        boolean fromName = false;
        boolean toName = false;
        try {
          stat = conn.createStatement();
          Segment tableName = new CharSegment(mm.relation());
          rs = stat.executeQuery(db.getResultSetMetaSql(TableName.render(tableName)));
          rsmd = rs.getMetaData();
          fromName = !Daos.isIntLikeColumn(rsmd, mm.from());
          toName = !Daos.isIntLikeColumn(rsmd, mm.to());
        }
View Full Code Here

        Segments.create("H${4");
    }

    @Test
    public void testLackLeftBracket() {
        Segment seg = Segments.create("H$4}B");
        assertEquals("H$4}B", seg.toString());
        assertEquals(0, seg.keys().size());
        assertEquals(1, seg.values().size());
    }
View Full Code Here

        assertEquals(1, seg.values().size());
    }

    @Test
    public void testEscapeChar() {
        Segment seg = Segments.create("H$$4}B");
        assertEquals("H$4}B", seg.toString());
        assertEquals(0, seg.keys().size());
        assertEquals(1, seg.values().size());
    }
View Full Code Here

        assertEquals(1, seg.values().size());
    }

    @Test
    public void testEscapeChar2() {
        Segment seg = Segments.create("H$$$4}B");
        assertEquals("H$$4}B", seg.toString());
    }
View Full Code Here

        assertEquals("H$$4}B", seg.toString());
    }

    @Test
    public void testEscapeChar3() {
        Segment seg = Segments.create("H$$$$4}B");
        assertEquals("H$$4}B", seg.toString());
    }
View Full Code Here

        assertEquals("H$$4}B", seg.toString());
    }

    @Test
    public void testAtTheEnd() {
        Segment seg = Segments.create("H${4}");
        seg.set("4", "zzh");
        assertEquals("Hzzh", seg.toString());
        assertEquals(1, seg.keys().size());
        assertEquals(2, seg.values().size());
    }
View Full Code Here

        assertEquals(2, seg.values().size());
    }

    @Test
    public void testAtTheBegin() {
        Segment seg = Segments.create("${4}B");
        seg.set("4", "zzh");
        assertEquals("zzhB", seg.toString());
        assertEquals(1, seg.keys().size());
        assertEquals(2, seg.values().size());
    }
View Full Code Here

TOP

Related Classes of org.nutz.lang.segment.Segment

Copyright © 2018 www.massapicom. 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.