Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Ignore slow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Jun 12, 2015
1 parent 3e3ca4a commit 02b6312
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions zanata-war/src/test/java/org/zanata/SlowTest.java
Expand Up @@ -26,6 +26,8 @@
import java.lang.annotation.Target;

/**
* (Currently not handled by test framework: please use
* <code>@Ignore("slow test")</code> as well.)
* Marker annotation to identify tests that might be potentially slow to run.
*
* @author Carlos Munoz <a
Expand Down
Expand Up @@ -69,7 +69,7 @@ public void transferFromResourceMetadata() {
// TODO check the results in 'to'
}

@Ignore
@Ignore("slow test")
// This should be executed manually in IDE
@Test
@SlowTest
Expand Down
Expand Up @@ -42,7 +42,6 @@
import org.junit.Test;
import org.junit.rules.ExternalResource;
import org.junit.rules.TestRule;
import org.junit.runner.RunWith;
import org.zanata.PerformanceProfiling;
import org.zanata.SlowTest;
import org.zanata.common.ContentState;
Expand Down Expand Up @@ -311,8 +310,8 @@ private static EntityMakerBuilder getEntityMakerBuilder() {
FixedValueMaker.EMPTY_STRING_MAKER);
}

@Ignore("slow test")
@Test
@Ignore
@SlowTest
@PerformanceProfiling
public void testCopyTransForDocument() throws Exception {
Expand Down
Expand Up @@ -141,6 +141,7 @@ public static Object[][] copyTransParams() {
return val;
}

@Ignore("slow test")
@Test
@UseDataProvider("copyTransParams")
@SlowTest
Expand Down
Expand Up @@ -21,8 +21,11 @@

package org.zanata.service.impl;

import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
Expand All @@ -31,6 +34,7 @@

import org.junit.Before;
import org.junit.Test;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
Expand Down Expand Up @@ -70,6 +74,7 @@ public class DocumentServiceImplTest {
private Messages msgs;

private DocumentServiceImpl documentService;
private DocumentServiceImpl spyService;

private Long docId = 1L, versionId = 1L, tfId = 1L;
private LocaleId localeId = LocaleId.DE;
Expand All @@ -87,6 +92,11 @@ public void setup() {
documentService = new DocumentServiceImpl();
documentService.init(projectIterationDAO, documentDAO,
translationStateCacheImpl, msgs);
// TODO spy should only be needed for legacy code
spyService = Mockito.spy(documentService);
// avoid triggering HTTP requests in a unit test:
doNothing().when(spyService).publishDocumentMilestoneEvent(
any(WebHook.class), any(DocumentMilestoneEvent.class));

HProjectIteration version = Mockito.mock(HProjectIteration.class);
HProject project = Mockito.mock(HProject.class);
Expand All @@ -107,8 +117,6 @@ public void setup() {

@Test
public void documentMilestoneEventTranslatedTest() {
DocumentServiceImpl spyService = Mockito.spy(documentService);

WordStatistic stats = new WordStatistic(0, 0, 0, 10, 0);
when(translationStateCacheImpl.getDocumentStatistics(docId, localeId))
.thenReturn(stats);
Expand All @@ -129,8 +137,6 @@ public void documentMilestoneEventTranslatedTest() {

@Test
public void documentMilestoneEventTranslatedNot100Test() {
DocumentServiceImpl spyService = Mockito.spy(documentService);

WordStatistic stats = new WordStatistic(0, 1, 0, 9, 0);
when(translationStateCacheImpl.getDocumentStatistics(docId, localeId))
.thenReturn(stats);
Expand All @@ -151,8 +157,6 @@ public void documentMilestoneEventTranslatedNot100Test() {

@Test
public void documentMilestoneEventApprovedTest() {
DocumentServiceImpl spyService = Mockito.spy(documentService);

WordStatistic stats = new WordStatistic(10, 0, 0, 0, 0);
when(translationStateCacheImpl.getDocumentStatistics(docId, localeId))
.thenReturn(stats);
Expand All @@ -172,8 +176,6 @@ public void documentMilestoneEventApprovedTest() {

@Test
public void documentMilestoneEventApprovedNot100Test() {
DocumentServiceImpl spyService = Mockito.spy(documentService);

WordStatistic stats = new WordStatistic(9, 0, 0, 1, 0);
when(translationStateCacheImpl.getDocumentStatistics(docId, localeId))
.thenReturn(stats);
Expand All @@ -194,7 +196,6 @@ public void documentMilestoneEventApprovedNot100Test() {

@Test
public void documentMilestoneEventSameStateTest1() {
DocumentServiceImpl spyService = Mockito.spy(documentService);
WordStatistic stats = new WordStatistic(10, 0, 0, 0, 0);
when(translationStateCacheImpl.getDocumentStatistics(docId, localeId))
.thenReturn(stats);
Expand All @@ -215,7 +216,6 @@ public void documentMilestoneEventSameStateTest1() {

@Test
public void documentMilestoneEventSameStateTest2() {
DocumentServiceImpl spyService = Mockito.spy(documentService);
WordStatistic stats = new WordStatistic(0, 0, 0, 10, 0);

when(translationStateCacheImpl.getDocumentStatistics(docId, localeId))
Expand Down

0 comments on commit 02b6312

Please sign in to comment.