Package io.cucumber.java
Class GlueLoadingAdvisor
java.lang.Object
io.cucumber.java.GlueLoadingAdvisor
- All Implemented Interfaces:
AutoCloseable
This class gives advices to the developer to improve the glue loading
performance.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Clockprivate final Instantprivate static final Logger(package private) static final AtomicBooleanprivate final GlueDiscoveryRequest -
Constructor Summary
ConstructorsConstructorDescriptionGlueLoadingAdvisor(GlueDiscoveryRequest request) GlueLoadingAdvisor(GlueDiscoveryRequest request, Clock clock) -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddContainerClass(Class<?> containerClass) Adds a class containing glue items (step definitions, hooks, injectors).(package private) voidaddGlueClass(Class<?> glueClass) Adds a class coming from the glue package.private voidprivate static voidaddSuggestionCucumberGlue(List<URI> gluePaths, List<String> suggestions) private voidaddSuggestionRemoveClassWithoutGlueFromGluePackage(List<String> suggestions) private voidaddSuggestionRemoveNonPublicClassFromGluePackage(List<String> suggestions) voidclose()private voidLogs suggestions to improve the glue loading performance if the scanning of glue package takes more time than the threshold defined by the "cucumber.glue.hint.threshold" property.
-
Field Details
-
log
-
containerClasses
-
glueClasses
-
request
-
clock
-
glueLoadingStart
-
loggedOnce
-
-
Constructor Details
-
GlueLoadingAdvisor
GlueLoadingAdvisor(GlueDiscoveryRequest request) -
GlueLoadingAdvisor
GlueLoadingAdvisor(GlueDiscoveryRequest request, Clock clock)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
logGlueLoadingSuggestions
private void logGlueLoadingSuggestions()Logs suggestions to improve the glue loading performance if the scanning of glue package takes more time than the threshold defined by the "cucumber.glue.hint.threshold" property. Enabled by "cucumber.glue.hint.enabled" property. The suggestions are ordered by decreasing efficiency. -
addSuggestionCucumberGlue
-
addSuggestionRemoveClassWithoutGlueFromGluePackage
-
addSuggestionChangePublicStaticInnerClassesToPrivateClasses
-
addSuggestionRemoveNonPublicClassFromGluePackage
-
addGlueClass
Adds a class coming from the glue package. It may or may not contain glue items (step definitions, hooks, injectors).- Parameters:
glueClass- the class coming from the glue package
-
addContainerClass
Adds a class containing glue items (step definitions, hooks, injectors).- Parameters:
containerClass- the class that have been added to the container
-