ide/editor/src/test/java/org/apidesign/bck2brwsr/ide/editor/ManglingSinkTest.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Tue, 17 Sep 2013 15:00:18 +0200
changeset 1286 a83e16b8b825
permissions -rw-r--r--
[maven-release-plugin] prepare release release-0.8
     1 /**
     2  * Back 2 Browser Bytecode Translator
     3  * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     4  *
     5  * This program is free software: you can redistribute it and/or modify
     6  * it under the terms of the GNU General Public License as published by
     7  * the Free Software Foundation, version 2 of the License.
     8  *
     9  * This program is distributed in the hope that it will be useful,
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12  * GNU General Public License for more details.
    13  *
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program. Look for COPYING file in the top folder.
    16  * If not, see http://opensource.org/licenses/GPL-2.0.
    17  */
    18 package org.apidesign.bck2brwsr.ide.editor;
    19 
    20 import org.testng.Assert;
    21 import org.testng.annotations.Test;
    22 
    23 
    24 public class ManglingSinkTest {
    25 
    26     @Test
    27     public void testMangle_1() {
    28         Assert.assertEquals(
    29                 "binarySearch__I_3BIIB",
    30                 ManglingSink.mangle("java.util.Arrays", "binarySearch", "[BIIB")
    31         );
    32     }
    33 
    34     @Test
    35     public void testMangle_2() {
    36         Assert.assertEquals(
    37                 "sort__V_3I",
    38                 ManglingSink.mangle("java.util.Arrays", "sort", "[I")
    39         );
    40     }
    41 
    42     @Test
    43     public void testMangle_3() {
    44         Assert.assertEquals(
    45                 "binarySearch__I_3Ljava_lang_Object_2IILjava_lang_Object_2",
    46                 ManglingSink.mangle("java.util.Arrays", "binarySearch", "[Ljava/lang/Object;IILjava/lang/Object;")
    47         );
    48     }
    49 
    50 
    51     @Test
    52     public void testField() {
    53         final ManglingSink manglingSink = new ManglingSink();
    54         manglingSink.field(null, "value");
    55 
    56         Assert.assertEquals("_value()", manglingSink.toString());
    57     }
    58 }