You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/12/14 16:02:04 UTC

[shardingsphere] branch master updated: Add test cases for agent-core advisors (#22863)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new b360515ba7c Add test cases for agent-core advisors (#22863)
b360515ba7c is described below

commit b360515ba7c6582c730163e3686559818151c09e
Author: Junfeng <i...@jacob953.com>
AuthorDate: Thu Dec 15 00:01:54 2022 +0800

    Add test cases for agent-core advisors (#22863)
    
    * test: Add test cases for agent-core advisors
    
    Signed-off-by: Junfeng <i...@jacob953.com>
    
    * fix: add final to class
    
    Signed-off-by: Junfeng <i...@jacob953.com>
    
    Signed-off-by: Junfeng <i...@jacob953.com>
---
 .../advisor/ClassAdvisorRegistryFactoryTest.java   | 31 +++++++++++++++++++++
 .../core/advisor/ClassAdvisorRegistryTest.java     | 32 ++++++++++++++++++++++
 2 files changed, 63 insertions(+)

diff --git a/agent/core/src/test/java/org/apache/shardingsphere/agent/core/advisor/ClassAdvisorRegistryFactoryTest.java b/agent/core/src/test/java/org/apache/shardingsphere/agent/core/advisor/ClassAdvisorRegistryFactoryTest.java
new file mode 100644
index 00000000000..1af5cfe9b6c
--- /dev/null
+++ b/agent/core/src/test/java/org/apache/shardingsphere/agent/core/advisor/ClassAdvisorRegistryFactoryTest.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.agent.core.advisor;
+
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public final class ClassAdvisorRegistryFactoryTest {
+
+    @Test
+    public void assertGetRegistryWithType() {
+        assertThat(ClassAdvisorRegistryFactory.getRegistry("test"), instanceOf(ClassAdvisorRegistry.class));
+    }
+}
diff --git a/agent/core/src/test/java/org/apache/shardingsphere/agent/core/advisor/ClassAdvisorRegistryTest.java b/agent/core/src/test/java/org/apache/shardingsphere/agent/core/advisor/ClassAdvisorRegistryTest.java
new file mode 100644
index 00000000000..6ff4c4a740a
--- /dev/null
+++ b/agent/core/src/test/java/org/apache/shardingsphere/agent/core/advisor/ClassAdvisorRegistryTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.agent.core.advisor;
+
+import org.apache.shardingsphere.agent.advisor.ClassAdvisor;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public final class ClassAdvisorRegistryTest {
+
+    @Test
+    public void assertGetAdvisorWithType() {
+        assertThat(new ClassAdvisorRegistry().getAdvisor("test"), instanceOf(ClassAdvisor.class));
+    }
+}