use of org.jboss.as.model.test.FailedOperationTransformationConfig in project wildfly by wildfly.
the class MessagingActiveMQSubsystem_5_0_TestCase method testRejectingTransformers.
private void testRejectingTransformers(ModelTestControllerVersion controllerVersion, ModelVersion messagingVersion) throws Exception {
// Boot up empty controllers with the resources needed for the ops coming from the xml to work
KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());
builder.createLegacyKernelServicesBuilder(createAdditionalInitialization(), controllerVersion, messagingVersion).addMavenResourceURL(getMessagingActiveMQGAV(controllerVersion)).addMavenResourceURL(getActiveMQDependencies(controllerVersion)).addMavenResourceURL(getJGroupsDependencies(controllerVersion)).skipReverseControllerCheck().dontPersistXml();
KernelServices mainServices = builder.build();
assertTrue(mainServices.isSuccessfulBoot());
assertTrue(mainServices.getLegacyServices(messagingVersion).isSuccessfulBoot());
List<ModelNode> ops = builder.parseXmlResource("subsystem_5_0_reject_transform.xml");
System.out.println("ops = " + ops);
PathAddress subsystemAddress = PathAddress.pathAddress(SUBSYSTEM_PATH);
FailedOperationTransformationConfig config = new FailedOperationTransformationConfig();
if (messagingVersion.equals(MessagingExtension.VERSION_1_0_0)) {
config.addFailedAttribute(subsystemAddress, new FailedOperationTransformationConfig.NewAttributesConfig(MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE, MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.ELYTRON_DOMAIN, ServerDefinition.JOURNAL_DATASOURCE, ServerDefinition.JOURNAL_MESSAGES_TABLE, ServerDefinition.JOURNAL_BINDINGS_TABLE, ServerDefinition.JOURNAL_JMS_BINDINGS_TABLE, ServerDefinition.JOURNAL_LARGE_MESSAGES_TABLE, ServerDefinition.JOURNAL_PAGE_STORE_TABLE, ServerDefinition.JOURNAL_DATABASE, ServerDefinition.JOURNAL_JDBC_NETWORK_TIMEOUT, ServerDefinition.JOURNAL_JDBC_LOCK_EXPIRATION, ServerDefinition.JOURNAL_JDBC_LOCK_RENEW_PERIOD, ServerDefinition.JOURNAL_NODE_MANAGER_STORE_TABLE, ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_MASTER_PATH), new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())).addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_COLOCATED_PATH, MessagingExtension.CONFIGURATION_MASTER_PATH), new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())).addFailedAttribute(subsystemAddress.append(SERVER_PATH, ADDRESS_SETTING_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(AddressSettingDefinition.AUTO_CREATE_QUEUES, AddressSettingDefinition.AUTO_DELETE_QUEUES, AddressSettingDefinition.AUTO_CREATE_ADDRESSES, AddressSettingDefinition.AUTO_DELETE_ADDRESSES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, pathElement(CommonAttributes.HTTP_CONNECTOR)), new FailedOperationTransformationConfig.NewAttributesConfig(HTTPConnectorDefinition.SERVER_NAME)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, BRIDGE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BridgeDefinition.PRODUCER_WINDOW_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CLUSTER_CONNECTION_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ClusterConnectionDefinition.PRODUCER_WINDOW_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Pooled.ALLOW_LOCAL_TRANSACTIONS, ConnectionFactoryAttributes.Pooled.REBALANCE_CONNECTIONS, ConnectionFactoryAttributes.Pooled.STATISTICS_ENABLED, ConnectionFactoryAttributes.Pooled.CREDENTIAL_REFERENCE, ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST));
} else if (messagingVersion.equals(MessagingExtension.VERSION_2_0_0)) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, ADDRESS_SETTING_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(AddressSettingDefinition.AUTO_CREATE_QUEUES, AddressSettingDefinition.AUTO_DELETE_QUEUES, AddressSettingDefinition.AUTO_CREATE_ADDRESSES, AddressSettingDefinition.AUTO_DELETE_ADDRESSES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.JOURNAL_JDBC_LOCK_EXPIRATION, ServerDefinition.JOURNAL_JDBC_LOCK_RENEW_PERIOD, ServerDefinition.JOURNAL_NODE_MANAGER_STORE_TABLE, ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE));
} else {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE));
}
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.BROADCAST_GROUP_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BroadcastGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, DiscoveryGroupDefinition.PATH), new FailedOperationTransformationConfig.NewAttributesConfig(DiscoveryGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(DiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.REMOTE_CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.IN_VM_CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(MessagingExtension.HTTP_CONNECTOR_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(POOLED_CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_QUEUE_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_TOPIC_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
ModelTestUtils.checkFailedTransformedBootOperations(mainServices, messagingVersion, ops, config);
mainServices.shutdown();
}
use of org.jboss.as.model.test.FailedOperationTransformationConfig in project wildfly by wildfly.
the class MessagingActiveMQSubsystem_7_0_TestCase method testRejectingTransformers.
private void testRejectingTransformers(ModelTestControllerVersion controllerVersion, ModelVersion messagingVersion) throws Exception {
// Boot up empty controllers with the resources needed for the ops coming from the xml to work
KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());
builder.createLegacyKernelServicesBuilder(createAdditionalInitialization(), controllerVersion, messagingVersion).addMavenResourceURL(getMessagingActiveMQGAV(controllerVersion)).addMavenResourceURL(getActiveMQDependencies(controllerVersion)).addMavenResourceURL(getJGroupsDependencies(controllerVersion)).skipReverseControllerCheck().dontPersistXml();
KernelServices mainServices = builder.build();
assertTrue(mainServices.isSuccessfulBoot());
assertTrue(mainServices.getLegacyServices(messagingVersion).isSuccessfulBoot());
List<ModelNode> ops = builder.parseXmlResource("subsystem_7_0_reject_transform.xml");
System.out.println("ops = " + ops);
PathAddress subsystemAddress = PathAddress.pathAddress(SUBSYSTEM_PATH);
FailedOperationTransformationConfig config = new FailedOperationTransformationConfig();
if (messagingVersion.equals(MessagingExtension.VERSION_1_0_0)) {
config.addFailedAttribute(subsystemAddress, new FailedOperationTransformationConfig.NewAttributesConfig(MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE, MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.ELYTRON_DOMAIN, ServerDefinition.JOURNAL_DATASOURCE, ServerDefinition.JOURNAL_MESSAGES_TABLE, ServerDefinition.JOURNAL_BINDINGS_TABLE, ServerDefinition.JOURNAL_JMS_BINDINGS_TABLE, ServerDefinition.JOURNAL_LARGE_MESSAGES_TABLE, ServerDefinition.JOURNAL_PAGE_STORE_TABLE, ServerDefinition.JOURNAL_DATABASE, ServerDefinition.JOURNAL_JDBC_NETWORK_TIMEOUT, ServerDefinition.JOURNAL_JDBC_LOCK_EXPIRATION, ServerDefinition.JOURNAL_JDBC_LOCK_RENEW_PERIOD, ServerDefinition.JOURNAL_NODE_MANAGER_STORE_TABLE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_MASTER_PATH), new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())).addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_COLOCATED_PATH, MessagingExtension.CONFIGURATION_MASTER_PATH), new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())).addFailedAttribute(subsystemAddress.append(SERVER_PATH, ADDRESS_SETTING_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(AddressSettingDefinition.AUTO_CREATE_QUEUES, AddressSettingDefinition.AUTO_DELETE_QUEUES, AddressSettingDefinition.AUTO_CREATE_ADDRESSES, AddressSettingDefinition.AUTO_DELETE_ADDRESSES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, pathElement(CommonAttributes.HTTP_CONNECTOR)), new FailedOperationTransformationConfig.NewAttributesConfig(HTTPConnectorDefinition.SERVER_NAME)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, BRIDGE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BridgeDefinition.PRODUCER_WINDOW_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CLUSTER_CONNECTION_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ClusterConnectionDefinition.PRODUCER_WINDOW_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE, ConnectionFactoryAttributes.Common.USE_TOPOLOGY)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Pooled.ALLOW_LOCAL_TRANSACTIONS, ConnectionFactoryAttributes.Pooled.REBALANCE_CONNECTIONS, ConnectionFactoryAttributes.Pooled.STATISTICS_ENABLED, ConnectionFactoryAttributes.Pooled.CREDENTIAL_REFERENCE, ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
} else if (messagingVersion.equals(MessagingExtension.VERSION_2_0_0)) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, ADDRESS_SETTING_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(AddressSettingDefinition.AUTO_CREATE_QUEUES, AddressSettingDefinition.AUTO_DELETE_QUEUES, AddressSettingDefinition.AUTO_CREATE_ADDRESSES, AddressSettingDefinition.AUTO_DELETE_ADDRESSES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.JOURNAL_JDBC_LOCK_EXPIRATION, ServerDefinition.JOURNAL_JDBC_LOCK_RENEW_PERIOD, ServerDefinition.JOURNAL_NODE_MANAGER_STORE_TABLE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_5_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_6_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
}
if (messagingVersion.compareTo(MessagingExtension.VERSION_4_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.BROADCAST_GROUP_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BroadcastGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, DiscoveryGroupDefinition.PATH), new FailedOperationTransformationConfig.NewAttributesConfig(DiscoveryGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.QUEUE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(QueueDefinition.ROUTING_TYPE));
config.addFailedAttribute(subsystemAddress.append(DiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.REMOTE_CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.IN_VM_CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(MessagingExtension.HTTP_CONNECTOR_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(POOLED_CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_QUEUE_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_TOPIC_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_6_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.QUEUE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(QueueDefinition.ROUTING_TYPE));
config.addFailedAttribute(subsystemAddress.append(POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
}
ModelTestUtils.checkFailedTransformedBootOperations(mainServices, messagingVersion, ops, config);
mainServices.shutdown();
}
use of org.jboss.as.model.test.FailedOperationTransformationConfig in project wildfly by wildfly.
the class MessagingActiveMQSubsystem_10_0_TestCase method testRejectingTransformers.
private void testRejectingTransformers(ModelTestControllerVersion controllerVersion, ModelVersion messagingVersion) throws Exception {
// Boot up empty controllers with the resources needed for the ops coming from the xml to work
KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());
builder.createLegacyKernelServicesBuilder(createAdditionalInitialization(), controllerVersion, messagingVersion).addMavenResourceURL(getMessagingActiveMQGAV(controllerVersion)).addMavenResourceURL(getActiveMQDependencies(controllerVersion)).addMavenResourceURL(getJGroupsDependencies(controllerVersion)).skipReverseControllerCheck().dontPersistXml();
KernelServices mainServices = builder.build();
assertTrue(mainServices.isSuccessfulBoot());
assertTrue(mainServices.getLegacyServices(messagingVersion).isSuccessfulBoot());
List<ModelNode> ops = builder.parseXmlResource("subsystem_10_0_reject_transform.xml");
System.out.println("ops = " + ops);
PathAddress subsystemAddress = PathAddress.pathAddress(SUBSYSTEM_PATH);
FailedOperationTransformationConfig config = new FailedOperationTransformationConfig();
if (messagingVersion.compareTo(MessagingExtension.VERSION_10_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server1")), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server2")).append(BRIDGE_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server3")).append(POOLED_CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(JMS_BRIDGE, "bridge-with-credential-reference")), FailedOperationTransformationConfig.REJECTED_RESOURCE);
}
if (messagingVersion.compareTo(MessagingExtension.VERSION_9_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server1")), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server2")).append(BRIDGE_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server3")).append(POOLED_CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(JMS_BRIDGE, "bridge-with-credential-reference")), FailedOperationTransformationConfig.REJECTED_RESOURCE);
}
if (messagingVersion.equals(MessagingExtension.VERSION_1_0_0)) {
config.addFailedAttribute(subsystemAddress, new FailedOperationTransformationConfig.NewAttributesConfig(MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE, MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.ELYTRON_DOMAIN, ServerDefinition.JOURNAL_DATASOURCE, ServerDefinition.JOURNAL_MESSAGES_TABLE, ServerDefinition.JOURNAL_BINDINGS_TABLE, ServerDefinition.JOURNAL_JMS_BINDINGS_TABLE, ServerDefinition.JOURNAL_LARGE_MESSAGES_TABLE, ServerDefinition.JOURNAL_PAGE_STORE_TABLE, ServerDefinition.JOURNAL_DATABASE, ServerDefinition.JOURNAL_JDBC_NETWORK_TIMEOUT, ServerDefinition.JOURNAL_JDBC_LOCK_EXPIRATION, ServerDefinition.JOURNAL_JDBC_LOCK_RENEW_PERIOD, ServerDefinition.JOURNAL_NODE_MANAGER_STORE_TABLE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_MASTER_PATH), new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())).addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_COLOCATED_PATH, MessagingExtension.CONFIGURATION_MASTER_PATH), new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())).addFailedAttribute(subsystemAddress.append(SERVER_PATH, ADDRESS_SETTING_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(AddressSettingDefinition.AUTO_CREATE_QUEUES, AddressSettingDefinition.AUTO_DELETE_QUEUES, AddressSettingDefinition.AUTO_CREATE_ADDRESSES, AddressSettingDefinition.AUTO_DELETE_ADDRESSES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, pathElement(CommonAttributes.HTTP_CONNECTOR)), new FailedOperationTransformationConfig.NewAttributesConfig(HTTPConnectorDefinition.SERVER_NAME)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, BRIDGE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BridgeDefinition.PRODUCER_WINDOW_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CLUSTER_CONNECTION_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ClusterConnectionDefinition.PRODUCER_WINDOW_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE, ConnectionFactoryAttributes.Common.USE_TOPOLOGY)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Pooled.ALLOW_LOCAL_TRANSACTIONS, ConnectionFactoryAttributes.Pooled.REBALANCE_CONNECTIONS, ConnectionFactoryAttributes.Pooled.STATISTICS_ENABLED, ConnectionFactoryAttributes.Pooled.CREDENTIAL_REFERENCE, ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
} else if (messagingVersion.equals(MessagingExtension.VERSION_2_0_0)) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, ADDRESS_SETTING_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(AddressSettingDefinition.AUTO_CREATE_QUEUES, AddressSettingDefinition.AUTO_DELETE_QUEUES, AddressSettingDefinition.AUTO_CREATE_ADDRESSES, AddressSettingDefinition.AUTO_DELETE_ADDRESSES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.JOURNAL_JDBC_LOCK_EXPIRATION, ServerDefinition.JOURNAL_JDBC_LOCK_RENEW_PERIOD, ServerDefinition.JOURNAL_NODE_MANAGER_STORE_TABLE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_5_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_6_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.JGROUPS_BROADCAST_GROUP_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.SOCKET_BROADCAST_GROUP_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, JGroupsDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, SocketDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
}
if (messagingVersion.compareTo(MessagingExtension.VERSION_4_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.BROADCAST_GROUP_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BroadcastGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.JGROUPS_BROADCAST_GROUP_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BroadcastGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.SOCKET_BROADCAST_GROUP_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, DiscoveryGroupDefinition.PATH), new FailedOperationTransformationConfig.NewAttributesConfig(DiscoveryGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, JGroupsDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, SocketDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.QUEUE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(QueueDefinition.ROUTING_TYPE));
config.addFailedAttribute(subsystemAddress.append(DiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.REMOTE_CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.IN_VM_CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(MessagingExtension.HTTP_CONNECTOR_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(POOLED_CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_QUEUE_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_TOPIC_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(JGroupsDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SocketDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_6_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.QUEUE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(QueueDefinition.ROUTING_TYPE));
config.addFailedAttribute(subsystemAddress.append(POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
}
ModelTestUtils.checkFailedTransformedBootOperations(mainServices, messagingVersion, ops, config);
mainServices.shutdown();
}
use of org.jboss.as.model.test.FailedOperationTransformationConfig in project wildfly by wildfly.
the class MessagingActiveMQSubsystem_12_0_TestCase method testRejectingTransformers.
private void testRejectingTransformers(ModelTestControllerVersion controllerVersion, ModelVersion messagingVersion) throws Exception {
// Boot up empty controllers with the resources needed for the ops coming from the xml to work
KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());
builder.createLegacyKernelServicesBuilder(createAdditionalInitialization(), controllerVersion, messagingVersion).addMavenResourceURL(getMessagingActiveMQGAV(controllerVersion)).addMavenResourceURL(getActiveMQDependencies(controllerVersion)).addMavenResourceURL(getJGroupsDependencies(controllerVersion)).skipReverseControllerCheck().dontPersistXml();
KernelServices mainServices = builder.build();
assertTrue(mainServices.isSuccessfulBoot());
assertTrue(mainServices.getLegacyServices(messagingVersion).isSuccessfulBoot());
List<ModelNode> ops = builder.parseXmlResource("subsystem_12_0_reject_transform.xml");
// System.out.println("ops = " + ops);
PathAddress subsystemAddress = PathAddress.pathAddress(SUBSYSTEM_PATH);
FailedOperationTransformationConfig config = new FailedOperationTransformationConfig();
if (messagingVersion.compareTo(MessagingExtension.VERSION_9_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server1")), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server2")).append(BRIDGE_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server3")).append(POOLED_CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(JMS_BRIDGE, "bridge-with-credential-reference")), FailedOperationTransformationConfig.REJECTED_RESOURCE);
}
if (messagingVersion.equals(MessagingExtension.VERSION_1_0_0)) {
config.addFailedAttribute(subsystemAddress, new FailedOperationTransformationConfig.NewAttributesConfig(MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE, MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.ELYTRON_DOMAIN, ServerDefinition.JOURNAL_DATASOURCE, ServerDefinition.JOURNAL_MESSAGES_TABLE, ServerDefinition.JOURNAL_BINDINGS_TABLE, ServerDefinition.JOURNAL_JMS_BINDINGS_TABLE, ServerDefinition.JOURNAL_LARGE_MESSAGES_TABLE, ServerDefinition.JOURNAL_PAGE_STORE_TABLE, ServerDefinition.JOURNAL_DATABASE, ServerDefinition.JOURNAL_JDBC_NETWORK_TIMEOUT, ServerDefinition.JOURNAL_JDBC_LOCK_EXPIRATION, ServerDefinition.JOURNAL_JDBC_LOCK_RENEW_PERIOD, ServerDefinition.JOURNAL_NODE_MANAGER_STORE_TABLE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE, ServerDefinition.NETWORK_CHECK_LIST, ServerDefinition.NETWORK_CHECK_NIC, ServerDefinition.NETWORK_CHECK_PERIOD, ServerDefinition.NETWORK_CHECK_PING6_COMMAND, ServerDefinition.NETWORK_CHECK_PING_COMMAND, ServerDefinition.NETWORK_CHECK_TIMEOUT, ServerDefinition.NETWORK_CHECK_URL_LIST)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_MASTER_PATH), new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())).addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_COLOCATED_PATH, MessagingExtension.CONFIGURATION_MASTER_PATH), new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())).addFailedAttribute(subsystemAddress.append(SERVER_PATH, ADDRESS_SETTING_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(AddressSettingDefinition.AUTO_CREATE_QUEUES, AddressSettingDefinition.AUTO_DELETE_QUEUES, AddressSettingDefinition.AUTO_CREATE_ADDRESSES, AddressSettingDefinition.AUTO_DELETE_ADDRESSES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, pathElement(CommonAttributes.HTTP_CONNECTOR)), new FailedOperationTransformationConfig.NewAttributesConfig(HTTPConnectorDefinition.SERVER_NAME)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, BRIDGE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BridgeDefinition.PRODUCER_WINDOW_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CLUSTER_CONNECTION_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ClusterConnectionDefinition.PRODUCER_WINDOW_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE, ConnectionFactoryAttributes.Common.USE_TOPOLOGY)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Pooled.ALLOW_LOCAL_TRANSACTIONS, ConnectionFactoryAttributes.Pooled.REBALANCE_CONNECTIONS, ConnectionFactoryAttributes.Pooled.STATISTICS_ENABLED, ConnectionFactoryAttributes.Pooled.CREDENTIAL_REFERENCE, ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
} else if (messagingVersion.equals(MessagingExtension.VERSION_2_0_0)) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, ADDRESS_SETTING_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(AddressSettingDefinition.AUTO_CREATE_QUEUES, AddressSettingDefinition.AUTO_DELETE_QUEUES, AddressSettingDefinition.AUTO_CREATE_ADDRESSES, AddressSettingDefinition.AUTO_DELETE_ADDRESSES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.JOURNAL_JDBC_LOCK_EXPIRATION, ServerDefinition.JOURNAL_JDBC_LOCK_RENEW_PERIOD, ServerDefinition.JOURNAL_NODE_MANAGER_STORE_TABLE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.NETWORK_CHECK_LIST, ServerDefinition.NETWORK_CHECK_NIC, ServerDefinition.NETWORK_CHECK_PERIOD, ServerDefinition.NETWORK_CHECK_PING6_COMMAND, ServerDefinition.NETWORK_CHECK_PING_COMMAND, ServerDefinition.NETWORK_CHECK_TIMEOUT, ServerDefinition.NETWORK_CHECK_URL_LIST)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_5_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.NETWORK_CHECK_LIST, ServerDefinition.NETWORK_CHECK_NIC, ServerDefinition.NETWORK_CHECK_PERIOD, ServerDefinition.NETWORK_CHECK_PING6_COMMAND, ServerDefinition.NETWORK_CHECK_PING_COMMAND, ServerDefinition.NETWORK_CHECK_TIMEOUT, ServerDefinition.NETWORK_CHECK_URL_LIST));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_6_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.NETWORK_CHECK_LIST, ServerDefinition.NETWORK_CHECK_NIC, ServerDefinition.NETWORK_CHECK_PERIOD, ServerDefinition.NETWORK_CHECK_PING6_COMMAND, ServerDefinition.NETWORK_CHECK_PING_COMMAND, ServerDefinition.NETWORK_CHECK_TIMEOUT, ServerDefinition.NETWORK_CHECK_URL_LIST));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.JGROUPS_BROADCAST_GROUP_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.SOCKET_BROADCAST_GROUP_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, JGroupsDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, SocketDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
}
if (messagingVersion.compareTo(MessagingExtension.VERSION_4_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.BROADCAST_GROUP_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BroadcastGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.JGROUPS_BROADCAST_GROUP_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BroadcastGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.SOCKET_BROADCAST_GROUP_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, DiscoveryGroupDefinition.PATH), new FailedOperationTransformationConfig.NewAttributesConfig(DiscoveryGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, JGroupsDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, SocketDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.QUEUE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(QueueDefinition.ROUTING_TYPE));
config.addFailedAttribute(subsystemAddress.append(DiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.REMOTE_CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.IN_VM_CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(MessagingExtension.HTTP_CONNECTOR_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(POOLED_CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_QUEUE_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_TOPIC_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(JGroupsDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SocketDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_6_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.QUEUE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(QueueDefinition.ROUTING_TYPE));
config.addFailedAttribute(subsystemAddress.append(POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX, ConnectionFactoryAttributes.Common.USE_TOPOLOGY, ConnectionFactoryAttributes.Common.CLIENT_FAILURE_CHECK_PERIOD, ConnectionFactoryAttributes.Common.CONNECTION_TTL, CommonAttributes.CALL_TIMEOUT, CommonAttributes.CALL_FAILOVER_TIMEOUT, ConnectionFactoryAttributes.Common.CONSUMER_WINDOW_SIZE, ConnectionFactoryAttributes.Common.CONSUMER_MAX_RATE, ConnectionFactoryAttributes.Common.CONFIRMATION_WINDOW_SIZE, ConnectionFactoryAttributes.Common.PRODUCER_WINDOW_SIZE, ConnectionFactoryAttributes.Common.PRODUCER_MAX_RATE, ConnectionFactoryAttributes.Common.PROTOCOL_MANAGER_FACTORY, ConnectionFactoryAttributes.Common.COMPRESS_LARGE_MESSAGES, ConnectionFactoryAttributes.Common.CACHE_LARGE_MESSAGE_CLIENT, CommonAttributes.MIN_LARGE_MESSAGE_SIZE, CommonAttributes.CLIENT_ID, ConnectionFactoryAttributes.Common.DUPS_OK_BATCH_SIZE, ConnectionFactoryAttributes.Common.TRANSACTION_BATCH_SIZE, ConnectionFactoryAttributes.Common.BLOCK_ON_ACKNOWLEDGE, ConnectionFactoryAttributes.Common.BLOCK_ON_NON_DURABLE_SEND, ConnectionFactoryAttributes.Common.BLOCK_ON_DURABLE_SEND, ConnectionFactoryAttributes.Common.AUTO_GROUP, ConnectionFactoryAttributes.Common.PRE_ACKNOWLEDGE, ConnectionFactoryAttributes.Common.RETRY_INTERVAL, ConnectionFactoryAttributes.Common.RETRY_INTERVAL_MULTIPLIER, CommonAttributes.MAX_RETRY_INTERVAL, ConnectionFactoryAttributes.Common.RECONNECT_ATTEMPTS, ConnectionFactoryAttributes.Common.FAILOVER_ON_INITIAL_CONNECTION, ConnectionFactoryAttributes.Common.CONNECTION_LOAD_BALANCING_CLASS_NAME, ConnectionFactoryAttributes.Common.USE_GLOBAL_POOLS, ConnectionFactoryAttributes.Common.SCHEDULED_THREAD_POOL_MAX_SIZE, ConnectionFactoryAttributes.Common.THREAD_POOL_MAX_SIZE, ConnectionFactoryAttributes.Common.GROUP_ID, ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE));
} else {
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.CLIENT_FAILURE_CHECK_PERIOD, ConnectionFactoryAttributes.Common.CONNECTION_TTL, CommonAttributes.CALL_TIMEOUT, CommonAttributes.CALL_FAILOVER_TIMEOUT, ConnectionFactoryAttributes.Common.CONSUMER_WINDOW_SIZE, ConnectionFactoryAttributes.Common.CONSUMER_MAX_RATE, ConnectionFactoryAttributes.Common.CONFIRMATION_WINDOW_SIZE, ConnectionFactoryAttributes.Common.PRODUCER_WINDOW_SIZE, ConnectionFactoryAttributes.Common.PRODUCER_MAX_RATE, ConnectionFactoryAttributes.Common.PROTOCOL_MANAGER_FACTORY, ConnectionFactoryAttributes.Common.COMPRESS_LARGE_MESSAGES, ConnectionFactoryAttributes.Common.CACHE_LARGE_MESSAGE_CLIENT, CommonAttributes.MIN_LARGE_MESSAGE_SIZE, CommonAttributes.CLIENT_ID, ConnectionFactoryAttributes.Common.DUPS_OK_BATCH_SIZE, ConnectionFactoryAttributes.Common.TRANSACTION_BATCH_SIZE, ConnectionFactoryAttributes.Common.BLOCK_ON_ACKNOWLEDGE, ConnectionFactoryAttributes.Common.BLOCK_ON_NON_DURABLE_SEND, ConnectionFactoryAttributes.Common.BLOCK_ON_DURABLE_SEND, ConnectionFactoryAttributes.Common.AUTO_GROUP, ConnectionFactoryAttributes.Common.PRE_ACKNOWLEDGE, ConnectionFactoryAttributes.Common.RETRY_INTERVAL, ConnectionFactoryAttributes.Common.RETRY_INTERVAL_MULTIPLIER, CommonAttributes.MAX_RETRY_INTERVAL, ConnectionFactoryAttributes.Common.RECONNECT_ATTEMPTS, ConnectionFactoryAttributes.Common.FAILOVER_ON_INITIAL_CONNECTION, ConnectionFactoryAttributes.Common.CONNECTION_LOAD_BALANCING_CLASS_NAME, ConnectionFactoryAttributes.Common.USE_GLOBAL_POOLS, ConnectionFactoryAttributes.Common.SCHEDULED_THREAD_POOL_MAX_SIZE, ConnectionFactoryAttributes.Common.THREAD_POOL_MAX_SIZE, ConnectionFactoryAttributes.Common.GROUP_ID, ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.NETWORK_CHECK_LIST, ServerDefinition.NETWORK_CHECK_NIC, ServerDefinition.NETWORK_CHECK_PERIOD, ServerDefinition.NETWORK_CHECK_PING6_COMMAND, ServerDefinition.NETWORK_CHECK_PING_COMMAND, ServerDefinition.NETWORK_CHECK_TIMEOUT, ServerDefinition.NETWORK_CHECK_URL_LIST));
}
ModelTestUtils.checkFailedTransformedBootOperations(mainServices, messagingVersion, ops, config);
mainServices.shutdown();
}
use of org.jboss.as.model.test.FailedOperationTransformationConfig in project wildfly by wildfly.
the class MessagingActiveMQSubsystem_14_0_TestCase method testRejectingTransformers.
private void testRejectingTransformers(ModelTestControllerVersion controllerVersion, ModelVersion messagingVersion) throws Exception {
// Boot up empty controllers with the resources needed for the ops coming from the xml to work
KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());
builder.createLegacyKernelServicesBuilder(createAdditionalInitialization(), controllerVersion, messagingVersion).addMavenResourceURL(getMessagingActiveMQGAV(controllerVersion)).addMavenResourceURL(getActiveMQDependencies(controllerVersion)).addMavenResourceURL(getJGroupsDependencies(controllerVersion)).skipReverseControllerCheck().dontPersistXml();
KernelServices mainServices = builder.build();
assertTrue(mainServices.isSuccessfulBoot());
assertTrue(mainServices.getLegacyServices(messagingVersion).isSuccessfulBoot());
List<ModelNode> ops = builder.parseXmlResource("subsystem_14_0_reject_transform.xml");
// System.out.println("ops = " + ops);
PathAddress subsystemAddress = PathAddress.pathAddress(SUBSYSTEM_PATH);
FailedOperationTransformationConfig config = new FailedOperationTransformationConfig();
if (messagingVersion.compareTo(MessagingExtension.VERSION_9_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server1")), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server2")).append(BRIDGE_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(SERVER, "server3")).append(POOLED_CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(JMS_BRIDGE, "bridge-with-credential-reference")), FailedOperationTransformationConfig.REJECTED_RESOURCE);
}
if (messagingVersion.equals(MessagingExtension.VERSION_1_0_0)) {
config.addFailedAttribute(subsystemAddress, new FailedOperationTransformationConfig.NewAttributesConfig(MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE, MessagingSubsystemRootResourceDefinition.GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.ELYTRON_DOMAIN, ServerDefinition.JOURNAL_DATASOURCE, ServerDefinition.JOURNAL_MESSAGES_TABLE, ServerDefinition.JOURNAL_BINDINGS_TABLE, ServerDefinition.JOURNAL_JMS_BINDINGS_TABLE, ServerDefinition.JOURNAL_LARGE_MESSAGES_TABLE, ServerDefinition.JOURNAL_PAGE_STORE_TABLE, ServerDefinition.JOURNAL_DATABASE, ServerDefinition.JOURNAL_JDBC_NETWORK_TIMEOUT, ServerDefinition.JOURNAL_JDBC_LOCK_EXPIRATION, ServerDefinition.JOURNAL_JDBC_LOCK_RENEW_PERIOD, ServerDefinition.JOURNAL_NODE_MANAGER_STORE_TABLE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE, ServerDefinition.NETWORK_CHECK_LIST, ServerDefinition.NETWORK_CHECK_NIC, ServerDefinition.NETWORK_CHECK_PERIOD, ServerDefinition.NETWORK_CHECK_PING6_COMMAND, ServerDefinition.NETWORK_CHECK_PING_COMMAND, ServerDefinition.NETWORK_CHECK_TIMEOUT, ServerDefinition.NETWORK_CHECK_URL_LIST, ServerDefinition.CRITICAL_ANALYZER_ENABLED, ServerDefinition.CRITICAL_ANALYZER_CHECK_PERIOD, ServerDefinition.CRITICAL_ANALYZER_POLICY, ServerDefinition.CRITICAL_ANALYZER_TIMEOUT, ServerDefinition.JOURNAL_MAX_ATTIC_FILES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_MASTER_PATH), new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())).addFailedAttribute(subsystemAddress.append(SERVER_PATH, REPLICATION_COLOCATED_PATH, MessagingExtension.CONFIGURATION_MASTER_PATH), new ChangeToTrueConfig(HAAttributes.CHECK_FOR_LIVE_SERVER.getName())).addFailedAttribute(subsystemAddress.append(SERVER_PATH, ADDRESS_SETTING_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(AddressSettingDefinition.AUTO_CREATE_QUEUES, AddressSettingDefinition.AUTO_DELETE_QUEUES, AddressSettingDefinition.AUTO_CREATE_ADDRESSES, AddressSettingDefinition.AUTO_DELETE_ADDRESSES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, pathElement(CommonAttributes.HTTP_CONNECTOR)), new FailedOperationTransformationConfig.NewAttributesConfig(HTTPConnectorDefinition.SERVER_NAME)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, BRIDGE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BridgeDefinition.PRODUCER_WINDOW_SIZE, BridgeDefinition.CALL_TIMEOUT, BridgeDefinition.ROUTING_TYPE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CLUSTER_CONNECTION_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ClusterConnectionDefinition.PRODUCER_WINDOW_SIZE)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE, ConnectionFactoryAttributes.Common.USE_TOPOLOGY)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Pooled.ALLOW_LOCAL_TRANSACTIONS, ConnectionFactoryAttributes.Pooled.REBALANCE_CONNECTIONS, ConnectionFactoryAttributes.Pooled.STATISTICS_ENABLED, ConnectionFactoryAttributes.Pooled.CREDENTIAL_REFERENCE, ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
} else if (messagingVersion.equals(MessagingExtension.VERSION_2_0_0)) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, ADDRESS_SETTING_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(AddressSettingDefinition.AUTO_CREATE_QUEUES, AddressSettingDefinition.AUTO_DELETE_QUEUES, AddressSettingDefinition.AUTO_CREATE_ADDRESSES, AddressSettingDefinition.AUTO_DELETE_ADDRESSES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.JOURNAL_JDBC_LOCK_EXPIRATION, ServerDefinition.JOURNAL_JDBC_LOCK_RENEW_PERIOD, ServerDefinition.JOURNAL_NODE_MANAGER_STORE_TABLE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.NETWORK_CHECK_LIST, ServerDefinition.NETWORK_CHECK_NIC, ServerDefinition.NETWORK_CHECK_PERIOD, ServerDefinition.NETWORK_CHECK_PING6_COMMAND, ServerDefinition.NETWORK_CHECK_PING_COMMAND, ServerDefinition.NETWORK_CHECK_TIMEOUT, ServerDefinition.NETWORK_CHECK_URL_LIST, ServerDefinition.CRITICAL_ANALYZER_ENABLED, ServerDefinition.CRITICAL_ANALYZER_CHECK_PERIOD, ServerDefinition.CRITICAL_ANALYZER_POLICY, ServerDefinition.CRITICAL_ANALYZER_TIMEOUT, ServerDefinition.JOURNAL_MAX_ATTIC_FILES)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE, ConnectionFactoryAttributes.Common.USE_TOPOLOGY)).addFailedAttribute(subsystemAddress.append(SERVER_PATH, BRIDGE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BridgeDefinition.CALL_TIMEOUT, BridgeDefinition.ROUTING_TYPE));
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_5_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.GLOBAL_MAX_DISK_USAGE, ServerDefinition.DISK_SCAN_PERIOD, ServerDefinition.GLOBAL_MAX_MEMORY_SIZE, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.NETWORK_CHECK_LIST, ServerDefinition.NETWORK_CHECK_NIC, ServerDefinition.NETWORK_CHECK_PERIOD, ServerDefinition.NETWORK_CHECK_PING6_COMMAND, ServerDefinition.NETWORK_CHECK_PING_COMMAND, ServerDefinition.NETWORK_CHECK_TIMEOUT, ServerDefinition.NETWORK_CHECK_URL_LIST, ServerDefinition.CRITICAL_ANALYZER_ENABLED, ServerDefinition.CRITICAL_ANALYZER_CHECK_PERIOD, ServerDefinition.CRITICAL_ANALYZER_POLICY, ServerDefinition.CRITICAL_ANALYZER_TIMEOUT, ServerDefinition.JOURNAL_MAX_ATTIC_FILES));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, BRIDGE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BridgeDefinition.CALL_TIMEOUT, BridgeDefinition.ROUTING_TYPE));
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_QUEUE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX));
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_TOPIC_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX));
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_6_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.JOURNAL_FILE_OPEN_TIMEOUT, ServerDefinition.NETWORK_CHECK_LIST, ServerDefinition.NETWORK_CHECK_NIC, ServerDefinition.NETWORK_CHECK_PERIOD, ServerDefinition.NETWORK_CHECK_PING6_COMMAND, ServerDefinition.NETWORK_CHECK_PING_COMMAND, ServerDefinition.NETWORK_CHECK_TIMEOUT, ServerDefinition.NETWORK_CHECK_URL_LIST, ServerDefinition.CRITICAL_ANALYZER_ENABLED, ServerDefinition.CRITICAL_ANALYZER_CHECK_PERIOD, ServerDefinition.CRITICAL_ANALYZER_POLICY, ServerDefinition.CRITICAL_ANALYZER_TIMEOUT, ServerDefinition.JOURNAL_MAX_ATTIC_FILES));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.JGROUPS_BROADCAST_GROUP_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.SOCKET_BROADCAST_GROUP_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, JGroupsDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, SocketDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, BRIDGE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BridgeDefinition.CALL_TIMEOUT, BridgeDefinition.ROUTING_TYPE));
}
if (messagingVersion.compareTo(MessagingExtension.VERSION_4_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.BROADCAST_GROUP_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BroadcastGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.JGROUPS_BROADCAST_GROUP_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BroadcastGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.SOCKET_BROADCAST_GROUP_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, DiscoveryGroupDefinition.PATH), new FailedOperationTransformationConfig.NewAttributesConfig(DiscoveryGroupDefinition.JGROUPS_CHANNEL));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, JGroupsDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, SocketDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.QUEUE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(QueueDefinition.ROUTING_TYPE));
config.addFailedAttribute(subsystemAddress.append(DiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.REMOTE_CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.IN_VM_CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(pathElement(CommonAttributes.CONNECTOR)), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(MessagingExtension.HTTP_CONNECTOR_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(POOLED_CONNECTION_FACTORY_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_QUEUE_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_TOPIC_PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(JGroupsDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
config.addFailedAttribute(subsystemAddress.append(SocketDiscoveryGroupDefinition.PATH), FailedOperationTransformationConfig.REJECTED_RESOURCE);
} else if (messagingVersion.compareTo(MessagingExtension.VERSION_6_0_0) > 0) {
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, MessagingExtension.QUEUE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(QueueDefinition.ROUTING_TYPE));
config.addFailedAttribute(subsystemAddress.append(POOLED_CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX, ConnectionFactoryAttributes.Common.USE_TOPOLOGY));
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX, ConnectionFactoryAttributes.Common.USE_TOPOLOGY, ConnectionFactoryAttributes.Common.CLIENT_FAILURE_CHECK_PERIOD, ConnectionFactoryAttributes.Common.CONNECTION_TTL, CommonAttributes.CALL_TIMEOUT, CommonAttributes.CALL_FAILOVER_TIMEOUT, ConnectionFactoryAttributes.Common.CONSUMER_WINDOW_SIZE, ConnectionFactoryAttributes.Common.CONSUMER_MAX_RATE, ConnectionFactoryAttributes.Common.CONFIRMATION_WINDOW_SIZE, ConnectionFactoryAttributes.Common.PRODUCER_WINDOW_SIZE, ConnectionFactoryAttributes.Common.PRODUCER_MAX_RATE, ConnectionFactoryAttributes.Common.PROTOCOL_MANAGER_FACTORY, ConnectionFactoryAttributes.Common.COMPRESS_LARGE_MESSAGES, ConnectionFactoryAttributes.Common.CACHE_LARGE_MESSAGE_CLIENT, CommonAttributes.MIN_LARGE_MESSAGE_SIZE, CommonAttributes.CLIENT_ID, ConnectionFactoryAttributes.Common.DUPS_OK_BATCH_SIZE, ConnectionFactoryAttributes.Common.TRANSACTION_BATCH_SIZE, ConnectionFactoryAttributes.Common.BLOCK_ON_ACKNOWLEDGE, ConnectionFactoryAttributes.Common.BLOCK_ON_NON_DURABLE_SEND, ConnectionFactoryAttributes.Common.BLOCK_ON_DURABLE_SEND, ConnectionFactoryAttributes.Common.AUTO_GROUP, ConnectionFactoryAttributes.Common.PRE_ACKNOWLEDGE, ConnectionFactoryAttributes.Common.RETRY_INTERVAL, ConnectionFactoryAttributes.Common.RETRY_INTERVAL_MULTIPLIER, CommonAttributes.MAX_RETRY_INTERVAL, ConnectionFactoryAttributes.Common.RECONNECT_ATTEMPTS, ConnectionFactoryAttributes.Common.FAILOVER_ON_INITIAL_CONNECTION, ConnectionFactoryAttributes.Common.CONNECTION_LOAD_BALANCING_CLASS_NAME, ConnectionFactoryAttributes.Common.USE_GLOBAL_POOLS, ConnectionFactoryAttributes.Common.SCHEDULED_THREAD_POOL_MAX_SIZE, ConnectionFactoryAttributes.Common.THREAD_POOL_MAX_SIZE, ConnectionFactoryAttributes.Common.GROUP_ID, ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE));
} else {
config.addFailedAttribute(subsystemAddress.append(CONNECTION_FACTORY_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.Common.CLIENT_FAILURE_CHECK_PERIOD, ConnectionFactoryAttributes.Common.CONNECTION_TTL, CommonAttributes.CALL_TIMEOUT, CommonAttributes.CALL_FAILOVER_TIMEOUT, ConnectionFactoryAttributes.Common.CONSUMER_WINDOW_SIZE, ConnectionFactoryAttributes.Common.CONSUMER_MAX_RATE, ConnectionFactoryAttributes.Common.CONFIRMATION_WINDOW_SIZE, ConnectionFactoryAttributes.Common.PRODUCER_WINDOW_SIZE, ConnectionFactoryAttributes.Common.PRODUCER_MAX_RATE, ConnectionFactoryAttributes.Common.PROTOCOL_MANAGER_FACTORY, ConnectionFactoryAttributes.Common.COMPRESS_LARGE_MESSAGES, ConnectionFactoryAttributes.Common.CACHE_LARGE_MESSAGE_CLIENT, CommonAttributes.MIN_LARGE_MESSAGE_SIZE, CommonAttributes.CLIENT_ID, ConnectionFactoryAttributes.Common.DUPS_OK_BATCH_SIZE, ConnectionFactoryAttributes.Common.TRANSACTION_BATCH_SIZE, ConnectionFactoryAttributes.Common.BLOCK_ON_ACKNOWLEDGE, ConnectionFactoryAttributes.Common.BLOCK_ON_NON_DURABLE_SEND, ConnectionFactoryAttributes.Common.BLOCK_ON_DURABLE_SEND, ConnectionFactoryAttributes.Common.AUTO_GROUP, ConnectionFactoryAttributes.Common.PRE_ACKNOWLEDGE, ConnectionFactoryAttributes.Common.RETRY_INTERVAL, ConnectionFactoryAttributes.Common.RETRY_INTERVAL_MULTIPLIER, CommonAttributes.MAX_RETRY_INTERVAL, ConnectionFactoryAttributes.Common.RECONNECT_ATTEMPTS, ConnectionFactoryAttributes.Common.FAILOVER_ON_INITIAL_CONNECTION, ConnectionFactoryAttributes.Common.CONNECTION_LOAD_BALANCING_CLASS_NAME, ConnectionFactoryAttributes.Common.USE_GLOBAL_POOLS, ConnectionFactoryAttributes.Common.SCHEDULED_THREAD_POOL_MAX_SIZE, ConnectionFactoryAttributes.Common.THREAD_POOL_MAX_SIZE, ConnectionFactoryAttributes.Common.GROUP_ID, ConnectionFactoryAttributes.Common.DESERIALIZATION_BLACKLIST, ConnectionFactoryAttributes.Common.DESERIALIZATION_WHITELIST, ConnectionFactoryAttributes.Common.INITIAL_MESSAGE_PACKET_SIZE));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ServerDefinition.NETWORK_CHECK_LIST, ServerDefinition.NETWORK_CHECK_NIC, ServerDefinition.NETWORK_CHECK_PERIOD, ServerDefinition.NETWORK_CHECK_PING6_COMMAND, ServerDefinition.NETWORK_CHECK_PING_COMMAND, ServerDefinition.NETWORK_CHECK_TIMEOUT, ServerDefinition.NETWORK_CHECK_URL_LIST, ServerDefinition.CRITICAL_ANALYZER_ENABLED, ServerDefinition.CRITICAL_ANALYZER_CHECK_PERIOD, ServerDefinition.CRITICAL_ANALYZER_POLICY, ServerDefinition.CRITICAL_ANALYZER_TIMEOUT, ServerDefinition.JOURNAL_MAX_ATTIC_FILES));
config.addFailedAttribute(subsystemAddress.append(SERVER_PATH, BRIDGE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(BridgeDefinition.CALL_TIMEOUT, BridgeDefinition.ROUTING_TYPE));
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_QUEUE_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX));
config.addFailedAttribute(subsystemAddress.append(EXTERNAL_JMS_TOPIC_PATH), new FailedOperationTransformationConfig.NewAttributesConfig(ConnectionFactoryAttributes.External.ENABLE_AMQ1_PREFIX));
}
ModelTestUtils.checkFailedTransformedBootOperations(mainServices, messagingVersion, ops, config);
mainServices.shutdown();
}
Aggregations