Skip to content

Commit

Permalink
Add subsystem tests for all subsystems apart from threads and remoting.
Browse files Browse the repository at this point in the history
Fix descriptions where possible, or disable validation in tests for now (JIRAs have been opened to fix properly)
  • Loading branch information
kabir committed Sep 15, 2011
1 parent 2461f48 commit 63d5791
Show file tree
Hide file tree
Showing 58 changed files with 1,672 additions and 97 deletions.
5 changes: 5 additions & 0 deletions clustering/infinispan/pom.xml
Expand Up @@ -74,5 +74,10 @@
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,108 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.clustering.infinispan.subsystem;

import java.io.IOException;

import org.jboss.as.controller.OperationContext;
import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.jboss.as.subsystem.test.ModelDescriptionValidator.ValidationConfiguration;
import org.junit.Ignore;

/**
*
* @author <a href="kabir.khan@jboss.com">Kabir Khan</a>
*/
@Ignore
public class InfinispanSubsystemTestCase extends AbstractSubsystemBaseTest {

public InfinispanSubsystemTestCase() {
super(InfinispanExtension.SUBSYSTEM_NAME, new InfinispanExtension());
}

@Override
protected String getSubsystemXml() throws IOException {
//TODO: This is copied from standalone-ha.xml you may want to try more combinations

return
"<subsystem xmlns=\"urn:jboss:domain:infinispan:1.0\" default-cache-container=\"cluster\">" +
"<cache-container name=\"cluster\" default-cache=\"default\">" +
" <alias>ha-partition</alias>" +
" <replicated-cache name=\"default\" mode=\"SYNC\" batching=\"true\">" +
" <locking isolation=\"REPEATABLE_READ\"/>" +
" </replicated-cache>" +
"</cache-container>" +
"<cache-container name=\"web\" default-cache=\"repl\">" +
" <alias>standard-session-cache</alias>" +
" <replicated-cache name=\"repl\" mode=\"ASYNC\" batching=\"true\">" +
" <locking isolation=\"REPEATABLE_READ\"/>" +
" <file-store/>" +
" </replicated-cache>" +
" <distributed-cache name=\"dist\" mode=\"ASYNC\" batching=\"true\">" +
" <locking isolation=\"REPEATABLE_READ\"/>" +
" <file-store/>" +
" </distributed-cache>" +
"</cache-container>" +
"<cache-container name=\"sfsb\" default-cache=\"repl\">" +
" <alias>sfsb-cache</alias>" +
" <alias>jboss.cache:service=EJB3SFSBClusteredCache</alias>" +
" <replicated-cache name=\"repl\" mode=\"ASYNC\" batching=\"true\">" +
" <locking isolation=\"REPEATABLE_READ\"/>" +
" <eviction strategy=\"LRU\" max-entries=\"10000\"/>" +
" <file-store/>" +
" </replicated-cache>" +
"</cache-container>" +
"<cache-container name=\"hibernate\" default-cache=\"local-query\">" +
" <invalidation-cache name=\"entity\" mode=\"SYNC\">" +
" <eviction strategy=\"LRU\" max-entries=\"10000\"/>" +
" <expiration max-idle=\"100000\"/>" +
" </invalidation-cache>" +
" <local-cache name=\"local-query\">" +
" <eviction strategy=\"LRU\" max-entries=\"10000\"/>" +
" <expiration max-idle=\"100000\"/>" +
" </local-cache>" +
" <replicated-cache name=\"timestamps\" mode=\"ASYNC\">" +
" <eviction strategy=\"NONE\"/>" +
" </replicated-cache>" +
"</cache-container>" +
"</subsystem>";
}

protected AdditionalInitialization createAdditionalInitialization() {
return new AdditionalInitialization(){
@Override
protected OperationContext.Type getType() {
return OperationContext.Type.MANAGEMENT;
}


@Override
protected ValidationConfiguration getModelValidationConfiguration() {
//TODO fix validation https://issues.jboss.org/browse/AS7-1788
return null;
}
};
}


}
5 changes: 5 additions & 0 deletions clustering/jgroups/pom.xml
Expand Up @@ -65,5 +65,10 @@
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Expand Up @@ -27,12 +27,13 @@

import java.util.List;

import org.jboss.as.clustering.jgroups.subsystem.Namespace;
import org.jboss.as.clustering.subsystem.AbstractExtensionTest;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.registry.Resource;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.jboss.as.subsystem.test.ModelDescriptionValidator.ValidationConfiguration;
import org.jboss.dmr.ModelNode;

public class JGroupsExtensionTest extends AbstractExtensionTest {
Expand Down Expand Up @@ -71,4 +72,21 @@ protected ModelNode populate(List<ModelNode> operations) throws OperationFailedE
}
return model;
}

protected AdditionalInitialization createAdditionalInitialization() {
return new AdditionalInitialization(){
@Override
protected OperationContext.Type getType() {
return OperationContext.Type.MANAGEMENT;
}


@Override
protected ValidationConfiguration getModelValidationConfiguration() {
//TODO fix validation https://issues.jboss.org/browse/AS7-1786
return null;
}
};
}

}
@@ -0,0 +1,84 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.clustering.jgroups.subsystem;

import java.io.IOException;

import org.jboss.as.controller.OperationContext;
import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.jboss.as.subsystem.test.ModelDescriptionValidator.ValidationConfiguration;

/**
*
* @author <a href="kabir.khan@jboss.com">Kabir Khan</a>
*/
public class JGroupsSubsystemTest extends AbstractSubsystemBaseTest {

public JGroupsSubsystemTest() {
// FIXME JGroupsSubsystemTest constructor
super(JGroupsExtension.SUBSYSTEM_NAME, new JGroupsExtension());
}

@Override
protected String getSubsystemXml() throws IOException {
//TODO: This is copied from standalone-ha.xml you may want to try more combinations
return "<subsystem xmlns=\"urn:jboss:domain:jgroups:1.0\" default-stack=\"udp\">" +
" <stack name=\"udp\">" +
" <transport type=\"UDP\" socket-binding=\"jgroups-udp\" diagnostics-socket-binding=\"jgroups-diagnostics\"/>" +
" <protocol type=\"PING\"/>" +
" <protocol type=\"MERGE2\"/>" +
" <protocol type=\"FD_SOCK\" socket-binding=\"jgroups-udp-fd\"/>" +
" <protocol type=\"FD\"/>" +
" <protocol type=\"VERIFY_SUSPECT\"/>" +
" <protocol type=\"BARRIER\"/>" +
" <protocol type=\"pbcast.NAKACK\"/>" +
" <protocol type=\"UNICAST\"/>" +
" <protocol type=\"pbcast.STABLE\"/>" +
" <protocol type=\"VIEW_SYNC\"/>" +
" <protocol type=\"pbcast.GMS\"/>" +
" <protocol type=\"UFC\"/>" +
" <protocol type=\"MFC\"/>" +
" <protocol type=\"FRAG2\"/>" +
" <protocol type=\"pbcast.STREAMING_STATE_TRANSFER\"/>" +
" <protocol type=\"pbcast.FLUSH\"/>" +
" </stack>" +
"</subsystem>";
}

protected AdditionalInitialization createAdditionalInitialization() {
return new AdditionalInitialization(){
@Override
protected OperationContext.Type getType() {
return OperationContext.Type.MANAGEMENT;
}


@Override
protected ValidationConfiguration getModelValidationConfiguration() {
//TODO fix validation https://issues.jboss.org/browse/AS7-1787
return null;
}
};
}

}
5 changes: 5 additions & 0 deletions connector/pom.xml
Expand Up @@ -149,5 +149,10 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Expand Up @@ -44,8 +44,6 @@
*/
class Constants {

static final String DATASOURCES_SUBSYTEM = "datasources-subsystem";

static final String DATASOURCES = "datasources";

static final String DATA_SOURCE = "data-source";
Expand Down
Expand Up @@ -181,12 +181,14 @@
*/
public class DataSourcesExtension implements Extension {

public static final String SUBSYSTEM_NAME = Constants.DATASOURCES;

@Override
public void initialize(final ExtensionContext context) {
SUBSYSTEM_DATASOURCES_LOGGER.debugf("Initializing Datasources Extension");

// Register the remoting subsystem
final SubsystemRegistration registration = context.registerSubsystem(DATASOURCES);
final SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME);

registration.registerXMLElementWriter(NewDataSourceSubsystemParser.INSTANCE);

Expand Down
Expand Up @@ -87,7 +87,7 @@
*/
public class JcaExtension implements Extension {

private static String SUBSYSTEM_NAME = "jca";
public static String SUBSYSTEM_NAME = "jca";

@Override
public void initialize(final ExtensionContext context) {
Expand Down
Expand Up @@ -124,11 +124,13 @@
*/
public class ResourceAdaptersExtension implements Extension {

public static final String SUBSYSTEM_NAME = RESOURCEADAPTERS_NAME;

@Override
public void initialize(final ExtensionContext context) {
SUBSYSTEM_RA_LOGGER.debugf("Initializing ResourceAdapters Extension");
// Register the remoting subsystem
final SubsystemRegistration registration = context.registerSubsystem(RESOURCEADAPTERS_NAME);
final SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME);

registration.registerXMLElementWriter(ResourceAdapterSubsystemParser.INSTANCE);

Expand Down

0 comments on commit 63d5791

Please sign in to comment.