<commit_before>package org.safehaus.subutai.core.executor.ui;


import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.safehaus.subutai.core.executor.api.CommandExecutor;
import org.safehaus.subutai.core.hostregistry.api.HostRegistry;
import org.safehaus.subutai.server.ui.component.HostTree;

import com.vaadin.ui.TextArea;

import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;


@RunWith( MockitoJUnitRunner.class )
public class TerminalFormTest
{
    private static final String OUTPUT = "output";
    @Mock
    CommandExecutor commandExecutor;
    @Mock
    HostRegistry hostRegistry;
    @Mock
    TextArea commandOutputTxtArea;
    @Mock
    HostTree hostTree;

    TerminalForm terminalForm;


    @Before
    public void setUp() throws Exception
    {
        terminalForm = new TerminalForm( commandExecutor, hostRegistry );
        when( commandOutputTxtArea.getValue() ).thenReturn( OUTPUT );
    }


    @Test
    public void testProperties() throws Exception
    {
        assertNotNull( terminalForm.getHostTree() );
        assertNotNull( terminalForm.getProgramTxtFld() );
        assertNotNull( terminalForm.getTimeoutTxtFld() );
        assertNotNull( terminalForm.getWorkDirTxtFld() );
        assertNotNull( terminalForm.getRunAsTxtFld() );
        assertNotNull( terminalForm.getRequestTypeCombo() );
        assertNotNull( terminalForm.getIndicator() );
        assertNotNull( terminalForm.getTaskCount() );
    }


    @Test
    public void testAddOutput() throws Exception
    {
        terminalForm.commandOutputTxtArea = commandOutputTxtArea;
<commit_msg>SUBUTAI-2804 refactoring environment p2p working environment creation through secure tunnel<commit_after>package org.safehaus.subutai.core.executor.ui;


import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.safehaus.subutai.core.executor.api.CommandExecutor;
import org.safehaus.subutai.core.hostregistry.api.HostRegistry;
import org.safehaus.subutai.server.ui.component.HostTree;

import com.vaadin.ui.TextArea;

import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;


@RunWith( MockitoJUnitRunner.class )
public class TerminalFormTest
{
    private static final String OUTPUT = "output";
    @Mock
    CommandExecutor commandExecutor;
    @Mock
    HostRegistry hostRegistry;
    @Mock
    TextArea commandOutputTxtArea;
    @Mock
    HostTree hostTree;

    TerminalForm terminalForm;


    @Before
    public void setUp() throws Exception
    {
        terminalForm = new TerminalForm( commandExecutor, hostRegistry );
        when( commandOutputTxtArea.getValue() ).thenReturn( OUTPUT );
    }


    @Test
    public void testProperties() throws Exception
    {
        assertNotNull( terminalForm.getHostTree() );
        assertNotNull( terminalForm.getProgramTxtFld() );
        assertNotNull( terminalForm.getTimeoutTxtFld() );
        assertNotNull( terminalForm.getWorkDirTxtFld() );
        assertNotNull( terminalForm.getRunAsTxtFld() );
        assertNotNull( terminalForm.getRequestTypeCombo() );
        assertNotNull( terminalForm.getIndicator() );
        assertNotNull( terminalForm.getTaskCount() );
    }


    @Ignore
    @Test
    public void testAddOutput() throws Exception
    {
        terminalForm.commandOutputTxtArea = commandOutputTxtArea;

{'fraction_non_alphanumeric': 0.0891089108910891, 'fraction_numerical': 0.001337971635001338, 'mean_word_length': 3.9313984168865437, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4561724', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1074, 'n_words': 216}