@Test public void testFragmentMergeWithNull() { PluginInterface plugin = new Plugin( new String[] {"plugintest"}, BasePluginType.class, String.class, "", "plugin test", "", "a", false, null, false, new HashMap<>(), Collections.emptyList(), null, null, null, null, null ); plugin.merge( null ); assertEquals( "a", plugin.getImageFile() ); PluginInterface fragment = mock( PluginInterface.class ); when( fragment.getImageFile() ).thenReturn( "b" ); plugin.merge( fragment ); assertEquals( "b", plugin.getImageFile() ); when( fragment.getImageFile() ).thenReturn( null ); plugin.merge( fragment ); assertEquals( "b", plugin.getImageFile() ); }
@Override public String getImageFile() { return imageFile; }
Plugin implements PluginInterface, Comparable<Plugin> { @Override public String getImageFile() { return imageFile; } }
Plugin implements PluginInterface, Comparable<Plugin> { @Override public String getImageFile() { return imageFile; } Plugin( String[] ids, Class<? extends PluginTypeInterface> pluginType, Class<?> mainType,
                 String category, String name, String description, String imageFile, boolean separateClassLoaderNeeded,
                 boolean nativePlugin, Map<Class<?>, String> classMap, List<String> libraries, String errorHelpFile,
                 URL pluginFolder );  Plugin( String[] ids, Class<? extends PluginTypeInterface> pluginType, Class<?> mainType,
                 String category, String name, String description, String imageFile, boolean separateClassLoaderNeeded,
                 boolean nativePlugin, Map<Class<?>, String> classMap, List<String> libraries, String errorHelpFile,
                 URL pluginFolder, String documentationUrl, String casesUrl, String forumUrl );  Plugin( String[] ids, Class<? extends PluginTypeInterface> pluginType, Class<?> mainType,
                 String category, String name, String description, String imageFile, boolean separateClassLoaderNeeded,
                 String classLoaderGroup, boolean nativePlugin, Map<Class<?>, String> classMap, List<String> libraries,
                 String errorHelpFile, URL pluginFolder, String documentationUrl, String casesUrl, String forumUrl ); }
Plugin implements PluginInterface, Comparable<Plugin> { @Override public String getImageFile() { return imageFile; } Plugin( String[] ids, Class<? extends PluginTypeInterface> pluginType, Class<?> mainType,
                 String category, String name, String description, String imageFile, boolean separateClassLoaderNeeded,
                 boolean nativePlugin, Map<Class<?>, String> classMap, List<String> libraries, String errorHelpFile,
                 URL pluginFolder );  Plugin( String[] ids, Class<? extends PluginTypeInterface> pluginType, Class<?> mainType,
                 String category, String name, String description, String imageFile, boolean separateClassLoaderNeeded,
                 boolean nativePlugin, Map<Class<?>, String> classMap, List<String> libraries, String errorHelpFile,
                 URL pluginFolder, String documentationUrl, String casesUrl, String forumUrl );  Plugin( String[] ids, Class<? extends PluginTypeInterface> pluginType, Class<?> mainType,
                 String category, String name, String description, String imageFile, boolean separateClassLoaderNeeded,
                 String classLoaderGroup, boolean nativePlugin, Map<Class<?>, String> classMap, List<String> libraries,
                 String errorHelpFile, URL pluginFolder, String documentationUrl, String casesUrl, String forumUrl ); @Override String toString(); @Override boolean equals( Object obj ); @Override int hashCode(); @Override int compareTo( Plugin o ); @Override boolean matches( String id ); @Override String getCategory(); void setCategory( String category ); @Override String getName(); void setName( String name ); @Override String getDescription(); void setDescription( String description ); @Override String[] getIds(); void setIds( String[] ids ); @Override Class<? extends PluginTypeInterface> getPluginType(); void setPluginType( Class<? extends PluginTypeInterface> pluginType ); @Override String getImageFile(); @Override void setImageFile( String imageFile ); @Override boolean isSeparateClassLoaderNeeded(); void setSaperateClassLoaderNeeded( boolean separateClassLoaderNeeded ); @Override boolean isNativePlugin(); void setNativePlugin( boolean nativePlugin ); @Override Map<Class<?>, String> getClassMap(); void setClassMap( Map<Class<?>, String> classMap ); @Override List<String> getLibraries(); void setLibraries( List<String> libraries ); @Override String getErrorHelpFile(); @Override void setErrorHelpFile( String errorHelpFile ); @Override Class<?> getMainType(); @Override URL getPluginDirectory(); @Override String getDocumentationUrl(); @Override void setDocumentationUrl( String documentationUrl ); @Override String getCasesUrl(); @Override void setCasesUrl( String casesUrl ); @Override String getForumUrl(); @Override void setForumUrl( String forumUrl ); @Override String getClassLoaderGroup(); @Override void setClassLoaderGroup( String classLoaderGroup ); }
Plugin implements PluginInterface, Comparable<Plugin> { @Override public String getImageFile() { return imageFile; } Plugin( String[] ids, Class<? extends PluginTypeInterface> pluginType, Class<?> mainType,
                 String category, String name, String description, String imageFile, boolean separateClassLoaderNeeded,
                 boolean nativePlugin, Map<Class<?>, String> classMap, List<String> libraries, String errorHelpFile,
                 URL pluginFolder );  Plugin( String[] ids, Class<? extends PluginTypeInterface> pluginType, Class<?> mainType,
                 String category, String name, String description, String imageFile, boolean separateClassLoaderNeeded,
                 boolean nativePlugin, Map<Class<?>, String> classMap, List<String> libraries, String errorHelpFile,
                 URL pluginFolder, String documentationUrl, String casesUrl, String forumUrl );  Plugin( String[] ids, Class<? extends PluginTypeInterface> pluginType, Class<?> mainType,
                 String category, String name, String description, String imageFile, boolean separateClassLoaderNeeded,
                 String classLoaderGroup, boolean nativePlugin, Map<Class<?>, String> classMap, List<String> libraries,
                 String errorHelpFile, URL pluginFolder, String documentationUrl, String casesUrl, String forumUrl ); @Override String toString(); @Override boolean equals( Object obj ); @Override int hashCode(); @Override int compareTo( Plugin o ); @Override boolean matches( String id ); @Override String getCategory(); void setCategory( String category ); @Override String getName(); void setName( String name ); @Override String getDescription(); void setDescription( String description ); @Override String[] getIds(); void setIds( String[] ids ); @Override Class<? extends PluginTypeInterface> getPluginType(); void setPluginType( Class<? extends PluginTypeInterface> pluginType ); @Override String getImageFile(); @Override void setImageFile( String imageFile ); @Override boolean isSeparateClassLoaderNeeded(); void setSaperateClassLoaderNeeded( boolean separateClassLoaderNeeded ); @Override boolean isNativePlugin(); void setNativePlugin( boolean nativePlugin ); @Override Map<Class<?>, String> getClassMap(); void setClassMap( Map<Class<?>, String> classMap ); @Override List<String> getLibraries(); void setLibraries( List<String> libraries ); @Override String getErrorHelpFile(); @Override void setErrorHelpFile( String errorHelpFile ); @Override Class<?> getMainType(); @Override URL getPluginDirectory(); @Override String getDocumentationUrl(); @Override void setDocumentationUrl( String documentationUrl ); @Override String getCasesUrl(); @Override void setCasesUrl( String casesUrl ); @Override String getForumUrl(); @Override void setForumUrl( String forumUrl ); @Override String getClassLoaderGroup(); @Override void setClassLoaderGroup( String classLoaderGroup ); static Comparator<PluginInterface> nullStringComparator; }