forked from apache/shardingsphere
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test cases for YamlAdvisorsConfigurationSwapper (apache#22983)
- Loading branch information
Showing
10 changed files
with
236 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...test/java/org/apache/shardingsphere/agent/core/plugin/yaml/fixture/YamlAdviceFixture.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* 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.plugin.yaml.fixture; | ||
|
||
import org.apache.shardingsphere.agent.advice.MethodInvocationResult; | ||
import org.apache.shardingsphere.agent.advice.TargetAdviceObject; | ||
import org.apache.shardingsphere.agent.advice.type.ConstructorAdvice; | ||
import org.apache.shardingsphere.agent.advice.type.InstanceMethodAdvice; | ||
import org.apache.shardingsphere.agent.advice.type.StaticMethodAdvice; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
public final class YamlAdviceFixture implements ConstructorAdvice, InstanceMethodAdvice, StaticMethodAdvice { | ||
|
||
@Override | ||
public void onConstructor(final TargetAdviceObject target, final Object[] args) { | ||
} | ||
|
||
@Override | ||
public void beforeMethod(final TargetAdviceObject target, final Method method, final Object[] args, final MethodInvocationResult invocationResult) { | ||
} | ||
|
||
@Override | ||
public void beforeMethod(final Class<?> clazz, final Method method, final Object[] args, final MethodInvocationResult result) { | ||
} | ||
|
||
@Override | ||
public void afterMethod(final TargetAdviceObject target, final Method method, final Object[] args, final MethodInvocationResult invocationResult) { | ||
} | ||
|
||
@Override | ||
public void afterMethod(final Class<?> clazz, final Method method, final Object[] args, final MethodInvocationResult result) { | ||
} | ||
|
||
@Override | ||
public void onThrowing(final TargetAdviceObject target, final Method method, final Object[] args, final Throwable throwable) { | ||
} | ||
|
||
@Override | ||
public void onThrowing(final Class<?> clazz, final Method method, final Object[] args, final Throwable throwable) { | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
...ava/org/apache/shardingsphere/agent/core/plugin/yaml/fixture/YamlTargetObjectFixture.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* 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.plugin.yaml.fixture; | ||
|
||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
public final class YamlTargetObjectFixture { | ||
|
||
public YamlTargetObjectFixture(final String value) { | ||
} | ||
|
||
/** | ||
* Call instance method. | ||
*/ | ||
public void call() { | ||
} | ||
|
||
/** | ||
* Call instance method. | ||
* | ||
* @param value value | ||
*/ | ||
public void call(final String value) { | ||
} | ||
|
||
/** | ||
* Call instance method. | ||
* | ||
* @param value1 value1 | ||
* @param value2 value2 | ||
*/ | ||
public void call(final String value1, final String value2) { | ||
} | ||
|
||
/** | ||
* Call static method. | ||
*/ | ||
public static void staticCall() { | ||
} | ||
|
||
/** | ||
* Call static method. | ||
* | ||
* @param value value | ||
*/ | ||
public static void staticCall(final String value) { | ||
} | ||
|
||
/** | ||
* Call static method. | ||
* | ||
* @param value1 value1 | ||
* @param value2 value2 | ||
*/ | ||
public static void staticCall(final String value1, final String value2) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.