<commit_before>package com.a.eye.skywalking.collector.config;

import com.a.eye.skywalking.collector.cluster.ClusterConfig;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * @author pengys5
 */
public class ConfigInitializerTestCase {

    @Before
    public void clear() {
        System.clearProperty("cluster.current.hostname");
        System.clearProperty("cluster.current.port");
        System.clearProperty("cluster.current.roles");
        System.clearProperty("cluster.seed_nodes");
    }

    @Test
    public void testInitialize() throws Exception {
        ConfigInitializer.INSTANCE.initialize();

        Assert.assertEquals("127.0.0.1", ClusterConfig.Cluster.Current.hostname);
        Assert.assertEquals("1000", ClusterConfig.Cluster.Current.port);
        Assert.assertEquals("Test, Test1", ClusterConfig.Cluster.Current.roles);
        Assert.assertEquals("127.0.0.1:1000", ClusterConfig.Cluster.seed_nodes);
    }

    @Test
    public void testInitializeWithCli() throws Exception {
        System.setProperty("cluster.current.hostname", "127.0.0.2");
        System.setProperty("cluster.current.port", "1001");
        System.setProperty("cluster.current.roles", "Test1, Test2");
        System.setProperty("cluster.seed_nodes", "127.0.0.1:1000, 127.0.0.1:1001");

        ConfigInitializer.INSTANCE.initialize();

        Assert.assertEquals("127.0.0.2", ClusterConfig.Cluster.Current.hostname);<commit_msg>repair a test case bug<commit_after>package com.a.eye.skywalking.collector.config;

import com.a.eye.skywalking.collector.cluster.ClusterConfig;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * @author pengys5
 */
public class ConfigInitializerTestCase {

    @Before
    public void clear() {
        System.clearProperty("cluster.current.hostname");
        System.clearProperty("cluster.current.port");
        System.clearProperty("cluster.current.roles");
        System.clearProperty("cluster.seed_nodes");
    }

    @Test
    public void testInitialize() throws Exception {
        ConfigInitializer.INSTANCE.initialize();

        Assert.assertEquals("127.0.0.1", ClusterConfig.Cluster.Current.hostname);
        Assert.assertEquals("1000", ClusterConfig.Cluster.Current.port);
        Assert.assertEquals("WorkersListener", ClusterConfig.Cluster.Current.roles);
        Assert.assertEquals("127.0.0.1:1000", ClusterConfig.Cluster.seed_nodes);
    }

    @Test
    public void testInitializeWithCli() throws Exception {
        System.setProperty("cluster.current.hostname", "127.0.0.2");
        System.setProperty("cluster.current.port", "1001");
        System.setProperty("cluster.current.roles", "Test1, Test2");
        System.setProperty("cluster.seed_nodes", "127.0.0.1:1000, 127.0.0.1:1001");

        ConfigInitializer.INSTANCE.initialize();

        Assert.assertEquals("127.0.0.2", ClusterConfig.Cluster.Current.hostname);
{'fraction_non_alphanumeric': 0.13857677902621723, 'fraction_numerical': 0.040517534899557374, 'mean_word_length': 3.7083333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, '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': '7666698', 'n_tokens_mistral': 913, 'n_tokens_neox': 842, 'n_words': 118}