Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package pf4j.plugin.test;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;

import org.apache.commons.io.IOUtils;
import org.junit.Test;

public class CommonsIoCompatibilityTest {

@Test
public void resolvesFixedCommonsIoAndCopiesPluginData() throws Exception {
assertEquals("2.14.0", IOUtils.class.getPackage().getImplementationVersion());

byte[] pluginData = "pf4j-plugin-data-插件".getBytes(StandardCharsets.UTF_8);
ByteArrayOutputStream output = new ByteArrayOutputStream();
assertEquals(pluginData.length, IOUtils.copy(new ByteArrayInputStream(pluginData), output));
assertArrayEquals(pluginData, output.toByteArray());
}
}
11 changes: 5 additions & 6 deletions spring-boot-sample-pf4j/pf4j-plugin-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.12</junit.version>
<commons-io.version>2.5</commons-io.version>
<commons-io.version>2.14.0</commons-io.version>
<commons-lang3.version>3.18.0</commons-lang3.version>
<fastjson.version>1.2.61</fastjson.version>
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
Expand Down Expand Up @@ -214,17 +214,16 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<!-- 跳过单元测试 -->
<skip>true</skip>
<skipTests>true</skipTests>
<skip>false</skip>
<skipTests>false</skipTests>
<!--
forkMode 可设置值有 “never”, “once”, “always” 和 “pertest”。
pretest: 每一个测试创建一个新进程,为每个测试创建新的JVM是单独测试的最彻底方式,但也是最慢的,不适合hudson上持续回归。
once:在一个进程中进行所有测试。once为默认设置,在Hudson上持续回归时建议使用默认设置。
always:在一个进程中并行的运行脚本,Junit4.7以上版本才可以使用,surefire的版本要在2.6以上提供这个功能,其中 threadCount:执行时,指定可分配的线程数量。只和参数parallel配合使用有效。默认:5。
-->
<forkMode>once</forkMode>
<argLine>-Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF-8</argLine>
<argLine>-Xmx1024m -Dfile.encoding=UTF-8</argLine>
<additionalClasspathElements>
<additionalClasspathElement>${basedir}/target/test-classes</additionalClasspathElement>
</additionalClasspathElements>
Expand Down Expand Up @@ -384,4 +383,4 @@
</plugins>
</build>

</project>
</project>
7 changes: 6 additions & 1 deletion spring-boot-sample-swagger2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@
<build>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
</plugin>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-maven-plugin -->
<plugin>
<!-- Spring Boot 插件:构建可执行 fat-jar -->
Expand Down Expand Up @@ -441,4 +446,4 @@
</profile>
</profiles>

</project>
</project>
Loading