mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
remove compiler warning
This commit is contained in:
@@ -54,6 +54,7 @@ public final class UriUtils {
|
||||
}
|
||||
String query = uri.getRawQuery();
|
||||
HashMap<String, String> params = new HashMap<String, String>();
|
||||
@SuppressWarnings("resource")
|
||||
Scanner scan = new Scanner(query);
|
||||
scan.useDelimiter(SPLIT);
|
||||
while (scan.hasNext()) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.Statement;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.alibaba.otter.canal.parse.driver.mysql;
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.google.common.collect.MigrateMap;
|
||||
*/
|
||||
public class PatternUtils {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private static Map<String, Pattern> patterns = MigrateMap.makeComputingMap(new MapMaker().softValues(),
|
||||
new Function<String, Pattern>() {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.alibaba.otter.canal.filter;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.apache.commons.lang.RandomStringUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.otter.canal.protocol.ClientIdentity;
|
||||
import com.alibaba.otter.canal.protocol.position.EntryPosition;
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.Before;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.alibaba.otter.canal.meta;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.alibaba.otter.canal.meta;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.alibaba.otter.canal.meta;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.alibaba.otter.canal.meta;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
@@ -4,8 +4,7 @@ import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector;
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.net.InetSocketAddress;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.alibaba.otter.canal.parse.inbound.mysql;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.URL;
|
||||
@@ -10,6 +7,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -93,10 +91,10 @@ public class LocalBinlogEventParserTest {
|
||||
}
|
||||
|
||||
// check
|
||||
assertTrue(entryCount.get() > 0);
|
||||
Assert.assertTrue(entryCount.get() > 0);
|
||||
|
||||
// 对比第一条数据和起始的position相同
|
||||
assertEquals(entryPosition, defaultPosition);
|
||||
Assert.assertEquals(entryPosition, defaultPosition);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -155,12 +153,12 @@ public class LocalBinlogEventParserTest {
|
||||
}
|
||||
|
||||
// check
|
||||
assertTrue(entryCount.get() > 0);
|
||||
Assert.assertTrue(entryCount.get() > 0);
|
||||
|
||||
// 对比第一条数据和起始的position相同
|
||||
assertEquals(entryPosition.getJournalName(), "mysql-bin.000001");
|
||||
assertTrue(entryPosition.getPosition() <= 6163L);
|
||||
assertTrue(entryPosition.getTimestamp() <= defaultPosition.getTimestamp());
|
||||
Assert.assertEquals(entryPosition.getJournalName(), "mysql-bin.000001");
|
||||
Assert.assertTrue(entryPosition.getPosition() <= 6163L);
|
||||
Assert.assertTrue(entryPosition.getTimestamp() <= defaultPosition.getTimestamp());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -221,11 +219,11 @@ public class LocalBinlogEventParserTest {
|
||||
}
|
||||
|
||||
// check
|
||||
assertTrue(entryCount.get() > 0);
|
||||
Assert.assertTrue(entryCount.get() > 0);
|
||||
|
||||
// 对比第一条数据和起始的position相同
|
||||
// assertEquals(entryPosition.getJournalName(), "mysql-bin.000002");
|
||||
assertTrue(entryPosition.getTimestamp() <= defaultPosition.getTimestamp());
|
||||
Assert.assertTrue(entryPosition.getTimestamp() <= defaultPosition.getTimestamp());
|
||||
}
|
||||
|
||||
private EntryPosition buildPosition(String binlogFile, Long offest, Long timestamp) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.net.InetSocketAddress;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
package com.alibaba.otter.canal.parse.inbound.mysql;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.alibaba.otter.canal.parse.helper.TimeoutChecker;
|
||||
@@ -88,7 +84,7 @@ public class MysqlEventParserTest {
|
||||
}
|
||||
|
||||
// check
|
||||
assertTrue(entryCount.get() > 0);
|
||||
Assert.assertTrue(entryCount.get() > 0);
|
||||
|
||||
// 对比第一条数据和起始的position相同
|
||||
Assert.assertEquals(entryPosition, defaultPosition);
|
||||
@@ -152,12 +148,12 @@ public class MysqlEventParserTest {
|
||||
}
|
||||
|
||||
// check
|
||||
assertTrue(entryCount.get() > 0);
|
||||
Assert.assertTrue(entryCount.get() > 0);
|
||||
|
||||
// 对比第一条数据和起始的position相同
|
||||
assertEquals(entryPosition.getJournalName(), "mysql-bin.000001");
|
||||
assertTrue(entryPosition.getPosition() <= 6163L);
|
||||
assertTrue(entryPosition.getTimestamp() <= defaultPosition.getTimestamp());
|
||||
Assert.assertEquals(entryPosition.getJournalName(), "mysql-bin.000001");
|
||||
Assert.assertTrue(entryPosition.getPosition() <= 6163L);
|
||||
Assert.assertTrue(entryPosition.getTimestamp() <= defaultPosition.getTimestamp());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -219,12 +215,12 @@ public class MysqlEventParserTest {
|
||||
}
|
||||
|
||||
// check
|
||||
assertTrue(entryCount.get() > 0);
|
||||
Assert.assertTrue(entryCount.get() > 0);
|
||||
|
||||
// 对比第一条数据和起始的position相同
|
||||
Assert.assertEquals(entryPosition.getJournalName(), "mysql-bin.000001");
|
||||
assertTrue(entryPosition.getPosition() <= 6163L);
|
||||
assertTrue(entryPosition.getTimestamp() <= defaultPosition.getTimestamp());
|
||||
Assert.assertTrue(entryPosition.getPosition() <= 6163L);
|
||||
Assert.assertTrue(entryPosition.getTimestamp() <= defaultPosition.getTimestamp());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -288,12 +284,12 @@ public class MysqlEventParserTest {
|
||||
}
|
||||
|
||||
// check
|
||||
assertTrue(entryCount.get() > 0);
|
||||
Assert.assertTrue(entryCount.get() > 0);
|
||||
|
||||
// 对比第一条数据和起始的position相同
|
||||
// Assert.assertEquals(logfilename, "mysql-bin.000001");
|
||||
// Assert.assertEquals(106L, logfileoffset);
|
||||
assertTrue(entryPosition.getTimestamp() < defaultPosition.getTimestamp());
|
||||
Assert.assertTrue(entryPosition.getTimestamp() < defaultPosition.getTimestamp());
|
||||
}
|
||||
|
||||
// ======================== helper method =======================
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.alibaba.otter.canal.parse.inbound.mysql;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.alibaba.otter.canal.parse.inbound.mysql.dbsync.SimpleDdlParser;
|
||||
@@ -82,6 +81,12 @@ public class SimpleDdlParserTest {
|
||||
Assert.assertNotNull(result);
|
||||
Assert.assertEquals("temp_bond_keys", result.getSchemaName());
|
||||
Assert.assertEquals("temp_bond_key_id", result.getTableName());
|
||||
|
||||
queryString = "CREATE TABLE performance_schema.cond_instances(NAME ";
|
||||
result = SimpleDdlParser.parse(queryString, "retl");
|
||||
Assert.assertNotNull(result);
|
||||
Assert.assertEquals("performance_schema", result.getSchemaName());
|
||||
Assert.assertEquals("cond_instances", result.getTableName());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.alibaba.otter.canal.parse.index;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.Date;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.otter.canal.protocol.position.EntryPosition;
|
||||
import com.alibaba.otter.canal.protocol.position.LogIdentity;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.alibaba.otter.canal.parse.index;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.Before;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.alibaba.otter.canal.parse.index;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.Date;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.alibaba.otter.canal.parse.index;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.alibaba.otter.canal.parse.index;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.apache.commons.lang.math.RandomUtils;
|
||||
import org.junit.After;
|
||||
|
||||
Reference in New Issue
Block a user