Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergii Leschenko committed Dec 21, 2016
1 parent af9f5ba commit f22e6a6
Show file tree
Hide file tree
Showing 17 changed files with 95 additions and 243 deletions.
5 changes: 5 additions & 0 deletions core/che-core-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class CascadeEventService extends EventService {
* @param event
* event to publish
* @throws ApiException
* when some error occurs during operation publishing
* when any subscriber throws {@link ApiException}
*/
public void publish(CascadeEvent event) throws ApiException {
super.publish(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
*******************************************************************************/
package org.eclipse.che.core.db.cascade.event;

import org.eclipse.che.api.core.ApiException;
import org.eclipse.che.core.db.cascade.CascadeContext;

/**
* Special event type which is needed only for notification
* in the process which can require cascade operation.
*
* //TODO Add information about transaction
* <p>Rollback of operation must be performed when subscriber
* throws {@link ApiException} during event processing.
*
* @author Anton Korneta
* @author Sergii Leschenko
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* Cascade event about an entity persisting.
*
* <p>{@link ConflictException} or {@link ServerException} can be
* <p>{@link ConflictException} or {@link ServerException} can be thrown
* during event publishing.
*
* @author Sergii Leschenko
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* Cascade event about an entity removing.
*
* <p>{@link ConflictException} or {@link ServerException} can be
* <p>{@link ConflictException} or {@link ServerException} can be thrown
* during event publishing.
*
* @see CascadeEventService#publish(RemoveEvent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
/**
* Cascade event about an entity updating.
*
* <p>{@link NotFoundException}, {@link ConflictException} or {@link ServerException} can be
* during event publishing.
* <p>{@link NotFoundException}, {@link ConflictException} or {@link ServerException}
* can be thrown during event publishing.
*
* @author Sergii Leschenko
* @see CascadeEventService#publish(UpdateEvent)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

33 changes: 0 additions & 33 deletions core/che-core-db/src/test/resources/META-INF/persistence.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public interface RecipeDao {
* @throws NullPointerException
* when recipe {@code id} is not specified
* @throws ConflictException
* when recipe cannot be removed
* when any conflict occurs during cascade removing of related to recipe data
* @throws ServerException
* when any error occurs
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected void doUpdate(UserImpl update) throws NotFoundException, ConflictExcep
new UserImpl(update)));
}

@Transactional(rollbackOn = {RuntimeException.class, ApiException.class})
@Transactional(rollbackOn = {RuntimeException.class})
protected Optional<UserImpl> doRemove(String id) throws ConflictException, ServerException {
final EntityManager manager = managerProvider.get();
final UserImpl user = manager.find(UserImpl.class, id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public interface UserDao {
* @throws NullPointerException
* when {@code id} is null
* @throws ConflictException
* when given user cannot be deleted
* when any conflict occurs during cascade removing of related to user data
* @throws ServerException
* when any other error occurs
*/
Expand Down
Loading

0 comments on commit f22e6a6

Please sign in to comment.