Search in sources :

Example 1 with FlexCompilerProjectConfiguration

use of com.intellij.lang.javascript.flex.build.FlexCompilerProjectConfiguration in project intellij-plugins by JetBrains.

the class FlexUnitExecutionTest method tearDown.

@Override
protected void tearDown() throws Exception {
    FlexCompilerProjectConfiguration c = FlexCompilerProjectConfiguration.getInstance(myProject);
    c.USE_MXMLC_COMPC = myUseMxmlcCompc;
    c.USE_FCSH = myUseFcsh;
    c.USE_BUILT_IN_COMPILER = myUseBuiltInCompiler;
    UIUtil.invokeAndWaitIfNeeded((Runnable) () -> {
        if (BLOCK_PORT_843) {
            myStopBlocking = true;
        }
        try {
            FlexUnitExecutionTest.super.tearDown();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    });
}
Also used : FlexCompilerProjectConfiguration(com.intellij.lang.javascript.flex.build.FlexCompilerProjectConfiguration) SocketTimeoutException(java.net.SocketTimeoutException) IOException(java.io.IOException)

Example 2 with FlexCompilerProjectConfiguration

use of com.intellij.lang.javascript.flex.build.FlexCompilerProjectConfiguration in project intellij-plugins by JetBrains.

the class FlexUnitExecutionTest method setUp.

@Override
protected void setUp() throws Exception {
    UIUtil.invokeAndWaitIfNeeded((Runnable) () -> {
        try {
            FlexUnitExecutionTest.super.setUp();
            CompilerProjectExtension.getInstance(myProject).setCompilerOutputUrl(createOutputFolder().getUrl());
        } catch (Throwable e) {
            e.printStackTrace();
            assertTrue(false);
        }
    });
    if (BLOCK_PORT_843) {
        ApplicationManager.getApplication().executeOnPooledThread(() -> {
            ServerSocket socket = null;
            myStopBlocking = false;
            try {
                socket = new ServerSocket(843);
                socket.setSoTimeout(50);
                while (!myStopBlocking) {
                    try {
                        socket.accept();
                    } catch (SocketTimeoutException e) {
                    // continue looping
                    }
                }
            } catch (IOException e) {
                fail(e.getMessage());
            } finally {
                if (socket != null) {
                    try {
                        socket.close();
                    } catch (IOException e) {
                    // ignore
                    }
                }
            }
        });
    }
    FlexCompilerProjectConfiguration c = FlexCompilerProjectConfiguration.getInstance(myProject);
    myUseMxmlcCompc = c.USE_MXMLC_COMPC;
    myUseBuiltInCompiler = c.USE_BUILT_IN_COMPILER;
    myUseFcsh = c.USE_FCSH;
    c.USE_MXMLC_COMPC = true;
    c.USE_FCSH = false;
    c.USE_BUILT_IN_COMPILER = false;
}
Also used : SocketTimeoutException(java.net.SocketTimeoutException) FlexCompilerProjectConfiguration(com.intellij.lang.javascript.flex.build.FlexCompilerProjectConfiguration) ServerSocket(java.net.ServerSocket) IOException(java.io.IOException)

Aggregations

FlexCompilerProjectConfiguration (com.intellij.lang.javascript.flex.build.FlexCompilerProjectConfiguration)2 IOException (java.io.IOException)2 SocketTimeoutException (java.net.SocketTimeoutException)2 ServerSocket (java.net.ServerSocket)1