@Test public void testEquals() { assertFalse(marketplacePortletDefinition.equals(null)); assertFalse(marketplacePortletDefinition.equals("SomeStringObject")); final MarketplacePortletDefinition anotherMarketplacePortletDefinition = new MarketplacePortletDefinition( anotherPortletDefinition, service, categoryRegistry); assertTrue(marketplacePortletDefinition.equals(anotherMarketplacePortletDefinition)); when(portletDefinition.getFName()).thenReturn("snooper"); assertFalse(marketplacePortletDefinition.equals(anotherMarketplacePortletDefinition)); when(anotherPortletDefinition.getFName()).thenReturn("snooper"); assertTrue(marketplacePortletDefinition.equals(anotherMarketplacePortletDefinition)); assertEquals( marketplacePortletDefinition.hashCode(), anotherMarketplacePortletDefinition.hashCode()); when(anotherPortletDefinition.getFName()).thenReturn("marketplace"); assertFalse(marketplacePortletDefinition.equals(anotherMarketplacePortletDefinition)); }
@Override public boolean equals(Object other) { if (null == other) { return false; } if (this == other) { return true; } if (getClass() != other.getClass()) { return false; } final MarketplacePortletDefinition otherDefinition = (MarketplacePortletDefinition) other; if (getFName() == null && otherDefinition.getFName() == null) { return true; } return getFName().equals(otherDefinition.getFName()); }
MarketplacePortletDefinition implements IPortletDefinition { @Override public boolean equals(Object other) { if (null == other) { return false; } if (this == other) { return true; } if (getClass() != other.getClass()) { return false; } final MarketplacePortletDefinition otherDefinition = (MarketplacePortletDefinition) other; if (getFName() == null && otherDefinition.getFName() == null) { return true; } return getFName().equals(otherDefinition.getFName()); } }
MarketplacePortletDefinition implements IPortletDefinition { @Override public boolean equals(Object other) { if (null == other) { return false; } if (this == other) { return true; } if (getClass() != other.getClass()) { return false; } final MarketplacePortletDefinition otherDefinition = (MarketplacePortletDefinition) other; if (getFName() == null && otherDefinition.getFName() == null) { return true; } return getFName().equals(otherDefinition.getFName()); } MarketplacePortletDefinition(
            final IPortletDefinition portletDefinition,
            final IMarketplaceService service,
            final IPortletCategoryRegistry registry); }
MarketplacePortletDefinition implements IPortletDefinition { @Override public boolean equals(Object other) { if (null == other) { return false; } if (this == other) { return true; } if (getClass() != other.getClass()) { return false; } final MarketplacePortletDefinition otherDefinition = (MarketplacePortletDefinition) other; if (getFName() == null && otherDefinition.getFName() == null) { return true; } return getFName().equals(otherDefinition.getFName()); } MarketplacePortletDefinition(
            final IPortletDefinition portletDefinition,
            final IMarketplaceService service,
            final IPortletCategoryRegistry registry); List<ScreenShot> getScreenShots(); PortletReleaseNotes getPortletReleaseNotes(); Set<PortletCategory> getCategories(); Set<PortletCategory> getParentCategories(); Set<MarketplacePortletDefinition> getRelatedPortlets(); Set<MarketplacePortletDefinition> getRandomSamplingRelatedPortlets(final IPerson user); String getRenderUrl(); @Override String getDataId(); @Override String getDataTitle(); @Override String getDataDescription(); @Override IPortletDefinitionId getPortletDefinitionId(); @Override List<IPortletPreference> getPortletPreferences(); @Override boolean setPortletPreferences(List<IPortletPreference> portletPreferences); @Override PortletLifecycleState getLifecycleState(); @Override void updateLifecycleState(PortletLifecycleState lifecycleState, IPerson user); @Override void updateLifecycleState(
            PortletLifecycleState lifecycleState, IPerson user, Date timestamp); @Override List<IPortletLifecycleEntry> getLifecycle(); @Override void clearLifecycle(); @Override String getFName(); @Override String getName(); @Override String getDescription(); @Override IPortletDescriptorKey getPortletDescriptorKey(); @Override String getTitle(); @Override int getTimeout(); @Override Integer getActionTimeout(); @Override Integer getEventTimeout(); @Override Integer getRenderTimeout(); @Override Integer getResourceTimeout(); @Override IPortletType getType(); @Override Set<IPortletDefinitionParameter> getParameters(); @Override IPortletDefinitionParameter getParameter(String key); @Override Map<String, IPortletDefinitionParameter> getParametersAsUnmodifiableMap(); @Override String getName(String locale); @Override String getDescription(String locale); @Override String getTitle(String locale); @Override String getAlternativeMaximizedLink(); @Override void setFName(String fname); @Override void setName(String name); @Override void setDescription(String descr); @Override void setTitle(String title); @Override void setTimeout(int timeout); @Override void setActionTimeout(Integer actionTimeout); @Override void setEventTimeout(Integer eventTimeout); @Override void setRenderTimeout(Integer renderTimeout); @Override void setResourceTimeout(Integer resourceTimeout); @Override void setType(IPortletType channelType); @Override void setParameters(Set<IPortletDefinitionParameter> parameters); @Override void addLocalizedTitle(String locale, String chanTitle); @Override void addLocalizedName(String locale, String chanName); @Override void addLocalizedDescription(String locale, String chanDesc); @Override EntityIdentifier getEntityIdentifier(); @Override void addParameter(IPortletDefinitionParameter parameter); @Override void addParameter(String name, String value); @Override void removeParameter(IPortletDefinitionParameter parameter); @Override void removeParameter(String name); @Override Double getRating(); @Override void setRating(Double rating); @Override Long getUsersRated(); @Override void setUsersRated(Long usersRated); String getShortURL(); void setShortURL(String shortURL); @Override String getTarget(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); List<String> getKeywords(); }
MarketplacePortletDefinition implements IPortletDefinition { @Override public boolean equals(Object other) { if (null == other) { return false; } if (this == other) { return true; } if (getClass() != other.getClass()) { return false; } final MarketplacePortletDefinition otherDefinition = (MarketplacePortletDefinition) other; if (getFName() == null && otherDefinition.getFName() == null) { return true; } return getFName().equals(otherDefinition.getFName()); } MarketplacePortletDefinition(
            final IPortletDefinition portletDefinition,
            final IMarketplaceService service,
            final IPortletCategoryRegistry registry); List<ScreenShot> getScreenShots(); PortletReleaseNotes getPortletReleaseNotes(); Set<PortletCategory> getCategories(); Set<PortletCategory> getParentCategories(); Set<MarketplacePortletDefinition> getRelatedPortlets(); Set<MarketplacePortletDefinition> getRandomSamplingRelatedPortlets(final IPerson user); String getRenderUrl(); @Override String getDataId(); @Override String getDataTitle(); @Override String getDataDescription(); @Override IPortletDefinitionId getPortletDefinitionId(); @Override List<IPortletPreference> getPortletPreferences(); @Override boolean setPortletPreferences(List<IPortletPreference> portletPreferences); @Override PortletLifecycleState getLifecycleState(); @Override void updateLifecycleState(PortletLifecycleState lifecycleState, IPerson user); @Override void updateLifecycleState(
            PortletLifecycleState lifecycleState, IPerson user, Date timestamp); @Override List<IPortletLifecycleEntry> getLifecycle(); @Override void clearLifecycle(); @Override String getFName(); @Override String getName(); @Override String getDescription(); @Override IPortletDescriptorKey getPortletDescriptorKey(); @Override String getTitle(); @Override int getTimeout(); @Override Integer getActionTimeout(); @Override Integer getEventTimeout(); @Override Integer getRenderTimeout(); @Override Integer getResourceTimeout(); @Override IPortletType getType(); @Override Set<IPortletDefinitionParameter> getParameters(); @Override IPortletDefinitionParameter getParameter(String key); @Override Map<String, IPortletDefinitionParameter> getParametersAsUnmodifiableMap(); @Override String getName(String locale); @Override String getDescription(String locale); @Override String getTitle(String locale); @Override String getAlternativeMaximizedLink(); @Override void setFName(String fname); @Override void setName(String name); @Override void setDescription(String descr); @Override void setTitle(String title); @Override void setTimeout(int timeout); @Override void setActionTimeout(Integer actionTimeout); @Override void setEventTimeout(Integer eventTimeout); @Override void setRenderTimeout(Integer renderTimeout); @Override void setResourceTimeout(Integer resourceTimeout); @Override void setType(IPortletType channelType); @Override void setParameters(Set<IPortletDefinitionParameter> parameters); @Override void addLocalizedTitle(String locale, String chanTitle); @Override void addLocalizedName(String locale, String chanName); @Override void addLocalizedDescription(String locale, String chanDesc); @Override EntityIdentifier getEntityIdentifier(); @Override void addParameter(IPortletDefinitionParameter parameter); @Override void addParameter(String name, String value); @Override void removeParameter(IPortletDefinitionParameter parameter); @Override void removeParameter(String name); @Override Double getRating(); @Override void setRating(Double rating); @Override Long getUsersRated(); @Override void setUsersRated(Long usersRated); String getShortURL(); void setShortURL(String shortURL); @Override String getTarget(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); List<String> getKeywords(); static final String MARKETPLACE_FNAME; static final int QUANTITY_RELATED_PORTLETS_TO_SHOW; }