Package org.netbeans.modules.nodejs.api

Examples of org.netbeans.modules.nodejs.api.NodeJSUtils


        Stubs stubs = Stubs.getDefault();
        assertNotNull( stubs );
        FileObject actualHttp = stubs.getStubs( null ).getRoot().getFileObject( "http.js" );
        assertNotNull( actualHttp );

        NodeJSUtils utils = NodeJSUtils.getDefault();
        assertNotNull( utils );
        FileObject index = prj.getProjectDirectory().getFileObject( "index.js" );
        assertNotNull( index );
        FileObject other = utils.resolve( "./other", index );
        assertNotNull( other );
        assertEquals( "other.js", other.getNameExt() );
        assertEquals( index.getParent(), other.getParent() );

        FileObject http = utils.resolve( "http", index );
        assertNotNull( http );

        assertEquals( actualHttp, http );

        LibrariesChildFactory f = new LibrariesChildFactory( prj );
        Set<String> libs = new HashSet<>();
        for (ProjectNodeKey key : f.libraries()) {
            libs.add( key.toString() );
            if (!"boo".equals( key.toString() )) {
                assertTrue( key.isBuiltIn() );
            } else {
                assertFalse( key.isBuiltIn() );
            }
        }
        assertTrue( libs.contains( "util" ) );
        assertTrue( libs.contains( "fs" ) );
        assertTrue( libs.contains( "http" ) );
        assertFalse( libs.contains( "url" ) );
        assertTrue( libs.contains( "boo" ) );

        FileObject boo = utils.resolve( "boo", index );
        assertNotNull( boo );
        assertEquals( booDir.getFileObject( "boo.js" ), boo );

        NodeJSProjectProperties props = prj.getLookup().lookup( NodeJSProjectProperties.class );
        assertNotNull( props );
View Full Code Here

TOP

Related Classes of org.netbeans.modules.nodejs.api.NodeJSUtils

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.