diff --git a/spring-integration-xquery/pom.xml b/spring-integration-xquery/pom.xml index 8f8fcd2..e357641 100644 --- a/spring-integration-xquery/pom.xml +++ b/spring-integration-xquery/pom.xml @@ -21,7 +21,7 @@ UTF-8 - 2.2.0.RC2 + 4.3.19.RELEASE 4.10 @@ -112,4 +112,4 @@ test - \ No newline at end of file + diff --git a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/core/XQueryExecutor.java b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/core/XQueryExecutor.java index c00bbe6..947da8f 100644 --- a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/core/XQueryExecutor.java +++ b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/core/XQueryExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,11 +30,11 @@ import javax.xml.xquery.XQResultSequence; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Node; + import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.Resource; -import org.springframework.integration.Message; -import org.springframework.integration.MessagingException; import org.springframework.integration.xml.DefaultXmlPayloadConverter; import org.springframework.integration.xml.XmlPayloadConverter; import org.springframework.integration.xquery.support.AbstractXQueryResultMapper; @@ -45,10 +45,11 @@ import org.springframework.integration.xquery.support.StringResultMapper; import org.springframework.integration.xquery.support.XQueryParameter; import org.springframework.integration.xquery.support.XQueryResultMapper; import org.springframework.integration.xquery.support.XQueryUtils; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; -import org.w3c.dom.Node; /** * The common logic for performing the common xquery operations would reside in this @@ -60,6 +61,7 @@ import org.w3c.dom.Node; * to a custom object type * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * @@ -170,6 +172,7 @@ public class XQueryExecutor implements InitializingBean,BeanClassLoaderAware { + @Override public void setBeanClassLoader(ClassLoader classLoader) { Assert.notNull(classLoader, "Non null class loader instance expected"); this.classLoader = classLoader; @@ -364,7 +367,7 @@ public class XQueryExecutor implements InitializingBean,BeanClassLoaderAware { */ @SuppressWarnings("rawtypes") public void setResultMappers(Map, XQueryResultMapper> mappers) { - Assert.notNull(mappers); + Assert.notNull(mappers, "mappers cannot be null"); this.resultMappers = new HashMap, XQueryResultMapper>(mappers); //not iterate through them and set the format for(Object mapper:resultMappers.values()) { diff --git a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/router/XQueryRouter.java b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/router/XQueryRouter.java index 95fb1ba..19f1b91 100644 --- a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/router/XQueryRouter.java +++ b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/router/XQueryRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,9 +18,9 @@ package org.springframework.integration.xquery.router; import java.util.ArrayList; import java.util.List; -import org.springframework.integration.Message; import org.springframework.integration.router.AbstractMappingMessageRouter; import org.springframework.integration.xquery.core.XQueryExecutor; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** @@ -28,6 +28,7 @@ import org.springframework.util.Assert; * to which the message will be routed * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * @@ -39,7 +40,7 @@ public class XQueryRouter extends AbstractMappingMessageRouter { private Class resultType; @Override - public void onInit() { + public void onInit() throws Exception { super.onInit(); Assert.notNull(executor,"No XQueryExecutor instance provided"); if(resultType == null) { diff --git a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/BooleanResultMapper.java b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/BooleanResultMapper.java index a025c6a..3b36a4b 100644 --- a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/BooleanResultMapper.java +++ b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/BooleanResultMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,19 +21,22 @@ import java.util.List; import javax.xml.xquery.XQItemType; import javax.xml.xquery.XQResultSequence; -import org.springframework.integration.MessagingException; import org.w3c.dom.Node; +import org.springframework.messaging.MessagingException; + /** * The Result mapper implementation that maps the {@link XQResultSequence} to {@link Boolean} * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * */ public class BooleanResultMapper extends AbstractXQueryResultMapper { + @Override public List mapResults(XQResultSequence result) { List results = new ArrayList(); try { diff --git a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/NodeResultMapper.java b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/NodeResultMapper.java index f9d03a2..d60fe56 100644 --- a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/NodeResultMapper.java +++ b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/NodeResultMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,19 +21,22 @@ import java.util.List; import javax.xml.xquery.XQItemType; import javax.xml.xquery.XQResultSequence; -import org.springframework.integration.MessagingException; import org.w3c.dom.Node; +import org.springframework.messaging.MessagingException; + /** * The Result mapper implementation that maps the {@link XQResultSequence} to {@link Node} * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * */ public class NodeResultMapper extends AbstractXQueryResultMapper { + @Override public List mapResults(XQResultSequence result) { List results = new ArrayList(); try { @@ -49,4 +52,5 @@ public class NodeResultMapper extends AbstractXQueryResultMapper { } return results; } + } diff --git a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/NumberResultMapper.java b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/NumberResultMapper.java index 35070bd..b32c34c 100644 --- a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/NumberResultMapper.java +++ b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/NumberResultMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,20 +21,23 @@ import java.util.List; import javax.xml.xquery.XQItemType; import javax.xml.xquery.XQResultSequence; -import org.springframework.integration.MessagingException; -import org.springframework.util.StringUtils; import org.w3c.dom.Node; +import org.springframework.messaging.MessagingException; +import org.springframework.util.StringUtils; + /** * The Result mapper implementation that maps the {@link XQResultSequence} to {@link Number} * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * */ public class NumberResultMapper extends AbstractXQueryResultMapper { + @Override public List mapResults(XQResultSequence result) { List results = new ArrayList(); try { @@ -62,4 +65,4 @@ public class NumberResultMapper extends AbstractXQueryResultMapper { return results; } -} \ No newline at end of file +} diff --git a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/StringResultMapper.java b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/StringResultMapper.java index a2ed944..108bae0 100644 --- a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/StringResultMapper.java +++ b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/StringResultMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,19 +21,22 @@ import java.util.List; import javax.xml.xquery.XQItemType; import javax.xml.xquery.XQResultSequence; -import org.springframework.integration.MessagingException; import org.w3c.dom.Node; +import org.springframework.messaging.MessagingException; + /** * The Result mapper implementation that maps the {@link XQResultSequence} to {@link String} * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * */ public class StringResultMapper extends AbstractXQueryResultMapper { + @Override public List mapResults(XQResultSequence result) { List results = new ArrayList(); try { @@ -66,4 +69,4 @@ public class StringResultMapper extends AbstractXQueryResultMapper { } return results; } -} \ No newline at end of file +} diff --git a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/XQueryParameter.java b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/XQueryParameter.java index d5a87bd..177cfae 100644 --- a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/XQueryParameter.java +++ b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/XQueryParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ package org.springframework.integration.xquery.support; import org.springframework.expression.Expression; import org.springframework.expression.spel.standard.SpelExpressionParser; -import org.springframework.integration.Message; import org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor; +import org.springframework.messaging.Message; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -28,6 +28,7 @@ import org.springframework.util.StringUtils; * instance * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * diff --git a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/XQueryUtils.java b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/XQueryUtils.java index ed43e2f..d90bf78 100644 --- a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/XQueryUtils.java +++ b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/support/XQueryUtils.java @@ -23,8 +23,9 @@ import java.net.URL; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.springframework.core.io.Resource; -import org.springframework.integration.MessagingException; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; /** @@ -33,6 +34,7 @@ import org.springframework.util.Assert; * by the router, transformer etc along with all the parsers for these components * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * diff --git a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/transformer/XQueryTransformer.java b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/transformer/XQueryTransformer.java index 55ee854..1007bb5 100644 --- a/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/transformer/XQueryTransformer.java +++ b/spring-integration-xquery/src/main/java/org/springframework/integration/xquery/transformer/XQueryTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,12 +17,13 @@ package org.springframework.integration.xquery.transformer; import java.util.List; -import org.springframework.integration.Message; +import org.w3c.dom.Node; + import org.springframework.integration.transformer.AbstractTransformer; import org.springframework.integration.xquery.core.XQueryExecutor; import org.springframework.integration.xquery.support.XQueryResultMapper; +import org.springframework.messaging.Message; import org.springframework.util.Assert; -import org.w3c.dom.Node; /** @@ -40,6 +41,7 @@ import org.w3c.dom.Node; * provided then the value of the {@link #resultType} defaults to {@link String}. * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * diff --git a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/config/xml/XQueryRouterParserTests.java b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/config/xml/XQueryRouterParserTests.java index d32ed0b..4237b78 100644 --- a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/config/xml/XQueryRouterParserTests.java +++ b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/config/xml/XQueryRouterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,9 @@ import java.util.Map; import javax.xml.xquery.XQDataSource; -import junit.framework.Assert; -import net.sf.saxon.xqj.SaxonXQDataSource; - +import org.junit.Assert; import org.junit.Test; + import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; @@ -32,11 +31,14 @@ import org.springframework.integration.xquery.DummyXmlPayloadConverter; import org.springframework.integration.xquery.router.XQueryRouter; import org.springframework.integration.xquery.support.XQueryParameter; +import net.sf.saxon.xqj.SaxonXQDataSource; + /** * The test case for the XQuery router parser * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * diff --git a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/config/xml/XQueryTransformerParserTests.java b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/config/xml/XQueryTransformerParserTests.java index 6cf61ed..542c242 100644 --- a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/config/xml/XQueryTransformerParserTests.java +++ b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/config/xml/XQueryTransformerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +21,10 @@ import java.util.Map; import javax.xml.xquery.XQDataSource; import javax.xml.xquery.XQResultSequence; -import junit.framework.Assert; -import net.sf.saxon.xqj.SaxonXQDataSource; - +import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; + import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; @@ -40,10 +39,13 @@ import org.springframework.integration.xquery.transformer.XQueryTransformer; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import net.sf.saxon.xqj.SaxonXQDataSource; + /** * The test class for XQuery Transformer parser * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * @@ -137,6 +139,7 @@ public class XQueryTransformerParserTests { public static class DummyXQueryResultMapper implements XQueryResultMapper { + @Override public List mapResults(XQResultSequence result) { return null; } diff --git a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/core/AbstractXQueryExecutorTests.java b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/core/AbstractXQueryExecutorTests.java index 5678113..e130d8b 100644 --- a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/core/AbstractXQueryExecutorTests.java +++ b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/core/AbstractXQueryExecutorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,10 +27,10 @@ import javax.xml.xquery.XQResultSequence; import org.junit.Assert; import org.junit.Test; +import org.w3c.dom.Node; + import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; -import org.springframework.integration.Message; -import org.springframework.integration.MessagingException; import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.test.util.TestUtils; import org.springframework.integration.xquery.support.AbstractXQueryResultMapper; @@ -40,12 +40,14 @@ import org.springframework.integration.xquery.support.NumberResultMapper; import org.springframework.integration.xquery.support.StringResultMapper; import org.springframework.integration.xquery.support.XQueryParameter; import org.springframework.integration.xquery.support.XQueryResultMapper; -import org.w3c.dom.Node; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessagingException; /** * The base test class for the XQueryExecutor tests * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * @@ -97,6 +99,7 @@ public abstract class AbstractXQueryExecutorTests { executor.setXQuery("'Hello'"); Map map = new HashMap(); map.put(MyCustomClass.class, new XQueryResultMapper() { + @Override public List mapResults(XQResultSequence result) { // TODO Auto-generated method stub return null; @@ -647,6 +650,7 @@ public abstract class AbstractXQueryExecutorTests { private class MyCustomClass {} private class CustomNodeMapper implements XQueryResultMapper { + @Override public List mapResults(XQResultSequence result) { return null; } diff --git a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/router/XQueryRouterTests.java b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/router/XQueryRouterTests.java index 29ba222..6d2b5d5 100644 --- a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/router/XQueryRouterTests.java +++ b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/router/XQueryRouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +17,9 @@ package org.springframework.integration.xquery.router; import java.util.List; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; + import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.test.util.TestUtils; import org.springframework.integration.xquery.core.XQueryExecutor; diff --git a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/support/XQueryParameterTests.java b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/support/XQueryParameterTests.java index 66b5491..51798c8 100644 --- a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/support/XQueryParameterTests.java +++ b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/support/XQueryParameterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,12 +19,12 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; -import org.springframework.integration.Message; + import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.test.util.TestUtils; +import org.springframework.messaging.Message; /** * The test class for {@link XQueryParameter} class diff --git a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/transformer/XQueryTransformerTests.java b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/transformer/XQueryTransformerTests.java index 9c5fe39..a7c26af 100644 --- a/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/transformer/XQueryTransformerTests.java +++ b/spring-integration-xquery/src/test/java/org/springframework/integration/xquery/transformer/XQueryTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,20 +20,21 @@ import java.util.List; import javax.xml.xquery.XQResultSequence; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; +import org.w3c.dom.Node; + import org.springframework.core.io.ClassPathResource; import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.test.util.TestUtils; import org.springframework.integration.xquery.core.XQueryExecutor; import org.springframework.integration.xquery.support.XQueryResultMapper; -import org.w3c.dom.Node; /** * The Test class for the {@link XQueryTransformer} class * * @author Amol Nayak + * @author Gary Russell * * @since 1.0 * @@ -220,6 +221,7 @@ public class XQueryTransformerTests { private class DummyXQueryResultMapper implements XQueryResultMapper { + @Override public List mapResults(XQResultSequence result) { // TODO Auto-generated method stub return null;