Skip to content

Commit

Permalink
share awaitility and commons-io versions (Activiti#3077)
Browse files Browse the repository at this point in the history
  • Loading branch information
mteodori authored Jan 20, 2020
1 parent dc7468d commit 602716c
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 55 deletions.
12 changes: 0 additions & 12 deletions activiti-core-common/activiti-core-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,4 @@
<module>activiti-core-test-assertions</module>
<module>activiti-core-test-local-runtime</module>
</modules>
<properties>
<awaitility.version>4.0.1</awaitility.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public List<Resource> discoverApplications() {
try {
resources = Arrays.asList(resourceLoader.getResources(applicationsLocation + "**.zip"));
} catch (IOException e) {
throw new AppliationLoadException("Unable to load application resources", e);
throw new ApplicationLoadException("Unable to load application resources", e);
}
}
return resources;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@

package org.activiti.application;

public class AppliationLoadException extends RuntimeException {
public class ApplicationLoadException extends RuntimeException {

public AppliationLoadException(String message,
Throwable cause) {
super(message,
cause);
public ApplicationLoadException(String message, Throwable cause) {
super(message, cause);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public ApplicationContent read(InputStream inputStream) {
)))));
}
} catch (IOException e) {
throw new AppliationLoadException("Unable to read zip file",
throw new ApplicationLoadException("Unable to read zip file",
e);
}
return application;
Expand All @@ -60,7 +60,7 @@ private byte[] readBytes(ZipInputStream zipInputStream) {
try {
return IOUtils.toByteArray(zipInputStream);
} catch (IOException e) {
throw new AppliationLoadException("Unable to read zip file",
throw new ApplicationLoadException("Unable to read zip file",
e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public List<ApplicationContent> loadApplications() {
}
}
} catch (IOException e) {
throw new AppliationLoadException("Unable to load application resource", e);
throw new ApplicationLoadException("Unable to load application resource", e);
}
return applications;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void discoverApplicationsShouldThrowApplicationLoadExceptionWhenIOExcepti

//then
assertThat(thrown)
.isInstanceOf(AppliationLoadException.class)
.isInstanceOf(ApplicationLoadException.class)
.hasCause(ioException);
}

Expand All @@ -82,4 +82,4 @@ private void givenExistingResourceFolder() {
given(folderResource.exists()).willReturn(true);
given(resourceLoader.getResource(anyString())).willReturn(folderResource);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void shouldThrowApplicationLoadExceptionWhenIOExceptionOccurs() throws Ex
applicationService.loadApplications());

//then
assertThat(thrown).isInstanceOf(AppliationLoadException.class)
assertThat(thrown).isInstanceOf(ApplicationLoadException.class)
.hasCause(ioException);
}
}
}
12 changes: 0 additions & 12 deletions activiti-core-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@
<artifactId>activiti-core-common</artifactId>
<packaging>pom</packaging>
<name>Activiti :: Core :: Common :: Parent</name>
<properties>
<commons-io.version>2.6</commons-io.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.activiti.api</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
package org.activiti.engine.test.logging.mdc;

import java.io.StringWriter;
import java.io.ByteArrayOutputStream;

import ch.qos.logback.core.OutputStreamAppender;
import org.apache.commons.io.output.WriterOutputStream;

/**
* @author Saeid Mirzaei
*/
public class MemoryLogAppender<E> extends OutputStreamAppender<E> {

StringWriter stringWriter = new StringWriter();
ByteArrayOutputStream baos;

@Override
public void start() {
this.setOutputStream(new WriterOutputStream(stringWriter));
this.init();
super.start();
}

private void init() {
baos = new ByteArrayOutputStream();
this.setOutputStream(baos);
}

public String toString() {
return stringWriter.toString();
return new String(baos.toByteArray());
}

public void clear() {
stringWriter = new StringWriter();
this.init();
}

}
12 changes: 0 additions & 12 deletions activiti-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
<packaging>pom</packaging>
<name>Activiti :: Core :: Parent</name>
<properties>
<awaitility.version>3.1.6</awaitility.version>
<batik.version>1.10</batik.version>
<commons-email.version>1.5</commons-email.version>
<commons-fileupload.version>1.3.3</commons-fileupload.version>
<commons-io.version>2.6</commons-io.version>
<el-api.version>2.2</el-api.version>
<geronimo.version>1.1.1</geronimo.version>
<java-uuid-generator.version>3.1.4</java-uuid-generator.version>
Expand Down Expand Up @@ -54,11 +52,6 @@
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>${hibernate-jpa-2.1-api.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
Expand Down Expand Up @@ -120,11 +113,6 @@
<artifactId>jsr250-api</artifactId>
<version>${jsr250-api.version}</version>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
</dependency>
<!-- batik -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
Expand Down
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<spring-boot.version>2.1.12.RELEASE</spring-boot.version>
<versions-maven-plugin.version>2.7</versions-maven-plugin.version>
<commons-io.version>2.6</commons-io.version>
<awaitility.version>4.0.1</awaitility.version>

<!-- configuration properties for tests -->
<generated-assertions-folder>${project.build.directory}/generated-test-sources/assertions</generated-assertions-folder>
Expand All @@ -241,6 +243,16 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
Expand Down

0 comments on commit 602716c

Please sign in to comment.