Event Dispatcher  v0.1.6-beta.1
Project that offers a small library that allows to subscribe and fire events.
ObservableValueTest

Detailed Description

Definition at line 41 of file ObservableValueTest.java.

Package Functions

void beforeEach ()
 
void testUnregisterEvent (int value, TestInfo testInfo)
 
void testUnregisterAllEvents (int value, TestInfo testInfo)
 
void testEventMethodInvocation (int expected, int value, TestInfo testInfo)
 
void testEventMethodInvocation (String name, String newName, int age)
 
void testEventMethodValueChange (String name, String newName, int age)
 
void testEventMethodNotInvoqued (int value, TestInfo testInfo)
 
void testEventNotification (boolean notifyChange, TestInfo testInfo)
 
void testSerialization (boolean expected, @TempDir Path tempDir)
 
void testSerialization (byte expected, @TempDir Path tempDir)
 
void testSerialization (char expected, @TempDir Path tempDir)
 
void testSerialization (short expected, @TempDir Path tempDir)
 
void testSerialization (int expected, @TempDir Path tempDir)
 
void testSerialization (long expected, @TempDir Path tempDir)
 
void testSerialization (float expected, @TempDir Path tempDir)
 
void testSerialization (double expected, @TempDir Path tempDir)
 
void testSerialization (String expected, @TempDir Path tempDir)
 
void testSerialization (String name, int age, @TempDir Path tempDir)
 
void testSerialization (int[] expected, @TempDir Path tempDir)
 
private< T extends Serializable > void serialiceToTempFile (T value, String fileName, Path tempDir)
 
private< T > T deserialiceFromTempFile (Class< T > cls, String fileName, Path tempDir)
 
private< T > T convertInstanceOfObject (Object obj, Class< T > cls)
 

Static Package Functions

static void beforeAll ()
 

Static Package Attributes

static String fileName
 
static boolean eventMethodInvoked
 
static boolean listenerMethodInvoked
 

Static Private Member Functions

static< T > void valueChangedTest (T oldValue, T newValue)
 

Static Private Attributes

static final Logger LOGGER = LogManager.getLogger(ObservableValueTest.class)
 

Member Function Documentation

◆ beforeAll()

static void beforeAll ( )
staticpackage

Definition at line 50 of file ObservableValueTest.java.

◆ beforeEach()

void beforeEach ( )
package

Definition at line 55 of file ObservableValueTest.java.

◆ testUnregisterEvent()

void testUnregisterEvent ( int  value,
TestInfo  testInfo 
)
package

Test for a unregister event.

Parameters
valueA integer number.
testInfoThe info of the test.

Definition at line 69 of file ObservableValueTest.java.

◆ testUnregisterAllEvents()

void testUnregisterAllEvents ( int  value,
TestInfo  testInfo 
)
package

Test for a unregister all events.

Parameters
valueA integer number.
testInfoThe info of the test.

Definition at line 105 of file ObservableValueTest.java.

◆ testEventMethodInvocation() [1/2]

void testEventMethodInvocation ( int  expected,
int  value,
TestInfo  testInfo 
)
package

Test for notify a change in the input integer value.

Parameters
expectedThe expected value.
valueA integer number.
testInfoThe info of the test.

Definition at line 148 of file ObservableValueTest.java.

◆ testEventMethodInvocation() [2/2]

void testEventMethodInvocation ( String  name,
String  newName,
int  age 
)
package

Test for notify a change in the name of the input person object.

Parameters
nameThe name of the object person.
newNameThe expected new name.
ageThe age of the object person.

Definition at line 178 of file ObservableValueTest.java.

◆ testEventMethodValueChange()

void testEventMethodValueChange ( String  name,
String  newName,
int  age 
)
package

Test for notify a change in the name of the input person object.

Parameters
nameThe name of the object person.
newNameThe expected new name.
ageThe age of the object person.

Definition at line 204 of file ObservableValueTest.java.

◆ testEventMethodNotInvoqued()

void testEventMethodNotInvoqued ( int  value,
TestInfo  testInfo 
)
package

Test for a event not fired.

Parameters
valueA integer number.
testInfoThe info of the test.

Definition at line 231 of file ObservableValueTest.java.

◆ testEventNotification()

void testEventNotification ( boolean  notifyChange,
TestInfo  testInfo 
)
package

Test of enable/disable of value change notification.

Parameters
notifyChangeBoolean value for change notification.
testInfoThe info of the test.

Definition at line 255 of file ObservableValueTest.java.

◆ testSerialization() [1/11]

void testSerialization ( boolean  expected,
@TempDir Path  tempDir 
)
package

Test of the serialization of a boolean.

Parameters
expectedThe boolean expected.
tempDirTemporal dir of JUnit.

Definition at line 279 of file ObservableValueTest.java.

◆ testSerialization() [2/11]

void testSerialization ( byte  expected,
@TempDir Path  tempDir 
)
package

Test of the serialization of a byte.

Parameters
expectedThe byte expected.
tempDirTemporal dir of JUnit.

Definition at line 300 of file ObservableValueTest.java.

◆ testSerialization() [3/11]

void testSerialization ( char  expected,
@TempDir Path  tempDir 
)
package

Test of the serialization of a char.

Parameters
expectedThe char expected.
tempDirTemporal dir of JUnit.

Definition at line 320 of file ObservableValueTest.java.

◆ testSerialization() [4/11]

void testSerialization ( short  expected,
@TempDir Path  tempDir 
)
package

Test of the serialization of a short.

Parameters
expectedThe short expected.
tempDirTemporal dir of JUnit.

Definition at line 341 of file ObservableValueTest.java.

◆ testSerialization() [5/11]

void testSerialization ( int  expected,
@TempDir Path  tempDir 
)
package

Test of the serialization of a int.

Parameters
expectedThe int expected.
tempDirTemporal dir of JUnit.

Definition at line 362 of file ObservableValueTest.java.

◆ testSerialization() [6/11]

void testSerialization ( long  expected,
@TempDir Path  tempDir 
)
package

Test of the serialization of a long.

Parameters
expectedThe long expected.
tempDirTemporal dir of JUnit.

Definition at line 383 of file ObservableValueTest.java.

◆ testSerialization() [7/11]

void testSerialization ( float  expected,
@TempDir Path  tempDir 
)
package

Test of the serialization of a float.

Parameters
expectedThe float expected.
tempDirTemporal dir of JUnit.

Definition at line 404 of file ObservableValueTest.java.

◆ testSerialization() [8/11]

void testSerialization ( double  expected,
@TempDir Path  tempDir 
)
package

Test of the serialization of a double.

Parameters
expectedThe double expected.
tempDirTemporal dir of JUnit.

Definition at line 425 of file ObservableValueTest.java.

◆ testSerialization() [9/11]

void testSerialization ( String  expected,
@TempDir Path  tempDir 
)
package

Test of the serialization of a string.

Parameters
expectedThe string expected.
tempDirTemporal dir of JUnit.

Definition at line 446 of file ObservableValueTest.java.

◆ testSerialization() [10/11]

void testSerialization ( String  name,
int  age,
@TempDir Path  tempDir 
)
package

Test of the serialization of a object.

Parameters
nameThe name data of the expected object.
ageThe age data of the expected object.
tempDirTemporal dir of JUnit.

Definition at line 468 of file ObservableValueTest.java.

◆ testSerialization() [11/11]

void testSerialization ( int []  expected,
@TempDir Path  tempDir 
)
package

Test of the serialization of a array of integers.

Parameters
expectedThe expected array of integers.
tempDirTemporal dir of JUnit.

Definition at line 494 of file ObservableValueTest.java.

◆ valueChangedTest()

static <T> void valueChangedTest ( oldValue,
newValue 
)
staticprivate

Method for values changes.

Parameters
oldValueThe old value.
newValueThe new value of the change.

Definition at line 512 of file ObservableValueTest.java.

◆ serialiceToTempFile()

private<T extends Serializable> void serialiceToTempFile ( value,
String  fileName,
Path  tempDir 
)
package

Method for serialization to temp file.

Parameters
valueThe value to serialization.
fileNameThe temp file.
tempDirTemporal dir of JUnit.

Definition at line 524 of file ObservableValueTest.java.

◆ deserialiceFromTempFile()

private<T> T deserialiceFromTempFile ( Class< T >  cls,
String  fileName,
Path  tempDir 
)
package

Method for deserialization from a temp file.

Parameters
clsThe class deserializated.
fileNameThe temp file.
tempDirTemporal dir of JUnit.
Returns
The deserializated object.

Definition at line 550 of file ObservableValueTest.java.

◆ convertInstanceOfObject()

private<T> T convertInstanceOfObject ( Object  obj,
Class< T >  cls 
)
package

Method for convert a instance of a object.

Parameters
objThe object to instance.
clsThe class for instance.
Returns
The object instanced.

Definition at line 576 of file ObservableValueTest.java.

Member Data Documentation

◆ LOGGER

final Logger LOGGER = LogManager.getLogger(ObservableValueTest.class)
staticprivate

Definition at line 43 of file ObservableValueTest.java.

◆ fileName

String fileName
staticpackage

Definition at line 45 of file ObservableValueTest.java.

◆ eventMethodInvoked

boolean eventMethodInvoked
staticpackage

Definition at line 46 of file ObservableValueTest.java.

◆ listenerMethodInvoked

boolean listenerMethodInvoked
staticpackage

Definition at line 47 of file ObservableValueTest.java.