<commit_before>package org.jboss.hal.testsuite.test.configuration.infinispan;

import org.apache.commons.lang3.RandomStringUtils;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.hal.testsuite.category.Shared;
import org.jboss.hal.testsuite.creaper.ResourceVerifier;
import org.jboss.hal.testsuite.fragment.config.infinispan.CacheWizard;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.wildfly.extras.creaper.core.online.operations.OperationException;
import org.wildfly.extras.creaper.core.online.operations.Values;

import java.io.IOException;

/**
 * @author mkrajcov <<EMAIL>>
 */
@RunWith(Arquillian.class)
@Category(Shared.class)
public class LocalCacheTestCase extends AbstractCacheTestCase {

    @Override
    @Test
    public void createCache() throws Exception {
        String name = "cn_" + RandomStringUtils.randomAlphanumeric(5);
        CacheWizard wizard = page.content().addCache();

        boolean result = wizard.name(name)
                .finish();

        Assert.assertTrue("Window should be closed", result);
        administration.reloadIfRequired();
        new ResourceVerifier(cacheAddress, client).verifyExists();

        page.content().getResourceManager().removeResourceAndConfirm(name);
        administration.reloadIfRequired();
        new ResourceVerifier(cacheAddress, client).verifyDoesNotExist();
    }

    @Override
    protected CacheType getCacheType() {
        return CacheType.LOCAL;
    }

    @Before
    public void before_() {
        page.local();
        page.selectCache(cacheName);<commit_msg>LocalCacheTestCase: use the right cache.<commit_after>package org.jboss.hal.testsuite.test.configuration.infinispan;

import org.apache.commons.lang3.RandomStringUtils;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.hal.testsuite.category.Shared;
import org.jboss.hal.testsuite.creaper.ResourceVerifier;
import org.jboss.hal.testsuite.fragment.config.infinispan.CacheWizard;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.wildfly.extras.creaper.core.online.operations.Address;
import org.wildfly.extras.creaper.core.online.operations.OperationException;
import org.wildfly.extras.creaper.core.online.operations.Values;

import java.io.IOException;

/**
 * @author mkrajcov <<EMAIL>>
 */
@RunWith(Arquillian.class)
@Category(Shared.class)
public class LocalCacheTestCase extends AbstractCacheTestCase {

    @Override
    @Test
    public void createCache() throws Exception {
        String name = "cn_" + RandomStringUtils.randomAlphanumeric(5);
        Address localCacheAddress = ABSTRACT_CACHE_ADDRESS.and(getCacheType().getAddressName(), name);

        CacheWizard wizard = page.content().addCache();

        try {
            boolean result = wizard.name(name)
                    .finish();

            Assert.assertTrue("Window should be closed", result);
            administration.reloadIfRequired();
            new ResourceVerifier(localCacheAddress, client).verifyExists();

            page.content().getResourceManager().removeResourceAndConfirm(name);
            administration.reloadIfRequired();
            new ResourceVerifier(localCacheAddress, client).verifyDoesNotExist();

        } finally {
            operations.removeIfExists(localCacheAddress);
        }
    }

    @Override
    protected CacheType getCacheType() {
        return CacheType.LOCAL;
    }

    @Before
    public void before_() {
        page.local();
        page.selectCache(cacheName);
{'fraction_non_alphanumeric': 0.1076051779935275, 'fraction_numerical': 0.0010787486515641855, 'mean_word_length': 3.791989664082687, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '264707', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1021, 'n_words': 176}