Skip to content

Commit

Permalink
Remove and Polish unstable UT
Browse files Browse the repository at this point in the history
  • Loading branch information
vongosling committed Aug 29, 2017
1 parent 38d70bd commit c0e4c3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

package org.apache.rocketmq.common.filter;

import java.util.HashSet;
import java.util.Set;
import org.apache.rocketmq.common.protocol.heartbeat.SubscriptionData;
import org.junit.Test;

import java.util.HashSet;
import java.util.Set;

import static org.assertj.core.api.Assertions.assertThat;

public class FilterAPITest {
Expand All @@ -32,7 +33,7 @@ public class FilterAPITest {
@Test
public void testBuildSubscriptionData() throws Exception {
SubscriptionData subscriptionData =
FilterAPI.buildSubscriptionData(group, topic, subString);
FilterAPI.buildSubscriptionData(group, topic, subString);
assertThat(subscriptionData.getTopic()).isEqualTo(topic);
assertThat(subscriptionData.getSubString()).isEqualTo(subString);
String[] tags = subString.split("\\|\\|");
Expand All @@ -47,7 +48,7 @@ public void testBuildSubscriptionData() throws Exception {
public void testBuildTagSome() {
try {
SubscriptionData subscriptionData = FilterAPI.build(
"TOPIC", "A || B", ExpressionType.TAG
"TOPIC", "A || B", ExpressionType.TAG
);

assertThat(subscriptionData).isNotNull();
Expand All @@ -67,7 +68,7 @@ public void testBuildTagSome() {
public void testBuildSQL() {
try {
SubscriptionData subscriptionData = FilterAPI.build(
"TOPIC", "a is not null", ExpressionType.SQL92
"TOPIC", "a is not null", ExpressionType.SQL92
);

assertThat(subscriptionData).isNotNull();
Expand All @@ -79,16 +80,8 @@ public void testBuildSQL() {
}
}

@Test
public void testBuildSQLWithNullSubString() {
try {
FilterAPI.build(
"TOPIC", null, ExpressionType.SQL92
);

assertThat(Boolean.FALSE).isTrue();
} catch (Exception e) {
e.printStackTrace();
}
@Test(expected = IllegalArgumentException.class)
public void testBuildSQLWithNullSubString() throws Exception {
FilterAPI.build("TOPIC", null, ExpressionType.SQL92);
}
}

This file was deleted.

0 comments on commit c0e4c3f

Please sign in to comment.