@Test public void testIsShowDataSources() { Assert.assertEquals(ServerParseShow.DATASOURCES, ServerParseShow.parse("show datasources", 4)); Assert.assertEquals(ServerParseShow.DATASOURCES, ServerParseShow.parse("SHOW DATASOURCES", 4)); Assert.assertEquals( ServerParseShow.DATASOURCES, ServerParseShow.parse(" SHOW DATASOURCES ", 6)); }
@Test public void testShowMycatCluster() { Assert.assertEquals( ServerParseShow.MYCAT_CLUSTER, ServerParseShow.parse("show mycat_cluster", 4)); Assert.assertEquals( ServerParseShow.MYCAT_CLUSTER, ServerParseShow.parse("Show mycat_CLUSTER ", 4)); Assert.assertEquals( ServerParseShow.MYCAT_CLUSTER, ServerParseShow.parse(" show MYCAT_cluster", 5)); Assert.assertEquals(ServerParseShow.OTHER, ServerParseShow.parse(" show mycat_clust", 5)); Assert.assertEquals(ServerParseShow.OTHER, ServerParseShow.parse(" show mycat_cluster2", 5)); Assert.assertEquals(ServerParseShow.OTHER, ServerParseShow.parse("Show mycat_cluster9 ", 4)); }
@Test public void testShowMycatStatus() { Assert.assertEquals( ServerParseShow.MYCAT_STATUS, ServerParseShow.parse("show mycat_status", 4)); Assert.assertEquals( ServerParseShow.MYCAT_STATUS, ServerParseShow.parse("show mycat_status ", 4)); Assert.assertEquals( ServerParseShow.MYCAT_STATUS, ServerParseShow.parse(" SHOW MYCAT_STATUS", " SHOW".length())); Assert.assertEquals( ServerParseShow.OTHER, ServerParseShow.parse(" show mycat_statu", " SHOW".length())); Assert.assertEquals( ServerParseShow.OTHER, ServerParseShow.parse(" show mycat_status2", " SHOW".length())); Assert.assertEquals( ServerParseShow.OTHER, ServerParseShow.parse("Show mycat_status2 ", "SHOW".length())); }
@Test public void testIsShowOther() { Assert.assertEquals(ServerParseShow.OTHER, ServerParseShow.parse("show ...", 4)); Assert.assertEquals(ServerParseShow.OTHER, ServerParseShow.parse("SHOW ...", 4)); Assert.assertEquals(ServerParseShow.OTHER, ServerParseShow.parse("SHOW ... ", 4)); }
@Test public void testIsShowDatabases() { Assert.assertEquals(ServerParseShow.DATABASES, ServerParseShow.parse("show databases", 4)); Assert.assertEquals(ServerParseShow.DATABASES, ServerParseShow.parse("SHOW DATABASES", 4)); Assert.assertEquals(ServerParseShow.DATABASES, ServerParseShow.parse("SHOW databases ", 4)); }