diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2014-10-17 13:58:04 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2014-10-17 13:58:04 +0000 |
commit | 5e8136af6e36d5f2689dd07e70095546c0120dbc (patch) | |
tree | 4b824e122d1cbb810e632dd4286c31227a16f414 /java/systests/src/main | |
parent | e823be1ce23fc8970afc7f437eb84c164c70d837 (diff) | |
download | qpid-python-QPID-6125-ProtocolRefactoring.tar.gz |
merged from trunkQPID-6125-ProtocolRefactoring
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-6125-ProtocolRefactoring@1632579 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests/src/main')
-rwxr-xr-x | java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java | 1 | ||||
-rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java | 51 |
2 files changed, 51 insertions, 1 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java index 386cd80f38..369a76a6c6 100755 --- a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java +++ b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java @@ -50,6 +50,7 @@ import javax.naming.NamingException; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; + import org.apache.qpid.AMQException; import org.apache.qpid.client.AMQConnectionFactory; import org.apache.qpid.client.AMQConnectionURL; diff --git a/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java b/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java index c7bcdd2edb..fb254f59ae 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java +++ b/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java @@ -57,6 +57,8 @@ import org.apache.qpid.server.model.Plugin; import org.apache.qpid.server.model.PreferencesProvider; import org.apache.qpid.server.model.SystemConfig; import org.apache.qpid.server.model.UUIDGenerator; +import org.apache.qpid.server.model.VirtualHostAlias; +import org.apache.qpid.server.model.VirtualHostNode; import org.apache.qpid.server.model.adapter.FileBasedGroupProvider; import org.apache.qpid.server.model.adapter.FileBasedGroupProviderImpl; import org.apache.qpid.server.plugin.PluggableFactoryLoader; @@ -254,12 +256,47 @@ public class TestBrokerConfiguration } public UUID[] removeObjectConfiguration(final Class<? extends ConfiguredObject> category, - String name) + final String name) { final ConfiguredObjectRecord entry = findObject(category, name); + if (entry != null) { + + if(category == VirtualHostNode.class) + { + final List<ConfiguredObjectRecord> aliasRecords = new ArrayList<>(); + // remove vhost aliases associated with the vhost + final ConfiguredObjectRecordHandler visitor = new ConfiguredObjectRecordHandler() + { + @Override + public void begin() + { + + } + + @Override + public boolean handle(final ConfiguredObjectRecord record) + { + if (record.getType().equals(VirtualHostAlias.class.getSimpleName()) + && name.equals(record.getAttributes().get(ConfiguredObject.NAME))) + { + aliasRecords.add(record); + } + return true; + } + + @Override + public void end() + { + + } + }; + _store.visitConfiguredObjectRecords(visitor); + _store.remove(aliasRecords.toArray(new ConfiguredObjectRecord[aliasRecords.size()])); + } return _store.remove(entry); + } return null; } @@ -271,6 +308,18 @@ public class TestBrokerConfiguration return id; } + public UUID addObjectConfiguration(final Class<? extends ConfiguredObject> parentCategory, final String parentName, + Class<? extends ConfiguredObject> type, Map<String, Object> attributes) + { + UUID id = UUIDGenerator.generateRandomUUID(); + ConfiguredObjectRecord entry = + new ConfiguredObjectRecordImpl(id, type.getSimpleName(), attributes, + Collections.singletonMap(parentCategory.getSimpleName(), findObject(parentCategory,parentName).getId())); + + _store.update(true, entry); + return id; + } + public UUID addJmxManagementConfiguration() { Map<String, Object> attributes = new HashMap<String, Object>(); |