Skip to content
Browse files

AS7-3632 / AS7-4127- re-enable few remoting tests

  • Loading branch information...
1 parent 40880c0 commit fad93064dd78aedd94283792d41d5efb1c912fb9 @ctomc ctomc committed with bstansberry
Showing with 60 additions and 55 deletions.
  1. +60 −55 remoting-test/src/test/java/org/jboss/as/remoting/RemotingSubsystemTestCase.java
View
115 remoting-test/src/test/java/org/jboss/as/remoting/RemotingSubsystemTestCase.java
@@ -53,17 +53,14 @@
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceNotFoundException;
import org.jboss.msc.service.ServiceTarget;
-import org.junit.Ignore;
import org.junit.Test;
/**
- *
* @author <a href="kabir.khan@jboss.com">Kabir Khan</a>
*/
public class RemotingSubsystemTestCase extends AbstractSubsystemBaseTest {
public RemotingSubsystemTestCase() {
- // FIXME RemotingSubsystemTestCase constructor
super(RemotingExtension.SUBSYSTEM_NAME, new RemotingExtension());
}
@@ -75,19 +72,21 @@ public void testSubsystemWithThreadParameters() throws Exception {
@Test
public void testSubsystemWitThreadsAndConnectorProperties() throws Exception {
final int port = 12345;
- KernelServices services = installInController(new AdditionalInitialization(){
- @Override
- protected void setupController(ControllerInitializer controllerInitializer) {
- controllerInitializer.addSocketBinding("test", port);
- }
+ KernelServices services = createKernelServicesBuilder(new AdditionalInitialization() {
+ @Override
+ protected void setupController(ControllerInitializer controllerInitializer) {
+ controllerInitializer.addSocketBinding("test", port);
+ }
+
+ @Override
+ protected void addExtraServices(ServiceTarget target) {
+ //Needed for initialization of the RealmAuthenticationProviderService
+ AbsolutePathService.addService(ServerEnvironment.CONTROLLER_TEMP_DIR, new File("target/temp" + System.currentTimeMillis()).getAbsolutePath(), target);
+ }
- @Override
- protected void addExtraServices(ServiceTarget target) {
- //Needed for initialization of the RealmAuthenticationProviderService
- AbsolutePathService.addService(ServerEnvironment.CONTROLLER_TEMP_DIR, new File("target/temp" + System.currentTimeMillis()).getAbsolutePath(), target);
- }
+ }).setSubsystemXmlResource("remoting-with-threads.xml")
+ .build();
- },readResource("remoting-with-threads.xml"));
ServiceController<?> endPointService = services.getContainer().getRequiredService(RemotingServices.SUBSYSTEM_ENDPOINT);
assertNotNull(endPointService);
@@ -109,22 +108,23 @@ protected void addExtraServices(ServiceTarget target) {
assertEquals(1, connector.require(CommonAttributes.PROPERTY).require("org.xnio.Options.WORKER_ACCEPT_THREADS").require(CommonAttributes.VALUE).asInt());
}
- @Test @Ignore("AS7-4127")
+ @Test
public void testSubsystemWithThreadAttributeChange() throws Exception {
final int port = 12345;
- KernelServices services = installInController(new AdditionalInitialization(){
- @Override
- protected void setupController(ControllerInitializer controllerInitializer) {
- controllerInitializer.addSocketBinding("test", port);
- }
+ KernelServices services = createKernelServicesBuilder(new AdditionalInitialization() {
+ @Override
+ protected void setupController(ControllerInitializer controllerInitializer) {
+ controllerInitializer.addSocketBinding("test", port);
+ }
- @Override
- protected void addExtraServices(ServiceTarget target) {
- //Needed for initialization of the RealmAuthenticationProviderService
- AbsolutePathService.addService(ServerEnvironment.CONTROLLER_TEMP_DIR, new File("target/temp" + System.currentTimeMillis()).getAbsolutePath(), target);
- }
+ @Override
+ protected void addExtraServices(ServiceTarget target) {
+ //Needed for initialization of the RealmAuthenticationProviderService
+ AbsolutePathService.addService(ServerEnvironment.CONTROLLER_TEMP_DIR, new File("target/temp" + System.currentTimeMillis()).getAbsolutePath(), target);
+ }
- },readResource("remoting-with-threads.xml"));
+ }).setSubsystemXmlResource("remoting-with-threads.xml")
+ .build();
CurrentConnectorAndController current = CurrentConnectorAndController.create(services, RemotingServices.SUBSYSTEM_ENDPOINT, RemotingServices.serverServiceName("test-connector"));
@@ -154,21 +154,24 @@ private void updateAndCheckThreadAttribute(KernelServices services, CurrentConne
}
- @Test @Ignore("AS7-4127")
+ @Test
public void testSubsystemWithConnectorPropertyChange() throws Exception {
final int port = 12345;
- KernelServices services = installInController(new AdditionalInitialization(){
- @Override
- protected void setupController(ControllerInitializer controllerInitializer) {
- controllerInitializer.addSocketBinding("test", port);
- }
-
- @Override
- protected void addExtraServices(ServiceTarget target) {
- //Needed for initialization of the RealmAuthenticationProviderService
- AbsolutePathService.addService(ServerEnvironment.CONTROLLER_TEMP_DIR, new File("target/temp" + System.currentTimeMillis()).getAbsolutePath(), target);
- }
- },readResource("remoting-with-threads.xml"));
+
+ KernelServices services = createKernelServicesBuilder(new AdditionalInitialization() {
+ @Override
+ protected void setupController(ControllerInitializer controllerInitializer) {
+ controllerInitializer.addSocketBinding("test", port);
+ }
+
+ @Override
+ protected void addExtraServices(ServiceTarget target) {
+ //Needed for initialization of the RealmAuthenticationProviderService
+ AbsolutePathService.addService(ServerEnvironment.CONTROLLER_TEMP_DIR, new File("target/temp" + System.currentTimeMillis()).getAbsolutePath(), target);
+ }
+ }).setSubsystemXmlResource("remoting-with-threads.xml")
+ .build();
+
CurrentConnectorAndController current = CurrentConnectorAndController.create(services, RemotingServices.SUBSYSTEM_ENDPOINT, RemotingServices.serverServiceName("test-connector"));
@@ -207,16 +210,17 @@ protected void addExtraServices(ServiceTarget target) {
current.updateCurrentConnector(false);
}
- @Test @Ignore("AS7-3632")
+ @Test
public void testSubsystemWithBadConnectorProperty() throws Exception {
final int port = 12345;
- KernelServices services = installInController(new AdditionalInitialization(){
- @Override
- protected void setupController(ControllerInitializer controllerInitializer) {
- controllerInitializer.addSocketBinding("test", port);
- }
+ KernelServices services = createKernelServicesBuilder(new AdditionalInitialization() {
+ @Override
+ protected void setupController(ControllerInitializer controllerInitializer) {
+ controllerInitializer.addSocketBinding("test", port);
+ }
- },readResource("remoting-with-bad-connector-property.xml"));
+ }).setSubsystemXmlResource("remoting-with-bad-connector-property.xml")
+ .build();
try {
services.getContainer().getRequiredService(RemotingServices.SUBSYSTEM_ENDPOINT);
@@ -241,15 +245,16 @@ protected void setupController(ControllerInitializer controllerInitializer) {
public void testOutboundConnections() throws Exception {
final int outboundSocketBindingPort = 6799;
final int socketBindingPort = 1234;
- KernelServices services = installInController(new AdditionalInitialization(){
- @Override
- protected void setupController(ControllerInitializer controllerInitializer) {
- controllerInitializer.addSocketBinding("test", socketBindingPort);
- controllerInitializer.addRemoteOutboundSocketBinding("dummy-outbound-socket", "localhost", outboundSocketBindingPort);
- controllerInitializer.addRemoteOutboundSocketBinding("other-outbound-socket", "localhost", outboundSocketBindingPort);
- }
+ KernelServices services = createKernelServicesBuilder(new AdditionalInitialization() {
+ @Override
+ protected void setupController(ControllerInitializer controllerInitializer) {
+ controllerInitializer.addSocketBinding("test", socketBindingPort);
+ controllerInitializer.addRemoteOutboundSocketBinding("dummy-outbound-socket", "localhost", outboundSocketBindingPort);
+ controllerInitializer.addRemoteOutboundSocketBinding("other-outbound-socket", "localhost", outboundSocketBindingPort);
+ }
- },readResource("remoting-with-outbound-connections.xml"));
+ }).setSubsystemXmlResource("remoting-with-outbound-connections.xml")
+ .build();
ServiceController<?> endPointService = services.getContainer().getRequiredService(RemotingServices.SUBSYSTEM_ENDPOINT);
assertNotNull("Endpoint service was null", endPointService);
@@ -265,7 +270,7 @@ protected void setupController(ControllerInitializer controllerInitializer) {
ServiceName localOutboundConnectionServiceName = LocalOutboundConnectionService.LOCAL_OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(localOutboundConnectionName);
ServiceController<?> localOutboundConnectionService = services.getContainer().getRequiredService(localOutboundConnectionServiceName);
assertNotNull("Local outbound connection service for outbound connection:" + localOutboundConnectionName + " was null", localOutboundConnectionService);
- LocalOutboundConnectionService localService = (LocalOutboundConnectionService)localOutboundConnectionService.getService();
+ LocalOutboundConnectionService localService = (LocalOutboundConnectionService) localOutboundConnectionService.getService();
assertEquals(2, localService.connectionCreationOptions.size());
}

0 comments on commit fad9306

Please sign in to comment.
Something went wrong with that request. Please try again.