Skip to content

Commit

Permalink
abandon AllTests.java and fix some potential test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodyiam committed Mar 17, 2018
1 parent 2f23140 commit f754dc2
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 246 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
@Transactional
@WebIntegrationTest(randomPort = true)
@SpringApplicationConfiguration(classes = BizTestConfiguration.class)
public class AbstractIntegrationTest {
public abstract class AbstractIntegrationTest {

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import org.mockito.runners.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class AbstractUnitTest {
public abstract class AbstractUnitTest {

}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
Expand Down Expand Up @@ -342,11 +343,13 @@ public void testPollNotificationWithHandleMessageInBatch() throws Exception {

controller.handleMessage(someReleaseMessage, Topics.APOLLO_RELEASE_TOPIC);

assertTrue(!anotherDeferredResult.hasResult());
//in batch mode, at most one of them should have result
assertFalse(deferredResult.hasResult() && anotherDeferredResult.hasResult());

TimeUnit.MILLISECONDS.sleep(someBatchInterval * 10);

assertTrue(anotherDeferredResult.hasResult());
//now both of them should have result
assertTrue(deferredResult.hasResult() && anotherDeferredResult.hasResult());
}

private String transformApolloConfigNotificationsToString(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ protected void periodicSendMessage(ExecutorService executorService, String messa
private static class TestBizConfig extends BizConfig {
@Override
public int appNamespaceCacheScanInterval() {
return 50;
//should be short enough to update the AppNamespace cache in time
return 1;
}

@Override
Expand Down
24 changes: 0 additions & 24 deletions apollo-core/src/test/java/com/ctrip/framework/apollo/AllTests.java

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<includes>
<include>**/AllTests.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit f754dc2

Please sign in to comment.