[kune-commits] r920 - in trunk/src: main/java/org/ourproject/kune/platf/client/state main/java/org/ourproject/kune/platf/server/manager/file main/java/org/ourproject/kune/platf/server/state test/java/org/ourproject/kune/platf/client/state test/java/org/ourproject/kune/platf/server/manager/file

vjrj vjrj at ourproject.org
Wed Oct 22 13:09:42 CEST 2008


Author: vjrj
Date: 2008-10-22 13:09:41 +0200 (Wed, 22 Oct 2008)
New Revision: 920

Added:
   trunk/src/main/java/org/ourproject/kune/platf/server/state/StateAbstract.java
   trunk/src/main/java/org/ourproject/kune/platf/server/state/StateContent.java
   trunk/src/main/java/org/ourproject/kune/platf/server/state/StateNoContent.java
Modified:
   trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
   trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java
   trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java
   trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefault.java
   trunk/src/main/java/org/ourproject/kune/platf/server/state/State.java
   trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
   trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManagerTest.java
   trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefaultTest.java
Log:
Incomplete - task EntityLogo revisited 

Incomplete - task NPE finding a non existent content 

Incomplete - task Tools must me optional and User/Group creation must reflesh this 


Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -179,7 +179,7 @@
         if (oldState == null || !oldGroup.equals(newGroup)) {
             onGroupChanged.fire(oldGroup, newGroup);
         }
-        if (oldState == null || !oldToolName.equals(newToolName)) {
+        if (oldState == null || oldToolName == null || !oldToolName.equals(newToolName)) {
             onToolChanged.fire(oldToolName, newToolName);
         }
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -1,7 +1,10 @@
 package org.ourproject.kune.platf.server.manager.file;
 
 import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
 
+import magick.MagickException;
 import net.sf.json.JSONObject;
 
 import org.apache.commons.fileupload.FileItem;
@@ -51,15 +54,11 @@
         return response;
     }
 
-    @Override
-    @Authenticated
-    @Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
-    @Transactional(type = TransactionType.READ_WRITE)
-    protected void createUploadedFile(String userHash, StateToken stateToken, String fileName, FileItem file)
-            throws Exception {
-        BasicMimeType mimeType = new BasicMimeType(file.getContentType());
+    protected void createUploadedFile(StateToken stateToken, String mimeTypeS, File origFile) throws Exception,
+            IOException, MagickException, FileNotFoundException {
+        BasicMimeType mimeType = new BasicMimeType(mimeTypeS);
         if (!mimeType.getType().equals("image")) {
-            throw new Exception("Trying to set a non image (" + file.getContentType() + ") as group logo");
+            throw new Exception("Trying to set a non image (" + mimeTypeS + ") as group logo");
         }
         Group group = groupManager.findByShortName(stateToken.getGroup());
 
@@ -67,18 +66,31 @@
             throw new Exception("Group not found trying to set the logo");
         }
 
-        File tmpOrigFile = File.createTempFile("logoOrig", "");
-        file.write(tmpOrigFile);
         File tmpDestFile = File.createTempFile("logoDest", "");
 
-        boolean result = ImageUtilsDefault.scaleImageToMax(tmpOrigFile.getAbsolutePath(),
-                tmpDestFile.getAbsolutePath(), EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT);
+        boolean result = ImageUtilsDefault.scaleImageToMax(origFile.getAbsolutePath(), tmpDestFile.getAbsolutePath(),
+                EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT);
         if (result) {
             group.setLogo(FileUtils.getBytesFromFile(tmpDestFile));
             group.setLogoMime(mimeType);
+            tmpDestFile.delete();
         } else {
+            tmpDestFile.delete();
             throw new Exception("Cannot create group logo thumb");
         }
     }
 
+    @Override
+    @Authenticated
+    @Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
+    @Transactional(type = TransactionType.READ_WRITE)
+    protected void createUploadedFile(String userHash, StateToken stateToken, String fileName, FileItem file)
+            throws Exception {
+        String mimeTypeS = file.getContentType();
+        File tmpOrigFile = File.createTempFile("logoOrig", "");
+        file.write(tmpOrigFile);
+        createUploadedFile(stateToken, mimeTypeS, tmpOrigFile);
+        tmpOrigFile.delete();
+    }
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -1,6 +1,7 @@
 package org.ourproject.kune.platf.server.manager.file;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 
 import magick.MagickException;
 import net.sf.json.JSONObject;
@@ -144,6 +145,8 @@
             e.printStackTrace();
         } catch (MagickException e) {
             log.info("Problem generating image thumb for " + filename);
+        } catch (FileNotFoundException e) {
+            log.info("Original image not found generating image thumb for " + filename);
         }
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefault.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefault.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -2,6 +2,8 @@
 
 import java.awt.Dimension;
 import java.awt.Rectangle;
+import java.io.File;
+import java.io.FileNotFoundException;
 
 import magick.ImageInfo;
 import magick.MagickException;
@@ -12,13 +14,17 @@
     /**
      * http://en.wikipedia.org/wiki/Thumbnail
      * 
+     * @throws FileNotFoundException
+     * 
      */
-    public static void createThumb(String fileOrig, String fileDest, int cropDimension) throws MagickException {
+    public static void createThumb(String fileOrig, String fileDest, int cropDimension) throws MagickException,
+            FileNotFoundException {
         createThumb(fileOrig, fileDest, cropDimension, cropDimension);
     }
 
     public static void createThumb(String fileOrig, String fileDest, int thumbDimension, int cropDimension)
-            throws MagickException {
+            throws MagickException, FileNotFoundException {
+        checkExist(fileOrig);
         if (thumbDimension < cropDimension) {
             throw new IndexOutOfBoundsException("Thumb dimension must be bigger than crop dimension");
         }
@@ -34,12 +40,14 @@
     }
 
     public static boolean cropImage(String fileOrig, String fileDest, int x, int y, int width, int height)
-            throws MagickException {
+            throws MagickException, FileNotFoundException {
         Rectangle rectangle = new Rectangle(x, y, width, height);
         return cropImage(fileOrig, fileDest, rectangle);
     }
 
-    public static boolean cropImage(String fileOrig, String fileDest, Rectangle rectangle) throws MagickException {
+    public static boolean cropImage(String fileOrig, String fileDest, Rectangle rectangle) throws MagickException,
+            FileNotFoundException {
+        checkExist(fileOrig);
         return cropImage(createImage(fileOrig), fileDest, rectangle);
     }
 
@@ -48,17 +56,23 @@
         return imageOrig.getDimension();
     }
 
-    public static boolean scaleImage(String fileOrig, String fileDest, Dimension dimension) throws MagickException {
+    public static boolean scaleImage(String fileOrig, String fileDest, Dimension dimension) throws MagickException,
+            FileNotFoundException {
+        checkExist(fileOrig);
         MagickImage imageOrig = createImage(fileOrig);
         return scaleImage(imageOrig, fileDest, (int) dimension.getWidth(), (int) dimension.getHeight());
     }
 
-    public static boolean scaleImage(String fileOrig, String fileDest, int width, int height) throws MagickException {
+    public static boolean scaleImage(String fileOrig, String fileDest, int width, int height) throws MagickException,
+            FileNotFoundException {
+        checkExist(fileOrig);
         MagickImage imageOrig = createImage(fileOrig);
         return scaleImage(imageOrig, fileDest, width, height);
     }
 
-    public static boolean scaleImageToMax(String fileOrig, String fileDest, int maxSize) throws MagickException {
+    public static boolean scaleImageToMax(String fileOrig, String fileDest, int maxSize) throws MagickException,
+            FileNotFoundException {
+        checkExist(fileOrig);
         MagickImage imageOrig = createImage(fileOrig);
         Dimension origDimension = imageOrig.getDimension();
         int origHeight = origDimension.height;
@@ -90,6 +104,13 @@
         return new Dimension((int) width, (int) height);
     }
 
+    private static void checkExist(String fileOrig) throws FileNotFoundException {
+        File file = new File(fileOrig);
+        if (!file.exists()) {
+            throw new FileNotFoundException();
+        }
+    }
+
     private static ImageInfo createEmptyImageInfo() throws MagickException {
         ImageInfo info = new ImageInfo();
         return info;

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/state/State.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/state/State.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/state/State.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -23,59 +23,36 @@
 import java.util.Date;
 import java.util.List;
 
-import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.server.access.AccessRights;
-import org.ourproject.kune.platf.server.domain.AccessLists;
 import org.ourproject.kune.platf.server.domain.BasicMimeType;
 import org.ourproject.kune.platf.server.domain.Container;
 import org.ourproject.kune.platf.server.domain.ContentStatus;
-import org.ourproject.kune.platf.server.domain.Group;
-import org.ourproject.kune.platf.server.domain.I18nLanguage;
 import org.ourproject.kune.platf.server.domain.License;
-import org.ourproject.kune.platf.server.domain.SocialNetwork;
 import org.ourproject.kune.platf.server.domain.TagResult;
 import org.ourproject.kune.platf.server.domain.User;
-import org.ourproject.kune.platf.server.sn.ParticipationData;
-import org.ourproject.kune.platf.server.sn.UserBuddiesData;
 
-public class State {
+public class State extends StateContent {
     private String documentId;
     private String content;
-    private String title;
-    private String toolName;
-    private Group group;
     private Container container;
     private Container rootContainer;
-    private AccessLists accessLists;
     private AccessRights contentRights;
     private AccessRights containerRights;
-    private AccessRights groupRights;
     private ContentStatus status;
     private boolean isRateable;
     private Double rate;
     private Integer rateByUsers;
     private Double currentUserRate;
-    private String typeId;
     private BasicMimeType mimeType;
     private License license;
-    private I18nLanguage language;
     private List<User> authors;
     private Date publishedOn;
     private String tags;
     private List<TagResult> groupTags;
-    private SocialNetwork groupMembers;
-    private ParticipationData participation;
-    private StateToken stateToken;
-    private List<String> enabledTools;
-    private UserBuddiesData userBuddies;
 
     public State() {
     }
 
-    public AccessLists getAccessLists() {
-        return accessLists;
-    }
-
     public List<User> getAuthors() {
         return authors;
     }
@@ -104,30 +81,10 @@
         return documentId;
     }
 
-    public List<String> getEnabledTools() {
-        return enabledTools;
-    }
-
-    public Group getGroup() {
-        return group;
-    }
-
-    public SocialNetwork getGroupMembers() {
-        return groupMembers;
-    }
-
-    public AccessRights getGroupRights() {
-        return groupRights;
-    }
-
     public List<TagResult> getGroupTags() {
         return groupTags;
     }
 
-    public I18nLanguage getLanguage() {
-        return language;
-    }
-
     public License getLicense() {
         return license;
     }
@@ -136,10 +93,6 @@
         return mimeType;
     }
 
-    public ParticipationData getParticipation() {
-        return participation;
-    }
-
     public Date getPublishedOn() {
         return publishedOn;
     }
@@ -156,10 +109,6 @@
         return rootContainer;
     }
 
-    public StateToken getStateToken() {
-        return stateToken;
-    }
-
     public ContentStatus getStatus() {
         return status;
     }
@@ -168,30 +117,10 @@
         return tags;
     }
 
-    public String getTitle() {
-        return title;
-    }
-
-    public String getToolName() {
-        return toolName;
-    }
-
-    public String getTypeId() {
-        return typeId;
-    }
-
-    public UserBuddiesData getUserBuddies() {
-        return userBuddies;
-    }
-
     public boolean isRateable() {
         return isRateable;
     }
 
-    public void setAccessLists(final AccessLists accessLists) {
-        this.accessLists = accessLists;
-    }
-
     public void setAuthors(final List<User> authors) {
         this.authors = authors;
     }
@@ -220,22 +149,6 @@
         this.documentId = docRef;
     }
 
-    public void setEnabledTools(List<String> enabledTools) {
-        this.enabledTools = enabledTools;
-    }
-
-    public void setGroup(final Group group) {
-        this.group = group;
-    }
-
-    public void setGroupMembers(final SocialNetwork groupMembers) {
-        this.groupMembers = groupMembers;
-    }
-
-    public void setGroupRights(final AccessRights groupRights) {
-        this.groupRights = groupRights;
-    }
-
     public void setGroupTags(final List<TagResult> groupTags) {
         this.groupTags = groupTags;
     }
@@ -244,10 +157,6 @@
         this.isRateable = isRateable;
     }
 
-    public void setLanguage(final I18nLanguage language) {
-        this.language = language;
-    }
-
     public void setLicense(final License license) {
         this.license = license;
     }
@@ -256,10 +165,6 @@
         this.mimeType = mimeType;
     }
 
-    public void setParticipation(final ParticipationData participation) {
-        this.participation = participation;
-    }
-
     public void setPublishedOn(final Date publishedOn) {
         this.publishedOn = publishedOn;
     }
@@ -284,10 +189,6 @@
         this.rootContainer = rootContainer;
     }
 
-    public void setStateToken(final StateToken stateToken) {
-        this.stateToken = stateToken;
-    }
-
     public void setStatus(final ContentStatus status) {
         this.status = status;
     }
@@ -296,24 +197,8 @@
         this.tags = tags;
     }
 
-    public void setTitle(final String title) {
-        this.title = title;
-    }
-
-    public void setToolName(final String toolName) {
-        this.toolName = toolName;
-    }
-
-    public void setTypeId(final String typeId) {
-        this.typeId = typeId;
-    }
-
-    public void setUserBuddies(UserBuddiesData userBuddies) {
-        this.userBuddies = userBuddies;
-    }
-
     @Override
     public String toString() {
-        return "State[" + stateToken + "/" + typeId + "]";
+        return "State[" + getStateToken() + "/" + getTypeId() + "]";
     }
 }

Added: trunk/src/main/java/org/ourproject/kune/platf/server/state/StateAbstract.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/state/StateAbstract.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/state/StateAbstract.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -0,0 +1,97 @@
+package org.ourproject.kune.platf.server.state;
+
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.server.access.AccessRights;
+import org.ourproject.kune.platf.server.domain.AccessLists;
+import org.ourproject.kune.platf.server.domain.Group;
+import org.ourproject.kune.platf.server.domain.SocialNetwork;
+import org.ourproject.kune.platf.server.sn.ParticipationData;
+import org.ourproject.kune.platf.server.sn.UserBuddiesData;
+
+public abstract class StateAbstract {
+
+    private String title;
+    private Group group;
+    private AccessLists accessLists;
+    private AccessRights groupRights;
+    private SocialNetwork groupMembers;
+    private List<String> enabledTools;
+    private ParticipationData participation;
+    private UserBuddiesData userBuddies;
+    private StateToken stateToken;
+
+    public AccessLists getAccessLists() {
+        return accessLists;
+    }
+
+    public List<String> getEnabledTools() {
+        return enabledTools;
+    }
+
+    public Group getGroup() {
+        return group;
+    }
+
+    public SocialNetwork getGroupMembers() {
+        return groupMembers;
+    }
+
+    public AccessRights getGroupRights() {
+        return groupRights;
+    }
+
+    public ParticipationData getParticipation() {
+        return participation;
+    }
+
+    public StateToken getStateToken() {
+        return stateToken;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public UserBuddiesData getUserBuddies() {
+        return userBuddies;
+    }
+
+    public void setAccessLists(final AccessLists accessLists) {
+        this.accessLists = accessLists;
+    }
+
+    public void setEnabledTools(List<String> enabledTools) {
+        this.enabledTools = enabledTools;
+    }
+
+    public void setGroup(final Group group) {
+        this.group = group;
+    }
+
+    public void setGroupMembers(final SocialNetwork groupMembers) {
+        this.groupMembers = groupMembers;
+    }
+
+    public void setGroupRights(final AccessRights groupRights) {
+        this.groupRights = groupRights;
+    }
+
+    public void setParticipation(final ParticipationData participation) {
+        this.participation = participation;
+    }
+
+    public void setStateToken(final StateToken stateToken) {
+        this.stateToken = stateToken;
+    }
+
+    public void setTitle(final String title) {
+        this.title = title;
+    }
+
+    public void setUserBuddies(UserBuddiesData userBuddies) {
+        this.userBuddies = userBuddies;
+    }
+
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/server/state/StateContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/state/StateContent.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/state/StateContent.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -0,0 +1,35 @@
+package org.ourproject.kune.platf.server.state;
+
+import org.ourproject.kune.platf.server.domain.I18nLanguage;
+
+public abstract class StateContent extends StateAbstract {
+
+    private String typeId;
+    private I18nLanguage language;
+    private String toolName;
+
+    public I18nLanguage getLanguage() {
+        return language;
+    }
+
+    public String getTypeId() {
+        return typeId;
+    }
+
+    public void setLanguage(final I18nLanguage language) {
+        this.language = language;
+    }
+
+    public void setTypeId(final String typeId) {
+        this.typeId = typeId;
+    }
+
+    public String getToolName() {
+        return toolName;
+    }
+
+    public void setToolName(final String toolName) {
+        this.toolName = toolName;
+    }
+
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/server/state/StateNoContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/state/StateNoContent.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/state/StateNoContent.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -0,0 +1,8 @@
+package org.ourproject.kune.platf.server.state;
+
+/**
+ * Used for contents not found or users without homepage
+ */
+public class StateNoContent extends StateAbstract {
+
+}

Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -85,4 +85,5 @@
         Mockito.verify(contentProvider, Mockito.times(1)).getContent(Mockito.anyString(),
                 (StateToken) Mockito.anyObject(), (AsyncCallback<StateDTO>) Mockito.anyObject());
     }
+
 }

Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManagerTest.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManagerTest.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -1,12 +1,15 @@
 package org.ourproject.kune.platf.server.manager.file;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
 import net.sf.json.JSONObject;
 
-import org.apache.commons.fileupload.FileItem;
 import org.junit.Before;
 import org.junit.Test;
-import org.mockito.Mockito;
+import org.ourproject.kune.platf.client.dto.StateDTO;
 import org.ourproject.kune.platf.client.errors.SessionExpiredException;
 import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
 import org.ourproject.kune.platf.integration.IntegrationTestHelper;
@@ -28,11 +31,9 @@
 
     @Test
     public void testCreateLogo() throws Exception {
-        super.doLogin();
-        FileItem fileItem = Mockito.mock(FileItem.class);
-        Mockito.stub(fileItem.getContentType()).toReturn("image/png");
-        Mockito.stub(fileItem.getName()).toReturn(TEST_FILE);
-        manager.createUploadedFile(super.getHash(), super.getDefaultContent().getStateToken(), "file", fileItem);
+        manager.createUploadedFile(super.getDefaultContent().getStateToken(), "image/png", new File(TEST_FILE));
+        StateDTO defaultContent = super.getDefaultContent();
+        assertTrue(defaultContent.getGroup().hasLogo());
     }
 
     @Test

Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefaultTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefaultTest.java	2008-10-22 09:15:18 UTC (rev 919)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/ImageUtilsDefaultTest.java	2008-10-22 11:09:41 UTC (rev 920)
@@ -5,6 +5,7 @@
 
 import java.awt.Dimension;
 import java.io.File;
+import java.io.FileNotFoundException;
 
 import magick.MagickException;
 
@@ -40,7 +41,7 @@
     }
 
     @Test
-    public void generateIcon() throws MagickException {
+    public void generateIcon() throws MagickException, FileNotFoundException {
         for (String image : images) {
             ImageUtilsDefault.createThumb(IMG_PATH + image, imageDest, 16, 16);
             Dimension dimension = ImageUtilsDefault.getDimension(imageDest);
@@ -50,7 +51,7 @@
     }
 
     @Test
-    public void generateThumb() throws MagickException {
+    public void generateThumb() throws MagickException, FileNotFoundException {
         for (String image : images) {
             ImageUtilsDefault.createThumb(IMG_PATH + image, imageDest, 100, 85);
             Dimension dimension = ImageUtilsDefault.getDimension(imageDest);
@@ -151,7 +152,7 @@
     }
 
     @Test
-    public void testResize() throws MagickException {
+    public void testResize() throws MagickException, FileNotFoundException {
         for (String image : images) {
             assertTrue(ImageUtilsDefault.scaleImage(IMG_PATH + image, imageDest, 100, 100));
             Dimension dimension = ImageUtilsDefault.getDimension(imageDest);
@@ -170,7 +171,7 @@
     }
 
     @Test(expected = IndexOutOfBoundsException.class)
-    public void thumbSmallerThanCropMustFail() throws MagickException {
+    public void thumbSmallerThanCropMustFail() throws MagickException, FileNotFoundException {
         ImageUtilsDefault.createThumb(IMG_PATH + images[0], imageDest, 100, 200);
     }
 }




More information about the kune-commits mailing list