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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user