Package com.vaadin.flow.testutil
Class ClassesSerializableTest
java.lang.Object
com.vaadin.flow.testutil.ClassFinder
com.vaadin.flow.testutil.ClassesSerializableTest
A superclass for serialization testing. The test scans all the classpath and
tries to serialize every single class (except ones from whitelist) in the
classpath. Subclasses may adjust the whitelist by overriding
getExcludedPatterns(), ClassFinder.getBasePackages(),
ClassFinder.getJarPattern()- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTests that all the relevant classes and interfaces underClassFinder.getBasePackages()implement Serializable.protected voidThe method is called right after a class instantiation and might be overriden by subclasses to reset thread local values (ex. current UI).<T> TserializeAndDeserialize(T instance) Performs actual serialization/deserializationprotected voidThe method is called right a class instantiation and might be overriden by subclasses to install some necessary thread local values (ex. current UI).Methods inherited from class com.vaadin.flow.testutil.ClassFinder
findServerClasses, getBasePackages, getJarPattern, getRawClasspathEntries, isFunctionalType, isTestClass, isTestClassPath
-
Constructor Details
-
ClassesSerializableTest
public ClassesSerializableTest()
-
-
Method Details
-
getExcludedPatterns
-
serializeAndDeserialize
Performs actual serialization/deserialization- Type Parameters:
T- the type of the instance- Parameters:
instance- the instance- Returns:
- the copy of the source object
- Throws:
Throwable- if something goes wrong.
-
resetThreadLocals
protected void resetThreadLocals()The method is called right after a class instantiation and might be overriden by subclasses to reset thread local values (ex. current UI).- See Also:
-
setupThreadLocals
protected void setupThreadLocals()The method is called right a class instantiation and might be overriden by subclasses to install some necessary thread local values (ex. current UI).- See Also:
-
classesSerializable
Tests that all the relevant classes and interfaces underClassFinder.getBasePackages()implement Serializable.- Throws:
Throwable- serialization goes wrong
-