Skip to content

Commit

Permalink
Update: UnitTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
bostjans committed Jan 20, 2023
1 parent 92d8098 commit 331f329
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: d202301b
release_name: Release-2.0.5
tag_name: d202301c
release_name: Release-2.0.6

- name: Upload Release Asset
id: upload-release-asset
Expand All @@ -45,7 +45,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: target/jmsClient-2.0.5.jar
asset_path: target/jmsClient-2.0.6.jar
asset_name: jmsClient.jar
asset_content_type: application/java-archive

Expand Down
26 changes: 25 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- project coordinates .. -->
<groupId>com.stupica.base</groupId>
<artifactId>jmsClient</artifactId>
<version>2.0.5</version>
<version>2.0.6</version>
<packaging>jar</packaging>
<name>jmsClientBase</name>
<organization>
Expand Down Expand Up @@ -39,12 +39,23 @@
<version>[1,2)</version>
</dependency>

<!--
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>[4.13.2,5)</version>
<scope>test</scope>
</dependency>
-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<!--
<artifactId>junit-jupiter</artifactId>
-->
<artifactId>junit-jupiter-engine</artifactId>
<version>[5.9.2.,6)</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.activemq/artemis-jms-client -->
<dependency>
<groupId>org.apache.activemq</groupId>
Expand Down Expand Up @@ -85,6 +96,19 @@
</archive>
</configuration>
</plugin>
<!--
-->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>

<extensions>
Expand Down
17 changes: 11 additions & 6 deletions src/test/java/com/stupica/queue/TestClientConsumer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,33 @@

import com.stupica.ConstGlobal;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.DisplayName;

import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.TextMessage;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertNotNull;


@DisplayName("test21Consumer")
public class TestClientConsumer {

String qAddr = "tcp://mq01:61616";
public JmsClientBase objClient = null;


@Before
@BeforeEach
public void setUp() throws Exception {
objClient = new JmsClientBase();
}

@After
@AfterEach
public void tearDown() throws Exception {
// Local variables
int iResult;
Expand All @@ -37,6 +41,7 @@ public void tearDown() throws Exception {
}


@DisplayName("testConsumer01")
@Test
public void testConsumer01() throws Exception {
// Local variables
Expand Down
15 changes: 9 additions & 6 deletions src/test/java/com/stupica/queue/TestClientProducer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@

import com.stupica.ConstGlobal;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.DisplayName;

import javax.jms.MapMessage;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;


@DisplayName("test11Producer")
public class TestClientProducer {

String qAddr = "tcp://mq01:61616";
public JmsClientBase objClient = null;


@Before
@BeforeEach
public void setUp() throws Exception {
objClient = new JmsClientBase();
}

@After
@AfterEach
public void tearDown() throws Exception {
// Local variables
int iResult;
Expand All @@ -35,6 +37,7 @@ public void tearDown() throws Exception {
}


@DisplayName("testProducer11")
@Test
public void testProducer11() throws Exception {
// Local variables
Expand Down
2 changes: 2 additions & 0 deletions src/test/resources/junit-platform.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ClassOrderer$OrderAnnotation sorts classes based on their @Order annotation
junit.jupiter.testclass.order.default=org.junit.jupiter.api.ClassOrderer$DisplayName

0 comments on commit 331f329

Please sign in to comment.