Repository: activemq Updated Branches: refs/heads/master 8a28c0655 -> 4b3f07e90
https://issues.apache.org/jira/browse/AMQ-6441 https://issues.apache.org/jira/browse/AMQ-6526 Adding missing license headers Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/4b3f07e9 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/4b3f07e9 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/4b3f07e9 Branch: refs/heads/master Commit: 4b3f07e90ea497164aaf9cc00591e8e0f868f83b Parents: 8a28c06 Author: Christopher L. Shannon (cshannon) <[email protected]> Authored: Wed Dec 7 13:27:01 2016 -0500 Committer: Christopher L. Shannon (cshannon) <[email protected]> Committed: Wed Dec 7 13:32:18 2016 -0500 ---------------------------------------------------------------------- .../stomp/StompNIOSSLLargeMessageTest.java | 35 +++++++++++++++----- .../org/apache/activemq/util/LargeFile.java | 26 ++++++++++++--- 2 files changed, 47 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/4b3f07e9/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompNIOSSLLargeMessageTest.java ---------------------------------------------------------------------- diff --git a/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompNIOSSLLargeMessageTest.java b/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompNIOSSLLargeMessageTest.java index d600728..1cfbc38 100644 --- a/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompNIOSSLLargeMessageTest.java +++ b/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompNIOSSLLargeMessageTest.java @@ -1,3 +1,19 @@ +/** + * 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.activemq.transport.stomp; import static org.junit.Assert.*; @@ -39,6 +55,7 @@ public class StompNIOSSLLargeMessageTest extends StompTestSupport { // custom Log4J appender so we can filter the logging output in this test. protected Appender appender = new DefaultTestAppender() { //@Override + @Override public void doAppend(org.apache.log4j.spi.LoggingEvent event) { if (event.getMessage().toString().contains("<Unknown>") && event.getMessage().toString().contains("The maximum data length was exceeded")) { @@ -93,13 +110,13 @@ public class StompNIOSSLLargeMessageTest extends StompTestSupport { * Sends a Stomp message larger than maxDataLength bytes. * Expects to receive an exception from the broker. * The broker will throw an Stomp ProtocolException of type - * "Exception occurred processing: SEND -> - * org.apache.activemq.transport.stomp.ProtocolException: + * "Exception occurred processing: SEND -> + * org.apache.activemq.transport.stomp.ProtocolException: * The maximum data length was exceeded" - * - * Before bug AMQ-6526 this exception would contain \<Unkown\> for the + * + * Before bug AMQ-6526 this exception would contain \<Unkown\> for the * operation name. With the fix it should print the Stomp operation. - * + * * @throws Exception */ @Test(timeout = 6000000) @@ -130,9 +147,9 @@ public class StompNIOSSLLargeMessageTest extends StompTestSupport { /** - * Creates a large byte buffer and fills it with char 'X' except for the + * Creates a large byte buffer and fills it with char 'X' except for the * last byte, it gets value 0x0 assigned. - * + * * @param size - the size of the array to be created. * @return */ @@ -141,9 +158,9 @@ public class StompNIOSSLLargeMessageTest extends StompTestSupport { for (int i=0; i<size; i++) { buffer[i] = (char) 'X'; } - //insert trailing 0x0 + //insert trailing 0x0 buffer[size-1] = 0; - LOG.info("Created byte buffer of size {} starting with content {}", + LOG.info("Created byte buffer of size {} starting with content {}", size, new String(buffer,0,20)); return buffer; http://git-wip-us.apache.org/repos/asf/activemq/blob/4b3f07e9/activemq-unit-tests/src/test/java/org/apache/activemq/util/LargeFile.java ---------------------------------------------------------------------- diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/util/LargeFile.java b/activemq-unit-tests/src/test/java/org/apache/activemq/util/LargeFile.java index 5328f1d..90ab821 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/util/LargeFile.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/util/LargeFile.java @@ -1,23 +1,39 @@ +/** + * 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.activemq.util; import java.io.File; /** * @author wcrowell - * + * * LargeFile is used to simulate a large file system (e.g. exabytes in size). - * The getTotalSpace() method is intentionally set to exceed the largest + * The getTotalSpace() method is intentionally set to exceed the largest * value of a primitive long which is 9,223,372,036,854,775,807. A negative * number will be returned when getTotalSpace() is called. This class is for - * test purposes only. Using a mocking framework to mock the behavior of + * test purposes only. Using a mocking framework to mock the behavior of * java.io.File was a lot of work. - * + * */ public class LargeFile extends File { public LargeFile(File parent, String child) { super(parent, child); } - + @Override public long getTotalSpace() { return Long.MAX_VALUE + 4193L;
