http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/Booter.java ---------------------------------------------------------------------- diff --git a/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/Booter.java b/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/Booter.java new file mode 100644 index 0000000..a15b00b --- /dev/null +++ b/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/Booter.java @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.apache.qpid.systests.end_to_end_conversion.dependency_resolution; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; + +public class Booter +{ + private static final String FALLBACK_LOCAL_REPO_URL = Stream.of(System.getProperty("user.home"), + ".m2", "repository") + .collect(Collectors.joining(File.pathSeparator)); + private static final String REMOTE_REPO_URL = System.getProperty( + "qpid.systests.end_to_end_conversion.remoteRepository", + "https://repo.maven.apache.org/maven2/"); + private static final String LOCAL_REPO = + System.getProperty("qpid.systests.end_to_end_conversion.localRepository", FALLBACK_LOCAL_REPO_URL); + + public static RepositorySystem newRepositorySystem() + { + return ManualRepositorySystemFactory.newRepositorySystem(); + } + + public static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system) + { + DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); + + LocalRepository localRepo = new LocalRepository("target/local-repo"); + session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo)); + + session.setTransferListener(new ConsoleTransferListener()); + session.setRepositoryListener(new ConsoleRepositoryListener()); + + // uncomment to generate dirty trees + // session.setDependencyGraphTransformer( null ); + + return session; + } + + public static List<RemoteRepository> newRepositories() + { + return Arrays.asList(newLocalRepository(), newCentralRepository()); + } + + private static RemoteRepository newCentralRepository() + { + return new RemoteRepository.Builder("central", "default", REMOTE_REPO_URL).build(); + } + + private static RemoteRepository newLocalRepository() + { + final URL localRepoUrl = toUrl(LOCAL_REPO); + return new RemoteRepository.Builder("local", "default", localRepoUrl.toString()).build(); + } + + private static URL toUrl(final String localRepo) + { + try + { + return new URL(localRepo); + } + catch (MalformedURLException e) + { + try + { + return new File(localRepo).toURI().toURL(); + } + catch (MalformedURLException e1) + { + throw new RuntimeException(String.format("Failed to convert '%s' into a URL", localRepo), e); + } + } + } +}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ClasspathQuery.java ---------------------------------------------------------------------- diff --git a/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ClasspathQuery.java b/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ClasspathQuery.java new file mode 100644 index 0000000..78c8736 --- /dev/null +++ b/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ClasspathQuery.java @@ -0,0 +1,201 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.apache.qpid.systests.end_to_end_conversion.dependency_resolution; + +import java.io.File; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.DefaultArtifact; +import org.eclipse.aether.collection.CollectRequest; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.resolution.ArtifactResult; +import org.eclipse.aether.resolution.DependencyRequest; +import org.eclipse.aether.resolution.DependencyResolutionException; +import org.eclipse.aether.util.artifact.JavaScopes; +import org.eclipse.aether.util.filter.DependencyFilterUtils; + +public class ClasspathQuery +{ + private static final LoadingCache<Collection<String>, List<File>> _classpathCache; + private static final RepositorySystem _mavenRepositorySystem; + private static final RepositorySystemSession _mavenRepositorySession; + static + { + _mavenRepositorySystem = Booter.newRepositorySystem(); + _mavenRepositorySession = Booter.newRepositorySystemSession(_mavenRepositorySystem); + _classpathCache = CacheBuilder.newBuilder() + .maximumSize(8) + .recordStats() + .build(new CacheLoader<Collection<String>, List<File>>() + { + @Override + public List<File> load(final Collection<String> key) throws Exception + { + return doBuildClassPath(key); + } + }); + } + private final Class<?> _clientClass; + private final Collection<String> _clientGavs; + + + public ClasspathQuery(final Class<?> clientClass, final Collection<String> gavs) + { + _clientClass = clientClass; + _clientGavs = gavs; + } + + public Class<?> getClientClass() + { + return _clientClass; + } + + public Collection<String> getClientGavs() + { + return _clientGavs; + } + + public String getClasspath() + { + return buildClassPath(_clientClass, _clientGavs); + } + + public static String getCacheStats() + { + return _classpathCache.stats().toString(); + } + + private static List<File> doBuildClassPath(final Collection<String> gavs) + { + return new ArrayList<>(getJarFiles(gavs)); + } + + private static Set<File> getJarFiles(final Collection<String> gavs) + { + Set<File> jars = new HashSet<>(); + + for (final String gav : gavs) + { + Artifact artifact = new DefaultArtifact(gav); + + DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter(JavaScopes.COMPILE); + + CollectRequest collectRequest = new CollectRequest(); + collectRequest.setRoot(new Dependency(artifact, JavaScopes.COMPILE)); + collectRequest.setRepositories(Booter.newRepositories()); + + DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, classpathFlter); + + List<ArtifactResult> artifactResults = null; + try + { + artifactResults = _mavenRepositorySystem.resolveDependencies(_mavenRepositorySession, dependencyRequest) + .getArtifactResults(); + } + catch (DependencyResolutionException e) + { + throw new RuntimeException(String.format("Error while dependency resolution for '%s'", gav), e); + } + + if (artifactResults == null) + { + throw new RuntimeException(String.format("Could not resolve dependency for '%s'", gav)); + } + + for (ArtifactResult artifactResult : artifactResults) + { + System.out.println(artifactResult.getArtifact() + " resolved to " + + artifactResult.getArtifact().getFile()); + } + + jars.addAll(artifactResults.stream() + .map(result -> result.getArtifact().getFile()) + .collect(Collectors.toSet())); + } + return jars; + } + + private String buildClassPath(final Class<?> clientClazz, final Collection<String> gavs) + { + List<File> classpathElements = _classpathCache.getUnchecked(gavs); + classpathElements.add(getLocalClasspathElement(clientClazz)); + + final String collect = classpathElements.stream() + .map(File::toString) + .collect(Collectors.joining(System.getProperty("path.separator"))); + return collect; + } + + private File getLocalClasspathElement(final Class<?> clazz) + { + int packageDepth = getPackageDepth(clazz); + final URL resource = clazz.getResource("/" + clazz.getName().replace(".", "/") + ".class"); + // TODO handle JAR case + try + { + Path path = new File(resource.toURI()).toPath(); + for (int i = 0; i < packageDepth + 1; ++i) + { + path = path.getParent(); + } + + return path.toFile(); + } + catch (URISyntaxException e) + { + throw new RuntimeException(String.format("Failed to get classpath element for %s", clazz), e); + } + } + + private int getPackageDepth(Class clazz) + { + final String publisherClassName = clazz.getName(); + int lastIndex = 0; + int count = 0; + + while (lastIndex != -1) + { + lastIndex = publisherClassName.indexOf(".", lastIndex); + + if (lastIndex != -1) + { + count++; + lastIndex += 1; + } + } + return count; + } +} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ConsoleRepositoryListener.java ---------------------------------------------------------------------- diff --git a/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ConsoleRepositoryListener.java b/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ConsoleRepositoryListener.java new file mode 100644 index 0000000..9725a41 --- /dev/null +++ b/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ConsoleRepositoryListener.java @@ -0,0 +1,128 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.apache.qpid.systests.end_to_end_conversion.dependency_resolution; + +import java.io.PrintStream; + +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; + +public class ConsoleRepositoryListener extends AbstractRepositoryListener +{ + + private PrintStream _out; + + public ConsoleRepositoryListener() + { + this(null); + } + + public ConsoleRepositoryListener(PrintStream out) + { + this._out = (out != null) ? out : System.out; + } + + public void artifactDeployed(RepositoryEvent event) + { + _out.println("Deployed " + event.getArtifact() + " to " + event.getRepository()); + } + + public void artifactDeploying(RepositoryEvent event) + { + _out.println("Deploying " + event.getArtifact() + " to " + event.getRepository()); + } + + public void artifactDescriptorInvalid(RepositoryEvent event) + { + _out.println("Invalid artifact descriptor for " + event.getArtifact() + ": " + + event.getException().getMessage()); + } + + public void artifactDescriptorMissing(RepositoryEvent event) + { + _out.println("Missing artifact descriptor for " + event.getArtifact()); + } + + public void artifactInstalled(RepositoryEvent event) + { + _out.println("Installed " + event.getArtifact() + " to " + event.getFile()); + } + + public void artifactInstalling(RepositoryEvent event) + { + _out.println("Installing " + event.getArtifact() + " to " + event.getFile()); + } + + public void artifactResolved(RepositoryEvent event) + { + _out.println("Resolved artifact " + event.getArtifact() + " from " + event.getRepository()); + } + + public void artifactDownloading(RepositoryEvent event) + { + _out.println("Downloading artifact " + event.getArtifact() + " from " + event.getRepository()); + } + + public void artifactDownloaded(RepositoryEvent event) + { + _out.println("Downloaded artifact " + event.getArtifact() + " from " + event.getRepository()); + } + + public void artifactResolving(RepositoryEvent event) + { + _out.println("Resolving artifact " + event.getArtifact()); + } + + public void metadataDeployed(RepositoryEvent event) + { + _out.println("Deployed " + event.getMetadata() + " to " + event.getRepository()); + } + + public void metadataDeploying(RepositoryEvent event) + { + _out.println("Deploying " + event.getMetadata() + " to " + event.getRepository()); + } + + public void metadataInstalled(RepositoryEvent event) + { + _out.println("Installed " + event.getMetadata() + " to " + event.getFile()); + } + + public void metadataInstalling(RepositoryEvent event) + { + _out.println("Installing " + event.getMetadata() + " to " + event.getFile()); + } + + public void metadataInvalid(RepositoryEvent event) + { + _out.println("Invalid metadata " + event.getMetadata()); + } + + public void metadataResolved(RepositoryEvent event) + { + _out.println("Resolved metadata " + event.getMetadata() + " from " + event.getRepository()); + } + + public void metadataResolving(RepositoryEvent event) + { + _out.println("Resolving metadata " + event.getMetadata() + " from " + event.getRepository()); + } +} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ConsoleTransferListener.java ---------------------------------------------------------------------- diff --git a/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ConsoleTransferListener.java b/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ConsoleTransferListener.java new file mode 100644 index 0000000..765974b --- /dev/null +++ b/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ConsoleTransferListener.java @@ -0,0 +1,175 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.apache.qpid.systests.end_to_end_conversion.dependency_resolution; + +import java.io.PrintStream; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.eclipse.aether.transfer.AbstractTransferListener; +import org.eclipse.aether.transfer.MetadataNotFoundException; +import org.eclipse.aether.transfer.TransferEvent; +import org.eclipse.aether.transfer.TransferResource; + +public class ConsoleTransferListener extends AbstractTransferListener +{ + + private PrintStream _out; + + private Map<TransferResource, Long> _downloads = new ConcurrentHashMap<>(); + + private int _lastLength; + + public ConsoleTransferListener() + { + this(null); + } + + public ConsoleTransferListener(PrintStream out) + { + this._out = (out != null) ? out : System.out; + } + + @Override + public void transferInitiated(TransferEvent event) + { + String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading"; + + _out.println(message + ": " + event.getResource().getRepositoryUrl() + event.getResource() + .getResourceName()); + } + + @Override + public void transferProgressed(TransferEvent event) + { + TransferResource resource = event.getResource(); + _downloads.put(resource, Long.valueOf(event.getTransferredBytes())); + + StringBuilder buffer = new StringBuilder(64); + + for (Map.Entry<TransferResource, Long> entry : _downloads.entrySet()) + { + long total = entry.getKey().getContentLength(); + long complete = entry.getValue().longValue(); + + buffer.append(getStatus(complete, total)).append(" "); + } + + int pad = _lastLength - buffer.length(); + _lastLength = buffer.length(); + pad(buffer, pad); + buffer.append('\r'); + + _out.print(buffer); + } + + private String getStatus(long complete, long total) + { + if (total >= 1024) + { + return toKB(complete) + "/" + toKB(total) + " KB "; + } + else if (total >= 0) + { + return complete + "/" + total + " B "; + } + else if (complete >= 1024) + { + return toKB(complete) + " KB "; + } + else + { + return complete + " B "; + } + } + + private void pad(StringBuilder buffer, int spaces) + { + String block = " "; + while (spaces > 0) + { + int n = Math.min(spaces, block.length()); + buffer.append(block, 0, n); + spaces -= n; + } + } + + @Override + public void transferSucceeded(TransferEvent event) + { + transferCompleted(event); + + TransferResource resource = event.getResource(); + long contentLength = event.getTransferredBytes(); + if (contentLength >= 0) + { + String type = (event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded"); + String len = contentLength >= 1024 ? toKB(contentLength) + " KB" : contentLength + " B"; + + String throughput = ""; + long duration = System.currentTimeMillis() - resource.getTransferStartTime(); + if (duration > 0) + { + long bytes = contentLength - resource.getResumeOffset(); + DecimalFormat format = new DecimalFormat("0.0", new DecimalFormatSymbols(Locale.ENGLISH)); + double kbPerSec = (bytes / 1024.0) / (duration / 1000.0); + throughput = " at " + format.format(kbPerSec) + " KB/sec"; + } + + _out.println(type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len + + throughput + ")"); + } + } + + @Override + public void transferFailed(TransferEvent event) + { + transferCompleted(event); + + if (!(event.getException() instanceof MetadataNotFoundException)) + { + event.getException().printStackTrace(_out); + } + } + + private void transferCompleted(TransferEvent event) + { + _downloads.remove(event.getResource()); + + StringBuilder buffer = new StringBuilder(64); + pad(buffer, _lastLength); + buffer.append('\r'); + _out.print(buffer); + } + + public void transferCorrupted(TransferEvent event) + { + event.getException().printStackTrace(_out); + } + + protected long toKB(long bytes) + { + return (bytes + 1023) / 1024; + } +} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ManualRepositorySystemFactory.java ---------------------------------------------------------------------- diff --git a/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ManualRepositorySystemFactory.java b/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ManualRepositorySystemFactory.java new file mode 100644 index 0000000..a488fac --- /dev/null +++ b/systests/end-to-end-conversion-tests/src/main/java/org/apache/qpid/systests/end_to_end_conversion/dependency_resolution/ManualRepositorySystemFactory.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.apache.qpid.systests.end_to_end_conversion.dependency_resolution; + +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory; +import org.eclipse.aether.impl.DefaultServiceLocator; +import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; +import org.eclipse.aether.spi.connector.transport.TransporterFactory; +import org.eclipse.aether.transport.file.FileTransporterFactory; +import org.eclipse.aether.transport.http.HttpTransporterFactory; + +public class ManualRepositorySystemFactory +{ + + public static RepositorySystem newRepositorySystem() + { + /* + * Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the + * prepopulated DefaultServiceLocator, we only need to register the repository connector and transporter + * factories. + */ + DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator(); + locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class); + locator.addService(TransporterFactory.class, FileTransporterFactory.class); + locator.addService(TransporterFactory.class, HttpTransporterFactory.class); + + locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() + { + @Override + public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) + { + exception.printStackTrace(); + } + }); + + return locator.getService(RepositorySystem.class); + } +} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/end-to-end-conversion-tests/src/main/resources/config-end-to-end-conversion-tests.json ---------------------------------------------------------------------- diff --git a/systests/end-to-end-conversion-tests/src/main/resources/config-end-to-end-conversion-tests.json b/systests/end-to-end-conversion-tests/src/main/resources/config-end-to-end-conversion-tests.json new file mode 100644 index 0000000..c9fe08e --- /dev/null +++ b/systests/end-to-end-conversion-tests/src/main/resources/config-end-to-end-conversion-tests.json @@ -0,0 +1,47 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +{ + "name" : "${broker.name}", + "modelVersion" : "7.0", + "authenticationproviders" : [ { + "name" : "anon", + "type" : "Anonymous" + } ], + "ports" : [ { + "name" : "ANONYMOUS_AMQP", + "type" : "AMQP", + "authenticationProvider" : "anon", + "port" : "0", + "virtualhostaliases" : [ { + "name" : "defaultAlias", + "type" : "defaultAlias", + "durable" : true + }, { + "name": "patternMatchingAlias", + "type": "patternMatchingAlias" + }, { + "name" : "nameAlias", + "type" : "nameAlias", + "durable" : true + } ] + } ], + "virtualhostnodes" : [] +} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/end-to-end-conversion-tests/src/main/resources/logback-test.xml ---------------------------------------------------------------------- diff --git a/systests/end-to-end-conversion-tests/src/main/resources/logback-test.xml b/systests/end-to-end-conversion-tests/src/main/resources/logback-test.xml new file mode 100644 index 0000000..fb5a387 --- /dev/null +++ b/systests/end-to-end-conversion-tests/src/main/resources/logback-test.xml @@ -0,0 +1,48 @@ +<?xml version="1.0"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + ~ + --> +<configuration debug="true"> + + <contextName>qpid-systests-end-to-end-conversion</contextName> + + <!-- Logging configuration used for this module. This is named + logback-test.xml in order that it is found in preference to the logback.xml + found in qpid-test-utils (which is used for other, non-systests, modules). --> + + <appender name="RootSiftAppender" class="ch.qos.logback.classic.sift.SiftingAppender"> + <discriminator class="org.apache.qpid.test.utils.LogbackPropertyValueDiscriminator"> + <Key>classQualifiedTestName</Key> + <DefaultValue>testrun</DefaultValue> + </discriminator> + <sift> + <appender name="FILE-${classQualifiedTestName}" class="ch.qos.logback.core.FileAppender"> + <File>${test.output.dir}${file.separator}TEST-${classQualifiedTestName}-${qpid.systests.end_to_end_conversion.executionId}.txt</File> + <Append>False</Append> + <encoder> + <pattern>%date %-5level [%thread] %logger{10} %msg%n</pattern> + </encoder> + </appender> + </sift> + </appender> + <root level="debug"> + <appender-ref ref="RootSiftAppender"/> + </root> + <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/> +</configuration> http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/end-to-end-conversion-tests/src/test/java/org/apache/qpid/systests/end_to_end_conversion/SimpleConversionTest.java ---------------------------------------------------------------------- diff --git a/systests/end-to-end-conversion-tests/src/test/java/org/apache/qpid/systests/end_to_end_conversion/SimpleConversionTest.java b/systests/end-to-end-conversion-tests/src/test/java/org/apache/qpid/systests/end_to_end_conversion/SimpleConversionTest.java new file mode 100644 index 0000000..79812f0 --- /dev/null +++ b/systests/end-to-end-conversion-tests/src/test/java/org/apache/qpid/systests/end_to_end_conversion/SimpleConversionTest.java @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.apache.qpid.systests.end_to_end_conversion; + +import static org.junit.Assert.fail; + +import java.util.HashMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import org.junit.Ignore; +import org.junit.Test; + +import org.apache.qpid.systests.end_to_end_conversion.client.VerificationException; + +public class SimpleConversionTest extends EndToEndConversionTestBase +{ + private static final long TEST_TIMEOUT = 30000L; + + @Test + public void textMessage() throws Exception + { + final JmsInstructions.MessageDescription messageDescription = new JmsInstructions.MessageDescription(); + messageDescription.setMessageType(JmsInstructions.MessageDescription.MessageType.TEXT_MESSAGE); + messageDescription.setContent("foobar"); + + performSimpleTest(messageDescription); + } + + @Test + public void bytesMessage() throws Exception + { + final JmsInstructions.MessageDescription messageDescription = new JmsInstructions.MessageDescription(); + messageDescription.setMessageType(JmsInstructions.MessageDescription.MessageType.BYTES_MESSAGE); + messageDescription.setContent(new byte[]{0x00, (byte) 0xFF, (byte) 0xc3}); + + performSimpleTest(messageDescription); + } + + @Test + public void mapMessage() throws Exception + { + final JmsInstructions.MessageDescription messageDescription = new JmsInstructions.MessageDescription(); + messageDescription.setMessageType(JmsInstructions.MessageDescription.MessageType.MAP_MESSAGE); + HashMap<String, Object> content = new HashMap<>(); + content.put("int", 42); + content.put("boolean", true); + content.put("string", "testString"); + messageDescription.setContent(content); + + performSimpleTest(messageDescription); + } + + @Test + public void correlationId() throws Exception + { + final String correlationId = "myCorrelationId"; + final JmsInstructions.MessageDescription messageDescription = new JmsInstructions.MessageDescription(); + messageDescription.setHeader(JmsInstructions.MessageDescription.MessageHeader.CORRELATION_ID, correlationId); + + performSimpleTest(messageDescription); + } + + @Ignore("QPID-7897") + @Test + public void correlationIdAsBytes() throws Exception + { + final byte[] correlationId = new byte[]{(byte) 0xFF, 0x00, (byte) 0xC3}; + final JmsInstructions.MessageDescription messageDescription = new JmsInstructions.MessageDescription(); + messageDescription.setHeader(JmsInstructions.MessageDescription.MessageHeader.CORRELATION_ID, correlationId); + + performSimpleTest(messageDescription); + } + + @Test + public void property() throws Exception + { + final JmsInstructions.MessageDescription messageDescription = new JmsInstructions.MessageDescription(); + messageDescription.setProperty("intProperty", 42); + messageDescription.setProperty("stringProperty", "foobar"); + messageDescription.setProperty("booleanProperty", true); + messageDescription.setProperty("doubleProperty", 37.5); + + performSimpleTest(messageDescription); + } + + public void performSimpleTest(final JmsInstructions.MessageDescription messageDescription) throws Exception + { + final ListenableFuture<?> publisherFuture = + runPublisher(JmsInstructionBuilder.publishSingleMessage(messageDescription)); + final ListenableFuture<?> subscriberFuture = + runSubscriber(JmsInstructionBuilder.receiveSingleMessage(messageDescription)); + try + { + Futures.allAsList(publisherFuture, subscriberFuture).get(TEST_TIMEOUT, TimeUnit.MILLISECONDS); + } + catch (ExecutionException e) + { + final Throwable cause = e.getCause(); + if (cause instanceof VerificationException) + { + throw new AssertionError("Client failed verification", cause); + } + else if (cause instanceof Exception) + { + throw ((Exception) cause); + } + else + { + throw e; + } + } + } +} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/pom.xml ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/pom.xml b/systests/protocol-tests-amqp-1-0/pom.xml index d90f967..a3108b5 100644 --- a/systests/protocol-tests-amqp-1-0/pom.xml +++ b/systests/protocol-tests-amqp-1-0/pom.xml @@ -55,6 +55,11 @@ <dependency> <groupId>org.apache.qpid</groupId> + <artifactId>qpid-systests-utils</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.qpid</groupId> <artifactId>qpid-broker-plugins-logging-logback</artifactId> </dependency> @@ -129,4 +134,18 @@ </dependency> </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <systemPropertyVariables> + <qpid.initialConfigurationLocation>classpath:config-protocol-tests.json</qpid.initialConfigurationLocation> + </systemPropertyVariables> + </configuration> + </plugin> + </plugins> + </build> + </project> http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdmin.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdmin.java b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdmin.java deleted file mode 100644 index 303cc28..0000000 --- a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdmin.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.qpid.tests.protocol.v1_0; - -import java.lang.reflect.Method; -import java.net.InetSocketAddress; - -import com.google.common.util.concurrent.ListenableFuture; - -import org.apache.qpid.server.plugin.Pluggable; - -public interface BrokerAdmin extends Pluggable -{ - String TEST_QUEUE_NAME = "testQueue"; - Long RESTART_TIMEOUT = Long.getLong("brokerAdmin.restart_timeout", 10000); - - void beforeTestClass(final Class testClass); - void beforeTestMethod(final Class testClass, final Method method); - void afterTestMethod(final Class testClass, final Method method); - void afterTestClass(final Class testClass); - - InetSocketAddress getBrokerAddress(PortType portType); - - void createQueue(String queueName); - void deleteQueue(String queueName); - void putMessageOnQueue(String queueName, String... messages); - int getQueueDepthMessages(String testQueueName); - - boolean supportsRestart(); - ListenableFuture<Void> restart(); - - boolean isSASLSupported(); - boolean isSASLMechanismSupported(String mechanismName); - boolean isWebSocketSupported(); - boolean isQueueDepthSupported(); - - String getValidUsername(); - String getValidPassword(); - - - - enum PortType - { - ANONYMOUS_AMQP, - ANONYMOUS_AMQPWS, - AMQP - } -} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdminFactory.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdminFactory.java b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdminFactory.java deleted file mode 100644 index 6ecc02f..0000000 --- a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/BrokerAdminFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.qpid.tests.protocol.v1_0; - -import java.util.Map; - -import org.apache.qpid.server.plugin.QpidServiceLoader; - -public class BrokerAdminFactory -{ - BrokerAdmin createInstance(String type) - { - Map<String, BrokerAdmin> adminFacades = new QpidServiceLoader().getInstancesByType(BrokerAdmin.class); - BrokerAdmin brokerAdmin = adminFacades.get(type); - if (brokerAdmin == null) - { - throw new RuntimeException(String.format("Could not find BrokerAdmin implementation of type '%s'", type)); - } - return brokerAdmin; - } -} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java deleted file mode 100644 index e4dd859..0000000 --- a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java +++ /dev/null @@ -1,506 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.tests.protocol.v1_0; - -import java.io.File; -import java.lang.reflect.Method; -import java.net.InetSocketAddress; -import java.nio.file.Files; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; - -import ch.qos.logback.classic.LoggerContext; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.apache.qpid.server.SystemLauncher; -import org.apache.qpid.server.SystemLauncherListener; -import org.apache.qpid.server.logging.logback.LogbackLoggingSystemLauncherListener; -import org.apache.qpid.server.message.MessageDestination; -import org.apache.qpid.server.model.ConfiguredObject; -import org.apache.qpid.server.model.Container; -import org.apache.qpid.server.model.IllegalStateTransitionException; -import org.apache.qpid.server.model.ManageableMessage; -import org.apache.qpid.server.model.NotFoundException; -import org.apache.qpid.server.model.Port; -import org.apache.qpid.server.model.Queue; -import org.apache.qpid.server.model.SystemConfig; -import org.apache.qpid.server.model.VirtualHostNode; -import org.apache.qpid.server.plugin.PluggableService; -import org.apache.qpid.server.store.MemoryConfigurationStore; -import org.apache.qpid.server.util.FileUtils; -import org.apache.qpid.server.virtualhost.QueueManagingVirtualHost; -import org.apache.qpid.server.virtualhostnode.JsonVirtualHostNode; -import org.apache.qpid.test.utils.LogbackPropertyValueDiscriminator; - -@SuppressWarnings("unused") -@PluggableService -public class EmbeddedBrokerPerClassAdminImpl implements BrokerAdmin -{ - private static final Logger LOGGER = LoggerFactory.getLogger(EmbeddedBrokerPerClassAdminImpl.class); - private final Map<String, Integer> _ports = new HashMap<>(); - private SystemLauncher _systemLauncher; - private Container<?> _broker; - private VirtualHostNode<?> _currentVirtualHostNode; - private String _currentWorkDirectory; - private boolean _isPersistentStore; - - @Override - public void beforeTestClass(final Class testClass) - { - setClassQualifiedTestName(testClass.getName()); - LOGGER.info("========================= starting broker for test class : " + testClass.getSimpleName()); - try - { - String timestamp = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date(System.currentTimeMillis())); - _currentWorkDirectory = Files.createTempDirectory(String.format("qpid-work-%s-%s-", timestamp, testClass.getSimpleName())).toString(); - - Map<String,String> context = new HashMap<>(); - context.put("qpid.work_dir", _currentWorkDirectory); - context.put("qpid.port.protocol_handshake_timeout", "1000000"); - - Map<String,Object> systemConfigAttributes = new HashMap<>(); - systemConfigAttributes.put(SystemConfig.INITIAL_CONFIGURATION_LOCATION, "classpath:config-protocol-tests.json"); - systemConfigAttributes.put(ConfiguredObject.CONTEXT, context); - systemConfigAttributes.put(ConfiguredObject.TYPE, System.getProperty("broker.config-store-type", "JSON")); - systemConfigAttributes.put(SystemConfig.STARTUP_LOGGED_TO_SYSTEM_OUT, Boolean.FALSE); - - if (Thread.getDefaultUncaughtExceptionHandler() == null) - { - Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler()); - } - - LOGGER.info("Starting internal broker (same JVM)"); - - List<SystemLauncherListener> systemLauncherListeners = new ArrayList<>(); - systemLauncherListeners.add(new LogbackLoggingSystemLauncherListener()); - systemLauncherListeners.add(new ShutdownLoggingSystemLauncherListener()); - systemLauncherListeners.add(new PortExtractingLauncherListener()); - _systemLauncher = new SystemLauncher(systemLauncherListeners.toArray(new SystemLauncherListener[systemLauncherListeners.size()])); - - _systemLauncher.startup(systemConfigAttributes); - } - catch (Exception e) - { - throw new RuntimeException("Failed to start broker for test class", e); - } - } - - @Override - public void beforeTestMethod(final Class testClass, final Method method) - { - LOGGER.info("========================= prepare test environment for test : " + testClass.getSimpleName() + "#" + method.getName()); - - final String virtualHostNodeName = testClass.getSimpleName() + "_" + method.getName(); - final String storeType = System.getProperty("virtualhostnode.type"); - _isPersistentStore = !"Memory".equals(storeType); - - String storeDir = null; - if (System.getProperty("profile", "").startsWith("java-dby-mem")) - { - storeDir = ":memory:"; - } - else if (!MemoryConfigurationStore.TYPE.equals(storeType)) - { - storeDir = "${qpid.work_dir}" + File.separator + virtualHostNodeName; - } - - String blueprint = System.getProperty("virtualhostnode.context.blueprint"); - - Map<String, Object> attributes = new HashMap<>(); - attributes.put(VirtualHostNode.NAME, virtualHostNodeName); - attributes.put(VirtualHostNode.TYPE, storeType); - attributes.put(VirtualHostNode.CONTEXT, Collections.singletonMap("virtualhostBlueprint", blueprint)); - attributes.put(VirtualHostNode.DEFAULT_VIRTUAL_HOST_NODE, true); - attributes.put(VirtualHostNode.VIRTUALHOST_INITIAL_CONFIGURATION, blueprint); - if (storeDir != null) - { - attributes.put(JsonVirtualHostNode.STORE_PATH, storeDir); - } - - _currentVirtualHostNode = _broker.createChild(VirtualHostNode.class, attributes); - - LOGGER.info("========================= executing test : " + testClass.getSimpleName() + "#" + method.getName()); - setClassQualifiedTestName(testClass.getName() + "." + method.getName()); - LOGGER.info("========================= start executing test : " + testClass.getSimpleName() + "#" + method.getName()); - } - - @Override - public void afterTestMethod(final Class testClass, final Method method) - { - LOGGER.info("========================= stop executing test : " + testClass.getSimpleName() + "#" + method.getName()); - setClassQualifiedTestName(testClass.getName()); - LOGGER.info("========================= cleaning up test environment for test : " + testClass.getSimpleName() + "#" + method.getName()); - if (Boolean.getBoolean("broker.clean.between.tests")) - { - _currentVirtualHostNode.delete(); - } - else - { - _currentVirtualHostNode.setAttributes(Collections.singletonMap(VirtualHostNode.DEFAULT_VIRTUAL_HOST_NODE, - false)); - } - setClassQualifiedTestName(testClass.getName()); - LOGGER.info("========================= cleaning done for test : " + testClass.getSimpleName() + "#" + method.getName()); - } - - @Override - public void afterTestClass(final Class testClass) - { - LOGGER.info("========================= stopping broker for test class: " + testClass.getSimpleName()); - _systemLauncher.shutdown(); - _ports.clear(); - if (Boolean.getBoolean("broker.clean.between.tests")) - { - FileUtils.delete(new File(_currentWorkDirectory), true); - } - LOGGER.info("========================= stopping broker done for test class : " + testClass.getSimpleName()); - setClassQualifiedTestName(null); - } - - @Override - public InetSocketAddress getBrokerAddress(final PortType portType) - { - Integer port = _ports.get(portType.name()); - if (port == null) - { - throw new IllegalStateException(String.format("Could not find port with name '%s' on the Broker", portType.name())); - } - return new InetSocketAddress(port); - } - - @Override - public void createQueue(final String queueName) - { - final Map<String, Object> attributes = new HashMap<>(); - attributes.put(Queue.NAME, queueName); - attributes.put(Queue.TYPE, "standard"); - _currentVirtualHostNode.getVirtualHost().createChild(Queue.class, attributes); - } - - @Override - public void deleteQueue(final String queueName) - { - getQueue(queueName).delete(); - } - - @Override - public void putMessageOnQueue(final String queueName, final String... messages) - { - for (String message : messages) - { - ((QueueManagingVirtualHost<?>) _currentVirtualHostNode.getVirtualHost()).publishMessage(new ManageableMessage() - { - @Override - public String getAddress() - { - return queueName; - } - - @Override - public boolean isPersistent() - { - return false; - } - - @Override - public Date getExpiration() - { - return null; - } - - @Override - public String getCorrelationId() - { - return null; - } - - @Override - public String getAppId() - { - return null; - } - - @Override - public String getMessageId() - { - return null; - } - - @Override - public String getMimeType() - { - return "text/plain"; - } - - @Override - public String getEncoding() - { - return null; - } - - @Override - public int getPriority() - { - return 0; - } - - @Override - public Date getNotValidBefore() - { - return null; - } - - @Override - public String getReplyTo() - { - return null; - } - - @Override - public Map<String, Object> getHeaders() - { - return null; - } - - @Override - public Object getContent() - { - return message; - } - - @Override - public String getContentTransferEncoding() - { - return null; - } - }); - } - - } - - @Override - public int getQueueDepthMessages(final String testQueueName) - { - Queue queue = _currentVirtualHostNode.getVirtualHost().getChildByName(Queue.class, testQueueName); - return queue.getQueueDepthMessages(); - } - - @Override - public boolean supportsRestart() - { - return _isPersistentStore; - } - - @Override - public ListenableFuture<Void> restart() - { - try - { - LOGGER.info("Stopping VirtualHostNode for restart"); - _currentVirtualHostNode.stop(); - LOGGER.info("Starting VirtualHostNode for restart"); - _currentVirtualHostNode.start(); - LOGGER.info("Restarting VirtualHostNode completed"); - } - catch (Exception e) - { - return Futures.immediateFailedFuture(e); - } - return Futures.immediateFuture(null); - } - - @Override - public boolean isSASLSupported() - { - return true; - } - - @Override - public boolean isSASLMechanismSupported(final String mechanismName) - { - return true; - } - - @Override - public boolean isWebSocketSupported() - { - return true; - } - - @Override - public boolean isQueueDepthSupported() - { - return true; - } - - @Override - public String getValidUsername() - { - return "guest"; - } - - @Override - public String getValidPassword() - { - return "guest"; - } - - @Override - public String getType() - { - return "EMBEDDED_BROKER_PER_CLASS"; - } - - private Queue getQueue(final String queueName) - { - Collection<Queue> queues = _currentVirtualHostNode.getVirtualHost().getChildren(Queue.class); - for (Queue queue : queues) - { - if (queue.getName().equals(queueName)) - { - return queue; - } - } - throw new NotFoundException(String.format("Queue '%s' not found", queueName)); - } - - private void setClassQualifiedTestName(final String name) - { - final LoggerContext loggerContext = ((ch.qos.logback.classic.Logger) LOGGER).getLoggerContext(); - loggerContext.putProperty(LogbackPropertyValueDiscriminator.CLASS_QUALIFIED_TEST_NAME, name); - } - - private class PortExtractingLauncherListener implements SystemLauncherListener - { - private SystemConfig<?> _systemConfig; - - @Override - public void beforeStartup() - { - - } - - @Override - public void errorOnStartup(final RuntimeException e) - { - - } - - @Override - public void afterStartup() - { - - if (_systemConfig == null) - { - throw new IllegalStateException("System config is required"); - } - - _broker = _systemConfig.getContainer(); - Collection<Port> ports = _broker.getChildren(Port.class); - for (Port port : ports) - { - _ports.put(port.getName(), port.getBoundPort()); - } - } - - @Override - public void onContainerResolve(final SystemConfig<?> systemConfig) - { - _systemConfig = systemConfig; - } - - @Override - public void onContainerClose(final SystemConfig<?> systemConfig) - { - - } - - @Override - public void onShutdown(final int exitCode) - { - - } - - @Override - public void exceptionOnShutdown(final Exception e) - { - - } - } - - - private static class UncaughtExceptionHandler implements Thread.UncaughtExceptionHandler - { - private final AtomicInteger _count = new AtomicInteger(0); - - @Override - public void uncaughtException(final Thread t, final Throwable e) - { - System.err.print("Thread terminated due to uncaught exception"); - e.printStackTrace(); - - LOGGER.error("Uncaught exception from thread {}", t.getName(), e); - _count.getAndIncrement(); - } - - public int getAndResetCount() - { - int count; - do - { - count = _count.get(); - } - while (!_count.compareAndSet(count, 0)); - return count; - } - } - - private class ShutdownLoggingSystemLauncherListener extends SystemLauncherListener.DefaultSystemLauncherListener - { - @Override - public void onShutdown(final int exitCode) - { - _systemLauncher = null; - } - - @Override - public void exceptionOnShutdown(final Exception e) - { - if (e instanceof IllegalStateException - || e instanceof IllegalStateTransitionException) - { - System.out.println( - "IllegalStateException occurred on broker shutdown in test "); - } - } - } - -} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ExternalQpidBrokerAdminImpl.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ExternalQpidBrokerAdminImpl.java b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ExternalQpidBrokerAdminImpl.java deleted file mode 100644 index a580333..0000000 --- a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ExternalQpidBrokerAdminImpl.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.qpid.tests.protocol.v1_0; - -import java.lang.reflect.Method; -import java.net.InetSocketAddress; - -import com.google.common.util.concurrent.ListenableFuture; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.apache.qpid.server.plugin.PluggableService; - -@SuppressWarnings("unused") -@PluggableService -public class ExternalQpidBrokerAdminImpl implements BrokerAdmin -{ - private static final Logger LOGGER = LoggerFactory.getLogger(ExternalQpidBrokerAdminImpl.class); - - @Override - public void beforeTestClass(final Class testClass) - { - LOGGER.debug("beforeTestClass"); - } - - @Override - public void beforeTestMethod(final Class testClass, final Method method) - { - LOGGER.debug("beforeTestMethod"); - } - - @Override - public void afterTestMethod(final Class testClass, final Method method) - { - LOGGER.debug("afterTestMethod"); - } - - @Override - public void afterTestClass(final Class testClass) - { - LOGGER.debug("afterTestClass"); - } - - @Override - public InetSocketAddress getBrokerAddress(final PortType portType) - { - Integer port; - switch (portType) - { - case AMQP: - port = Integer.getInteger("qpid.tests.protocol.broker.external.port.standard"); - break; - case ANONYMOUS_AMQP: - port = Integer.getInteger("qpid.tests.protocol.broker.external.port.anonymous"); - break; - default: - throw new IllegalArgumentException(String.format("Unknown port type '%s'", portType)); - } - return new InetSocketAddress(port); - } - - @Override - public void createQueue(final String queueName) - { - LOGGER.debug(String.format("creation of queue '%s' requested", queueName)); - } - - @Override - public void deleteQueue(final String queueName) - { - LOGGER.debug(String.format("deletion of queue '%s' requested", queueName)); - } - - @Override - public void putMessageOnQueue(final String queueName, final String... messages) - { - LOGGER.debug(String.format("puting of %d messages on queue '%s' requested", messages.length, queueName)); - } - - @Override - public int getQueueDepthMessages(final String testQueueName) - { - throw new UnsupportedOperationException(); - } - - @Override - public boolean supportsRestart() - { - return false; - } - - @Override - public ListenableFuture<Void> restart() - { - throw new UnsupportedOperationException("External Qpid Broker does not support restart."); - } - - @Override - public boolean isSASLSupported() - { - return true; - } - - @Override - public boolean isWebSocketSupported() - { - return true; - } - - @Override - public boolean isQueueDepthSupported() - { - return false; - } - - @Override - public boolean isSASLMechanismSupported(final String mechanismName) - { - return true; - } - - @Override - public String getValidUsername() - { - return "guest"; - } - - @Override - public String getValidPassword() - { - return "guest"; - } - - @Override - public String getType() - { - return "EXTERNAL_BROKER"; - } -} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ProtocolTestBase.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ProtocolTestBase.java b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ProtocolTestBase.java deleted file mode 100644 index 846bed3..0000000 --- a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/ProtocolTestBase.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.qpid.tests.protocol.v1_0; - -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@RunWith(QpidTestRunner.class) -public abstract class ProtocolTestBase -{ - private static final Logger LOGGER = LoggerFactory.getLogger(ProtocolTestBase.class); - - private BrokerAdmin _brokerAdmin; - - public void init(final BrokerAdmin brokerAdmin) - { - _brokerAdmin = brokerAdmin; - } - - public BrokerAdmin getBrokerAdmin() - { - return _brokerAdmin; - } -} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/QpidTestRunner.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/QpidTestRunner.java b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/QpidTestRunner.java deleted file mode 100644 index 740bf32..0000000 --- a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/QpidTestRunner.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.qpid.tests.protocol.v1_0; - -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.BlockJUnit4ClassRunner; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.InitializationError; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class QpidTestRunner extends BlockJUnit4ClassRunner -{ - private final BrokerAdmin _brokerAdmin; - private final Class _testClass; - - public QpidTestRunner(final Class<?> klass) throws InitializationError - { - super(klass); - _testClass = klass; - _brokerAdmin = (new BrokerAdminFactory()).createInstance("EMBEDDED_BROKER_PER_CLASS"); - } - - @Override - protected Object createTest() throws Exception - { - Object test = super.createTest(); - ProtocolTestBase qpidTest = ((ProtocolTestBase) test); - qpidTest.init(_brokerAdmin); - return test; - } - - @Override - public void run(final RunNotifier notifier) - { - _brokerAdmin.beforeTestClass(_testClass); - try - { - super.run(notifier); - } - finally - { - _brokerAdmin.afterTestClass(_testClass); - } - } - - @Override - protected void runChild(final FrameworkMethod method, final RunNotifier notifier) - { - _brokerAdmin.beforeTestMethod(_testClass, method.getMethod()); - try - { - super.runChild(method, notifier); - } - finally - { - _brokerAdmin.afterTestMethod(_testClass, method.getMethod()); - } - } -} http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TemporaryDestinationTest.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TemporaryDestinationTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TemporaryDestinationTest.java index 1a1c8bf..817be05 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TemporaryDestinationTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TemporaryDestinationTest.java @@ -40,14 +40,14 @@ import org.apache.qpid.server.protocol.v1_0.type.transport.Begin; import org.apache.qpid.server.protocol.v1_0.type.transport.Flow; import org.apache.qpid.server.protocol.v1_0.type.transport.Open; import org.apache.qpid.server.protocol.v1_0.type.transport.Role; -import org.apache.qpid.tests.protocol.v1_0.BrokerAdmin; +import org.apache.qpid.tests.utils.BrokerAdmin; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; import org.apache.qpid.tests.protocol.v1_0.Interaction; -import org.apache.qpid.tests.protocol.v1_0.ProtocolTestBase; +import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase; import org.apache.qpid.tests.protocol.v1_0.SpecificationTest; import org.apache.qpid.tests.protocol.v1_0.Utils; -public class TemporaryDestinationTest extends ProtocolTestBase +public class TemporaryDestinationTest extends BrokerAdminUsingTestBase { private InetSocketAddress _brokerAddress; http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicy.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicy.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicy.java index 83303ad..4bee689 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicy.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicy.java @@ -45,12 +45,12 @@ import org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnect import org.apache.qpid.server.protocol.v1_0.type.transport.AmqpError; import org.apache.qpid.server.protocol.v1_0.type.transport.Close; import org.apache.qpid.server.protocol.v1_0.type.transport.Open; -import org.apache.qpid.tests.protocol.v1_0.BrokerAdmin; +import org.apache.qpid.tests.utils.BrokerAdmin; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; import org.apache.qpid.tests.protocol.v1_0.Interaction; -import org.apache.qpid.tests.protocol.v1_0.ProtocolTestBase; +import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase; -public class CloseExistingPolicy extends ProtocolTestBase +public class CloseExistingPolicy extends BrokerAdminUsingTestBase { private InetSocketAddress _brokerAddress; http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/MixedPolicy.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/MixedPolicy.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/MixedPolicy.java index d11e2fc..0c9ce9f 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/MixedPolicy.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/MixedPolicy.java @@ -33,12 +33,12 @@ import org.junit.Test; import org.apache.qpid.server.protocol.v1_0.type.transport.Close; import org.apache.qpid.server.protocol.v1_0.type.transport.Open; -import org.apache.qpid.tests.protocol.v1_0.BrokerAdmin; +import org.apache.qpid.tests.utils.BrokerAdmin; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; import org.apache.qpid.tests.protocol.v1_0.Interaction; -import org.apache.qpid.tests.protocol.v1_0.ProtocolTestBase; +import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase; -public class MixedPolicy extends ProtocolTestBase +public class MixedPolicy extends BrokerAdminUsingTestBase { private InetSocketAddress _brokerAddress; http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicy.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicy.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicy.java index 404e067..dea12a3 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicy.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicy.java @@ -46,12 +46,12 @@ import org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnect import org.apache.qpid.server.protocol.v1_0.type.transport.AmqpError; import org.apache.qpid.server.protocol.v1_0.type.transport.Close; import org.apache.qpid.server.protocol.v1_0.type.transport.Open; -import org.apache.qpid.tests.protocol.v1_0.BrokerAdmin; +import org.apache.qpid.tests.utils.BrokerAdmin; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; import org.apache.qpid.tests.protocol.v1_0.Interaction; -import org.apache.qpid.tests.protocol.v1_0.ProtocolTestBase; +import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase; -public class RefuseConnectionPolicy extends ProtocolTestBase +public class RefuseConnectionPolicy extends BrokerAdminUsingTestBase { private InetSocketAddress _brokerAddress; http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/websocket/WebSocketTest.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/websocket/WebSocketTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/websocket/WebSocketTest.java index 41b2dc3..a39b1b3 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/websocket/WebSocketTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/websocket/WebSocketTest.java @@ -39,13 +39,12 @@ import org.junit.Test; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.UnsignedShort; import org.apache.qpid.server.protocol.v1_0.type.transport.Open; -import org.apache.qpid.tests.protocol.v1_0.BrokerAdmin; +import org.apache.qpid.tests.utils.BrokerAdmin; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; -import org.apache.qpid.tests.protocol.v1_0.HeaderResponse; -import org.apache.qpid.tests.protocol.v1_0.ProtocolTestBase; +import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase; import org.apache.qpid.tests.protocol.v1_0.SpecificationTest; -public class WebSocketTest extends ProtocolTestBase +public class WebSocketTest extends BrokerAdminUsingTestBase { public static final byte[] AMQP_HEADER = "AMQP\0\1\0\0".getBytes(StandardCharsets.UTF_8); http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/DeleteOnCloseTest.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/DeleteOnCloseTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/DeleteOnCloseTest.java index 6327051..6ba9058 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/DeleteOnCloseTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/DeleteOnCloseTest.java @@ -44,14 +44,14 @@ import org.apache.qpid.server.protocol.v1_0.type.transport.Detach; import org.apache.qpid.server.protocol.v1_0.type.transport.Flow; import org.apache.qpid.server.protocol.v1_0.type.transport.Open; import org.apache.qpid.server.protocol.v1_0.type.transport.Role; -import org.apache.qpid.tests.protocol.v1_0.BrokerAdmin; +import org.apache.qpid.tests.utils.BrokerAdmin; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; import org.apache.qpid.tests.protocol.v1_0.Interaction; -import org.apache.qpid.tests.protocol.v1_0.ProtocolTestBase; +import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase; import org.apache.qpid.tests.protocol.v1_0.SpecificationTest; import org.apache.qpid.tests.protocol.v1_0.Utils; -public class DeleteOnCloseTest extends ProtocolTestBase +public class DeleteOnCloseTest extends BrokerAdminUsingTestBase { private InetSocketAddress _brokerAddress; http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MessageFormat.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MessageFormat.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MessageFormat.java index ea7d52a..4f3491f 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MessageFormat.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MessageFormat.java @@ -43,13 +43,13 @@ import org.apache.qpid.server.protocol.v1_0.type.transport.Error; import org.apache.qpid.server.protocol.v1_0.type.transport.Flow; import org.apache.qpid.server.protocol.v1_0.type.transport.Open; import org.apache.qpid.server.protocol.v1_0.type.transport.Role; -import org.apache.qpid.tests.protocol.v1_0.BrokerAdmin; +import org.apache.qpid.tests.utils.BrokerAdmin; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; -import org.apache.qpid.tests.protocol.v1_0.ProtocolTestBase; +import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase; import org.apache.qpid.tests.protocol.v1_0.Response; import org.apache.qpid.tests.protocol.v1_0.SpecificationTest; -public class MessageFormat extends ProtocolTestBase +public class MessageFormat extends BrokerAdminUsingTestBase { private InetSocketAddress _brokerAddress; http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MultiTransferTest.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MultiTransferTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MultiTransferTest.java index 1c09bb6..5c7a7f5 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MultiTransferTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MultiTransferTest.java @@ -51,15 +51,15 @@ import org.apache.qpid.server.protocol.v1_0.type.transport.Flow; import org.apache.qpid.server.protocol.v1_0.type.transport.Open; import org.apache.qpid.server.protocol.v1_0.type.transport.ReceiverSettleMode; import org.apache.qpid.server.protocol.v1_0.type.transport.Role; -import org.apache.qpid.tests.protocol.v1_0.BrokerAdmin; +import org.apache.qpid.tests.utils.BrokerAdmin; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; import org.apache.qpid.tests.protocol.v1_0.Interaction; -import org.apache.qpid.tests.protocol.v1_0.ProtocolTestBase; +import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase; import org.apache.qpid.tests.protocol.v1_0.Response; import org.apache.qpid.tests.protocol.v1_0.SpecificationTest; import org.apache.qpid.tests.protocol.v1_0.Utils; -public class MultiTransferTest extends ProtocolTestBase +public class MultiTransferTest extends BrokerAdminUsingTestBase { private InetSocketAddress _brokerAddress; private String _originalMmsMessageStorePersistence; http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java index 1bfe7c0..fdebd11 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java @@ -69,16 +69,16 @@ import org.apache.qpid.server.protocol.v1_0.type.transport.ReceiverSettleMode; import org.apache.qpid.server.protocol.v1_0.type.transport.Role; import org.apache.qpid.server.protocol.v1_0.type.transport.SenderSettleMode; import org.apache.qpid.server.protocol.v1_0.type.transport.Transfer; -import org.apache.qpid.tests.protocol.v1_0.BrokerAdmin; +import org.apache.qpid.tests.utils.BrokerAdmin; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; import org.apache.qpid.tests.protocol.v1_0.Interaction; import org.apache.qpid.tests.protocol.v1_0.MessageDecoder; import org.apache.qpid.tests.protocol.v1_0.MessageEncoder; -import org.apache.qpid.tests.protocol.v1_0.ProtocolTestBase; +import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase; import org.apache.qpid.tests.protocol.v1_0.Response; import org.apache.qpid.tests.protocol.v1_0.SpecificationTest; -public class TransferTest extends ProtocolTestBase +public class TransferTest extends BrokerAdminUsingTestBase { private static final String TEST_MESSAGE_DATA = "foo"; private InetSocketAddress _brokerAddress; http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a7e4a716/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/DischargeTest.java ---------------------------------------------------------------------- diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/DischargeTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/DischargeTest.java index f63d85e..d1a47db 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/DischargeTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/DischargeTest.java @@ -49,13 +49,13 @@ import org.apache.qpid.server.protocol.v1_0.type.transport.Error; import org.apache.qpid.server.protocol.v1_0.type.transport.Flow; import org.apache.qpid.server.protocol.v1_0.type.transport.Open; import org.apache.qpid.server.protocol.v1_0.type.transport.Role; -import org.apache.qpid.tests.protocol.v1_0.BrokerAdmin; +import org.apache.qpid.tests.utils.BrokerAdmin; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; import org.apache.qpid.tests.protocol.v1_0.Interaction; -import org.apache.qpid.tests.protocol.v1_0.ProtocolTestBase; +import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase; import org.apache.qpid.tests.protocol.v1_0.SpecificationTest; -public class DischargeTest extends ProtocolTestBase +public class DischargeTest extends BrokerAdminUsingTestBase { private InetSocketAddress _brokerAddress; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org