Ignore:
Timestamp:
04/20/12 12:59:56 (12 years ago)
Author:
twagoo
Message:

CommentsDao?.getById takes Id as Number. Added test for this method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/ComponentRegistryDbImpl.java

    r1892 r1895  
    653653            ComponentRegistryException, UserUnauthorizedException, DeleteFailedException {
    654654        try {
    655             Comment comment = commentsDao.getById(commentId);
     655            Comment comment = commentsDao.getById(Integer.parseInt(commentId));
    656656            if (comment != null
    657657                    // Comment must have an existing (in this registry) componentId or profileId
     
    666666        } catch (DataAccessException ex) {
    667667            throw new DeleteFailedException("Database access error while trying to delete component", ex);
     668        } catch (NumberFormatException ex) {
     669            throw new DeleteFailedException("Illegal comment ID, cannot parse integer", ex);
    668670        }
    669671    }
Note: See TracChangeset for help on using the changeset viewer.