Package org.kie.workbench.common.services.shared.enums

Examples of org.kie.workbench.common.services.shared.enums.EnumDropdownService


    @Test
    public void testLoadDropDown() throws Exception {

        //Override code that converts Path to ClassLoader for test
        final ClassLoader cl = Thread.currentThread().getContextClassLoader();
        final EnumDropdownService service = new EnumDropdownServiceImpl() {
            @Override
            public String[] loadDropDownExpression( final Path resource,
                                                    final String[] valuePairs,
                                                    final String expression ) {
                return super.loadDropDownExpression( cl,
                                                     valuePairs,
                                                     expression );
            }
        };

        final String[] pairs = new String[]{ "f1=x", "f2=2" };
        final String expression = "['@{f1}', '@{f2}']";
        final String[] r = service.loadDropDownExpression( mock( Path.class ),
                                                           pairs,
                                                           expression );
        assertEquals( 2,
                      r.length );
View Full Code Here


    @Test
    public void testLoadDropDownNoValuePairs() throws Exception {

        //Override code that converts Path to ClassLoader for test
        final ClassLoader cl = Thread.currentThread().getContextClassLoader();
        final EnumDropdownService service = new EnumDropdownServiceImpl() {
            @Override
            public String[] loadDropDownExpression( final Path resource,
                                                    final String[] valuePairs,
                                                    final String expression ) {
                return super.loadDropDownExpression( cl,
                                                     valuePairs,
                                                     expression );
            }
        };

        final String[] pairs = new String[]{ null };
        final String expression = "['@{f1}', '@{f2}']";
        final String[] r = service.loadDropDownExpression( mock( Path.class ),
                                                           pairs,
                                                           expression );

        assertEquals( 0,
                      r.length );
View Full Code Here

TOP

Related Classes of org.kie.workbench.common.services.shared.enums.EnumDropdownService

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.