mirror of
https://github.com/alibaba/testable-mock.git
synced 2026-08-22 11:13:31 +08:00
release v0.6.7
This commit is contained in:
@@ -49,7 +49,7 @@ dependencies {
|
||||
testImplementation 'androidx.test:runner:1.4.0-alpha05'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
testImplementation 'org.robolectric:robolectric:4.5.1'
|
||||
testImplementation 'com.alibaba.testable:testable-all:0.6.6'
|
||||
testImplementation 'com.alibaba.testable:testable-all:0.6.7'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
}
|
||||
@@ -13,8 +13,8 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
|
||||
testImplementation('com.alibaba.testable:testable-all:0.6.6')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.6.6')
|
||||
testImplementation('com.alibaba.testable:testable-all:0.6.7')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.6.7')
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<junit.version>5.6.2</junit.version>
|
||||
<testable.version>0.6.6</testable.version>
|
||||
<testable.version>0.6.7</testable.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -17,8 +17,8 @@ dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.6.2")
|
||||
testImplementation("com.alibaba.testable:testable-all:0.6.6")
|
||||
testAnnotationProcessor("com.alibaba.testable:testable-processor:0.6.6")
|
||||
testImplementation("com.alibaba.testable:testable-all:0.6.7")
|
||||
testAnnotationProcessor("com.alibaba.testable:testable-processor:0.6.7")
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<junit.version>5.6.2</junit.version>
|
||||
<testable.version>0.6.6</testable.version>
|
||||
<testable.version>0.6.7</testable.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -14,8 +14,8 @@ repositories {
|
||||
dependencies {
|
||||
testImplementation 'org.codehaus.groovy:groovy-all:3.0.7'
|
||||
testImplementation 'org.spockframework:spock-core:2.0-M5-groovy-3.0'
|
||||
testImplementation('com.alibaba.testable:testable-all:0.6.6')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.6.6')
|
||||
testImplementation('com.alibaba.testable:testable-all:0.6.7')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.6.7')
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<testable.version>0.6.6</testable.version>
|
||||
<testable.version>0.6.7</testable.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Release Note
|
||||
|
||||
## 0.6.7
|
||||
- support empty mock container class which has all mock methods in its parent
|
||||
- fix an issue cause mock fail when parameter has array element accessing
|
||||
|
||||
## 0.6.6
|
||||
- support global package path mapping for easier mocking code of 3rd packages
|
||||
- complete mock target checking, improve resistance to code refactoring
|
||||
|
||||
@@ -17,7 +17,7 @@ It is recommended to add a `property` field that identifies the TestableMock ver
|
||||
|
||||
```xml
|
||||
<properties>
|
||||
<testable.version>0.6.6</testable.version>
|
||||
<testable.version>0.6.7</testable.version>
|
||||
</properties>
|
||||
```
|
||||
|
||||
@@ -64,8 +64,8 @@ Add dependence of `TestableMock` in `build.gradle` file:
|
||||
|
||||
```groovy
|
||||
dependencies {
|
||||
testImplementation('com.alibaba.testable:testable-all:0.6.6')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.6.6')
|
||||
testImplementation('com.alibaba.testable:testable-all:0.6.7')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.6.7')
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Release Note
|
||||
|
||||
## 0.6.7
|
||||
- 支持所有Mock方法都定义在父类中的空Mock容器类(issue-167)
|
||||
- 修复一处导致参数包含数组下标读取的调用无法Mock的问题(issue-171)
|
||||
|
||||
## 0.6.6
|
||||
- 支持全局参数配置Mock容器的包路径映射,便于Mock三方包内的代码(issue-105)
|
||||
- 实现Mock功能的防代码重构机制(issue-5)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
```xml
|
||||
<properties>
|
||||
<testable.version>0.6.6</testable.version>
|
||||
<testable.version>0.6.7</testable.version>
|
||||
</properties>
|
||||
```
|
||||
|
||||
@@ -64,8 +64,8 @@
|
||||
|
||||
```groovy
|
||||
dependencies {
|
||||
testImplementation('com.alibaba.testable:testable-all:0.6.6')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.6.6')
|
||||
testImplementation('com.alibaba.testable:testable-all:0.6.7')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.6.7')
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -89,9 +89,3 @@ public class ServiceTest {
|
||||
完整代码示例见`java-demo`和`kotlin-demo`示例项目中`OneToMultiSvcTest`测试类的用例。
|
||||
|
||||
> 由于测试类无法通过`@MockWith`与多个Mock容器关联,目前这种用法仅支持生效范围为`MockScope.GLOBAL`的Mock方法。
|
||||
|
||||
### 4. 使用不包含Mock方法的Mock容器类
|
||||
|
||||
为了加快搜索Mock容器类的速度,在扫描过程中,`TestableMock`只会将自身定义有Mock方法(包含`@MockMethod`或`@MockMockConstructor`注解的方法)以及明确被`@MockWith`指向的类识别为有效的Mock容器,而不会去遍历其父类。
|
||||
|
||||
假如出于某些极特殊原因要使用无Mock方法的类型作为Mock容器,譬如希望将实际Mock方法均定义在父类,实际使用的子容器仅仅重载父类的某些特定方法。此时即使Mock容器类的位置符合约定,为了能够被识别,依然应该在相应的测试类上增加对Mock容器类的`@MockWith`引用。
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.6.6</version>
|
||||
<version>0.6.7</version>
|
||||
<relativePath>../testable-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>testable-agent</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.6.6</version>
|
||||
<version>0.6.7</version>
|
||||
<relativePath>../testable-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>testable-all</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.6.6</version>
|
||||
<version>0.6.7</version>
|
||||
<relativePath>../testable-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>testable-core</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.6.6</version>
|
||||
<version>0.6.7</version>
|
||||
<relativePath>../testable-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>testable-maven-plugin</artifactId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.6.6</version>
|
||||
<version>0.6.7</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>testable-parent</name>
|
||||
<description>Unit test enhancement toolkit</description>
|
||||
@@ -42,7 +42,7 @@
|
||||
<plugin.gpg.version>1.6</plugin.gpg.version>
|
||||
<plugin.staging.version>1.6.8</plugin.staging.version>
|
||||
<plugin.maven.version>3.6.0</plugin.maven.version>
|
||||
<testable.version>0.6.6</testable.version>
|
||||
<testable.version>0.6.7</testable.version>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.6.6</version>
|
||||
<version>0.6.7</version>
|
||||
<relativePath>../testable-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>testable-processor</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user