From 1db14cee3f2754015936bb75e31bcc967349d4e9 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Tue, 20 Feb 2018 17:30:59 +0100
Subject: [PATCH] unused CommentView removed

---
 .../services/impl/CommentService.java         |  98 ------
 .../services/interfaces/ICommentService.java  |  33 --
 .../mapviewer/services/view/CommentView.java  | 292 ------------------
 .../services/view/CommentViewFactory.java     | 116 -------
 .../resources/applicationContext-service.xml  |   1 -
 .../services/impl/CommentServiceTest.java     |  28 --
 .../mapviewer/services/view/AllViewTests.java |   2 -
 .../services/view/CommentViewFactoryTest.java |  84 -----
 .../services/view/CommentViewTest.java        |  27 --
 9 files changed, 681 deletions(-)
 delete mode 100644 service/src/main/java/lcsb/mapviewer/services/view/CommentView.java
 delete mode 100644 service/src/main/java/lcsb/mapviewer/services/view/CommentViewFactory.java
 delete mode 100644 service/src/test/java/lcsb/mapviewer/services/view/CommentViewFactoryTest.java
 delete mode 100644 service/src/test/java/lcsb/mapviewer/services/view/CommentViewTest.java

diff --git a/service/src/main/java/lcsb/mapviewer/services/impl/CommentService.java b/service/src/main/java/lcsb/mapviewer/services/impl/CommentService.java
index 1e928dd14e..5681b46730 100644
--- a/service/src/main/java/lcsb/mapviewer/services/impl/CommentService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/impl/CommentService.java
@@ -13,8 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
 import lcsb.mapviewer.common.ObjectUtils;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.common.exception.InvalidClassException;
 import lcsb.mapviewer.model.Project;
 import lcsb.mapviewer.model.map.Comment;
@@ -31,15 +29,9 @@ import lcsb.mapviewer.services.interfaces.ICommentService;
 import lcsb.mapviewer.services.interfaces.IConfigurationService;
 import lcsb.mapviewer.services.interfaces.IModelService;
 import lcsb.mapviewer.services.interfaces.IUserService;
-import lcsb.mapviewer.services.search.ElementIdentifierDetails;
-import lcsb.mapviewer.services.search.comment.CommentDetails;
 import lcsb.mapviewer.services.search.comment.FullCommentView;
 import lcsb.mapviewer.services.search.comment.FullCommentViewFactory;
-import lcsb.mapviewer.services.search.data.ElementIdentifier;
-import lcsb.mapviewer.services.search.data.ElementIdentifier.ElementIdentifierType;
 import lcsb.mapviewer.services.utils.EmailSender;
-import lcsb.mapviewer.services.view.CommentView;
-import lcsb.mapviewer.services.view.CommentViewFactory;
 
 /**
  * This class is responsible for all services connected with comments
@@ -87,12 +79,6 @@ public class CommentService implements ICommentService {
   @Autowired
   private IConfigurationService configurationService;
 
-  /**
-   * Factory object used for creation fo {@link CommentView} objects.
-   */
-  @Autowired
-  private CommentViewFactory commentViewFactory;
-
   @Override
   public Comment addComment(String name, String email, String content, Model model, Point2D coordinates, Object object,
       boolean pinned, Model submodel) {
@@ -188,23 +174,6 @@ public class CommentService implements ICommentService {
     }
   }
 
-  @Override
-  public List<CommentView> getCommentsByMap(Model model, String token) throws SecurityException {
-    boolean editComments = userService.userHasPrivilege(token, PrivilegeType.EDIT_COMMENTS_PROJECT, model.getProject());
-    boolean viewProject = userService.userHasPrivilege(token, PrivilegeType.VIEW_PROJECT, model.getProject());
-    if (!editComments && !viewProject) {
-      throw new UserAccessException("You have no privileges to see comments for given project");
-    }
-    List<Comment> comments = commentDao.getCommentByModel(model, null, null);
-    List<CommentView> commentList = new ArrayList<>();
-    for (Comment comment : comments) {
-      CommentView row = commentViewFactory.create(comment, model);
-      commentList.add(row);
-    }
-    return commentList;
-
-  }
-
   @Override
   public long getCommentCount() {
     return commentDao.getCount();
@@ -306,12 +275,6 @@ public class CommentService implements ICommentService {
     return result;
   }
 
-  @Override
-  public List<FullCommentView> getCommentMarkers(Model model) {
-    List<List<Comment>> comments = getAgregatedComments(model, true);
-    return agregatedCommentsIntoMarker(comments, model);
-  }
-
   @Override
   public void removeCommentsForModel(ModelData model) {
     List<Comment> comments = commentDao.getCommentByModel(model, null, null);
@@ -320,67 +283,6 @@ public class CommentService implements ICommentService {
     }
   }
 
-  /**
-   * Returns {@link CommentDetails detailed information} about comments for a
-   * specified element.
-   * 
-   * @param element
-   *          element for which we are looking for detailed information
-   * @param model
-   *          model where we are looking for the information
-   * @return {@link CommentDetails detailed information} about comments for a
-   *         specified element
-   */
-  public List<ElementIdentifierDetails> getElementInformationForResult(ElementIdentifier element, Model model) {
-    // TODO refactor!!!!
-    // it's slow...
-    List<FullCommentView> comments = getCommentMarkers(model);
-
-    List<ElementIdentifierDetails> result = new ArrayList<>();
-
-    if (ElementIdentifierType.REACTION.getJsName().equalsIgnoreCase(element.getType())) {
-      for (FullCommentView comment : comments) {
-        if (Reaction.class.equals(comment.getType())) {
-          if (comment.getIdObject().equals(element.getObjectId())
-              && comment.getModelId().equals(element.getModelId())) {
-            for (Pair<String, String> c : comment.getComments()) {
-              result.add(new CommentDetails(c.getLeft(), c.getRight()));
-            }
-            return result;
-          }
-        }
-      }
-      return result;
-    } else if (ElementIdentifierType.POINT.getJsName().equalsIgnoreCase(element.getType())) {
-      for (FullCommentView comment : comments) {
-        if (Point2D.class.equals(comment.getType())) {
-          if (equalPoints(comment.getUniqueId(), element.getObjectId())) {
-            for (Pair<String, String> c : comment.getComments()) {
-              result.add(new CommentDetails(c.getLeft(), c.getRight()));
-            }
-            return result;
-          }
-        }
-      }
-      return result;
-    } else if (ElementIdentifierType.ALIAS.getJsName().equalsIgnoreCase(element.getType())) {
-      for (FullCommentView comment : comments) {
-        if (Element.class.equals(comment.getType())) {
-          if (comment.getIdObject().equals(element.getObjectId())
-              && comment.getModelId().equals(element.getModelId())) {
-            for (Pair<String, String> c : comment.getComments()) {
-              result.add(new CommentDetails(c.getLeft(), c.getRight()));
-            }
-            return result;
-          }
-        }
-      }
-      return result;
-    } else {
-      throw new InvalidArgumentException("Unknown clas stype: " + element.getType());
-    }
-  }
-
   /**
    * Checks if identifier of the points refer to the same point.
    * 
diff --git a/service/src/main/java/lcsb/mapviewer/services/interfaces/ICommentService.java b/service/src/main/java/lcsb/mapviewer/services/interfaces/ICommentService.java
index 048f9249b2..43708ab53c 100644
--- a/service/src/main/java/lcsb/mapviewer/services/interfaces/ICommentService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/interfaces/ICommentService.java
@@ -11,9 +11,7 @@ import lcsb.mapviewer.model.user.User;
 import lcsb.mapviewer.services.SecurityException;
 import lcsb.mapviewer.services.UserAccessException;
 import lcsb.mapviewer.services.search.ElementIdentifierDetails;
-import lcsb.mapviewer.services.search.comment.FullCommentView;
 import lcsb.mapviewer.services.search.data.ElementIdentifier;
-import lcsb.mapviewer.services.view.CommentView;
 
 /**
  * Service responsible for comments functionality.
@@ -63,17 +61,6 @@ public interface ICommentService {
 
   void deleteComment(Comment comment, String token, String reason) throws UserAccessException, SecurityException;
 
-  /**
-   * Method returns all comments for a given map.
-   * 
-   * @param model
-   *          given map
-   * @return list of the comments to the map
-   * @throws UserAccessException
-   * @throws SecurityException 
-   */
-  List<CommentView> getCommentsByMap(Model model, String token) throws UserAccessException, SecurityException;
-
   List<Comment> getCommentsByProject(Project project, String token) throws UserAccessException, SecurityException;
 
   /**
@@ -91,15 +78,6 @@ public interface ICommentService {
    */
   void removeCommentsForModel(Model model);
 
-  /**
-   * This method returns marker for all comments in a model.
-   * 
-   * @param model
-   *          object to which we are looking for comments
-   * @return list of markers for comments
-   */
-  List<FullCommentView> getCommentMarkers(Model model);
-
   /**
    * Removes comments from the model.
    * 
@@ -108,17 +86,6 @@ public interface ICommentService {
    */
   void removeCommentsForModel(ModelData model);
 
-  /**
-   * Returns detailed comment information about element.
-   * 
-   * @param element
-   *          element for which we are looking for comments
-   * @param model
-   *          model where we are looking for comments
-   * @return detailed comment information about element
-   */
-  List<ElementIdentifierDetails> getElementInformationForResult(ElementIdentifier element, Model model);
-
   Comment getCommentById(String commentId);
 
 }
diff --git a/service/src/main/java/lcsb/mapviewer/services/view/CommentView.java b/service/src/main/java/lcsb/mapviewer/services/view/CommentView.java
deleted file mode 100644
index 0cffa23ff6..0000000000
--- a/service/src/main/java/lcsb/mapviewer/services/view/CommentView.java
+++ /dev/null
@@ -1,292 +0,0 @@
-package lcsb.mapviewer.services.view;
-
-import java.io.Serializable;
-
-import lcsb.mapviewer.model.map.Comment;
-
-/**
- * View representation of the Comment.
- * 
- * @author Piotr Gawron
- * 
- */
-
-public class CommentView extends AbstractView<Comment> implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * Author of the comment.
-	 */
-	private String						author;
-
-	/**
-	 * Email of the comment.
-	 */
-	private String						email;
-
-	/**
-	 * Content of the comment.
-	 */
-	private String						content;
-
-	/**
-	 * Title of the comment.
-	 */
-	private String						title;
-
-	/**
-	 * Is the comment visible on the map.
-	 */
-	private String						pinned;
-
-	/**
-	 * Is the comment removed.
-	 */
-	private String						removed;
-
-	/**
-	 * X coordinate on the map.
-	 */
-	private String						xCoord;
-
-	/**
-	 * Y coordinate on the map.
-	 */
-	private String						yCoord;
-
-	/**
-	 * Zoom level at which comment should be investigated on the map (to see
-	 * details).
-	 */
-	private String						zoom;
-
-	/**
-	 * Submap on which comment was placed.
-	 */
-	private String						submap;
-
-	/**
-	 * Constructor that initialize the view with the data from original comment.
-	 * 
-	 * @param comment
-	 *          data required for initialization
-	 */
-	protected CommentView(final Comment comment) {
-		super(comment);
-	}
-
-	/**
-	 * Default constructor. Should be used only for deserialization.
-	 */
-	protected CommentView() {
-	}
-
-	/**
-	 * @return the author
-	 * @see #author
-	 */
-	public String getAuthor() {
-		return author;
-	}
-
-	/**
-	 * @param author
-	 *          the author to set
-	 * @see #author
-	 */
-	public void setAuthor(String author) {
-		this.author = author;
-	}
-
-	/**
-	 * @return the email
-	 * @see #email
-	 */
-	public String getEmail() {
-		return email;
-	}
-
-	/**
-	 * @param email
-	 *          the email to set
-	 * @see #email
-	 */
-	public void setEmail(String email) {
-		this.email = email;
-	}
-
-	/**
-	 * @return the content
-	 * @see #content
-	 */
-	public String getContent() {
-		return content;
-	}
-
-	/**
-	 * @param content
-	 *          the content to set
-	 * @see #content
-	 */
-	public void setContent(String content) {
-		this.content = content;
-	}
-
-	/**
-	 * @return the title
-	 * @see #title
-	 */
-	public String getTitle() {
-		return title;
-	}
-
-	/**
-	 * @param title
-	 *          the title to set
-	 * @see #title
-	 */
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	/**
-	 * @return the pinned
-	 * @see #pinned
-	 */
-	public String getPinned() {
-		return pinned;
-	}
-
-	/**
-	 * @param pinned
-	 *          the pinned to set
-	 * @see #pinned
-	 */
-	public void setPinned(String pinned) {
-		this.pinned = pinned;
-	}
-
-	/**
-	 * @return the removed
-	 * @see #removed
-	 */
-	public String getRemoved() {
-		return removed;
-	}
-
-	/**
-	 * @param removed
-	 *          the removed to set
-	 * @see #removed
-	 */
-	public void setRemoved(String removed) {
-		this.removed = removed;
-	}
-
-	/**
-	 * @return the xCoord
-	 * @see #xCoord
-	 */
-	public String getxCoord() {
-		return xCoord;
-	}
-
-	/**
-	 * @param xCoord
-	 *          the xCoord to set
-	 * @see #xCoord
-	 */
-	public void setxCoord(String xCoord) {
-		this.xCoord = xCoord;
-	}
-
-	/**
-	 * @return the yCoord
-	 * @see #yCoord
-	 */
-	public String getyCoord() {
-		return yCoord;
-	}
-
-	/**
-	 * @param yCoord
-	 *          the yCoord to set
-	 * @see #yCoord
-	 */
-	public void setyCoord(String yCoord) {
-		this.yCoord = yCoord;
-	}
-
-	/**
-	 * @return the zoom
-	 * @see #zoom
-	 */
-	public String getZoom() {
-		return zoom;
-	}
-
-	/**
-	 * @param zoom
-	 *          the zoom to set
-	 * @see #zoom
-	 */
-	public void setZoom(String zoom) {
-		this.zoom = zoom;
-	}
-
-	/**
-	 * @param pinned
-	 *          the pinned to set
-	 * @see #pinned
-	 */
-	public void setPinned(final boolean pinned) {
-		if (pinned) {
-			setPinned("YES");
-		} else {
-			setPinned("NO");
-		}
-	}
-
-	/**
-	 * Sets x coordinate.
-	 * 
-	 * @param x
-	 *          x coordinate to set
-	 * @see #xCoord
-	 */
-	public void setxCoord(double x) {
-		this.xCoord = x + "";
-	}
-
-	/**
-	 * Sets y coordinate.
-	 * 
-	 * @param y
-	 *          y coordinate to set
-	 * @see #yCoord
-	 */
-	public void setyCoord(double y) {
-		this.yCoord = y + "";
-	}
-
-	/**
-	 * @return the submap
-	 * @see #submap
-	 */
-	public String getSubmap() {
-		return submap;
-	}
-
-	/**
-	 * @param submap
-	 *          the submap to set
-	 * @see #submap
-	 */
-	public void setSubmap(String submap) {
-		this.submap = submap;
-	}
-};
diff --git a/service/src/main/java/lcsb/mapviewer/services/view/CommentViewFactory.java b/service/src/main/java/lcsb/mapviewer/services/view/CommentViewFactory.java
deleted file mode 100644
index 09b8318332..0000000000
--- a/service/src/main/java/lcsb/mapviewer/services/view/CommentViewFactory.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package lcsb.mapviewer.services.view;
-
-import java.awt.geom.Point2D;
-
-import org.apache.log4j.Logger;
-
-import com.google.gson.Gson;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.Comment;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.Element;
-
-/**
- * Factory class for {@link CommentView} class.
- * 
- * @author Piotr Gawron
- * 
- */
-public class CommentViewFactory extends AbstractViewFactory<Comment, CommentView> {
-	/**
-	 * Default class logger.
-	 */
-	private static Logger logger = Logger.getLogger(CommentViewFactory.class);
-
-	@Override
-	public CommentView create(Comment comment) {
-		CommentView result = new CommentView(comment);
-		if (comment == null) {
-			return result;
-		}
-		Model model = comment.getModelData().getModel();
-		return create(comment, model);
-	}
-
-	/**
-	 * Creates a {@link CommentView} object for given comment.
-	 * 
-	 * @param comment
-	 *          comment for which view is created
-	 * @param model
-	 *          model where comments is placed
-	 * @return {@link CommentView} object for given comment
-	 */
-	public CommentView create(Comment comment, Model model) {
-		CommentView result = new CommentView(comment);
-		if (comment == null) {
-			return result;
-		}
-
-		result.setAuthor(comment.getName());
-		result.setContent(comment.getContent());
-		result.setEmail(comment.getEmail());
-		result.setPinned(comment.isPinned());
-		if (comment.isDeleted()) {
-			result.setRemoved("YES (" + comment.getRemoveReason() + ")");
-		} else {
-			result.setRemoved("NO");
-		}
-		if (comment.getSubmodelData() != null) {
-			result.setSubmap(comment.getSubmodelData().getId() + "");
-			model = model.getSubmodelById(comment.getSubmodelData().getId());
-			if (model == null) {
-				throw new InvalidArgumentException("Cannot find submodel with id: " + comment.getSubmodelData().getId());
-			}
-		}
-
-		String title = "";
-		Point2D coordinates = null;
-		if (comment.getCoordinates() != null) {
-			title = "Comment (coord: " + String.format("%.2f", comment.getCoordinates().getX()) + ", " + String.format("%.2f", comment.getCoordinates().getY())
-					+ ")";
-			coordinates = comment.getCoordinates();
-		}
-		if (comment.getTableName() != null) {
-			if (comment.getTableName().getName().contains("Reaction")) {
-				Reaction reaction = model.getReactionByDbId(comment.getTableId());
-				if (reaction != null) {
-					title = "Reaction " + reaction.getIdReaction();
-					coordinates = reaction.getCenterPoint();
-				} else {
-					logger.warn("Invalid reaction dbID: " + comment.getTableId());
-				}
-
-			} else {
-				Element alias = model.getElementByDbId(comment.getTableId());
-				if (alias != null) {
-					title = alias.getName();
-					coordinates = alias.getCenter();
-				} else {
-					logger.warn("Invalid alias dbID: " + comment.getTableId());
-				}
-			}
-		}
-		result.setTitle(title);
-		if (coordinates != null) {
-			result.setxCoord(coordinates.getX());
-			result.setyCoord(coordinates.getY());
-			result.setZoom("" + (Configuration.MIN_ZOOM_LEVEL + model.getZoomLevels() - 1));
-		}
-		return result;
-	}
-
-	@Override
-	public String createGson(CommentView object) {
-		return new Gson().toJson(object);
-	}
-
-	@Override
-	public Comment viewToObject(CommentView view) {
-		throw new NotImplementedException();
-	}
-}
diff --git a/service/src/main/resources/applicationContext-service.xml b/service/src/main/resources/applicationContext-service.xml
index 27a893af01..8e9ec634b7 100644
--- a/service/src/main/resources/applicationContext-service.xml
+++ b/service/src/main/resources/applicationContext-service.xml
@@ -48,7 +48,6 @@
 	
 	<!-- View factories -->
 	<bean id="AnnotationViewFactory" class="lcsb.mapviewer.services.view.AnnotationViewFactory"/>
-	<bean id="CommentViewFactory" class="lcsb.mapviewer.services.view.CommentViewFactory"/>
 	<bean id="ConfigurationViewFactory" class="lcsb.mapviewer.services.view.ConfigurationViewFactory"/>
 	<bean id="DataMiningViewFactory" class="lcsb.mapviewer.services.view.DataMiningViewFactory"/>
 	<bean id="LayoutViewFactory" class="lcsb.mapviewer.services.view.LayoutViewFactory"/>
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/CommentServiceTest.java b/service/src/test/java/lcsb/mapviewer/services/impl/CommentServiceTest.java
index 4f8644c3d0..87178b5eb5 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/CommentServiceTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/CommentServiceTest.java
@@ -19,14 +19,9 @@ import lcsb.mapviewer.model.Project;
 import lcsb.mapviewer.model.map.Comment;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.reaction.Reaction;
 import lcsb.mapviewer.model.map.species.Element;
-import lcsb.mapviewer.model.user.ObjectPrivilege;
-import lcsb.mapviewer.model.user.PrivilegeType;
-import lcsb.mapviewer.model.user.User;
 import lcsb.mapviewer.services.ServiceTestFunctions;
 import lcsb.mapviewer.services.search.comment.FullCommentView;
-import lcsb.mapviewer.services.view.CommentView;
 
 @Rollback(true)
 public class CommentServiceTest extends ServiceTestFunctions {
@@ -198,29 +193,6 @@ public class CommentServiceTest extends ServiceTestFunctions {
     }
   }
 
-  @Test
-  public void testReactionComment() throws Exception {
-    try {
-      User admin = userService.getUserByLogin("admin");
-      userService.setUserPrivilege(admin, new ObjectPrivilege(project, 1, PrivilegeType.VIEW_PROJECT, admin));
-
-      Reaction reaction = model.getReactionByReactionId("re3");
-      Comment comment = commentService.addComment("John Doe", "a@a.pl", "Conteneta 1", model, new Point2D.Double(0, 1),
-          reaction, false, model);
-
-      // assume that we have admin account with all the privileges
-      String adminToken = userService.login("admin", "admin");
-
-      List<CommentView> views = commentService.getCommentsByMap(model, adminToken);
-      assertNotNull(views.get(0).getTitle());
-      commentDao.delete(comment);
-
-    } catch (Exception e) {
-      e.printStackTrace();
-      throw e;
-    }
-  }
-
   @Test
   public void testComparePointCommentId() throws Exception {
     try {
diff --git a/service/src/test/java/lcsb/mapviewer/services/view/AllViewTests.java b/service/src/test/java/lcsb/mapviewer/services/view/AllViewTests.java
index 43dc9e5141..07a5323d15 100644
--- a/service/src/test/java/lcsb/mapviewer/services/view/AllViewTests.java
+++ b/service/src/test/java/lcsb/mapviewer/services/view/AllViewTests.java
@@ -7,8 +7,6 @@ import org.junit.runners.Suite.SuiteClasses;
 @RunWith(Suite.class)
 @SuiteClasses({ AnnotationViewFactoryTest.class, //
     AnnotationViewTest.class, //
-    CommentViewFactoryTest.class, //
-    CommentViewTest.class, //
     ConfigurationViewFactoryTest.class, //
     ConfigurationViewTest.class, //
     DataMiningSetViewTest.class, //
diff --git a/service/src/test/java/lcsb/mapviewer/services/view/CommentViewFactoryTest.java b/service/src/test/java/lcsb/mapviewer/services/view/CommentViewFactoryTest.java
deleted file mode 100644
index 13aeba6fe5..0000000000
--- a/service/src/test/java/lcsb/mapviewer/services/view/CommentViewFactoryTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package lcsb.mapviewer.services.view;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.model.map.Comment;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.model.ModelSubmodelConnection;
-import lcsb.mapviewer.model.map.model.SubmodelType;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-
-public class CommentViewFactoryTest extends ServiceTestFunctions {
-
-	Logger						 logger	= Logger.getLogger(CommentViewFactoryTest.class);
-
-	@Autowired
-	CommentViewFactory commentViewFactory;
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCreateEmpty() throws Exception {
-		try {
-			Object object = commentViewFactory.create(null);
-			assertNotNull(object);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCreateGson() throws Exception {
-		try {
-			CommentView object = commentViewFactory.create(null);
-			assertNotNull(commentViewFactory.createGson(object));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCreateOnSubmap() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Model submodel = new ModelFullIndexed(null);
-			submodel.setId(1);
-			Species species = new GenericProtein("id");
-			species.setId(23);
-			species.setName("ProteinName");
-			submodel.addElement(species);
-			
-			model.addSubmodelConnection(new ModelSubmodelConnection(submodel, SubmodelType.UNKNOWN));
-			
-			Comment comment = new Comment();
-			comment.setModel(model);
-			comment.setSubmodel(submodel);
-			comment.setTableName(species.getClass());
-			comment.setTableId(species.getId());
-			CommentView object = commentViewFactory.create(comment,model);
-			assertTrue(object.getTitle().contains(species.getName()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
diff --git a/service/src/test/java/lcsb/mapviewer/services/view/CommentViewTest.java b/service/src/test/java/lcsb/mapviewer/services/view/CommentViewTest.java
deleted file mode 100644
index 170e999db1..0000000000
--- a/service/src/test/java/lcsb/mapviewer/services/view/CommentViewTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package lcsb.mapviewer.services.view;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class CommentViewTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new CommentView());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
-- 
GitLab