Package org.jibx.custom.classes

Examples of org.jibx.custom.classes.PackageCustom


        assertNull("empty namespace",custom.getNamespace());
    }
   
    public void testSimplePackage() throws Exception {
        GlobalCustom custom = readCustom(SIMPLE_PACKAGE);
        PackageCustom pack = custom.getPackage("org.jibx.binding");
        assertTrue("map-abstract default", pack.isMapAbstract());
        assertEquals("name style default", CustomBase.CAMEL_CASE_NAMES, pack.getNameStyle());
        assertEquals("value style default", NestingBase.ATTRIBUTE_VALUE_STYLE, pack.getValueStyle("int"));
        assertFalse("require setting", pack.isObjectRequired("java.lang.String"));
        assertTrue("require setting", pack.isPrimitiveRequired("int"));
        assertFalse("property-access setting", pack.isPropertyAccess());
        assertEquals("get root", custom, pack.getGlobal());
        assertEquals("package namespace", "urn:binding", pack.getNamespace());
    }
View Full Code Here


        assertEquals("package namespace", "urn:binding", pack.getNamespace());
    }
   
    public void testNestedPackage() throws Exception {
        GlobalCustom custom = readCustom(NESTED_PACKAGE);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertTrue("map-abstract default", pack.isMapAbstract());
        assertEquals("name style default", CustomBase.CAMEL_CASE_NAMES, pack.getNameStyle());
        assertEquals("value style default", NestingBase.ATTRIBUTE_VALUE_STYLE, pack.getValueStyle("int"));
        assertFalse("require setting", pack.isObjectRequired("java.lang.String"));
        assertTrue("require setting", pack.isPrimitiveRequired("int"));
        assertTrue("property-access setting", pack.isPropertyAccess());
        assertEquals("get root", custom, pack.getGlobal());
        assertEquals("package namespace", "urn:binding/generator", pack.getNamespace());
    }
View Full Code Here

        assertEquals("package namespace", "urn:binding/generator", pack.getNamespace());
    }
   
    public void testMultiplePackage() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PACKAGE);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertTrue("property-access setting", pack.isPropertyAccess());
        assertEquals("package namespace", "urn:binding.generator", pack.getNamespace());
        pack = custom.getPackage("org.jibx.runtime");
        assertTrue("property-access setting", pack.isPropertyAccess());
        assertEquals("package namespace", "urn:runtime", pack.getNamespace());
        pack = custom.getPackage("org.jibx.extras");
        assertFalse("property-access setting", pack.isPropertyAccess());
        assertNull("package namespace", pack.getNamespace());
        assertEquals("simple name", "a", pack.convertName("a"));
        assertEquals("simple name", "a", pack.convertName("A"));
        assertEquals("simple name", "aName", pack.convertName("aName"));
        assertEquals("leading underscore name", "aName",
            pack.convertName("__aName"));
        assertEquals("embedded underscores name", "aName",
            pack.convertName("a__Name"));
        assertEquals("complex name", "aBCDefgH",
            pack.convertName("aB_cDefgH"));
    }
View Full Code Here

            pack.convertName("aB_cDefgH"));
    }
   
    public void testHyphenated() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PACKAGE_HYPHENATED);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertEquals("simple name", "a", pack.convertName("a"));
        assertEquals("simple name", "a", pack.convertName("A"));
        assertEquals("simple name", "a-name", pack.convertName("aName"));
        assertEquals("leading underscore name", "a-name",
            pack.convertName("__aName"));
        assertEquals("embedded underscores name", "a-name",
            pack.convertName("a__Name"));
        assertEquals("complex name", "a-b-c-defg-h",
            pack.convertName("aB_cDefgH"));
    }
View Full Code Here

            pack.convertName("aB_cDefgH"));
    }
   
    public void testUpperCamelCase() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PACKAGE_UPPERCAMELCASE);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertEquals("simple name", "A", pack.convertName("a"));
        assertEquals("simple name", "A", pack.convertName("A"));
        assertEquals("simple name", "AName", pack.convertName("aName"));
        assertEquals("leading underscore name", "AName",
            pack.convertName("__aName"));
        assertEquals("embedded underscores name", "AName",
            pack.convertName("a__Name"));
        assertEquals("complex name", "ABCDefgH",
            pack.convertName("aB_cDefgH"));
    }
View Full Code Here

            pack.convertName("aB_cDefgH"));
    }
   
    public void testDotted() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PACKAGE_DOTTED);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertEquals("simple name", "a", pack.convertName("a"));
        assertEquals("simple name", "a", pack.convertName("A"));
        assertEquals("simple name", "a.name", pack.convertName("aName"));
        assertEquals("leading underscore name", "a.name",
            pack.convertName("__aName"));
        assertEquals("embedded underscores name", "a.name",
            pack.convertName("a__Name"));
        assertEquals("complex name", "a.b.c.defg.h",
            pack.convertName("aB_cDefgH"));
    }
View Full Code Here

            pack.convertName("aB_cDefgH"));
    }
   
    public void testUnderscored() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PACKAGE_UNDERSCORED);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertEquals("simple name", "a", pack.convertName("a"));
        assertEquals("simple name", "a", pack.convertName("A"));
        assertEquals("simple name", "a_name", pack.convertName("aName"));
        assertEquals("leading underscore name", "a_name",
            pack.convertName("__aName"));
        assertEquals("embedded underscores name", "a_name",
            pack.convertName("a__Name"));
        assertEquals("complex name", "a_b_c_defg_h",
            pack.convertName("aB_cDefgH"));
    }
View Full Code Here

TOP

Related Classes of org.jibx.custom.classes.PackageCustom

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.