<commit_before>/*******************************************************************************
 * Copyright (c) 2014
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    <NAME>
 *******************************************************************************/
package org.splevo.vpm.analyzer;

import static org.mockito.Mockito.mock;

import org.graphstream.graph.Graph;
import org.graphstream.graph.Node;
import org.splevo.vpm.analyzer.graph.VPMGraph;
import org.splevo.vpm.variability.VariationPoint;

/**
 * Utility class to support VPM Analysis test development.
 */
public final class VPMAnalyzerTestUtil {

    private VPMAnalyzerTestUtil() {
    }

    /**
     * Create node with a label.
     *
     * @param graph
     *            The graph to create the node in.
     * @param label
     *            The string for the node identifier and label.
     * @return The prepared node.
     */
    public static Node createNode(Graph graph, String label) {
        Node node = graph.addNode(label);
        node.addAttribute(VPMGraph.GS_LABEL, label);

        return node;
    }

    /**
     * Create a node in the graph with the provided label and a mock variation point.
     *
     * @param graph
     *            The graph to add the node to.
     * @param label
     *            The label of the node
     * @return The prepared node.
     */
    public static Node createNodeWithVP(VPMGraph graph, String label) {
        Node node = createNode(graph, label);
        node.addAttribute(VPMGraph.VARIATIONPOINT, mock(VariationPoint.class));
        return node;
    }

}<commit_msg>SPLEVO-240 Refinement Detection: Improve Group Handling Fixed incomplete test data<commit_after>/*******************************************************************************
 * Copyright (c) 2014
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    <NAME>
 *******************************************************************************/
package org.splevo.vpm.analyzer;

import org.graphstream.graph.Graph;
import org.graphstream.graph.Node;
import org.splevo.vpm.analyzer.graph.VPMGraph;
import org.splevo.vpm.variability.VariationPoint;
import org.splevo.vpm.variability.VariationPointGroup;
import org.splevo.vpm.variability.variabilityFactory;

/**
 * Utility class to support VPM Analysis test development.
 */
public final class VPMAnalyzerTestUtil {

    private VPMAnalyzerTestUtil() {
    }

    /**
     * Create node with a label.
     *
     * @param graph
     *            The graph to create the node in.
     * @param label
     *            The string for the node identifier and label.
     * @return The prepared node.
     */
    public static Node createNode(Graph graph, String label) {
        Node node = graph.addNode(label);
        node.addAttribute(VPMGraph.GS_LABEL, label);

        return node;
    }

    /**
     * Create a node in the graph with the provided label and a mock variation point.
     *
     * @param graph
     *            The graph to add the node to.
     * @param label
     *            The label of the node
     * @return The prepared node.
     */
    public static Node createNodeWithVP(VPMGraph graph, String label) {
        Node node = createNode(graph, label);
        VariationPoint vp = variabilityFactory.eINSTANCE.createVariationPoint();
        VariationPointGroup group = variabilityFactory.eINSTANCE.createVariationPointGroup();
        group.setGroupId(label);
        vp.setGroup(group);
        node.addAttribute(VPMGraph.VARIATIONPOINT, vp);
        return node;
    }

}
{'fraction_non_alphanumeric': 0.15818500877412886, 'fraction_numerical': 0.004763098520932565, 'mean_word_length': 2.9387956564659428, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1224692', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1053, 'n_words': 328}