Skip to content

Commit

Permalink
tests(bindings): IBM MQ 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Apr 27, 2024
1 parent e99fd01 commit 3d88804
Show file tree
Hide file tree
Showing 83 changed files with 975 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.asyncapi.bindings.anypointmq.AnypointMQChannelBinding;
import com.asyncapi.bindings.googlepubsub.GooglePubSubChannelBinding;
import com.asyncapi.bindings.http.HTTPChannelBinding;
import com.asyncapi.bindings.ibmmq.v0._1_0.channel.IBMMQChannelBinding;
import com.asyncapi.bindings.ibmmq.IBMMQChannelBinding;
import com.asyncapi.bindings.jms.v0._0_1.channel.JMSChannelBinding;
import com.asyncapi.bindings.kafka.v0._4_0.channel.KafkaChannelBinding;
import com.asyncapi.bindings.mercure.v0._1_0.channel.MercureChannelBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.asyncapi.bindings.anypointmq.AnypointMQMessageBinding;
import com.asyncapi.bindings.googlepubsub.GooglePubSubMessageBinding;
import com.asyncapi.bindings.http.HTTPMessageBinding;
import com.asyncapi.bindings.ibmmq.v0._1_0.message.IBMMQMessageBinding;
import com.asyncapi.bindings.ibmmq.IBMMQMessageBinding;
import com.asyncapi.bindings.jms.v0._0_1.message.JMSMessageBinding;
import com.asyncapi.bindings.kafka.v0._4_0.message.KafkaMessageBinding;
import com.asyncapi.bindings.mercure.v0._1_0.message.MercureMessageBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.asyncapi.bindings.anypointmq.AnypointMQOperationBinding;
import com.asyncapi.bindings.googlepubsub.GooglePubSubOperationBinding;
import com.asyncapi.bindings.http.HTTPOperationBinding;
import com.asyncapi.bindings.ibmmq.v0._1_0.operation.IBMMQOperationBinding;
import com.asyncapi.bindings.ibmmq.IBMMQOperationBinding;
import com.asyncapi.bindings.jms.v0._0_1.operation.JMSOperationBinding;
import com.asyncapi.bindings.kafka.v0._4_0.operation.KafkaOperationBinding;
import com.asyncapi.bindings.mercure.v0._1_0.operation.MercureOperationBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.asyncapi.bindings.anypointmq.AnypointMQServerBinding;
import com.asyncapi.bindings.googlepubsub.GooglePubSubServerBinding;
import com.asyncapi.bindings.http.HTTPServerBinding;
import com.asyncapi.bindings.ibmmq.v0._1_0.server.IBMMQServerBinding;
import com.asyncapi.bindings.ibmmq.IBMMQServerBinding;
import com.asyncapi.bindings.jms.v0._0_1.server.JMSServerBinding;
import com.asyncapi.bindings.kafka.v0._4_0.server.KafkaServerBinding;
import com.asyncapi.bindings.mercure.v0._1_0.server.MercureServerBinding;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.asyncapi.bindings.ibmmq;

import com.asyncapi.bindings.ChannelBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;

/**
* Describes IBM MQ channel binding.
* <p>
* This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/ibmmq#channel-binding-object">IBM MQ channel binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.ibmmq.v0._1_0.channel.IBMMQChannelBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.ibmmq.v0._1_0.channel.IBMMQChannelBinding.class, names = {
"0.1.0",
"latest"
}),
})
@EqualsAndHashCode(callSuper = true)
public class IBMMQChannelBinding extends ChannelBinding {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.asyncapi.bindings.ibmmq;

import com.asyncapi.bindings.MessageBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;

/**
* Describes IBM MQ message binding.
* <p>
* This object contains information about the message representation in IBM MQ.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/ibmmq#message-binding-object">IBM MQ message binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.ibmmq.v0._1_0.message.IBMMQMessageBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.ibmmq.v0._1_0.message.IBMMQMessageBinding.class, names = {
"0.1.0",
"latest"
}),
})
@EqualsAndHashCode(callSuper = true)
public class IBMMQMessageBinding extends MessageBinding {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.asyncapi.bindings.ibmmq;

import com.asyncapi.bindings.OperationBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;

/**
* Describes IBM MQ operation binding.
* <p>
* This object MUST NOT contain any properties. Its name is reserved for future use.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/ibmmq#operation-binding-object">IBM MQ operation binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.ibmmq.v0._1_0.operation.IBMMQOperationBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.ibmmq.v0._1_0.operation.IBMMQOperationBinding.class, names = {
"0.1.0",
"latest"
}),
})
@EqualsAndHashCode(callSuper = true)
public class IBMMQOperationBinding extends OperationBinding {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.asyncapi.bindings.ibmmq;

import com.asyncapi.bindings.ServerBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;

/**
* Describes IBM MQ server binding.
* <p>
* This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager.
* This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/ibmmq#server-binding-object">IBM MQ server binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.ibmmq.v0._1_0.server.IBMMQServerBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.ibmmq.v0._1_0.server.IBMMQServerBinding.class, names = {
"0.1.0",
"latest"
}),
})
@EqualsAndHashCode(callSuper = true)
public class IBMMQServerBinding extends ServerBinding {}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@JsonClassDescription("Describes IBM MQ channel binding.")
public class IBMMQChannelBinding extends ChannelBinding {
public class IBMMQChannelBinding extends com.asyncapi.bindings.ibmmq.IBMMQChannelBinding {

/**
* Defines the type of AsyncAPI channel.
Expand Down Expand Up @@ -77,12 +77,14 @@ public class IBMMQChannelBinding extends ChannelBinding {
@JsonPropertyDescription("The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center.")
private Integer maxMsgLength;

/**
* The version of this binding.
*/
@Builder.Default
@JsonProperty("bindingVersion")
@JsonPropertyDescription("The version of this binding.")
private String bindingVersion = "0.1.0";
@Override
public String getBindingVersion() {
return "0.1.0";
}

@Override
public void setBindingVersion(@Nullable String bindingVersion) {
super.setBindingVersion("0.1.0");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@JsonClassDescription("Describes IBM MQ message binding.")
public class IBMMQMessageBinding extends MessageBinding {
public class IBMMQMessageBinding extends com.asyncapi.bindings.ibmmq.IBMMQMessageBinding {

/**
* The type of the message.
Expand Down Expand Up @@ -77,13 +77,14 @@ public class IBMMQMessageBinding extends MessageBinding {
@JsonPropertyDescription("The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center.")
private Integer expiry = 0;

/**
* The version of this binding.
*/
@Nullable
@Builder.Default
@JsonProperty("bindingVersion")
@JsonPropertyDescription("The version of this binding.")
private String bindingVersion = "0.1.0";
@Override
public String getBindingVersion() {
return "0.1.0";
}

@Override
public void setBindingVersion(@Nullable String bindingVersion) {
super.setBindingVersion("0.1.0");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.Nullable;

/**
* Describes IBM MQ operation binding.
Expand All @@ -19,5 +20,16 @@
@Builder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class IBMMQOperationBinding extends OperationBinding {
public class IBMMQOperationBinding extends com.asyncapi.bindings.ibmmq.IBMMQOperationBinding {

@Override
public String getBindingVersion() {
return "0.1.0";
}

@Override
public void setBindingVersion(@Nullable String bindingVersion) {
super.setBindingVersion("0.1.0");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@JsonClassDescription("Describes IBM MQ server binding.")
public class IBMMQServerBinding extends ServerBinding {
public class IBMMQServerBinding extends com.asyncapi.bindings.ibmmq.IBMMQServerBinding {

/**
* Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used
Expand Down Expand Up @@ -91,12 +91,14 @@ public class IBMMQServerBinding extends ServerBinding {
@JsonPropertyDescription("The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager.")
private int heartBeatInterval = 300;

/**
* The version of this binding.
*/
@Builder.Default
@JsonProperty("bindingVersion")
@JsonPropertyDescription("The version of this binding.")
private String bindingVersion = "0.1.0";
@Override
public String getBindingVersion() {
return "0.1.0";
}

@Override
public void setBindingVersion(@Nullable String bindingVersion) {
super.setBindingVersion("0.1.0");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.asyncapi.bindings.ibmmq;

import org.junit.platform.suite.api.SelectPackages;
import org.junit.platform.suite.api.Suite;
import org.junit.platform.suite.api.SuiteDisplayName;

@Suite
@SuiteDisplayName("IBM MQ")
@SelectPackages("com.asyncapi.bindings.ibmmq")
public class IBMMQ {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.asyncapi.bindings.ibmmq;

import com.asyncapi.bindings.BindingTest;
import com.asyncapi.bindings.ibmmq.v0._1_0.channel.IBMMQChannelBinding;
import com.asyncapi.bindings.ibmmq.v0._1_0.message.IBMMQMessageBinding;
import com.asyncapi.bindings.ibmmq.v0._1_0.operation.IBMMQOperationBinding;
import com.asyncapi.bindings.ibmmq.v0._1_0.server.IBMMQServerBinding;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;

@DisplayName("latest")
public class IBMMQLatestTest {

@Nested
@DisplayName("channel")
class ChannelTest extends BindingTest<IBMMQChannelBinding> {{
super.binding = IBMMQV0_1_0Test.channelBinding();
super.bindingTypeClass = IBMMQChannelBinding.class;
super.pathToBindingJson = "/bindings/ibmmq/latest/channel/binding.json";
super.pathToExtendedBindingJson = "/bindings/ibmmq/latest/channel/binding - extended.json";
super.pathToWronglyExtendedBindingJson = "/bindings/ibmmq/latest/channel/binding - wrongly extended.json";
}}

@Nested
@DisplayName("message")
class Message extends BindingTest<IBMMQMessageBinding> {{
super.binding = IBMMQV0_1_0Test.messageBinding();
super.bindingTypeClass = IBMMQMessageBinding.class;
super.pathToBindingJson = "/bindings/ibmmq/latest/message/binding.json";
super.pathToExtendedBindingJson = "/bindings/ibmmq/latest/message/binding - extended.json";
super.pathToWronglyExtendedBindingJson = "/bindings/ibmmq/latest/message/binding - wrongly extended.json";
}}

@Nested
@DisplayName("operation")
class Operation extends BindingTest<IBMMQOperationBinding> {{
super.binding = IBMMQV0_1_0Test.operationBinding();
super.bindingTypeClass = IBMMQOperationBinding.class;
super.pathToBindingJson = "/bindings/ibmmq/latest/operation/binding.json";
super.pathToExtendedBindingJson = "/bindings/ibmmq/latest/operation/binding - extended.json";
super.pathToWronglyExtendedBindingJson = "/bindings/ibmmq/latest/operation/binding - wrongly extended.json";
}}

@Nested
@DisplayName("server")
class Server extends BindingTest<IBMMQServerBinding> {{
super.binding = IBMMQV0_1_0Test.serverBinding();
super.bindingTypeClass = IBMMQServerBinding.class;
super.pathToBindingJson = "/bindings/ibmmq/latest/server/binding.json";
super.pathToExtendedBindingJson = "/bindings/ibmmq/latest/server/binding - extended.json";
super.pathToWronglyExtendedBindingJson = "/bindings/ibmmq/latest/server/binding - wrongly extended.json";
}}

}
Loading

0 comments on commit 3d88804

Please sign in to comment.