mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-03-24 08:41:12 +08:00
release v0.7.8
This commit is contained in:
parent
f508f7aba9
commit
46e4499035
demo
android-demo/app
java-demo
kotlin-demo
spock-demo
docs
en-us/doc
zh-cn/doc
testable-agent
testable-all
testable-core
testable-maven-plugin
testable-parent
testable-processor
@ -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.7'
|
||||
testImplementation 'com.alibaba.testable:testable-all:0.7.8'
|
||||
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.7.7')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.7')
|
||||
testImplementation('com.alibaba.testable:testable-all:0.7.8')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.8')
|
||||
}
|
||||
|
||||
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.7.7</testable.version>
|
||||
<testable.version>0.7.8</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.7.7")
|
||||
testAnnotationProcessor("com.alibaba.testable:testable-processor:0.7.7")
|
||||
testImplementation("com.alibaba.testable:testable-all:0.7.8")
|
||||
testAnnotationProcessor("com.alibaba.testable:testable-processor:0.7.8")
|
||||
}
|
||||
|
||||
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.7.7</testable.version>
|
||||
<testable.version>0.7.8</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.7.7')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.7')
|
||||
testImplementation('com.alibaba.testable:testable-all:0.7.8')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.8')
|
||||
}
|
||||
|
||||
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.7.7</testable.version>
|
||||
<testable.version>0.7.8</testable.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
@ -35,9 +35,7 @@ Parent parent = OmniConstructor.newInstance(Parent.class);
|
||||
parent.getChild().getGrandChild().getContent();
|
||||
```
|
||||
|
||||
> **Note 1**: In the current version, the member fields of type interface or abstract class will still be initialized to `null`, this problem will be fixed in the future.
|
||||
>
|
||||
> **Note 2**: 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.
|
||||
> **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.
|
||||
> 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.
|
||||
|
||||
|
@ -1,10 +1,14 @@
|
||||
# Release Note
|
||||
|
||||
## 0.7.7
|
||||
## 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
|
||||
- fix a compatibility issue with jdk 1.6
|
||||
|
||||
## 0.7.7
|
||||
- skip bytecode process for classes which not associated to any mock class, speed up test initialization
|
||||
- only generate substitution method for mocked method references
|
||||
- fix compatibility issue with jdk 17
|
||||
- fix compatibility issues with jdk 17
|
||||
|
||||
## 0.7.6
|
||||
- define package mapping rule according to order in config, to avoid a short path overwrite longer ones
|
||||
|
@ -16,7 +16,7 @@ It is recommended to add a `property` field that identifies the TestableMock ver
|
||||
|
||||
```xml
|
||||
<properties>
|
||||
<testable.version>0.7.7</testable.version>
|
||||
<testable.version>0.7.8</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.7')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.7')
|
||||
testImplementation('com.alibaba.testable:testable-all:0.7.8')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.8')
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -35,9 +35,7 @@ Parent parent = OmniConstructor.newInstance(Parent.class);
|
||||
parent.getChild().getGrandChild().getContent();
|
||||
```
|
||||
|
||||
> **注意 1** :在当前版本中,类型为接口或抽象类的成员字段依然会被初始化为`null`,此问题将在后续版本修复
|
||||
>
|
||||
> **注意 2** :基于轻量优先原则,默认模式下,`OmniConstructor`仅利用类型原有的构造方法来创建对象,对于绝大多数POJO和`Model`层对象而言这种模式已经能够满足需要。
|
||||
> **注意**:基于轻量优先原则,默认模式下,`OmniConstructor`仅利用类型原有的构造方法来创建对象,对于绝大多数POJO和`Model`层对象而言这种模式已经能够满足需要。
|
||||
> 但对于更复杂的情形,譬如遇到某些类型的构造方法会抛出异常或包含其他妨碍构造正常执行的语句时,对象构造可能会失败。
|
||||
> 此时可通过[Testable全局配置](zh-cn/doc/javaagent-args.md)`omni.constructor.enhance.enable = true`启用`OmniConstructor`的字节码增强模式,在该模式下,任何Java类型皆可构造。
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
# Release Note
|
||||
|
||||
## 0.7.7
|
||||
## 0.7.8
|
||||
- 支持使用`OmniConstructor`工具类自动创建接口和抽象类的实例
|
||||
- 提供`CollectionUtil`工具类,包含在测试中常用的集合创建方法
|
||||
- 修复一处JDK 1.6的兼容问题
|
||||
|
||||
## 0.7.7
|
||||
- 未关联Mock类的类型自动跳过字节码处理,提升大型项目测试启动速度
|
||||
- 仅对被Mock的方法引用生成替代方法 (issue-280)
|
||||
- 修复JDK 17的兼容性问题 (issue-283)
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
```xml
|
||||
<properties>
|
||||
<testable.version>0.7.7</testable.version>
|
||||
<testable.version>0.7.8</testable.version>
|
||||
</properties>
|
||||
```
|
||||
|
||||
@ -63,8 +63,8 @@
|
||||
|
||||
```groovy
|
||||
dependencies {
|
||||
testImplementation('com.alibaba.testable:testable-all:0.7.7')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.7')
|
||||
testImplementation('com.alibaba.testable:testable-all:0.7.8')
|
||||
testAnnotationProcessor('com.alibaba.testable:testable-processor:0.7.8')
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.7.7</version>
|
||||
<version>0.7.8</version>
|
||||
<relativePath>../testable-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>testable-agent</artifactId>
|
||||
@ -123,6 +123,9 @@
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<additionalOptions>-Xdoclint:none</additionalOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@ -137,6 +140,13 @@
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- Prevent `gpg` from using pinentry programs -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.7.7</version>
|
||||
<version>0.7.8</version>
|
||||
<relativePath>../testable-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>testable-all</artifactId>
|
||||
@ -59,6 +59,9 @@
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<additionalOptions>-Xdoclint:none</additionalOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@ -73,6 +76,13 @@
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- Prevent `gpg` from using pinentry programs -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.7.7</version>
|
||||
<version>0.7.8</version>
|
||||
<relativePath>../testable-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>testable-core</artifactId>
|
||||
@ -80,6 +80,9 @@
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<additionalOptions>-Xdoclint:none</additionalOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@ -94,6 +97,13 @@
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- Prevent `gpg` from using pinentry programs -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.7.7</version>
|
||||
<version>0.7.8</version>
|
||||
<relativePath>../testable-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>testable-maven-plugin</artifactId>
|
||||
@ -85,6 +85,9 @@
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<additionalOptions>-Xdoclint:none</additionalOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@ -99,6 +102,13 @@
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- Prevent `gpg` from using pinentry programs -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.7.7</version>
|
||||
<version>0.7.8</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>testable-parent</name>
|
||||
<description>Unit test enhancement toolkit</description>
|
||||
@ -33,16 +33,16 @@
|
||||
<java.version>1.6</java.version>
|
||||
<project.compiler.level>1.6</project.compiler.level>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<plugin.compiler.version>3.8.1</plugin.compiler.version>
|
||||
<plugin.surefire.version>3.0.0-M5</plugin.surefire.version>
|
||||
<plugin.jar.version>3.2.0</plugin.jar.version>
|
||||
<plugin.shade.version>3.2.4</plugin.shade.version>
|
||||
<plugin.source.version>3.2.0</plugin.source.version>
|
||||
<plugin.javadoc.version>3.2.0</plugin.javadoc.version>
|
||||
<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.7.7</testable.version>
|
||||
<plugin.compiler.version>3.10.1</plugin.compiler.version>
|
||||
<plugin.surefire.version>3.0.0-M7</plugin.surefire.version>
|
||||
<plugin.jar.version>3.3.0</plugin.jar.version>
|
||||
<plugin.shade.version>3.4.1</plugin.shade.version>
|
||||
<plugin.source.version>3.2.1</plugin.source.version>
|
||||
<plugin.javadoc.version>3.4.1</plugin.javadoc.version>
|
||||
<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>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
@ -73,6 +73,9 @@
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<additionalOptions>-Xdoclint:none</additionalOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@ -87,6 +90,13 @@
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- Prevent `gpg` from using pinentry programs -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.alibaba.testable</groupId>
|
||||
<artifactId>testable-parent</artifactId>
|
||||
<version>0.7.7</version>
|
||||
<version>0.7.8</version>
|
||||
<relativePath>../testable-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>testable-processor</artifactId>
|
||||
@ -92,6 +92,9 @@
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<additionalOptions>-Xdoclint:none</additionalOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@ -106,6 +109,13 @@
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- Prevent `gpg` from using pinentry programs -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
Loading…
Reference in New Issue
Block a user