<commit_before>/*
 * ******************************************************************************
 *  * Copyright (c) 2017 <NAME>.
 *  * All rights reserved. This program and the accompanying materials
 *  * are made available under the terms of the GNU Lesser Public License v3.0
 *  * which accompanies this distribution, and is available at
 *  * http://www.gnu.org/licenses/lgpl.html
 *  *
 *  * Contributors:
 *  *     <NAME> - <NAME>, up to version 0.3.1
 *  *     <NAME> - from version 0.4.0 onwards
 *  *     <NAME> - <NAME>, from version 0.4.1 onwards
 *  *****************************************************************************
 */

package com.net2plan.gui.plugins;

import com.net2plan.gui.plugins.networkDesign.visualizationControl.VisualizationState;
import com.net2plan.interfaces.networkDesign.NetPlan;
import com.net2plan.interfaces.networkDesign.NetworkLayer;
import com.net2plan.utils.Pair;
import org.apache.commons.collections15.BidiMap;
import org.junit.BeforeClass;
import org.junit.Test;

import javax.swing.*;
import java.util.Map;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

/**
 * @author <NAME>
 * @date 3/04/17
 */
public class GUINetworkDesignTest
{
    private static GUINetworkDesign callback;
    private static NetPlan netPlan;

    @BeforeClass
    public static void setUp()
    {
        callback = new GUINetworkDesign();
        callback.configure(new JPanel());

        netPlan = new NetPlan();
        callback.setDesign(netPlan);
        final Pair<BidiMap<NetworkLayer, Integer>, Map<NetworkLayer, Boolean>> pair = VisualizationState.generateCanvasDefaultVisualizationLayerInfo(netPlan);
        callback.getVisualizationState().setCanvasLayerVisibilityAndOrder(callback.getDesign(), pair.getFirst(), pair.getSecond());
    }

    @Test
    public void getDesignTest()
    {
        assertNotNull(callback.getDesign());
    }

    @Test
    public void getVisualizationStateTest()
    {
        assertNotNull(callback.getVisualizationState());
    }

    @Test
    public void setDesignTest()
    {
        final NetPlan netPlan = new NetPlan();
        callback.setDesign(netPlan);
        assertEquals(netPlan, callback.getDesign());
    }
}<commit_msg>Small change<commit_after>/*
 * ******************************************************************************
 *  * Copyright (c) 2017 <NAME>.
 *  * All rights reserved. This program and the accompanying materials
 *  * are made available under the terms of the GNU Lesser Public License v3.0
 *  * which accompanies this distribution, and is available at
 *  * http://www.gnu.org/licenses/lgpl.html
 *  *
 *  * Contributors:
 *  *     <NAME> - <NAME>, up to version 0.3.1
 *  *     <NAME> - from version 0.4.0 onwards
 *  *     <NAME> - <NAME>, from version 0.4.1 onwards
 *  *****************************************************************************
 */

package com.net2plan.gui.plugins;

import com.net2plan.gui.plugins.networkDesign.visualizationControl.VisualizationState;
import com.net2plan.interfaces.networkDesign.NetPlan;
import com.net2plan.interfaces.networkDesign.NetworkLayer;
import com.net2plan.utils.Pair;
import org.apache.commons.collections15.BidiMap;
import org.junit.BeforeClass;
import org.junit.Test;

import javax.swing.*;
import java.util.Map;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

/**
 * @author <NAME>
 * @date 3/04/17
 */
public class GUINetworkDesignTest
{
    private static GUINetworkDesign callback;

    @BeforeClass
    public static void setUp()
    {
        callback = new GUINetworkDesign();
        callback.configure(new JPanel());

        final NetPlan netPlan = new NetPlan();
        callback.setDesign(netPlan);
        final Pair<BidiMap<NetworkLayer, Integer>, Map<NetworkLayer, Boolean>> pair = VisualizationState.generateCanvasDefaultVisualizationLayerInfo(netPlan);
        callback.getVisualizationState().setCanvasLayerVisibilityAndOrder(callback.getDesign(), pair.getFirst(), pair.getSecond());
    }

    @Test
    public void getDesignTest()
    {
        assertNotNull(callback.getDesign());
    }

    @Test
    public void getVisualizationStateTest()
    {
        assertNotNull(callback.getVisualizationState());
    }

    @Test
    public void setDesignTest()
    {
        final NetPlan netPlan = new NetPlan();
        callback.setDesign(netPlan);
        assertEquals(netPlan, callback.getDesign());
    }
}
{'fraction_non_alphanumeric': 0.17227546244706932, 'fraction_numerical': 0.012034767104969913, 'mean_word_length': 3.7948717948717947, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5457877', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1224, 'n_words': 281}