Package net.flexmojos.oss.compiler

Examples of net.flexmojos.oss.compiler.ICompcConfiguration


    @Test
    public void simpleCfgParse()
        throws Exception
    {
        ICompcConfiguration cfg = mock( ICompcConfiguration.class, RETURNS_NULL );
        when( cfg.getDebugPassword() ).thenReturn( "dbgPw" );

        List<String> args = parser.getArgumentsList( cfg, ICompcConfiguration.class );

        Assert.assertNotNull( args );
        Assert.assertEquals( args.size(), 1, args.toString() );
View Full Code Here


    @Test
    public void compilerCfgParse()
        throws Exception
    {
        ICompcConfiguration cfg = mock( ICompcConfiguration.class, RETURNS_NULL );
        ICompilerConfiguration compilerCfg = mock( ICompilerConfiguration.class, RETURNS_NULL );
        IFontsConfiguration fontCfg = mock( IFontsConfiguration.class, RETURNS_NULL );
        ILanguages langsCfg = mock( ILanguages.class, RETURNS_NULL );
        ILanguageRange thaiLangRangeCfg = mock( ILanguageRange.class, RETURNS_NULL );
        ILanguageRange ptLangRangeCfg = mock( ILanguageRange.class, RETURNS_NULL );
        IMetadataConfiguration metadataCfg = mock( IMetadataConfiguration.class, RETURNS_NULL );
        IRuntimeSharedLibraryPath runtimeCfg = mock( IRuntimeSharedLibraryPath.class, RETURNS_NULL );
        Map<String, String> urls = new LinkedHashMap<String, String>();
        urls.put( "http://a.com/rsls/MyLibrary.swf", "http://a.com/rsls/crossdomain.xml" );
        urls.put( "MyLibrary.swf", null );
        IFramesConfiguration frameCfg = mock( IFramesConfiguration.class, RETURNS_NULL );
        IFrame frame = mock( IFrame.class, RETURNS_NULL );
        INamespacesConfiguration namespacesCfg = mock( INamespacesConfiguration.class, RETURNS_NULL );
        INamespace namespace = mock( INamespace.class, RETURNS_NULL );
        INamespace namespace2 = mock( INamespace.class, RETURNS_NULL );
        IDefine define = mock( IDefine.class, RETURNS_NULL );

        when( cfg.getIncludeClasses() ).thenReturn( Arrays.asList( "AClass", "BClass" ) );
        when( cfg.getCompilerConfiguration() ).thenReturn( compilerCfg );
        when( cfg.getMetadataConfiguration() ).thenReturn( metadataCfg );
        when( compilerCfg.getAccessible() ).thenReturn( true );
        when( compilerCfg.getFontsConfiguration() ).thenReturn( fontCfg );
        when( fontCfg.getLanguagesConfiguration() ).thenReturn( langsCfg );
        when( langsCfg.getLanguageRange() ).thenReturn( new ILanguageRange[] { thaiLangRangeCfg, ptLangRangeCfg } );
        when( thaiLangRangeCfg.lang() ).thenReturn( "Thai" );
        when( thaiLangRangeCfg.range() ).thenReturn( "U+0E01-0E5B" );
        when( ptLangRangeCfg.lang() ).thenReturn( "ptBR" );
        when( ptLangRangeCfg.range() ).thenReturn( "U+0A0C-0EAA" );
        when( metadataCfg.getCreator() ).thenReturn( new String[] { "Marvin", "VELO", "Froeder" } );
        when( cfg.getRuntimeSharedLibraryPath() ).thenReturn( new IRuntimeSharedLibraryPath[] { runtimeCfg } );
        when( runtimeCfg.pathElement() ).thenReturn( "MyLibrary.swc" );
        when( runtimeCfg.rslUrl() ).thenReturn( urls );
        when( cfg.getFramesConfiguration() ).thenReturn( frameCfg );
        when( frameCfg.getFrame() ).thenReturn( new IFrame[] { frame } );
        when( frame.label() ).thenReturn( "my-frame" );
        when( frame.classname() ).thenReturn( new String[] { "org.package.1", "org.package.2" } );
        when( compilerCfg.getNamespacesConfiguration() ).thenReturn( namespacesCfg );
        when( namespacesCfg.getNamespace() ).thenReturn( new INamespace[] { namespace, namespace2 } );
View Full Code Here

    @Test
    public void emptyCfgParse()
        throws Exception
    {
        ICompcConfiguration cfg = mock( ICompcConfiguration.class, RETURNS_NULL );
        when( cfg.getLoadConfig() ).thenReturn( new String[] {} );

        List<String> args = parser.getArgumentsList( cfg, ICompcConfiguration.class );

        Assert.assertNotNull( args );
        Assert.assertEquals( args.size(), 1, args.toString() );
View Full Code Here

        for ( String bundle : resourceBundleBaseDir.list() )
        {
            bundles.add( bundle.replace( ".properties", "" ) );
        }

        ICompcConfiguration cfg = mock( ICompcConfiguration.class, RETURNS_NULL );
        when( cfg.getLoadConfig() ).thenReturn( getLoadConfig() );
        when( cfg.getIncludeResourceBundles() ).thenReturn( bundles );
        String output = PathUtil.path( baseRbSwc.getFile() ).replace( baseRbSwc.getClassifier(), rbSwc.getClassifier() );
        when( cfg.getOutput() ).thenReturn( output );

        ICompilerConfiguration compilerCfg = mock( ICompilerConfiguration.class, RETURNS_NULL );
        when( compilerCfg.getTheme() ).thenReturn( Collections.EMPTY_LIST );
        when( compilerCfg.getFontsConfiguration() ).thenReturn( getFontsConfiguration() );
        when( compilerCfg.getLocale() ).thenReturn( new String[] { requestedLocale } );
        when( compilerCfg.getSourcePath() ).thenReturn( new File[] { resourceBundleBaseDir } );
        when( compilerCfg.getExternalLibraryPath() ).thenReturn( this.getExternalLibraryPath() );
        when( compilerCfg.getLibraryPath() ).thenReturn( this.getLibraryPath( false ) );

        when( cfg.getCompilerConfiguration() ).thenReturn( compilerCfg );

        try
        {
            checkResult( compiler.compileSwc( cfg, true ) );
        }
View Full Code Here

TOP

Related Classes of net.flexmojos.oss.compiler.ICompcConfiguration

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.