ObjectUtilTest Class — netty Architecture
Architecture documentation for the ObjectUtilTest class in ObjectUtilTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 8fcf4c56_0a48_2ee3_0436_44c30076d4c0["ObjectUtilTest"] bf61ff73_51f3_60bd_29cc_c4fc1ddd0753["ObjectUtilTest.java"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|defined in| bf61ff73_51f3_60bd_29cc_c4fc1ddd0753 2899fde7_81ba_0c4d_4b3d_aa0067ac0444["testCheckNotNull()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 2899fde7_81ba_0c4d_4b3d_aa0067ac0444 0265a19f_c9a0_0ba8_9d5a_05b95421778c["testCheckNotNullWithIAE()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 0265a19f_c9a0_0ba8_9d5a_05b95421778c 7ae176b6_7ca7_2f02_417b_aea166991fe5["testCheckNotNullArrayParam()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 7ae176b6_7ca7_2f02_417b_aea166991fe5 5024077d_58ab_9ac8_52c1_8051375651ac["testCheckPositiveIntString()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 5024077d_58ab_9ac8_52c1_8051375651ac cb158533_9ddc_2a48_a98a_9baae4b059d4["testCheckPositiveLongString()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| cb158533_9ddc_2a48_a98a_9baae4b059d4 71ddb96a_5189_7dac_c873_705ab4ff8dc8["testCheckPositiveDoubleString()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 71ddb96a_5189_7dac_c873_705ab4ff8dc8 2f0c669a_81fb_0757_43fa_b407682f441d["testCheckPositiveFloatString()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 2f0c669a_81fb_0757_43fa_b407682f441d 9e48254d_ed28_ba56_43b7_391a4801d5b3["testCheckPositiveOrZeroIntString()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 9e48254d_ed28_ba56_43b7_391a4801d5b3 0c141d0e_8114_673d_1900_bcc0fac2ea14["testCheckPositiveOrZeroLongString()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 0c141d0e_8114_673d_1900_bcc0fac2ea14 66ef5431_ba10_b300_1b96_184a4f3a0b25["testCheckPositiveOrZeroDoubleString()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 66ef5431_ba10_b300_1b96_184a4f3a0b25 a1fc1013_5b3e_9910_e3f0_7aba15c19a43["testCheckPositiveOrZeroFloatString()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| a1fc1013_5b3e_9910_e3f0_7aba15c19a43 1728520c_b505_80bf_f4cb_010e21932afd["testCheckNonEmptyTArrayString()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 1728520c_b505_80bf_f4cb_010e21932afd 2d49ac8c_f830_5295_b8a8_a23691df609e["testCheckNonEmptyByteArrayString()"] 8fcf4c56_0a48_2ee3_0436_44c30076d4c0 -->|method| 2d49ac8c_f830_5295_b8a8_a23691df609e
Relationship Graph
Source Code
common/src/test/java/io/netty/util/internal/ObjectUtilTest.java lines 32–614
public class ObjectUtilTest {
private static final Object NULL_OBJECT = null;
private static final Object NON_NULL_OBJECT = "Object is not null";
private static final String NON_NULL_EMPTY_STRING = "";
private static final String NON_NULL_WHITESPACE_STRING = " ";
private static final Object[] NON_NULL_EMPTY_OBJECT_ARRAY = {};
private static final Object[] NON_NULL_FILLED_OBJECT_ARRAY = { NON_NULL_OBJECT };
private static final CharSequence NULL_CHARSEQUENCE = (CharSequence) NULL_OBJECT;
private static final CharSequence NON_NULL_CHARSEQUENCE = (CharSequence) NON_NULL_OBJECT;
private static final CharSequence NON_NULL_EMPTY_CHARSEQUENCE = (CharSequence) NON_NULL_EMPTY_STRING;
private static final byte[] NON_NULL_EMPTY_BYTE_ARRAY = {};
private static final byte[] NON_NULL_FILLED_BYTE_ARRAY = { (byte) 0xa };
private static final char[] NON_NULL_EMPTY_CHAR_ARRAY = {};
private static final char[] NON_NULL_FILLED_CHAR_ARRAY = { 'A' };
private static final String NULL_NAME = "IS_NULL";
private static final String NON_NULL_NAME = "NOT_NULL";
private static final String NON_NULL_EMPTY_NAME = "NOT_NULL_BUT_EMPTY";
private static final String TEST_RESULT_NULLEX_OK = "Expected a NPE/IAE";
private static final String TEST_RESULT_NULLEX_NOK = "Expected no exception";
private static final String TEST_RESULT_EXTYPE_NOK = "Expected type not found";
private static final int ZERO_INT = 0;
private static final long ZERO_LONG = 0;
private static final double ZERO_DOUBLE = 0.0d;
private static final float ZERO_FLOAT = 0.0f;
private static final int POS_ONE_INT = 1;
private static final long POS_ONE_LONG = 1;
private static final double POS_ONE_DOUBLE = 1.0d;
private static final float POS_ONE_FLOAT = 1.0f;
private static final int NEG_ONE_INT = -1;
private static final long NEG_ONE_LONG = -1;
private static final double NEG_ONE_DOUBLE = -1.0d;
private static final float NEG_ONE_FLOAT = -1.0f;
private static final String NUM_POS_NAME = "NUMBER_POSITIVE";
private static final String NUM_ZERO_NAME = "NUMBER_ZERO";
private static final String NUM_NEG_NAME = "NUMBER_NEGATIVE";
@Test
public void testCheckNotNull() {
Exception actualEx = null;
try {
ObjectUtil.checkNotNull(NON_NULL_OBJECT, NON_NULL_NAME);
} catch (Exception e) {
actualEx = e;
}
assertNull(actualEx, TEST_RESULT_NULLEX_NOK);
actualEx = null;
try {
ObjectUtil.checkNotNull(NULL_OBJECT, NULL_NAME);
} catch (Exception e) {
actualEx = e;
}
assertNotNull(actualEx, TEST_RESULT_NULLEX_OK);
assertTrue(actualEx instanceof NullPointerException, TEST_RESULT_EXTYPE_NOK);
}
@Test
public void testCheckNotNullWithIAE() {
Exception actualEx = null;
try {
ObjectUtil.checkNotNullWithIAE(NON_NULL_OBJECT, NON_NULL_NAME);
} catch (Exception e) {
actualEx = e;
}
assertNull(actualEx, TEST_RESULT_NULLEX_NOK);
actualEx = null;
try {
ObjectUtil.checkNotNullWithIAE(NULL_OBJECT, NULL_NAME);
} catch (Exception e) {
actualEx = e;
}
assertNotNull(actualEx, TEST_RESULT_NULLEX_OK);
Source
Frequently Asked Questions
What is the ObjectUtilTest class?
ObjectUtilTest is a class in the netty codebase, defined in common/src/test/java/io/netty/util/internal/ObjectUtilTest.java.
Where is ObjectUtilTest defined?
ObjectUtilTest is defined in common/src/test/java/io/netty/util/internal/ObjectUtilTest.java at line 32.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free