SimpleName:IDENTIFIER 39 expected expected

SimpleName:IDENTIFIER 39 NodeNotFoundException NodeNotFoundException

SimpleName:IDENTIFIER 40 testBuildSqlInfo testBuildSqlInfo

SimpleName:IDENTIFIER 41 ConditContext ConditContext

SimpleName:IDENTIFIER 41 buildSqlInfo buildSqlInfo

SimpleName:IDENTIFIER 41 BuildSource BuildSource

SimpleName:IDENTIFIER 41 SqlInfo SqlInfo

SimpleName:IDENTIFIER 41 newInstance newInstance

StringLiteralExpr:LITERAL 41 "abcd" "abcd"

@Test(expected = NodeNotFoundException.class)
public void testBuildSqlInfo() {
    ConditContext.buildSqlInfo(new BuildSource(SqlInfo.newInstance()), "abcd");
}

package com.blinkfox.zealot.test.core;

import com.blinkfox.zealot.bean.BuildSource;
import com.blinkfox.zealot.bean.SqlInfo;
import com.blinkfox.zealot.config.ZealotConfigManager;
import com.blinkfox.zealot.core.ConditContext;
import com.blinkfox.zealot.exception.NodeNotFoundException;
import com.blinkfox.zealot.test.config.MyZealotConfig;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

public class adhoc_ConditContextTest {

    @BeforeClass
    public static void init() {
        ZealotConfigManager.getInstance().initLoad(MyZealotConfig.class);
    }

    @AfterClass
    public static void after() {
        ZealotConfigManager.getInstance().clear();
    }
    /*TEST PLACEHOLDER*/
}

测试构建sql片段时未找到Xml中Node节点异常的方法.

测试构建sql片段时未找到Xml中Node节点异常的方法.


SimpleName:IDENTIFIER 42 expected expected

SimpleName:IDENTIFIER 42 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 43 testSameArgumentFailure testSameArgumentFailure

SimpleName:IDENTIFIER 45 Calendar Calendar

SimpleName:IDENTIFIER 45 getInstance getInstance

SimpleName:IDENTIFIER 46 getTime getTime

SimpleName:IDENTIFIER 48 TimeUtils TimeUtils

SimpleName:IDENTIFIER 48 checkTimeInRangeWithSkew checkTimeInRangeWithSkew

@Test(expected = IllegalArgumentException.class)
public void testSameArgumentFailure() {
    Calendar cal = Calendar.getInstance();
    Date now = cal.getTime();
    TimeUtils.checkTimeInRangeWithSkew(now, now, now, 1);
}

package org.italiangrid.voms.test;

import java.util.Calendar;
import java.util.Date;
import org.junit.Assert;
import org.italiangrid.voms.util.TimeUtils;
import org.junit.Test;

public class adhoc_TestTimeUtils {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 51 expected expected

SimpleName:IDENTIFIER 51 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 52 testInvertedIntervalFailure testInvertedIntervalFailure

SimpleName:IDENTIFIER 54 Calendar Calendar

SimpleName:IDENTIFIER 54 getInstance getInstance

SimpleName:IDENTIFIER 55 getTime getTime

SimpleName:IDENTIFIER 56 Calendar Calendar

SimpleName:IDENTIFIER 57 fiveMinutesAgo fiveMinutesAgo

SimpleName:IDENTIFIER 57 getTime getTime

SimpleName:IDENTIFIER 59 TimeUtils TimeUtils

SimpleName:IDENTIFIER 59 checkTimeInRangeWithSkew checkTimeInRangeWithSkew

SimpleName:IDENTIFIER 59 fiveMinutesAgo fiveMinutesAgo

@Test(expected = IllegalArgumentException.class)
public void testInvertedIntervalFailure() {
    Calendar cal = Calendar.getInstance();
    Date now = cal.getTime();
    cal.add(Calendar.MINUTE, -5);
    Date fiveMinutesAgo = cal.getTime();
    TimeUtils.checkTimeInRangeWithSkew(now, now, fiveMinutesAgo, 1);
}


SimpleName:IDENTIFIER 44 expected expected

SimpleName:IDENTIFIER 44 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 45 perPageException perPageException

SimpleName:IDENTIFIER 46 pagination pagination

SimpleName:IDENTIFIER 46 Pagination Pagination

SimpleName:IDENTIFIER 47 pagination pagination

SimpleName:IDENTIFIER 47 setPerPage setPerPage

SimpleName:IDENTIFIER 47 Pagination Pagination

@Test(expected = IllegalArgumentException.class)
public void perPageException() {
    Pagination pagination = new Pagination();
    pagination.setPerPage(Pagination.MAX_ITEMS_PER_PAGE + 1);
}

package org.gitlab.api;

import org.gitlab.api.http.Query;
import org.junit.Test;
import java.io.UnsupportedEncodingException;
import static org.junit.Assert.assertEquals;

public class adhoc_PaginationTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 93 expected expected

SimpleName:IDENTIFIER 93 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 94 shouldFailValidationWithAsciiSpace shouldFailValidationWithAsciiSpace

SimpleName:IDENTIFIER 95 StringUtils StringUtils

SimpleName:IDENTIFIER 95 validateKey validateKey

StringLiteralExpr:LITERAL
95
"key baz"
"key baz"

BooleanLiteralExpr:LITERAL 95 false false

@Test(expected = IllegalArgumentException.class)
public void shouldFailValidationWithAsciiSpace() {
    StringUtils.validateKey("key baz", false);
}

package net.spy.memcached.util;

import net.spy.memcached.MemcachedClientIF;
import org.junit.Before;
import org.junit.Test;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class adhoc_StringUtilsTest {

    private String tooLongKey;

    @Before
    public void setup() {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < MemcachedClientIF.MAX_KEY_LENGTH + 1; i++) {
            builder.append("k");
        }
        tooLongKey = builder.toString();
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 98 expected expected

SimpleName:IDENTIFIER 98 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 99 shouldFailValidationWithAsciiNewline shouldFailValidationWithAsciiNewline

SimpleName:IDENTIFIER 100 StringUtils StringUtils

SimpleName:IDENTIFIER 100 validateKey validateKey

StringLiteralExpr:LITERAL 100 "keybaz\n" "keybaz\n"

BooleanLiteralExpr:LITERAL 100 false false

@Test(expected = IllegalArgumentException.class)
public void shouldFailValidationWithAsciiNewline() {
    StringUtils.validateKey("keybaz\n", false);
}

SimpleName:IDENTIFIER 103 expected expected

SimpleName:IDENTIFIER 103 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 104 shouldFailValidationWithAsciiReturn shouldFailValidationWithAsciiReturn

SimpleName:IDENTIFIER 105 StringUtils StringUtils

SimpleName:IDENTIFIER 105 validateKey validateKey

StringLiteralExpr:LITERAL 105 "keybaz\r" "keybaz\r"

BooleanLiteralExpr:LITERAL 105 false false

@Test(expected = IllegalArgumentException.class)
public void shouldFailValidationWithAsciiReturn() {
    StringUtils.validateKey("keybaz\r", false);
}

SimpleName:IDENTIFIER 108 expected expected

SimpleName:IDENTIFIER 108 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 109 shouldFailValidationWithAsciiNull shouldFailValidationWithAsciiNull

SimpleName:IDENTIFIER 110 StringUtils StringUtils

SimpleName:IDENTIFIER 110 validateKey validateKey

BooleanLiteralExpr:LITERAL 110 false false

@Test(expected = IllegalArgumentException.class)
public void shouldFailValidationWithAsciiNull() {
    StringUtils.validateKey("keybaz\0", false);
}


SimpleName:IDENTIFIER 155 expected expected

SimpleName:IDENTIFIER 155 FileNotFoundException FileNotFoundException

SimpleName:IDENTIFIER 156 testMissingServerXMLFile testMissingServerXMLFile

SimpleName:IDENTIFIER 156 Exception Exception

SimpleName:IDENTIFIER 157 HttpPortUtil HttpPortUtil

SimpleName:IDENTIFIER 157 getHttpPort getHttpPort

StringLiteralExpr:LITERAL 157 "somethingThatIsMissing" "somethingThatIsMissing"

@Test(expected = FileNotFoundException.class)
public void testMissingServerXMLFile() throws Exception {
    HttpPortUtil.getHttpPort(new File("somethingThatIsMissing"), null, null);
}

package io.openliberty.tools.common.arquillian.util;

import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Properties;
import org.junit.Test;
import org.xml.sax.SAXParseException;
import io.openliberty.tools.common.arquillian.util.ArquillianConfigurationException;
import io.openliberty.tools.common.arquillian.util.HttpPortUtil;

public class adhoc_HttpPortUtilTest {

    private static final String SERVER_XML_BEGIN = "<!-- Copyright (c) 2015 IBM Corp. Licensed under the Apache License, Version " + "	2.0 (the \"License\"); you may not use this file except in compliance with " + "	the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 " + "	Unless required by applicable law or agreed to in writing, software distributed " + "	under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES " + "	OR CONDITIONS OF ANY KIND, either express or implied. See the License for " + "	the specific language governing permissions and limitations under the License. -->" + "<server description=\"Sample Liberty server\">" + "	<!-- The features installed by the Liberty application accelerator will " + "		not appear here. Once the application is built the configured features can " + "		be found in the configDropins/defaults folder in the target/wlp folder. -->" + "	<!-- To extend the feature list either add the app accelerator Maven dependencies, " + "		add the features below or put a server.xml file in configDropins/overrides. " + "		Note: you may need to add Maven provided dependencies for use at compile " + "		time if not using app accelerator dependencies. -->" + "	<featureManager>" + "		<feature>localConnector-1.0</feature>" + "		<feature>jpa-2.1</feature>" + "		<feature>jaxrs-2.0</feature>" + "		<feature>ejbLite-3.2</feature>" + "	</featureManager>" + "	<dataSource id=\"mydb\" jndiName=\"jdbc/mydb\"" + "		type=\"javax.sql.ConnectionPoolDataSource\">" + "		<jdbcDriver javax.sql.ConnectionPoolDataSource=\"org.h2.jdbcx.JdbcDataSource\"" + "			javax.sql.DataSource=\"org.h2.jdbcx.JdbcDataSource\"" + "			javax.sql.XADataSource=\"org.h2.jdbcx.JdbcDataSource\" libraryRef=\"SharedLibrary_H2\" />" + "		<properties URL=\"jdbc:h2:~/liberty-crypto-db;DB_CLOSE_ON_EXIT=FALSE\"" + "			user=\"\" password=\"sa\" />" + "	</dataSource>" + "	<library id=\"SharedLibrary_H2\">" + "		<fileset dir=\"${shared.resource.dir}/h2\" id=\"Fileset_H2\" />" + "	</library>" + "	<cors domain=\"/myLibertyApp\" allowedOrigins=\"http://localhost:8081\"" + "		allowedMethods=\"GET, POST, PUT, DELETE, OPTIONS, HEAD\" allowedHeaders=\"origin, content-type, accept, authorization\"" + "		allowCredentials=\"true\" maxAge=\"1209600\" />";

    private static final String SERVER_XML_END = "	<cdi12 enableImplicitBeanArchives=\"false\" />" + "</server>";

    private static final String BOOTSTRAP_PROPERTIES_PORTS = "	<httpEndpoint httpPort=\"${default.http.port}\" httpsPort=\"${default.https.port}\"" + "		id=\"defaultHttpEndpoint\" />";

    private static final String INTEGER_PORTS = "	<httpEndpoint httpPort=\"9081\" httpsPort=\"9444\"" + "		id=\"defaultHttpEndpoint\" />";

    private static final String CONFIG_VARIABLE_XML = "<server><variable name=\"default.http.port\" value=\"9084\"/></server>";

    private static final String CONFIG_VARIABLE_DEFAULT_XML = "<server><variable name=\"default.http.port\" defaultValue=\"9084\"/></server>";

    private static final String CONFIG_VARIABLE_INVALID_XML = "<server><variable name=\"default.http.port\" value=\"invalid\"/></server>";

    private static final String CONFIG_VARIABLE_NO_MATCH_XML = "<server><variable name=\"random\" value=\"random\"/></server>";
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 108 expected expected

SimpleName:IDENTIFIER 108 IndexOutOfBoundsException IndexOutOfBoundsException

SimpleName:IDENTIFIER 109 testAddIndexOneAccessory testAddIndexOneAccessory

SimpleName:IDENTIFIER 109 Exception Exception

SimpleName:IDENTIFIER 110 accessory accessory

SimpleName:IDENTIFIER 110 thenReturn thenReturn

SimpleName:IDENTIFIER 111 addAccessory addAccessory

SimpleName:IDENTIFIER 111 accessory accessory

@Test(expected = IndexOutOfBoundsException.class)
public void testAddIndexOneAccessory() throws Exception {
    when(accessory.getId()).thenReturn(1);
    root.addAccessory(accessory);
}

package io.github.hapjava.server.impl;

import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import io.github.hapjava.accessories.HomekitAccessory;
import io.github.hapjava.server.HomekitAuthInfo;
import io.github.hapjava.server.HomekitWebHandler;
import io.github.hapjava.server.impl.http.HomekitClientConnectionFactory;
import io.github.hapjava.server.impl.jmdns.JmdnsHomekitAdvertiser;
import java.util.concurrent.CompletableFuture;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class adhoc_HomekitRootTest {

    private HomekitAccessory accessory;

    private HomekitRoot root;

    private HomekitWebHandler webHandler;

    private JmdnsHomekitAdvertiser advertiser;

    private HomekitAuthInfo authInfo;

    private static final int PORT = 12345;

    private static final String SETUPID = "Gx12";

    private static final String LABEL = "Test Label";

    @Before
    public void setup() throws Exception {
        accessory = mock(HomekitAccessory.class);
        when(accessory.getId()).thenReturn(2);
        webHandler = mock(HomekitWebHandler.class);
        when(webHandler.start(any())).thenReturn(CompletableFuture.completedFuture(PORT));
        advertiser = mock(JmdnsHomekitAdvertiser.class);
        authInfo = mock(HomekitAuthInfo.class);
        root = new HomekitRoot(LABEL, webHandler, authInfo, advertiser);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 65 expected expected

SimpleName:IDENTIFIER 65 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 66 createWithNull createWithNull

SimpleName:IDENTIFIER 67 TestUtils TestUtils

SimpleName:IDENTIFIER 67 SorterFactory SorterFactory

SimpleName:IDENTIFIER 67 createSorter createSorter

SimpleName:IDENTIFIER 68 SorterFactory SorterFactory

SimpleName:IDENTIFIER 68 getSimpleName getSimpleName

String.format("The SortType (null) is not supported by the %s!", SorterFactory.class.getSimpleName());

@Test(expected = IllegalArgumentException.class)
public void createWithNull() {
    TestUtils.doIllegalArgumentExceptionThrowingOperation(() -> SorterFactory.createSorter(null), () -> String.format("The SortType (null) is not supported by the %s!", SorterFactory.class.getSimpleName()));
}

package org.cp.elements.util.sort;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import org.cp.elements.test.TestUtils;
import org.cp.elements.util.sort.support.BubbleSort;
import org.cp.elements.util.sort.support.CombSort;
import org.cp.elements.util.sort.support.HeapSort;
import org.cp.elements.util.sort.support.InsertionSort;
import org.cp.elements.util.sort.support.MergeSort;
import org.cp.elements.util.sort.support.QuickSort;
import org.cp.elements.util.sort.support.SelectionSort;
import org.cp.elements.util.sort.support.ShellSort;
import org.junit.Test;

public class adhoc_SorterFactoryTests {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 46 expected expected

SimpleName:IDENTIFIER 46 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 47 createSearcherWithNull createSearcherWithNull

SimpleName:IDENTIFIER 48 TestUtils TestUtils

SimpleName:IDENTIFIER 48 SearcherFactory SearcherFactory

SimpleName:IDENTIFIER 48 createSearcher createSearcher

SimpleName:IDENTIFIER 49 SearcherFactory SearcherFactory

SimpleName:IDENTIFIER 49 getSimpleName getSimpleName

String.format("The SearchType (null) is not supported by the %s!", SearcherFactory.class.getSimpleName());

@Test(expected = IllegalArgumentException.class)
public void createSearcherWithNull() {
    TestUtils.doIllegalArgumentExceptionThrowingOperation(() -> SearcherFactory.createSearcher(null), () -> String.format("The SearchType (null) is not supported by the %s!", SearcherFactory.class.getSimpleName()));
}

package org.cp.elements.util.search;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import org.cp.elements.test.TestUtils;
import org.cp.elements.util.search.support.BinarySearch;
import org.cp.elements.util.search.support.LinearSearch;
import org.junit.Test;

public class adhoc_SearcherFactoryTests {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 699 expected expected

SimpleName:IDENTIFIER 699 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 700 newMapEntryIsImmutable newMapEntryIsImmutable

SimpleName:IDENTIFIER 702 mapEntry mapEntry

SimpleName:IDENTIFIER 702 MapUtils MapUtils

SimpleName:IDENTIFIER 702 newMapEntry newMapEntry

StringLiteralExpr:LITERAL 702 "aKey" "aKey"

StringLiteralExpr:LITERAL 702 "aValue" "aValue"

SimpleName:IDENTIFIER 704 assertThat assertThat

SimpleName:IDENTIFIER 704 mapEntry mapEntry

SimpleName:IDENTIFIER 704 isNotNull isNotNull

SimpleName:IDENTIFIER 705 assertThat assertThat

SimpleName:IDENTIFIER 705 mapEntry mapEntry

SimpleName:IDENTIFIER 705 isEqualTo isEqualTo

StringLiteralExpr:LITERAL 705 "aKey" "aKey"

SimpleName:IDENTIFIER 706 assertThat assertThat

SimpleName:IDENTIFIER 706 mapEntry mapEntry

SimpleName:IDENTIFIER 706 getValue getValue

SimpleName:IDENTIFIER 706 isEqualTo isEqualTo

StringLiteralExpr:LITERAL 706 "aValue" "aValue"

SimpleName:IDENTIFIER 709 mapEntry mapEntry

SimpleName:IDENTIFIER 709 setValue setValue

StringLiteralExpr:LITERAL 709 "junk" "junk"

SimpleName:IDENTIFIER 711 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 711 expected expected

SimpleName:IDENTIFIER 713 assertThat assertThat

SimpleName:IDENTIFIER 713 expected expected

SimpleName:IDENTIFIER 713 getMessage getMessage

SimpleName:IDENTIFIER 713 isEqualTo isEqualTo

SimpleName:IDENTIFIER 713 Constants Constants

SimpleName:IDENTIFIER 714 assertThat assertThat

SimpleName:IDENTIFIER 714 expected expected

SimpleName:IDENTIFIER 714 getCause getCause

SimpleName:IDENTIFIER 716 expected expected

@Test(expected = UnsupportedOperationException.class)
public void newMapEntryIsImmutable() {
    Map.Entry<Object, Object> mapEntry = MapUtils.newMapEntry("aKey", "aValue");
    assertThat(mapEntry).isNotNull();
    assertThat(mapEntry.getKey()).isEqualTo("aKey");
    assertThat(mapEntry.getValue()).isEqualTo("aValue");
    try {
        mapEntry.setValue("junk");
    } catch (UnsupportedOperationException expected) {
        assertThat(expected.getMessage()).isEqualTo(Constants.OPERATION_NOT_SUPPORTED);
        assertThat(expected.getCause()).isNull();
        throw expected;
    }
}

package org.cp.elements.util;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
import org.cp.elements.lang.Constants;
import org.cp.elements.lang.FilteringTransformer;
import org.cp.elements.lang.NumberUtils;
import org.junit.Test;

public class adhoc_MapUtilsTests {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 175 expected expected

SimpleName:IDENTIFIER 175 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 176 asImmutableMapEntry asImmutableMapEntry

SimpleName:IDENTIFIER 178 mapEntry mapEntry

SimpleName:IDENTIFIER 178 SimpleKeyValue SimpleKeyValue

SimpleName:IDENTIFIER 178 newKeyValue newKeyValue

StringLiteralExpr:LITERAL 178 "TestKey" "TestKey"

StringLiteralExpr:LITERAL 178 "TestValue" "TestValue"

SimpleName:IDENTIFIER 178 asMapEntry asMapEntry

SimpleName:IDENTIFIER 180 assertThat assertThat

SimpleName:IDENTIFIER 180 mapEntry mapEntry

SimpleName:IDENTIFIER 180 isNotNull isNotNull

SimpleName:IDENTIFIER 181 assertThat assertThat

SimpleName:IDENTIFIER 181 mapEntry mapEntry

SimpleName:IDENTIFIER 181 isEqualTo isEqualTo

StringLiteralExpr:LITERAL 181 "TestKey" "TestKey"

SimpleName:IDENTIFIER 182 assertThat assertThat

SimpleName:IDENTIFIER 182 mapEntry mapEntry

SimpleName:IDENTIFIER 182 getValue getValue

SimpleName:IDENTIFIER 182 isEqualTo isEqualTo

StringLiteralExpr:LITERAL 182 "TestValue" "TestValue"

SimpleName:IDENTIFIER 185 mapEntry mapEntry

SimpleName:IDENTIFIER 185 setValue setValue

StringLiteralExpr:LITERAL 185 "MockValue" "MockValue"

SimpleName:IDENTIFIER 187 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 187 expected expected

SimpleName:IDENTIFIER 189 assertThat assertThat

SimpleName:IDENTIFIER 189 expected expected

SimpleName:IDENTIFIER 189 hasMessage hasMessage

SimpleName:IDENTIFIER 189 Constants Constants

SimpleName:IDENTIFIER 190 assertThat assertThat

SimpleName:IDENTIFIER 190 expected expected

SimpleName:IDENTIFIER 190 hasNoCause hasNoCause

SimpleName:IDENTIFIER 192 expected expected

SimpleName:IDENTIFIER 195 assertThat assertThat

SimpleName:IDENTIFIER 195 mapEntry mapEntry

SimpleName:IDENTIFIER 195 isEqualTo isEqualTo

StringLiteralExpr:LITERAL 195 "TestKey" "TestKey"

SimpleName:IDENTIFIER 196 assertThat assertThat

SimpleName:IDENTIFIER 196 mapEntry mapEntry

SimpleName:IDENTIFIER 196 getValue getValue

SimpleName:IDENTIFIER 196 isEqualTo isEqualTo

StringLiteralExpr:LITERAL 196 "TestValue" "TestValue"

@Test(expected = UnsupportedOperationException.class)
public void asImmutableMapEntry() {
    Map.Entry<Object, Object> mapEntry = SimpleKeyValue.<Object, Object>newKeyValue("TestKey", "TestValue").asMapEntry();
    assertThat(mapEntry).isNotNull();
    assertThat(mapEntry.getKey()).isEqualTo("TestKey");
    assertThat(mapEntry.getValue()).isEqualTo("TestValue");
    try {
        mapEntry.setValue("MockValue");
    } catch (UnsupportedOperationException expected) {
        assertThat(expected).hasMessage(Constants.OPERATION_NOT_SUPPORTED);
        assertThat(expected).hasNoCause();
        throw expected;
    } finally {
        assertThat(mapEntry.getKey()).isEqualTo("TestKey");
        assertThat(mapEntry.getValue()).isEqualTo("TestValue");
    }
}

package org.cp.elements.data.struct;

import static org.assertj.core.api.Assertions.assertThat;
import static org.cp.elements.data.struct.SimpleKeyValue.newKeyValue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.Map;
import java.util.Optional;
import org.cp.elements.lang.Constants;
import org.junit.Test;

public class adhoc_SimpleKeyValueTests {

    @SuppressWarnings("unused")
    static final class TestKeyValue<K, V> extends SimpleKeyValue<K, V> {

        TestKeyValue(K key) {
            super(key);
        }

        TestKeyValue(K key, V value) {
            super(key, value);
        }
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 94 expected expected

SimpleName:IDENTIFIER 94 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 97 mockConverter mockConverter

SimpleName:IDENTIFIER 97 convert convert

SimpleName:IDENTIFIER 97 anyString anyString

SimpleName:IDENTIFIER 97 thenThrow thenThrow

SimpleName:IDENTIFIER 97 newConversionException newConversionException

StringLiteralExpr:LITERAL 97 "test" "test"

SimpleName:IDENTIFIER 99 propertyEditor propertyEditor

SimpleName:IDENTIFIER 99 ConvertingPropertyEditorAdapter ConvertingPropertyEditorAdapter

SimpleName:IDENTIFIER 99 mockConverter mockConverter

SimpleName:IDENTIFIER 102 assertThat assertThat

SimpleName:IDENTIFIER 102 propertyEditor propertyEditor

SimpleName:IDENTIFIER 102 isNotNull isNotNull

SimpleName:IDENTIFIER 103 assertThat assertThat

SimpleName:IDENTIFIER 103 propertyEditor propertyEditor

SimpleName:IDENTIFIER 103 getConverter getConverter

SimpleName:IDENTIFIER 103 isEqualTo isEqualTo

SimpleName:IDENTIFIER 103 mockConverter mockConverter

SimpleName:IDENTIFIER 104 assertThat assertThat

SimpleName:IDENTIFIER 104 propertyEditor propertyEditor

SimpleName:IDENTIFIER 104 getValue getValue

SimpleName:IDENTIFIER 106 propertyEditor propertyEditor

SimpleName:IDENTIFIER 106 setAsText setAsText

StringLiteralExpr:LITERAL 106 "test" "test"

SimpleName:IDENTIFIER 108 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 108 expected expected

SimpleName:IDENTIFIER 110 assertThat assertThat

SimpleName:IDENTIFIER 110 expected expected

SimpleName:IDENTIFIER 110 hasMessage hasMessage

StringLiteralExpr:LITERAL
110
"Could not set text [test] as value"
"Could not set text [test] as value"

SimpleName:IDENTIFIER 111 assertThat assertThat

SimpleName:IDENTIFIER 111 expected expected

SimpleName:IDENTIFIER 111 hasCauseInstanceOf hasCauseInstanceOf

SimpleName:IDENTIFIER 111 ConversionException ConversionException

SimpleName:IDENTIFIER 112 assertThat assertThat

SimpleName:IDENTIFIER 112 expected expected

SimpleName:IDENTIFIER 112 getCause getCause

SimpleName:IDENTIFIER 112 hasMessage hasMessage

StringLiteralExpr:LITERAL 112 "test" "test"

SimpleName:IDENTIFIER 113 assertThat assertThat

SimpleName:IDENTIFIER 113 expected expected

SimpleName:IDENTIFIER 113 getCause getCause

SimpleName:IDENTIFIER 113 hasNoCause hasNoCause

SimpleName:IDENTIFIER 115 expected expected

SimpleName:IDENTIFIER 118 mockConverter mockConverter

SimpleName:IDENTIFIER 118 convert convert

StringLiteralExpr:LITERAL 118 "test" "test"

SimpleName:IDENTIFIER 119 assertThat assertThat

SimpleName:IDENTIFIER 119 propertyEditor propertyEditor

SimpleName:IDENTIFIER 119 getValue getValue

@Test(expected = IllegalArgumentException.class)
public void setAsTextHandlesConversionExceptionThrowsIllegalArgumentException() {
    when(this.mockConverter.convert(anyString())).thenThrow(newConversionException("test"));
    ConvertingPropertyEditorAdapter propertyEditor = ConvertingPropertyEditorAdapter.of(this.mockConverter);
    try {
        assertThat(propertyEditor).isNotNull();
        assertThat(propertyEditor.getConverter()).isEqualTo(this.mockConverter);
        assertThat(propertyEditor.getValue()).isNull();
        propertyEditor.setAsText("test");
    } catch (IllegalArgumentException expected) {
        assertThat(expected).hasMessage("Could not set text [test] as value");
        assertThat(expected).hasCauseInstanceOf(ConversionException.class);
        assertThat(expected.getCause()).hasMessage("test");
        assertThat(expected.getCause()).hasNoCause();
        throw expected;
    } finally {
        verify(this.mockConverter, times(1)).convert(eq("test"));
        assertThat(propertyEditor.getValue()).isNull();
    }
}

package org.cp.elements.data.conversion.support;

import static org.assertj.core.api.Assertions.assertThat;
import static org.cp.elements.lang.ElementsExceptionsFactory.newConversionException;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.cp.elements.data.conversion.ConversionException;
import org.cp.elements.data.conversion.Converter;
import org.cp.elements.enums.Gender;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class adhoc_ConvertingPropertyEditorAdapterTests {

    @Mock
    private Converter<String, Object> mockConverter;
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 92 expected expected

SimpleName:IDENTIFIER 92 ConversionException ConversionException

SimpleName:IDENTIFIER 95 doThrow doThrow

SimpleName:IDENTIFIER 95 newIllegalArgumentException newIllegalArgumentException

StringLiteralExpr:LITERAL 95 "test" "test"

SimpleName:IDENTIFIER 95 mockPropertyEditor mockPropertyEditor

SimpleName:IDENTIFIER 95 setAsText setAsText

SimpleName:IDENTIFIER 95 anyString anyString

SimpleName:IDENTIFIER 98 PropertyEditingConverterAdapter PropertyEditingConverterAdapter

SimpleName:IDENTIFIER 98 mockPropertyEditor mockPropertyEditor

SimpleName:IDENTIFIER 98 convert convert

StringLiteralExpr:LITERAL 98 "test" "test"

SimpleName:IDENTIFIER 100 ConversionException ConversionException

SimpleName:IDENTIFIER 100 expected expected

SimpleName:IDENTIFIER 102 assertThat assertThat

SimpleName:IDENTIFIER 102 expected expected

SimpleName:IDENTIFIER 102 hasMessage hasMessage

SimpleName:IDENTIFIER 103 assertThat assertThat

SimpleName:IDENTIFIER 103 expected expected

SimpleName:IDENTIFIER 103 hasCauseInstanceOf hasCauseInstanceOf

SimpleName:IDENTIFIER 103 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 104 assertThat assertThat

SimpleName:IDENTIFIER 104 expected expected

SimpleName:IDENTIFIER 104 getCause getCause

SimpleName:IDENTIFIER 104 hasMessage hasMessage

StringLiteralExpr:LITERAL 104 "test" "test"

SimpleName:IDENTIFIER 105 assertThat assertThat

SimpleName:IDENTIFIER 105 expected expected

SimpleName:IDENTIFIER 105 getCause getCause

SimpleName:IDENTIFIER 105 hasNoCause hasNoCause

SimpleName:IDENTIFIER 107 expected expected

SimpleName:IDENTIFIER 110 mockPropertyEditor mockPropertyEditor

SimpleName:IDENTIFIER 110 setAsText setAsText

StringLiteralExpr:LITERAL 110 "test" "test"

SimpleName:IDENTIFIER 111 mockPropertyEditor mockPropertyEditor

SimpleName:IDENTIFIER 111 getValue getValue

@Test(expected = ConversionException.class)
public void convertHandlesIllegalArgumentExceptionThrowsConversionException() {
    doThrow(newIllegalArgumentException("test")).when(this.mockPropertyEditor).setAsText(anyString());
    try {
        PropertyEditingConverterAdapter.of(this.mockPropertyEditor).convert("test");
    } catch (ConversionException expected) {
        assertThat(expected).hasMessage("Cannot convert [test] to an Object type");
        assertThat(expected).hasCauseInstanceOf(IllegalArgumentException.class);
        assertThat(expected.getCause()).hasMessage("test");
        assertThat(expected.getCause()).hasNoCause();
        throw expected;
    } finally {
        verify(this.mockPropertyEditor, times(1)).setAsText(eq("test"));
        verify(this.mockPropertyEditor, never()).getValue();
    }
}

package org.cp.elements.data.conversion.support;

import static org.assertj.core.api.Assertions.assertThat;
import static org.cp.elements.lang.RuntimeExceptionsFactory.newIllegalArgumentException;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.beans.PropertyEditor;
import org.cp.elements.data.conversion.ConversionException;
import org.cp.elements.enums.Gender;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class adhoc_PropertyEditingConverterAdapterTests {

    @Mock
    private PropertyEditor mockPropertyEditor;
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 85 expected expected

SimpleName:IDENTIFIER 85 ConversionException ConversionException

SimpleName:IDENTIFIER 89 converter converter

SimpleName:IDENTIFIER 89 convert convert

StringLiteralExpr:LITERAL 89 "test" "test"

SimpleName:IDENTIFIER 91 ConversionException ConversionException

SimpleName:IDENTIFIER 91 expected expected

SimpleName:IDENTIFIER 93 assertThat assertThat

SimpleName:IDENTIFIER 93 expected expected

SimpleName:IDENTIFIER 93 hasMessage hasMessage

StringLiteralExpr:LITERAL
93
"[test] is not a valid BigDecimal"
"[test] is not a valid BigDecimal"

SimpleName:IDENTIFIER 94 assertThat assertThat

SimpleName:IDENTIFIER 94 expected expected

SimpleName:IDENTIFIER 94 hasCauseInstanceOf hasCauseInstanceOf

SimpleName:IDENTIFIER 94 NumberFormatException NumberFormatException

SimpleName:IDENTIFIER 95 assertThat assertThat

SimpleName:IDENTIFIER 95 expected expected

SimpleName:IDENTIFIER 95 getCause getCause

SimpleName:IDENTIFIER 95 hasNoCause hasNoCause

SimpleName:IDENTIFIER 97 expected expected

@Test(expected = ConversionException.class)
public void convertInvalidValueToBigDecimalThrowsException() {
    try {
        this.converter.convert("test");
    } catch (ConversionException expected) {
        assertThat(expected).hasMessage("[test] is not a valid BigDecimal");
        assertThat(expected).hasCauseInstanceOf(NumberFormatException.class);
        assertThat(expected.getCause()).hasNoCause();
        throw expected;
    }
}

package org.cp.elements.data.conversion.converters;

import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.cp.elements.data.conversion.ConversionException;
import org.junit.Test;

public class adhoc_BigDecimalConverterTests {

    private BigDecimalConverter converter = new BigDecimalConverter();
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 77 expected expected

SimpleName:IDENTIFIER 77 ConversionException ConversionException

SimpleName:IDENTIFIER 78 convertInvalidEnumeratedValueOfEnum convertInvalidEnumeratedValueOfEnum

SimpleName:IDENTIFIER 81 converter converter

SimpleName:IDENTIFIER 81 convert convert

SimpleName:IDENTIFIER 83 ConversionException ConversionException

SimpleName:IDENTIFIER 83 expected expected

SimpleName:IDENTIFIER 85 assertThat assertThat

SimpleName:IDENTIFIER 85 expected expected

SimpleName:IDENTIFIER 85 hasMessage hasMessage

SimpleName:IDENTIFIER 86 getName getName

SimpleName:IDENTIFIER 88 assertThat assertThat

SimpleName:IDENTIFIER 88 expected expected

SimpleName:IDENTIFIER 88 hasCauseInstanceOf hasCauseInstanceOf

SimpleName:IDENTIFIER 88 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 89 assertThat assertThat

SimpleName:IDENTIFIER 89 expected expected

SimpleName:IDENTIFIER 89 getCause getCause

SimpleName:IDENTIFIER 89 hasNoCause hasNoCause

SimpleName:IDENTIFIER 91 expected expected

@Test(expected = ConversionException.class)
public void convertInvalidEnumeratedValueOfEnum() {
    try {
        this.converter.convert("IT", Gender.class);
    } catch (ConversionException expected) {
        assertThat(expected).hasMessage("[IT] is not a valid enumerated value of Enum [%s]", Gender.class.getName());
        assertThat(expected).hasCauseInstanceOf(IllegalArgumentException.class);
        assertThat(expected.getCause()).hasNoCause();
        throw expected;
    }
}

package org.cp.elements.data.conversion.converters;

import static org.assertj.core.api.Assertions.assertThat;
import org.cp.elements.data.conversion.ConversionException;
import org.cp.elements.enums.Gender;
import org.cp.elements.enums.Race;
import org.cp.elements.enums.TimeUnit;
import org.junit.Test;

public class adhoc_EnumConverterTests {

    private EnumConverter converter = new EnumConverter();
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 95 expected expected

SimpleName:IDENTIFIER 95 ConversionException ConversionException

SimpleName:IDENTIFIER 99 converter converter

SimpleName:IDENTIFIER 99 convert convert

StringLiteralExpr:LITERAL 99 "BLACK" "BLACK"

SimpleName:IDENTIFIER 101 ConversionException ConversionException

SimpleName:IDENTIFIER 101 expected expected

SimpleName:IDENTIFIER 103 assertThat assertThat

SimpleName:IDENTIFIER 103 expected expected

SimpleName:IDENTIFIER 103 hasMessage hasMessage

SimpleName:IDENTIFIER 104 getName getName

SimpleName:IDENTIFIER 106 assertThat assertThat

SimpleName:IDENTIFIER 106 expected expected

SimpleName:IDENTIFIER 106 hasCauseInstanceOf hasCauseInstanceOf

SimpleName:IDENTIFIER 106 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 107 assertThat assertThat

SimpleName:IDENTIFIER 107 expected expected

SimpleName:IDENTIFIER 107 getCause getCause

SimpleName:IDENTIFIER 107 hasNoCause hasNoCause

SimpleName:IDENTIFIER 109 expected expected

@Test(expected = ConversionException.class)
public void convertInvalidStringToEnumThrowsException() {
    try {
        this.converter.convert("BLACK", Gender.class);
    } catch (ConversionException expected) {
        assertThat(expected).hasMessage("[BLACK] is not a valid enumerated value of Enum [%s]", Gender.class.getName());
        assertThat(expected).hasCauseInstanceOf(IllegalArgumentException.class);
        assertThat(expected.getCause()).hasNoCause();
        throw expected;
    }
}

SimpleName:IDENTIFIER 113 expected expected

SimpleName:IDENTIFIER 113 ConversionException ConversionException

SimpleName:IDENTIFIER 114 convertWithEnumThrowsException convertWithEnumThrowsException

SimpleName:IDENTIFIER 117 converter converter

SimpleName:IDENTIFIER 117 convert convert

StringLiteralExpr:LITERAL 117 "test" "test"

SimpleName:IDENTIFIER 119 ConversionException ConversionException

SimpleName:IDENTIFIER 119 expected expected

SimpleName:IDENTIFIER 121 assertThat assertThat

SimpleName:IDENTIFIER 121 expected expected

SimpleName:IDENTIFIER 121 hasMessage hasMessage

SimpleName:IDENTIFIER 122 getName getName

SimpleName:IDENTIFIER 124 assertThat assertThat

SimpleName:IDENTIFIER 124 expected expected

SimpleName:IDENTIFIER 124 hasCauseInstanceOf hasCauseInstanceOf

SimpleName:IDENTIFIER 124 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 125 assertThat assertThat

SimpleName:IDENTIFIER 125 expected expected

SimpleName:IDENTIFIER 125 getCause getCause

SimpleName:IDENTIFIER 125 hasNoCause hasNoCause

SimpleName:IDENTIFIER 127 expected expected

@Test(expected = ConversionException.class)
public void convertWithEnumThrowsException() {
    try {
        this.converter.convert("test", Enum.class);
    } catch (ConversionException expected) {
        assertThat(expected).hasMessage("[test] is not a valid enumerated value of Enum [%s]", Enum.class.getName());
        assertThat(expected).hasCauseInstanceOf(IllegalArgumentException.class);
        assertThat(expected.getCause()).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 79 expected expected

SimpleName:IDENTIFIER 79 ConversionException ConversionException

SimpleName:IDENTIFIER 83 converter converter

SimpleName:IDENTIFIER 83 convert convert

StringLiteralExpr:LITERAL 83 "test" "test"

SimpleName:IDENTIFIER 85 ConversionException ConversionException

SimpleName:IDENTIFIER 85 expected expected

SimpleName:IDENTIFIER 87 assertThat assertThat

SimpleName:IDENTIFIER 87 expected expected

SimpleName:IDENTIFIER 87 hasMessage hasMessage

StringLiteralExpr:LITERAL
87
"[test] is not a valid BigInteger"
"[test] is not a valid BigInteger"

SimpleName:IDENTIFIER 88 assertThat assertThat

SimpleName:IDENTIFIER 88 expected expected

SimpleName:IDENTIFIER 88 hasCauseInstanceOf hasCauseInstanceOf

SimpleName:IDENTIFIER 88 NumberFormatException NumberFormatException

SimpleName:IDENTIFIER 89 assertThat assertThat

SimpleName:IDENTIFIER 89 expected expected

SimpleName:IDENTIFIER 89 getCause getCause

SimpleName:IDENTIFIER 89 hasNoCause hasNoCause

SimpleName:IDENTIFIER 91 expected expected

@Test(expected = ConversionException.class)
public void convertInvalidValueToBigIntegerThrowsException() {
    try {
        this.converter.convert("test");
    } catch (ConversionException expected) {
        assertThat(expected).hasMessage("[test] is not a valid BigInteger");
        assertThat(expected).hasCauseInstanceOf(NumberFormatException.class);
        assertThat(expected.getCause()).hasNoCause();
        throw expected;
    }
}

package org.cp.elements.data.conversion.converters;

import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.cp.elements.data.conversion.ConversionException;
import org.junit.Test;

public class adhoc_BigIntegerConverterTests {

    private BigIntegerConverter converter = new BigIntegerConverter();
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 262 expected expected

SimpleName:IDENTIFIER 262 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 264 newConverter newConverter

SimpleName:IDENTIFIER 264 convert convert

StringLiteralExpr:LITERAL 264 "test" "test"

@Test(expected = UnsupportedOperationException.class)
public void convertThrowsUnsupportedOperationException() {
    newConverter().convert("test");
}

package org.cp.elements.data.conversion;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import java.net.URL;
import java.sql.Date;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Calendar;
import java.util.function.Function;
import org.junit.Test;

@SuppressWarnings("unused")
public class adhoc_AbstractConverterTests {

    private AbstractConverter<Object, Object> newConverter() {
        return new TestConverter();
    }

    private AbstractConverter<Object, Object> newConverter(Class<?> type) {
        return new TestConverter(type);
    }

    static class ObjectToStringConverter extends AbstractConverter<Object, String> {
    }

    static class ObjectToStringFunction implements Function<Object, String> {

        @Override
        public String apply(Object obj) {
            return String.valueOf(obj);
        }
    }

    static class RawTypeConverter extends AbstractConverter {
    }

    static class StringToIntegerConverter extends AbstractConverter<String, Integer> {
    }

    static class StringToNumberConverter extends AbstractConverter<String, Number> {
    }

    static class StringToUrlConverter extends AbstractConverter<String, URL> {
    }

    static class TimestampToLocalDateTimeConverter extends AbstractConverter<Timestamp, LocalDateTime> {
    }

    static class TestConverter extends AbstractConverter<Object, Object> {

        TestConverter() {
        }

        TestConverter(Class<?> type) {
            super(type);
        }
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 210 expected expected

SimpleName:IDENTIFIER 210 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 213 cacheMap cacheMap

SimpleName:IDENTIFIER 213 CacheToMapAdapter CacheToMapAdapter

SimpleName:IDENTIFIER 213 MapToCacheAdapter MapToCacheAdapter

SimpleName:IDENTIFIER 214 Collections Collections

SimpleName:IDENTIFIER 214 Comparable Comparable

SimpleName:IDENTIFIER 214 singletonMap singletonMap

StringLiteralExpr:LITERAL 214 "key" "key"

StringLiteralExpr:LITERAL 214 "value" "value"

SimpleName:IDENTIFIER 216 assertThat assertThat

SimpleName:IDENTIFIER 216 cacheMap cacheMap

SimpleName:IDENTIFIER 216 isNotNull isNotNull

SimpleName:IDENTIFIER 217 assertThat assertThat

SimpleName:IDENTIFIER 217 cacheMap cacheMap

SimpleName:IDENTIFIER 217 hasSize hasSize

SimpleName:IDENTIFIER 219 entrySet entrySet

SimpleName:IDENTIFIER 219 cacheMap cacheMap

SimpleName:IDENTIFIER 221 assertThat assertThat

SimpleName:IDENTIFIER 221 entrySet entrySet

SimpleName:IDENTIFIER 221 isNotNull isNotNull

SimpleName:IDENTIFIER 222 assertThat assertThat

SimpleName:IDENTIFIER 222 entrySet entrySet

SimpleName:IDENTIFIER 222 hasSize hasSize

SimpleName:IDENTIFIER 224 entrySetIterator entrySetIterator

SimpleName:IDENTIFIER 224 entrySet entrySet

SimpleName:IDENTIFIER 224 iterator iterator

SimpleName:IDENTIFIER 226 assertThat assertThat

SimpleName:IDENTIFIER 226 entrySetIterator entrySetIterator

SimpleName:IDENTIFIER 226 hasNext hasNext

SimpleName:IDENTIFIER 227 assertThat assertThat

SimpleName:IDENTIFIER 227 entrySetIterator entrySetIterator

SimpleName:IDENTIFIER 227 getValue getValue

SimpleName:IDENTIFIER 227 isEqualTo isEqualTo

StringLiteralExpr:LITERAL 227 "value" "value"

SimpleName:IDENTIFIER 228 assertThat assertThat

SimpleName:IDENTIFIER 228 entrySetIterator entrySetIterator

SimpleName:IDENTIFIER 228 hasNext hasNext

SimpleName:IDENTIFIER 228 isFalse isFalse

SimpleName:IDENTIFIER 231 entrySetIterator entrySetIterator

SimpleName:IDENTIFIER 233 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 233 expected expected

SimpleName:IDENTIFIER 235 assertThat assertThat

SimpleName:IDENTIFIER 235 expected expected

SimpleName:IDENTIFIER 235 hasMessage hasMessage

StringLiteralExpr:LITERAL
235
"No more cache entries"
"No more cache entries"

SimpleName:IDENTIFIER 236 assertThat assertThat

SimpleName:IDENTIFIER 236 expected expected

SimpleName:IDENTIFIER 236 hasNoCause hasNoCause

SimpleName:IDENTIFIER 238 expected expected

@Test(expected = NoSuchElementException.class)
public void entrySetNextWithNoMoreCacheEntriesThrowsNoSuchElementException() {
    Map cacheMap = CacheToMapAdapter.of(MapToCacheAdapter.of(Collections.<Comparable, Object>singletonMap("key", "value")));
    assertThat(cacheMap).isNotNull();
    assertThat(cacheMap).hasSize(1);
    Set entrySet = cacheMap.entrySet();
    assertThat(entrySet).isNotNull();
    assertThat(entrySet).hasSize(1);
    Iterator<Map.Entry> entrySetIterator = entrySet.iterator();
    assertThat(entrySetIterator.hasNext()).isTrue();
    assertThat(entrySetIterator.next().getValue()).isEqualTo("value");
    assertThat(entrySetIterator.hasNext()).isFalse();
    try {
        entrySetIterator.next();
    } catch (NoSuchElementException expected) {
        assertThat(expected).hasMessage("No more cache entries");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}

package org.cp.elements.data.caching.support;

import static org.assertj.core.api.Assertions.assertThat;
import static org.cp.elements.data.caching.support.CacheToMapAdapter.CacheEntry;
import static org.cp.elements.util.CollectionUtils.asSet;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.atMost;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import org.cp.elements.data.caching.Cache;
import org.cp.elements.util.ArrayUtils;
import org.cp.elements.util.MapBuilder;
import org.cp.elements.util.MapUtils;
import org.junit.Test;

@SuppressWarnings({ "rawtypes", "unchecked" })
public class adhoc_CacheToMapAdapterTests {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 46 expected expected

SimpleName:IDENTIFIER 46 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 52 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 52 expected expected

SimpleName:IDENTIFIER 54 assertThat assertThat

SimpleName:IDENTIFIER 54 expected expected

SimpleName:IDENTIFIER 54 hasMessage hasMessage

StringLiteralExpr:LITERAL
54
"Clear is not supported"
"Clear is not supported"

SimpleName:IDENTIFIER 55 assertThat assertThat

SimpleName:IDENTIFIER 55 expected expected

SimpleName:IDENTIFIER 55 hasNoCause hasNoCause

SimpleName:IDENTIFIER 57 expected expected

@Test(expected = UnsupportedOperationException.class)
public void clearThrowsUnsupportedOperationException() {
    try {
        this.cache.clear();
    } catch (UnsupportedOperationException expected) {
        assertThat(expected).hasMessage("Clear is not supported");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}

package org.cp.elements.data.caching.support;

import static org.assertj.core.api.Assertions.assertThat;
import java.util.Iterator;
import org.junit.Test;

@SuppressWarnings({ "rawtypes", "unchecked" })
public class adhoc_ReadOnlyCacheTests {

    private ReadOnlyCache cache = new ReadOnlyCache() {
    };

    private static <T> Iterable<T> asIterable(Iterator<T> iterator) {
        return () -> iterator;
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 36 expected expected

SimpleName:IDENTIFIER 36 UnsupportedOperationException UnsupportedOperationException

{
    this.table.add(mock(Column.class));
}

@Test(expected = UnsupportedOperationException.class)
public void addColumnThrowsUnsupportedOperationException() {
    this.table.add(mock(Column.class));
}

{
    this.table.add(mock(Column.class));
}

package org.cp.elements.data.struct.tabular;

import static org.mockito.Mockito.mock;
import org.junit.Test;

public class adhoc_AbstractTableTests {

    private AbstractTable table = new TestTable();

    private static final class TestTable extends AbstractTable {
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 41 expected expected

SimpleName:IDENTIFIER 41 UnsupportedOperationException UnsupportedOperationException

{
    this.table.add(mock(Row.class));
}

@Test(expected = UnsupportedOperationException.class)
public void addRowThrowsUnsupportedOperationException() {
    this.table.add(mock(Row.class));
}

{
    this.table.add(mock(Row.class));
}


SimpleName:IDENTIFIER 46 expected expected

SimpleName:IDENTIFIER 46 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 48 removeColumn removeColumn

@Test(expected = UnsupportedOperationException.class)
public void removeColumnAtIndexThrowsUnsupportedOperationException() {
    this.table.removeColumn(0);
}


SimpleName:IDENTIFIER 51 expected expected

SimpleName:IDENTIFIER 51 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 53 removeRow removeRow

@Test(expected = UnsupportedOperationException.class)
public void removeRowAtIndexThrowsUnsupportedOperationException() {
    this.table.removeRow(0);
}


SimpleName:IDENTIFIER 70 expected expected

SimpleName:IDENTIFIER 70 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 71 isRunningThrowsIllegalStateException isRunningThrowsIllegalStateException

SimpleName:IDENTIFIER 74 mockExecutable mockExecutable

SimpleName:IDENTIFIER 74 isRunning isRunning

SimpleName:IDENTIFIER 74 thenCallRealMethod thenCallRealMethod

SimpleName:IDENTIFIER 76 mockExecutable mockExecutable

SimpleName:IDENTIFIER 76 isRunning isRunning

SimpleName:IDENTIFIER 78 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 78 expected expected

SimpleName:IDENTIFIER 80 assertThat assertThat

SimpleName:IDENTIFIER 80 expected expected

SimpleName:IDENTIFIER 80 hasMessage hasMessage

SimpleName:IDENTIFIER 81 assertThat assertThat

SimpleName:IDENTIFIER 81 expected expected

SimpleName:IDENTIFIER 81 hasNoCause hasNoCause

SimpleName:IDENTIFIER 83 expected expected

@Test(expected = IllegalStateException.class)
public void isRunningThrowsIllegalStateException() {
    try {
        when(this.mockExecutable.isRunning()).thenCallRealMethod();
        this.mockExecutable.isRunning();
    } catch (IllegalStateException expected) {
        assertThat(expected).hasMessage("The runnable state of this object cannot be determined");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}

package org.cp.elements.lang;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doCallRealMethod;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class adhoc_ExecutableTests {

    @Mock
    private Executable mockExecutable;
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 118 expected expected

SimpleName:IDENTIFIER 118 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 122 argument argument

BooleanLiteralExpr:LITERAL 122 false false

StringLiteralExpr:LITERAL 122 "test" "test"

SimpleName:IDENTIFIER 124 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 124 expected expected

SimpleName:IDENTIFIER 126 assertThat assertThat

SimpleName:IDENTIFIER 126 expected expected

SimpleName:IDENTIFIER 126 hasMessage hasMessage

StringLiteralExpr:LITERAL 126 "test" "test"

SimpleName:IDENTIFIER 127 assertThat assertThat

SimpleName:IDENTIFIER 127 expected expected

SimpleName:IDENTIFIER 127 hasNoCause hasNoCause

SimpleName:IDENTIFIER 129 expected expected

@Test(expected = IllegalArgumentException.class)
public void assertArgumentUsesSuppliedMessageThrowsIllegalArgumentException() {
    try {
        Assert.argument(false, () -> "test");
    } catch (IllegalArgumentException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}

package org.cp.elements.lang;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Month;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
import org.junit.Test;

public class adhoc_AssertUnitTests {

    private static final Object LOCK = new Object();

    private static Object returnsNull() {
        return null;
    }

    private void testAssertNotEmptyCollectionWithEmptyCollection(Collection<?> collection) {
        try {
            Assert.notEmpty(collection);
        } catch (IllegalArgumentException expected) {
            assertThat(expected).hasMessage("Collection is empty");
            assertThat(expected).hasNoCause();
            throw expected;
        }
    }

    private enum TestEnum {

        ONE, TWO
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 246 expected expected

SimpleName:IDENTIFIER 246 ComparisonException ComparisonException

SimpleName:IDENTIFIER 250 comparable comparable

StringLiteralExpr:LITERAL 250 "test" "test"

StringLiteralExpr:LITERAL 250 "mock" "mock"

SimpleName:IDENTIFIER 252 ComparisonException ComparisonException

SimpleName:IDENTIFIER 252 expected expected

SimpleName:IDENTIFIER 254 assertThat assertThat

SimpleName:IDENTIFIER 254 expected expected

SimpleName:IDENTIFIER 254 hasMessage hasMessage

StringLiteralExpr:LITERAL 254 "test" "test"

SimpleName:IDENTIFIER 255 assertThat assertThat

SimpleName:IDENTIFIER 255 expected expected

SimpleName:IDENTIFIER 255 hasNoCause hasNoCause

SimpleName:IDENTIFIER 257 expected expected

@Test(expected = ComparisonException.class)
public void assertComparableUsesSuppliedMessageThrowsComparisonException() {
    try {
        Assert.comparable("test", "mock", () -> "test");
    } catch (ComparisonException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 456 expected expected

SimpleName:IDENTIFIER 456 EqualityException EqualityException

StringLiteralExpr:LITERAL 460 "test" "test"

StringLiteralExpr:LITERAL 460 "mock" "mock"

SimpleName:IDENTIFIER 462 EqualityException EqualityException

SimpleName:IDENTIFIER 462 expected expected

SimpleName:IDENTIFIER 464 assertThat assertThat

SimpleName:IDENTIFIER 464 expected expected

SimpleName:IDENTIFIER 464 hasMessage hasMessage

StringLiteralExpr:LITERAL 464 "test" "test"

SimpleName:IDENTIFIER 465 assertThat assertThat

SimpleName:IDENTIFIER 465 expected expected

SimpleName:IDENTIFIER 465 hasNoCause hasNoCause

SimpleName:IDENTIFIER 467 expected expected

@Test(expected = EqualityException.class)
public void assertEqualsUsesSuppliedMessageThrowsEqualityException() {
    try {
        Assert.equals("test", "mock", () -> "test");
    } catch (EqualityException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 576 expected expected

SimpleName:IDENTIFIER 576 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 580 hasText hasText

StringLiteralExpr:LITERAL
580
"   "
"   "

StringLiteralExpr:LITERAL 580 "test" "test"

{
    Assert.hasText("   ", () -> "test");
}

SimpleName:IDENTIFIER 582 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 582 expected expected

SimpleName:IDENTIFIER 584 assertThat assertThat

SimpleName:IDENTIFIER 584 expected expected

SimpleName:IDENTIFIER 584 hasMessage hasMessage

StringLiteralExpr:LITERAL 584 "test" "test"

SimpleName:IDENTIFIER 585 assertThat assertThat

SimpleName:IDENTIFIER 585 expected expected

SimpleName:IDENTIFIER 585 hasNoCause hasNoCause

SimpleName:IDENTIFIER 587 expected expected

@Test(expected = IllegalArgumentException.class)
public void assertHasTextUsesSuppliedMessageThrowsIllegalArgumentException() {
    try {
        Assert.hasText("   ", () -> "test");
    } catch (IllegalArgumentException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 676 expected expected

SimpleName:IDENTIFIER 676 IllegalMonitorStateException IllegalMonitorStateException

SimpleName:IDENTIFIER 680 holdsLock holdsLock

StringLiteralExpr:LITERAL 680 "test" "test"

SimpleName:IDENTIFIER 682 IllegalMonitorStateException IllegalMonitorStateException

SimpleName:IDENTIFIER 682 expected expected

SimpleName:IDENTIFIER 684 assertThat assertThat

SimpleName:IDENTIFIER 684 expected expected

SimpleName:IDENTIFIER 684 hasMessage hasMessage

StringLiteralExpr:LITERAL 684 "test" "test"

SimpleName:IDENTIFIER 685 assertThat assertThat

SimpleName:IDENTIFIER 685 expected expected

SimpleName:IDENTIFIER 685 hasNoCause hasNoCause

SimpleName:IDENTIFIER 687 expected expected

@Test(expected = IllegalMonitorStateException.class)
public void assertHoldsLockUsesSuppliedMessageThrowsIllegalMonitorStateException() {
    try {
        Assert.holdsLock(LOCK, () -> "test");
    } catch (IllegalMonitorStateException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 796 expected expected

SimpleName:IDENTIFIER 796 ClassCastException ClassCastException

SimpleName:IDENTIFIER 800 isAssignableTo isAssignableTo

SimpleName:IDENTIFIER 800 Integer Integer

StringLiteralExpr:LITERAL 800 "test" "test"

SimpleName:IDENTIFIER 802 ClassCastException ClassCastException

SimpleName:IDENTIFIER 802 expected expected

SimpleName:IDENTIFIER 804 assertThat assertThat

SimpleName:IDENTIFIER 804 expected expected

SimpleName:IDENTIFIER 804 hasMessage hasMessage

StringLiteralExpr:LITERAL 804 "test" "test"

SimpleName:IDENTIFIER 805 assertThat assertThat

SimpleName:IDENTIFIER 805 expected expected

SimpleName:IDENTIFIER 805 hasNoCause hasNoCause

SimpleName:IDENTIFIER 807 expected expected

@Test(expected = ClassCastException.class)
public void assertIsAssignableToUsesSuppliedMessageThrowsClassCastException() {
    try {
        Assert.isAssignableTo(Integer.class, Long.class, () -> "test");
    } catch (ClassCastException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 894 expected expected

SimpleName:IDENTIFIER 894 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 898 isFalse isFalse

BooleanLiteralExpr:LITERAL 898 true true

StringLiteralExpr:LITERAL 898 "test" "test"

{
    Assert.isFalse(true, () -> "test");
}

SimpleName:IDENTIFIER 900 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 900 expected expected

SimpleName:IDENTIFIER 902 assertThat assertThat

SimpleName:IDENTIFIER 902 expected expected

SimpleName:IDENTIFIER 902 hasMessage hasMessage

StringLiteralExpr:LITERAL 902 "test" "test"

SimpleName:IDENTIFIER 903 assertThat assertThat

SimpleName:IDENTIFIER 903 expected expected

SimpleName:IDENTIFIER 903 hasNoCause hasNoCause

SimpleName:IDENTIFIER 905 expected expected

@Test(expected = IllegalArgumentException.class)
public void assertIsFalseUsesSuppliedMessageThrowsIllegalArgumentException() {
    try {
        Assert.isFalse(true, () -> "test");
    } catch (IllegalArgumentException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 1016 expected expected

SimpleName:IDENTIFIER 1016 IllegalTypeException IllegalTypeException

SimpleName:IDENTIFIER 1020 Assert Assert

SimpleName:IDENTIFIER 1020 isInstanceOf isInstanceOf

SimpleName:IDENTIFIER 1020 String String

StringLiteralExpr:LITERAL 1020 "test" "test"

SimpleName:IDENTIFIER 1022 IllegalTypeException IllegalTypeException

SimpleName:IDENTIFIER 1022 expected expected

SimpleName:IDENTIFIER 1024 assertThat assertThat

SimpleName:IDENTIFIER 1024 expected expected

SimpleName:IDENTIFIER 1024 hasMessage hasMessage

StringLiteralExpr:LITERAL 1024 "test" "test"

SimpleName:IDENTIFIER 1025 assertThat assertThat

SimpleName:IDENTIFIER 1025 expected expected

SimpleName:IDENTIFIER 1025 hasNoCause hasNoCause

SimpleName:IDENTIFIER 1027 expected expected

@Test(expected = IllegalTypeException.class)
public void assertIsInstanceOfUsesSuppliedMessageThrowsIllegalTypeException() {
    try {
        Assert.isInstanceOf('x', String.class, () -> "test");
    } catch (IllegalTypeException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 1116 expected expected

SimpleName:IDENTIFIER 1116 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1120 Assert Assert

SimpleName:IDENTIFIER 1120 isTrue isTrue

BooleanLiteralExpr:LITERAL 1120 false false

StringLiteralExpr:LITERAL 1120 "test" "test"

{
    Assert.isTrue(false, () -> "test");
}

SimpleName:IDENTIFIER 1122 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1122 expected expected

SimpleName:IDENTIFIER 1124 assertThat assertThat

SimpleName:IDENTIFIER 1124 expected expected

SimpleName:IDENTIFIER 1124 hasMessage hasMessage

StringLiteralExpr:LITERAL 1124 "test" "test"

SimpleName:IDENTIFIER 1125 assertThat assertThat

SimpleName:IDENTIFIER 1125 expected expected

SimpleName:IDENTIFIER 1125 hasNoCause hasNoCause

SimpleName:IDENTIFIER 1127 expected expected

@Test(expected = IllegalArgumentException.class)
public void assertIsTrueUsesSuppliedMessageThrowsIllegalArgumentException() {
    try {
        Assert.isTrue(false, () -> "test");
    } catch (IllegalArgumentException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 1218 expected expected

SimpleName:IDENTIFIER 1218 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1222 Assert Assert

SimpleName:IDENTIFIER 1222 notEmpty notEmpty

StringLiteralExpr:LITERAL 1222 "test" "test"

{
    Assert.notEmpty("", () -> "test");
}

SimpleName:IDENTIFIER 1224 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1224 expected expected

SimpleName:IDENTIFIER 1226 assertThat assertThat

SimpleName:IDENTIFIER 1226 expected expected

SimpleName:IDENTIFIER 1226 hasMessage hasMessage

StringLiteralExpr:LITERAL 1226 "test" "test"

SimpleName:IDENTIFIER 1227 assertThat assertThat

SimpleName:IDENTIFIER 1227 expected expected

SimpleName:IDENTIFIER 1227 hasNoCause hasNoCause

SimpleName:IDENTIFIER 1229 expected expected

@Test(expected = IllegalArgumentException.class)
public void assertNotEmptyStringUsesSuppliedMessageThrowsIllegalArgumentException() {
    try {
        Assert.notEmpty("", () -> "test");
    } catch (IllegalArgumentException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 1320 expected expected

SimpleName:IDENTIFIER 1320 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1324 Assert Assert

SimpleName:IDENTIFIER 1324 notEmpty notEmpty

SimpleName:IDENTIFIER 1324 Object Object

StringLiteralExpr:LITERAL 1324 "test" "test"

SimpleName:IDENTIFIER 1326 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1326 expected expected

SimpleName:IDENTIFIER 1328 assertThat assertThat

SimpleName:IDENTIFIER 1328 expected expected

SimpleName:IDENTIFIER 1328 hasMessage hasMessage

StringLiteralExpr:LITERAL 1328 "test" "test"

SimpleName:IDENTIFIER 1329 assertThat assertThat

SimpleName:IDENTIFIER 1329 expected expected

SimpleName:IDENTIFIER 1329 hasNoCause hasNoCause

SimpleName:IDENTIFIER 1331 expected expected

@Test(expected = IllegalArgumentException.class)
public void assertNotEmptyArrayUsesSuppliedMessageThrowsIllegalArgumentException() {
    try {
        Assert.notEmpty(new Object[0], () -> "test");
    } catch (IllegalArgumentException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 1428 expected expected

SimpleName:IDENTIFIER 1428 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1432 Assert Assert

SimpleName:IDENTIFIER 1432 notEmpty notEmpty

SimpleName:IDENTIFIER 1432 Collections Collections

SimpleName:IDENTIFIER 1432 emptySet emptySet

StringLiteralExpr:LITERAL 1432 "test" "test"

SimpleName:IDENTIFIER 1434 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1434 expected expected

SimpleName:IDENTIFIER 1436 assertThat assertThat

SimpleName:IDENTIFIER 1436 expected expected

SimpleName:IDENTIFIER 1436 hasMessage hasMessage

StringLiteralExpr:LITERAL 1436 "test" "test"

SimpleName:IDENTIFIER 1437 assertThat assertThat

SimpleName:IDENTIFIER 1437 expected expected

SimpleName:IDENTIFIER 1437 hasNoCause hasNoCause

SimpleName:IDENTIFIER 1439 expected expected

@Test(expected = IllegalArgumentException.class)
public void assertNotEmptyCollectionUsesSuppliedMessageThrowsIllegalArgumentException() {
    try {
        Assert.notEmpty(Collections.emptySet(), () -> "test");
    } catch (IllegalArgumentException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 1531 expected expected

SimpleName:IDENTIFIER 1531 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1535 Assert Assert

SimpleName:IDENTIFIER 1535 notEmpty notEmpty

SimpleName:IDENTIFIER 1535 Collections Collections

SimpleName:IDENTIFIER 1535 emptyMap emptyMap

StringLiteralExpr:LITERAL 1535 "test" "test"

SimpleName:IDENTIFIER 1537 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1537 expected expected

SimpleName:IDENTIFIER 1539 assertThat assertThat

SimpleName:IDENTIFIER 1539 expected expected

SimpleName:IDENTIFIER 1539 hasMessage hasMessage

StringLiteralExpr:LITERAL 1539 "test" "test"

SimpleName:IDENTIFIER 1540 assertThat assertThat

SimpleName:IDENTIFIER 1540 expected expected

SimpleName:IDENTIFIER 1540 hasNoCause hasNoCause

SimpleName:IDENTIFIER 1542 expected expected

@Test(expected = IllegalArgumentException.class)
public void assertNotEmptyMapUsesSuppliedMessageThrowsIllegalArgumentException() {
    try {
        Assert.notEmpty(Collections.emptyMap(), () -> "test");
    } catch (IllegalArgumentException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 1635 expected expected

SimpleName:IDENTIFIER 1635 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1639 Assert Assert

SimpleName:IDENTIFIER 1639 notNull notNull

StringLiteralExpr:LITERAL 1639 "test" "test"

{
    Assert.notNull(null, () -> "test");
}

SimpleName:IDENTIFIER 1641 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 1641 expected expected

SimpleName:IDENTIFIER 1643 assertThat assertThat

SimpleName:IDENTIFIER 1643 expected expected

SimpleName:IDENTIFIER 1643 hasMessage hasMessage

StringLiteralExpr:LITERAL 1643 "test" "test"

SimpleName:IDENTIFIER 1644 assertThat assertThat

SimpleName:IDENTIFIER 1644 expected expected

SimpleName:IDENTIFIER 1644 hasNoCause hasNoCause

SimpleName:IDENTIFIER 1646 expected expected

@Test(expected = IllegalArgumentException.class)
public void assertNotNullUsesSuppliedMessageThrowsIllegalArgumentException() {
    try {
        Assert.notNull(null, () -> "test");
    } catch (IllegalArgumentException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 1751 expected expected

SimpleName:IDENTIFIER 1751 IdentityException IdentityException

SimpleName:IDENTIFIER 1755 Assert Assert

StringLiteralExpr:LITERAL 1755 "test" "test"

SimpleName:IDENTIFIER 1757 IdentityException IdentityException

SimpleName:IDENTIFIER 1757 expected expected

SimpleName:IDENTIFIER 1759 assertThat assertThat

SimpleName:IDENTIFIER 1759 expected expected

SimpleName:IDENTIFIER 1759 hasMessage hasMessage

StringLiteralExpr:LITERAL 1759 "test" "test"

SimpleName:IDENTIFIER 1760 assertThat assertThat

SimpleName:IDENTIFIER 1760 expected expected

SimpleName:IDENTIFIER 1760 hasNoCause hasNoCause

SimpleName:IDENTIFIER 1762 expected expected

@Test(expected = IdentityException.class)
public void assertSameUsesSuppliedMessageThrowsIdentityException() {
    try {
        Assert.same(1, -1, () -> "test");
    } catch (IdentityException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 1843 expected expected

SimpleName:IDENTIFIER 1843 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 1847 Assert Assert

BooleanLiteralExpr:LITERAL 1847 false false

StringLiteralExpr:LITERAL 1847 "test" "test"

{
    Assert.state(false, () -> "test");
}

SimpleName:IDENTIFIER 1849 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 1849 expected expected

SimpleName:IDENTIFIER 1851 assertThat assertThat

SimpleName:IDENTIFIER 1851 expected expected

SimpleName:IDENTIFIER 1851 hasMessage hasMessage

StringLiteralExpr:LITERAL 1851 "test" "test"

SimpleName:IDENTIFIER 1852 assertThat assertThat

SimpleName:IDENTIFIER 1852 expected expected

SimpleName:IDENTIFIER 1852 hasNoCause hasNoCause

SimpleName:IDENTIFIER 1854 expected expected

@Test(expected = IllegalStateException.class)
public void assertStateUsesSuppliedMessageThrowsIllegalStateException() {
    try {
        Assert.state(false, () -> "test");
    } catch (IllegalStateException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 1935 expected expected

SimpleName:IDENTIFIER 1935 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1939 Assert Assert

SimpleName:IDENTIFIER 1939 supported supported

BooleanLiteralExpr:LITERAL 1939 false false

StringLiteralExpr:LITERAL 1939 "test" "test"

SimpleName:IDENTIFIER 1941 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1941 expected expected

SimpleName:IDENTIFIER 1943 assertThat assertThat

SimpleName:IDENTIFIER 1943 expected expected

SimpleName:IDENTIFIER 1943 hasMessage hasMessage

StringLiteralExpr:LITERAL 1943 "test" "test"

SimpleName:IDENTIFIER 1944 assertThat assertThat

SimpleName:IDENTIFIER 1944 expected expected

SimpleName:IDENTIFIER 1944 hasNoCause hasNoCause

SimpleName:IDENTIFIER 1946 expected expected

@Test(expected = UnsupportedOperationException.class)
public void assertSupportedUsesSuppliedMessageThrowsUnsupportedOperationException() {
    try {
        Assert.supported(false, () -> "test");
    } catch (UnsupportedOperationException expected) {
        assertThat(expected).hasMessage("test");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}


SimpleName:IDENTIFIER 98 expected expected

SimpleName:IDENTIFIER 98 FileNotFoundException FileNotFoundException

SimpleName:IDENTIFIER 99 assertExistsWithNonExistingDirectory assertExistsWithNonExistingDirectory

SimpleName:IDENTIFIER 99 FileNotFoundException FileNotFoundException

SimpleName:IDENTIFIER 102 FileUtils FileUtils

SimpleName:IDENTIFIER 102 assertExists assertExists

SimpleName:IDENTIFIER 102 newFile newFile

SimpleName:IDENTIFIER 104 FileNotFoundException FileNotFoundException

SimpleName:IDENTIFIER 104 expected expected

SimpleName:IDENTIFIER 106 assertThat assertThat

SimpleName:IDENTIFIER 106 expected expected

SimpleName:IDENTIFIER 106 hasMessage hasMessage

SimpleName:IDENTIFIER 107 assertThat assertThat

SimpleName:IDENTIFIER 107 expected expected

SimpleName:IDENTIFIER 107 hasNoCause hasNoCause

SimpleName:IDENTIFIER 109 expected expected

@Test(expected = FileNotFoundException.class)
public void assertExistsWithNonExistingDirectory() throws FileNotFoundException {
    try {
        FileUtils.assertExists(newFile("/absolute/path/to/non/existing/directory"));
    } catch (FileNotFoundException expected) {
        assertThat(expected).hasMessage("[/absolute/path/to/non/existing/directory] was not found");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}

package org.cp.elements.io;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
import org.cp.elements.lang.StringUtils;
import org.cp.elements.test.AbstractBaseTestSuite;
import org.cp.elements.test.annotation.IntegrationTest;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class adhoc_FileUtilsTests extends AbstractBaseTestSuite {

    @Mock
    private File mockFile;

    @BeforeClass
    public static void beforeTestSuite() {
        FileSystemUtils.delete(new File(TEMPORARY_DIRECTORY, "writeToFileThenReadFromFileIsSuccessful.txt"));
    }

    private File newFile(String pathname) {
        return new File(pathname);
    }

    private File newFile(File parent, String pathname) {
        return new File(parent, pathname);
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 113 expected expected

SimpleName:IDENTIFIER 113 FileNotFoundException FileNotFoundException

SimpleName:IDENTIFIER 114 assertExistsWithNonExistingFile assertExistsWithNonExistingFile

SimpleName:IDENTIFIER 114 FileNotFoundException FileNotFoundException

SimpleName:IDENTIFIER 117 FileUtils FileUtils

SimpleName:IDENTIFIER 117 assertExists assertExists

SimpleName:IDENTIFIER 117 newFile newFile

SimpleName:IDENTIFIER 119 FileNotFoundException FileNotFoundException

SimpleName:IDENTIFIER 119 expected expected

SimpleName:IDENTIFIER 121 assertThat assertThat

SimpleName:IDENTIFIER 121 expected expected

SimpleName:IDENTIFIER 121 hasMessage hasMessage

SimpleName:IDENTIFIER 122 assertThat assertThat

SimpleName:IDENTIFIER 122 expected expected

SimpleName:IDENTIFIER 122 hasNoCause hasNoCause

SimpleName:IDENTIFIER 124 expected expected

@Test(expected = FileNotFoundException.class)
public void assertExistsWithNonExistingFile() throws FileNotFoundException {
    try {
        FileUtils.assertExists(newFile("relative/path/to/non/existing/file.ext"));
    } catch (FileNotFoundException expected) {
        assertThat(expected).hasMessage("[relative/path/to/non/existing/file.ext] was not found");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}

SimpleName:IDENTIFIER 128 expected expected

SimpleName:IDENTIFIER 128 FileNotFoundException FileNotFoundException

SimpleName:IDENTIFIER 129 assertExistsWithNull assertExistsWithNull

SimpleName:IDENTIFIER 129 FileNotFoundException FileNotFoundException

SimpleName:IDENTIFIER 132 FileUtils FileUtils

SimpleName:IDENTIFIER 132 assertExists assertExists

SimpleName:IDENTIFIER 134 FileNotFoundException FileNotFoundException

SimpleName:IDENTIFIER 134 expected expected

SimpleName:IDENTIFIER 136 assertThat assertThat

SimpleName:IDENTIFIER 136 expected expected

SimpleName:IDENTIFIER 136 hasMessage hasMessage

StringLiteralExpr:LITERAL
136
"[null] was not found"
"[null] was not found"

SimpleName:IDENTIFIER 137 assertThat assertThat

SimpleName:IDENTIFIER 137 expected expected

SimpleName:IDENTIFIER 137 hasNoCause hasNoCause

SimpleName:IDENTIFIER 139 expected expected

@Test(expected = FileNotFoundException.class)
public void assertExistsWithNull() throws FileNotFoundException {
    try {
        FileUtils.assertExists(null);
    } catch (FileNotFoundException expected) {
        assertThat(expected).hasMessage("[null] was not found");
        assertThat(expected).hasNoCause();
        throw expected;
    }
}