|
|
|
@ -1,6 +1,20 @@ |
|
|
|
package org.springframework.mock.staticmock; |
|
|
|
/* |
|
|
|
|
|
|
|
* Copyright 2002-2010 the original author or authors. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Licensed 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. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
import javax.persistence.Entity; |
|
|
|
package org.springframework.mock.staticmock; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Annotation-based aspect to use in test build to enable mocking static methods |
|
|
|
* Annotation-based aspect to use in test build to enable mocking static methods |
|
|
|
@ -23,11 +37,9 @@ import javax.persistence.Entity; |
|
|
|
* occur automatically. |
|
|
|
* occur automatically. |
|
|
|
* </ol> |
|
|
|
* </ol> |
|
|
|
* |
|
|
|
* |
|
|
|
* @see MockStaticEntityMethods |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @author Rod Johnson |
|
|
|
* @author Rod Johnson |
|
|
|
* @author Ramnivas Laddad |
|
|
|
* @author Ramnivas Laddad |
|
|
|
* |
|
|
|
* @see MockStaticEntityMethods |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public aspect AnnotationDrivenStaticEntityMockingControl extends AbstractMethodMockingControl { |
|
|
|
public aspect AnnotationDrivenStaticEntityMockingControl extends AbstractMethodMockingControl { |
|
|
|
|
|
|
|
|
|
|
|
@ -50,6 +62,6 @@ public aspect AnnotationDrivenStaticEntityMockingControl extends AbstractMethodM |
|
|
|
// @MockStatics classes to invoke each other without resetting the mocking environment |
|
|
|
// @MockStatics classes to invoke each other without resetting the mocking environment |
|
|
|
protected pointcut mockStaticsTestMethod() : execution(public * (@MockStaticEntityMethods *).*(..)); |
|
|
|
protected pointcut mockStaticsTestMethod() : execution(public * (@MockStaticEntityMethods *).*(..)); |
|
|
|
|
|
|
|
|
|
|
|
protected pointcut methodToMock() : execution(public static * (@Entity *).*(..)); |
|
|
|
protected pointcut methodToMock() : execution(public static * (@javax.persistence.Entity *).*(..)); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|