release v0.7.9

This commit is contained in:
金戟 2022-12-14 19:22:37 +08:00
parent 1e9079e8d3
commit 0287d27d85
19 changed files with 40 additions and 24 deletions

View File

@ -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.7.8'
testImplementation 'com.alibaba.testable:testable-all:0.7.9'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

View File

@ -13,8 +13,8 @@ repositories {
dependencies {
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
testImplementation('com.alibaba.testable:testable-all:0.7.8')
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.8')
testImplementation('com.alibaba.testable:testable-all:0.7.9')
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.9')
}
tasks.withType(JavaCompile) {

View File

@ -12,7 +12,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<junit.version>5.9.1</junit.version>
<testable.version>0.7.8</testable.version>
<testable.version>0.7.9</testable.version>
</properties>
<dependencies>

View File

@ -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.7.8")
testAnnotationProcessor("com.alibaba.testable:testable-processor:0.7.8")
testImplementation("com.alibaba.testable:testable-all:0.7.9")
testAnnotationProcessor("com.alibaba.testable:testable-processor:0.7.9")
}
tasks.withType<KotlinCompile> {

View File

@ -14,7 +14,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<junit.version>5.9.1</junit.version>
<testable.version>0.7.8</testable.version>
<testable.version>0.7.9</testable.version>
</properties>
<dependencies>

View File

@ -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.7.8')
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.8')
testImplementation('com.alibaba.testable:testable-all:0.7.9')
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.9')
}
tasks.withType(JavaCompile) {

View File

@ -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.7.8</testable.version>
<testable.version>0.7.9</testable.version>
</properties>
<dependencyManagement>

View File

@ -35,7 +35,9 @@ Parent parent = OmniConstructor.newInstance(Parent.class);
parent.getChild().getGrandChild().getContent();
```
> **Note**: Based on the light-weight principle, in the default mode, `OmniConstructor` will only uses the original constructor of the class to create objects. For POJO and most model layer objects, this mode has been able to meet the needs.
> Interface and abstract class can also be instantiated by `OmniConstructor`, you can try it e.g. `OmniConstructor.newInstance(CharSequence.class)` ^_^
> **Notice**: Based on the light-weight principle, in the default mode, `OmniConstructor` will only uses the original constructor of the class to create objects. For POJO and most model layer objects, this mode has been able to meet the needs.
> But for more complex situations, such as when certain class have constructors throwing exceptions or contain other statements that hinder the normal execution of the construction, the object construction may fail.
> In those situations, you can use the [Testable global configuration](en-us/doc/javaagent-args.md) `omni.constructor.enhance.enable = true` to enable bytecode enhancement mode of `OmniConstructor`, in this mode, any Java class can be constructed.

View File

@ -1,5 +1,11 @@
# Release Note
## 0.7.9
- fix many issues relate to interface instance creation of `OmniConstructor`
- add `@MockContainer` annotation to support multiply parents inheritance between mock classes
- add `targetClassName` parameter to `@MockInvoke` annotation, support mock method of private internal class
- move collection creation methods from `CollectionUtil` class to `CollectionTool` class
## 0.7.8
- support use `OmniConstructor` class to create instance of interface type or abstract class
- provide a `CollectionUtil` class which contains many utility collection creation methods

View File

@ -16,7 +16,7 @@ It is recommended to add a `property` field that identifies the TestableMock ver
```xml
<properties>
<testable.version>0.7.8</testable.version>
<testable.version>0.7.9</testable.version>
</properties>
```
@ -63,8 +63,8 @@ Add dependence of `TestableMock` in `build.gradle` file:
```groovy
dependencies {
testImplementation('com.alibaba.testable:testable-all:0.7.8')
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.8')
testImplementation('com.alibaba.testable:testable-all:0.7.9')
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.9')
}
```

View File

@ -35,6 +35,8 @@ Parent parent = OmniConstructor.newInstance(Parent.class);
parent.getChild().getGrandChild().getContent();
```
> 接口类型和抽象类型也可以直接通过`OmniConstructor`实例化哦,不信试试看`OmniConstructor.newInstance(CharSequence.class)` ^_^
> **注意**:基于轻量优先原则,默认模式下,`OmniConstructor`仅利用类型原有的构造方法来创建对象对于绝大多数POJO和`Model`层对象而言这种模式已经能够满足需要。
> 但对于更复杂的情形,譬如遇到某些类型的构造方法会抛出异常或包含其他妨碍构造正常执行的语句时,对象构造可能会失败。
> 此时可通过[Testable全局配置](zh-cn/doc/javaagent-args.md)`omni.constructor.enhance.enable = true`启用`OmniConstructor`的字节码增强模式在该模式下任何Java类型皆可构造。

View File

@ -1,5 +1,11 @@
# Release Note
## 0.7.9
- 修复多处`OmniConstructor`创建接口类型对象相关的问题
- 新增`@MockContainer`注解支持Mock容器类之间的多重继承
- `@MockInvoke`注解新增`targetClassName`参数支持Mock私有内部类的方法
- 将`CollectionUtil`中的集合构造方法独立为`CollectionTool`工具类并发布
## 0.7.8
- 支持使用`OmniConstructor`工具类自动创建接口和抽象类的实例
- 提供`CollectionUtil`工具类,包含在测试中常用的集合创建方法

View File

@ -16,7 +16,7 @@
```xml
<properties>
<testable.version>0.7.8</testable.version>
<testable.version>0.7.9</testable.version>
</properties>
```
@ -63,8 +63,8 @@
```groovy
dependencies {
testImplementation('com.alibaba.testable:testable-all:0.7.8')
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.8')
testImplementation('com.alibaba.testable:testable-all:0.7.9')
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.9')
}
```

View File

@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.testable</groupId>
<artifactId>testable-parent</artifactId>
<version>0.7.8</version>
<version>0.7.9</version>
<relativePath>../testable-parent</relativePath>
</parent>
<artifactId>testable-agent</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.testable</groupId>
<artifactId>testable-parent</artifactId>
<version>0.7.8</version>
<version>0.7.9</version>
<relativePath>../testable-parent</relativePath>
</parent>
<artifactId>testable-all</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.testable</groupId>
<artifactId>testable-parent</artifactId>
<version>0.7.8</version>
<version>0.7.9</version>
<relativePath>../testable-parent</relativePath>
</parent>
<artifactId>testable-core</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.testable</groupId>
<artifactId>testable-parent</artifactId>
<version>0.7.8</version>
<version>0.7.9</version>
<relativePath>../testable-parent</relativePath>
</parent>
<artifactId>testable-maven-plugin</artifactId>

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.alibaba.testable</groupId>
<artifactId>testable-parent</artifactId>
<version>0.7.8</version>
<version>0.7.9</version>
<packaging>pom</packaging>
<name>testable-parent</name>
<description>Unit test enhancement toolkit</description>
@ -42,7 +42,7 @@
<plugin.gpg.version>3.0.1</plugin.gpg.version>
<plugin.staging.version>1.6.13</plugin.staging.version>
<plugin.maven.version>3.7.0</plugin.maven.version>
<testable.version>0.7.8</testable.version>
<testable.version>0.7.9</testable.version>
</properties>
<profiles>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.testable</groupId>
<artifactId>testable-parent</artifactId>
<version>0.7.8</version>
<version>0.7.9</version>
<relativePath>../testable-parent</relativePath>
</parent>
<artifactId>testable-processor</artifactId>