INT-3154/INT-3137 JavaDoc Formatting
INT-3154 Use SPR Java7 stylesheet to put a box around `<pre class="code"/>` code. Update `<pre/>` tags to include class="code". INT-3137 Remove NOTICE from `JdbcChannelMessageStore`. JIRA: https://jira.springsource.org/browse/INT-3137 https://jira.springsource.org/browse/INT-3154
This commit is contained in:
committed by
Artem Bilan
parent
87988b5032
commit
970852741d
@@ -641,6 +641,7 @@ task api(type: Javadoc) {
|
||||
options.author = true
|
||||
options.header = rootProject.description
|
||||
options.overview = 'src/api/overview.html'
|
||||
options.stylesheetFile = file("src/api/stylesheet.css")
|
||||
source subprojects.collect { project ->
|
||||
project.sourceSets.main.allJava
|
||||
}
|
||||
|
||||
@@ -41,11 +41,11 @@ import org.apache.commons.logging.LogFactory;
|
||||
* IMPORTANT: MessageHeaders are immutable. Any mutating operation (e.g., put(..), putAll(..) etc.)
|
||||
* will result in {@link UnsupportedOperationException}
|
||||
* To create MessageHeaders instance use fluent MessageBuilder API
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* MessageBuilder.withPayload("foo").setHeader("key1", "value1").setHeader("key2", "value2");
|
||||
* </pre>
|
||||
* or create an instance of GenericMessage passing payload as {@link Object} and headers as a regular {@link Map}
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* Map headers = new HashMap();
|
||||
* headers.put("key1", "value1");
|
||||
* headers.put("key2", "value2");
|
||||
|
||||
@@ -52,13 +52,15 @@ import org.springframework.util.Assert;
|
||||
* the configuration by removing channels that can be created implicitly.
|
||||
* <p>
|
||||
*
|
||||
* <pre>
|
||||
* <chain>
|
||||
* <filter ref="someFilter"/>
|
||||
* <bean class="SomeMessageHandlerImplementation"/>
|
||||
* <transformer ref="someTransformer"/>
|
||||
* <aggregator ... />
|
||||
* </chain>
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* <chain>
|
||||
* <filter ref="someFilter"/>
|
||||
* <bean class="SomeMessageHandlerImplementation"/>
|
||||
* <transformer ref="someTransformer"/>
|
||||
* <aggregator ... />
|
||||
* </chain>
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Mark Fisher
|
||||
|
||||
@@ -27,11 +27,13 @@ import org.springframework.integration.core.MessageSelector;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* <recipient-list-router id="simpleRouter" input-channel="routingChannelA">
|
||||
* <recipient channel="channel1"/>
|
||||
* <recipient channel="channel2"/>
|
||||
* </recipient-list-router>
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* <recipient-list-router id="simpleRouter" input-channel="routingChannelA">
|
||||
* <recipient channel="channel1"/>
|
||||
* <recipient channel="channel2"/>
|
||||
* </recipient-list-router>
|
||||
* }
|
||||
* </pre>
|
||||
* <p>
|
||||
* A Message Router that sends Messages to a list of recipient channels. The
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.LinkedCaseInsensitiveMap;
|
||||
* {@link SqlParameterSourceFactory} abstraction, the default implementation of which wraps the message so that its bean
|
||||
* properties can be referred to by name in the query string E.g.
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* INSERT INTO FOOS (MESSAGE_ID, PAYLOAD) VALUES (:headers[id], :payload)
|
||||
* </pre>
|
||||
*
|
||||
@@ -101,6 +101,7 @@ public class JdbcMessageHandler extends AbstractMessageHandler {
|
||||
/**
|
||||
* Executes the update, passing the message into the {@link SqlParameterSourceFactory}.
|
||||
*/
|
||||
@Override
|
||||
protected void handleMessageInternal(Message<?> message) throws MessageRejectedException, MessageHandlingException,
|
||||
MessageDeliveryException {
|
||||
List<? extends Map<String, Object>> keys = executeUpdateQuery(message, keysGenerated);
|
||||
|
||||
@@ -76,12 +76,6 @@ import org.springframework.util.StringUtils;
|
||||
* This message store shall be used for message channels only.
|
||||
* </p>
|
||||
* <p>
|
||||
* <strong>NOTICE</strong>: This implementation may change for Spring Integration
|
||||
* 3.0. It is provided for use-cases where the current {@link JdbcMessageStore}
|
||||
* is not delivering the desired performance characteristics.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* As such, the {@link JdbcChannelMessageStore} uses database specific SQL queries.
|
||||
* </p>
|
||||
* <p>
|
||||
@@ -89,8 +83,8 @@ import org.springframework.util.StringUtils;
|
||||
* database table only. The SQL scripts to create the necessary table are packaged
|
||||
* under <code>org/springframework/integration/jdbc/messagestore/channel/schema-*.sql</code>,
|
||||
* where <code>*</code> denotes the target database type.
|
||||
* </p
|
||||
* >
|
||||
* </p>
|
||||
*
|
||||
* @author Gunnar Hillert
|
||||
* @author Artem Bilan
|
||||
* @since 2.2
|
||||
@@ -331,7 +325,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
* <p>For this to work, you must setup the corresponding
|
||||
* {@link TransactionSynchronizationFactory}:</p>
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* <int:transaction-synchronization-factory id="syncFactory">
|
||||
* <int:after-commit expression="@jdbcChannelMessageStore.removeFromIdCache(headers.id.toString())" />
|
||||
@@ -343,7 +337,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
* This {@link TransactionSynchronizationFactory} is then referenced in the
|
||||
* transaction configuration of the poller:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* <int:poller fixed-delay="300" receive-timeout="500"
|
||||
* max-messages-per-poll="1" task-executor="pool">
|
||||
|
||||
@@ -15,17 +15,18 @@
|
||||
*/
|
||||
package org.springframework.integration.test.matcher;
|
||||
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Factory;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.junit.Assert;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageHeaders;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Factory;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageHeaders;
|
||||
|
||||
/**
|
||||
* Are the {@link MessageHeaders} of a {@link Message} containing any entry
|
||||
@@ -35,30 +36,34 @@ import static org.hamcrest.CoreMatchers.is;
|
||||
* entry:
|
||||
* <p>
|
||||
*
|
||||
* <pre>
|
||||
* ANY_HEADER_KEY = "foo";
|
||||
* ANY_HEADER_VALUE = "bar";
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* ANY_HEADER_KEY = "foo";
|
||||
* ANY_HEADER_VALUE = "bar";
|
||||
* assertThat(message, hasEntry(ANY_HEADER_KEY, ANY_HEADER_VALUE));
|
||||
* assertThat(message, hasEntry(ANY_HEADER_KEY, is(String.class)));
|
||||
* assertThat(message, hasEntry(ANY_HEADER_KEY, notNullValue()));
|
||||
* assertThat(message, hasEntry(ANY_HEADER_KEY, is(ANY_HEADER_VALUE)));
|
||||
* }
|
||||
* </pre>
|
||||
* <p>
|
||||
* For multiple entries to match all:
|
||||
* <p>
|
||||
* <pre>
|
||||
* Map<String, Object> expectedInHeaderMap = new HashMap<String, Object>();
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* Map<String, Object> expectedInHeaderMap = new HashMap<String, Object>();
|
||||
* expectedInHeaderMap.put(ANY_HEADER_KEY, ANY_HEADER_VALUE);
|
||||
* expectedInHeaderMap.put(OTHER_HEADER_KEY, is(OTHER_HEADER_VALUE));
|
||||
* assertThat(message, HeaderMatcher.hasAllEntries(expectedInHeaderMap));
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* <p>
|
||||
* For a single key:
|
||||
* <p>
|
||||
*
|
||||
* <pre>
|
||||
* ANY_HEADER_KEY = "foo";
|
||||
* <pre class="code">
|
||||
* ANY_HEADER_KEY = "foo";
|
||||
* assertThat(message, HeaderMatcher.hasKey(ANY_HEADER_KEY));
|
||||
* </pre>
|
||||
*
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.hamcrest.core.IsEqual;
|
||||
* It is possible to match a single entry by value or matcher like this:
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* assertThat(map, hasEntry(SOME_KEY, is(SOME_VALUE)));
|
||||
* assertThat(map, hasEntry(SOME_KEY, is(String.class)));
|
||||
* assertThat(map, hasEntry(SOME_KEY, notNullValue()));
|
||||
@@ -43,16 +43,18 @@ import org.hamcrest.core.IsEqual;
|
||||
* It's also possible to match multiple entries in a map:
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
* Map<String, Object> expectedInMap = new HashMap<String, Object>();
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* Map<String, Object> expectedInMap = new HashMap<String, Object>();
|
||||
* expectedInMap.put(SOME_KEY, SOME_VALUE);
|
||||
* expectedInMap.put(OTHER_KEY, is(OTHER_VALUE));
|
||||
* assertThat(map, hasAllEntries(expectedInMap));
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* <p>If you only need to verify the existence of a key:</p>
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* assertThat(map, hasKey(SOME_KEY));
|
||||
* </pre>
|
||||
*
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.Map;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import org.springframework.integration.Message;
|
||||
|
||||
/**
|
||||
@@ -38,22 +39,26 @@ import org.springframework.integration.Message;
|
||||
* With {@link Mockito#verify(Object)}:
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* @Mock
|
||||
* MessageHandler handler;
|
||||
* ...
|
||||
* handler.handleMessage(message);
|
||||
* verify(handler).handleMessage(messageWithPayload(SOME_PAYLOAD));
|
||||
* verify(handler).handleMessage(messageWithPayload(is(SOME_CLASS)));
|
||||
* }
|
||||
* </pre>
|
||||
* <p>
|
||||
* With {@link Mockito#when(Object)}:
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* ...
|
||||
* when(channel.send(messageWithPayload(SOME_PAYLOAD))).thenReturn(true);
|
||||
* assertThat(channel.send(message), is(true));
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Alex Peters
|
||||
@@ -64,12 +69,12 @@ public class MockitoMessageMatchers {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> Message<T> messageWithPayload(Matcher<T> payloadMatcher) {
|
||||
return (Message<T>) argThat(hasPayload(payloadMatcher));
|
||||
return argThat(hasPayload(payloadMatcher));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> Message<T> messageWithPayload(T payload) {
|
||||
return (Message<T>) argThat(hasPayload(payload));
|
||||
return argThat(hasPayload(payload));
|
||||
}
|
||||
|
||||
public static Message<?> messageWithHeaderEntry(String key, Object value) {
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.hamcrest.Factory;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.core.IsEqual;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.springframework.integration.Message;
|
||||
|
||||
/**
|
||||
@@ -29,17 +30,20 @@ import org.springframework.integration.Message;
|
||||
* A Junit example using {@link Assert#assertThat(Object, Matcher)} could look
|
||||
* like this to test a payload value:
|
||||
* <p>
|
||||
* <pre>
|
||||
* ANY_PAYLOAD = new BigDecimal("1.123");
|
||||
* Message<BigDecimal message = MessageBuilder.withPayload(ANY_PAYLOAD).build();
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* ANY_PAYLOAD = new BigDecimal("1.123");
|
||||
* Message<BigDecimal message = MessageBuilder.withPayload(ANY_PAYLOAD).build();
|
||||
* assertThat(message, hasPayload(ANY_PAYLOjAD));
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* <p>
|
||||
* An example using {@link Assert#assertThat(Object, Matcher)} delegating to
|
||||
* another {@link Matcher}.
|
||||
* <p>
|
||||
* <pre>
|
||||
* ANY_PAYLOAD = new BigDecimal("1.123");
|
||||
* <pre class="code">
|
||||
* ANY_PAYLOAD = new BigDecimal("1.123");
|
||||
* assertThat(message, PayloadMatcher.hasPayload(is(BigDecimal.class)));
|
||||
* assertThat(message, PayloadMatcher.hasPayload(notNullValue()));
|
||||
* assertThat(message, not((PayloadMatcher.hasPayload(is(String.class))))); *
|
||||
|
||||
@@ -47,7 +47,7 @@ public final class SocketUtils {
|
||||
* the need to use the methods of this class multiple times from within your
|
||||
* Spring Application Context XML file using SpEL. Of course you can do:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* ...port="#{T(org.springframework.integration.test.util.SocketUtils).findAvailableServerSocket(12000)}"
|
||||
* }
|
||||
@@ -57,7 +57,7 @@ public final class SocketUtils {
|
||||
* This will be acceptable for single use, but if you need to invoke the
|
||||
* methods numerous time, you may instead want to do this:
|
||||
*
|
||||
* <pre>
|
||||
* <pre class="code">
|
||||
* {@code
|
||||
* <bean id="tcpIpUtils" class="org.springframework.integration.test.util.SocketUtils" />
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user