diff options
author | Simone Bordet | 2012-08-24 09:52:29 +0000 |
---|---|---|
committer | Simone Bordet | 2012-08-24 09:52:29 +0000 |
commit | 06b2de17d5a8728d71cd8fd40c5711cd5b611ebc (patch) | |
tree | 6a87fcf2cf363dbd68bf58821988d54324ed9780 /jetty-xml | |
parent | b73ca3e316797e5b075f89f4c0d6679626ce9c5a (diff) | |
parent | e92006390e06ceb3e9906343681ebe7d8fbcfb7b (diff) | |
download | org.eclipse.jetty.project-06b2de17d5a8728d71cd8fd40c5711cd5b611ebc.tar.gz org.eclipse.jetty.project-06b2de17d5a8728d71cd8fd40c5711cd5b611ebc.tar.xz org.eclipse.jetty.project-06b2de17d5a8728d71cd8fd40c5711cd5b611ebc.zip |
Merge branch 'jetty-9-aggregation' into jetty-9-spdy-http
Diffstat (limited to 'jetty-xml')
9 files changed, 216 insertions, 159 deletions
diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessor.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessor.java index 02c4fa043e..150698daad 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessor.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessor.java @@ -1,15 +1,20 @@ -// ======================================================================== -// Copyright (c) 2011 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== +// +// ======================================================================== +// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// package org.eclipse.jetty.xml; diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessorFactory.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessorFactory.java index 9679c1a464..c6f2988609 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessorFactory.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessorFactory.java @@ -1,15 +1,20 @@ -// ======================================================================== -// Copyright (c) 2011 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== +// +// ======================================================================== +// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// package org.eclipse.jetty.xml; diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java index 866e0e07cb..f03020197a 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java @@ -1,15 +1,20 @@ -// ======================================================================== -// Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== +// +// ======================================================================== +// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// package org.eclipse.jetty.xml; diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java index 5307925a13..655430f2ac 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java @@ -1,15 +1,20 @@ -// ======================================================================== -// Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== +// +// ======================================================================== +// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// package org.eclipse.jetty.xml; @@ -25,7 +30,6 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Stack; import java.util.StringTokenizer; - import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; @@ -46,10 +50,10 @@ import org.xml.sax.helpers.DefaultHandler; * XML Parser wrapper. This class wraps any standard JAXP1.1 parser with convieniant error and * entity handlers and a mini dom-like document tree. * <P> - * By default, the parser is created as a validating parser only if xerces is present. This can be + * By default, the parser is created as a validating parser only if xerces is present. This can be * configured by setting the "org.eclipse.jetty.xml.XmlParser.Validating" system property. - * - * + * + * */ public class XmlParser { @@ -84,7 +88,7 @@ public class XmlParser { setValidating(validating); } - + /* ------------------------------------------------------------ */ public void setValidating(boolean validating) { @@ -93,7 +97,7 @@ public class XmlParser SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(validating); _parser = factory.newSAXParser(); - + try { if (validating) @@ -109,7 +113,7 @@ public class XmlParser _parser.getXMLReader().setFeature("http://xml.org/sax/features/validation", validating); _parser.getXMLReader().setFeature("http://xml.org/sax/features/namespaces", true); - _parser.getXMLReader().setFeature("http://xml.org/sax/features/namespace-prefixes", false); + _parser.getXMLReader().setFeature("http://xml.org/sax/features/namespace-prefixes", false); try { if (validating) @@ -126,7 +130,7 @@ public class XmlParser throw new Error(e.toString()); } } - + /* ------------------------------------------------------------ */ /** * @param name @@ -140,7 +144,7 @@ public class XmlParser /* ------------------------------------------------------------ */ /** - * + * * @return Returns the xpath. */ public String getXpath() @@ -152,7 +156,7 @@ public class XmlParser /** * Set an XPath A very simple subset of xpath is supported to select a partial tree. Currently * only path like "/node1/nodeA | /node1/nodeB" are supported. - * + * * @param xpath The xpath to set. */ public void setXpath(String xpath) @@ -174,7 +178,7 @@ public class XmlParser * Add a ContentHandler. Add an additional _content handler that is triggered on a tag name. SAX * events are passed to the ContentHandler provided from a matching start element to the * corresponding end element. Only a single _content handler can be registered against each tag. - * + * * @param trigger Tag local or q name. * @param observer SAX ContentHandler */ @@ -273,7 +277,7 @@ public class XmlParser _depth--; } } - + /* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */ private class Handler extends DefaultHandler @@ -307,7 +311,7 @@ public class XmlParser name = qName; Node node = new Node(_context, name, attrs); - + // check if the node matches any xpaths set? if (_xpaths != null) @@ -411,10 +415,10 @@ public class XmlParser { if (LOG.isDebugEnabled()) LOG.debug("resolveEntity(" + pid + ", " + sid + ")"); - + if (sid!=null && sid.endsWith(".dtd")) _dtd=sid; - + URL entity = null; if (pid != null) entity = (URL) _redirectMap.get(pid); @@ -548,7 +552,7 @@ public class XmlParser /* ------------------------------------------------------------ */ /** * Get an element attribute. - * + * * @return attribute or null. */ public String getAttribute(String name) @@ -559,7 +563,7 @@ public class XmlParser /* ------------------------------------------------------------ */ /** * Get an element attribute. - * + * * @return attribute or null. */ public String getAttribute(String name, String dft) @@ -586,7 +590,7 @@ public class XmlParser /* ------------------------------------------------------------ */ /** * Get the ith child node or content. - * + * * @return Node or String. */ public Object get(int i) @@ -599,7 +603,7 @@ public class XmlParser /* ------------------------------------------------------------ */ /** * Get the first child node with the tag. - * + * * @param tag * @return Node or null. */ @@ -656,7 +660,7 @@ public class XmlParser /* ------------------------------------------------------------ */ /** * Get a tag as a string. - * + * * @param tag The tag to get * @param tags IF true, tags are included in the value. * @param trim If true, trim the value. @@ -682,7 +686,7 @@ public class XmlParser /* ------------------------------------------------------------ */ /** * Convert to a string. - * + * * @param tag If false, only _content is shown. */ public synchronized String toString(boolean tag) @@ -695,7 +699,7 @@ public class XmlParser /* ------------------------------------------------------------ */ /** * Convert to a string. - * + * * @param tag If false, only _content is shown. */ public synchronized String toString(boolean tag, boolean trim) @@ -755,7 +759,7 @@ public class XmlParser /* ------------------------------------------------------------ */ /** * Iterator over named child nodes. - * + * * @param tag The tag of the nodes. * @return Iterator over all child nodes with the specified tag. */ diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/AnnotatedTestConfiguration.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/AnnotatedTestConfiguration.java index 9644c475ae..523068b4d8 100644 --- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/AnnotatedTestConfiguration.java +++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/AnnotatedTestConfiguration.java @@ -1,3 +1,21 @@ +// +// ======================================================================== +// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// + package org.eclipse.jetty.xml; import org.eclipse.jetty.util.annotation.Name; diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/ConstructorArgTestClass.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/ConstructorArgTestClass.java index e5f994edbb..2885401c73 100644 --- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/ConstructorArgTestClass.java +++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/ConstructorArgTestClass.java @@ -1,15 +1,20 @@ -// ======================================================================== -// Copyright (c) 2009-2009 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== +// +// ======================================================================== +// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// package org.eclipse.jetty.xml; diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/TestConfiguration.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/TestConfiguration.java index 8c35a8e8e2..ec5525ba21 100644 --- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/TestConfiguration.java +++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/TestConfiguration.java @@ -1,15 +1,20 @@ -// ======================================================================== -// Copyright (c) 2006-2009 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== +// +// ======================================================================== +// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// package org.eclipse.jetty.xml; diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java index 5a3e6eebc0..b634863e54 100644 --- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java +++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java @@ -1,25 +1,23 @@ -// ======================================================================== -// Copyright (c) 2006-2009 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== +// +// ======================================================================== +// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// package org.eclipse.jetty.xml; -import static junit.framework.Assert.assertEquals; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - import java.net.URL; import java.util.HashMap; import java.util.Map; @@ -27,6 +25,13 @@ import java.util.Map; import org.junit.Assert; import org.junit.Test; +import static junit.framework.Assert.assertEquals; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + public class XmlConfigurationTest { protected String _configure="org/eclipse/jetty/xml/configure.xml"; @@ -342,7 +347,7 @@ public class XmlConfigurationTest xmlConfiguration.configure(tc); Assert.assertEquals("tc.map is has two entries as specified in the XML", 2, tc.map.size()); } - + @Test public void testConstructorNamedInjection() throws Exception { @@ -352,14 +357,14 @@ public class XmlConfigurationTest " <Arg>arg2</Arg> " + " <Arg>arg3</Arg> " + "</Configure>"); - + AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); - + Assert.assertEquals("first parameter not wired correctly","arg1", atc.getFirst()); Assert.assertEquals("second parameter not wired correctly","arg2", atc.getSecond()); Assert.assertEquals("third parameter not wired correctly","arg3", atc.getThird()); } - + @Test public void testConstructorNamedInjectionOrdered() throws Exception { @@ -369,14 +374,14 @@ public class XmlConfigurationTest " <Arg name=\"second\">arg2</Arg> " + " <Arg name=\"third\">arg3</Arg> " + "</Configure>"); - + AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); - + Assert.assertEquals("first parameter not wired correctly","arg1", atc.getFirst()); Assert.assertEquals("second parameter not wired correctly","arg2", atc.getSecond()); Assert.assertEquals("third parameter not wired correctly","arg3", atc.getThird()); } - + @Test public void testConstructorNamedInjectionUnOrdered() throws Exception { @@ -386,14 +391,14 @@ public class XmlConfigurationTest " <Arg name=\"third\">arg3</Arg> " + " <Arg name=\"second\">arg2</Arg> " + "</Configure>"); - + AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); - + Assert.assertEquals("first parameter not wired correctly","arg1", atc.getFirst()); Assert.assertEquals("second parameter not wired correctly","arg2", atc.getSecond()); Assert.assertEquals("third parameter not wired correctly","arg3", atc.getThird()); } - + @Test public void testConstructorNamedInjectionOrderedMixed() throws Exception { @@ -403,14 +408,14 @@ public class XmlConfigurationTest " <Arg>arg2</Arg> " + " <Arg name=\"third\">arg3</Arg> " + "</Configure>"); - + AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); - + Assert.assertEquals("first parameter not wired correctly","arg1", atc.getFirst()); Assert.assertEquals("second parameter not wired correctly","arg2", atc.getSecond()); Assert.assertEquals("third parameter not wired correctly","arg3", atc.getThird()); } - + @Test public void testConstructorNamedInjectionUnorderedMixed() throws Exception { @@ -420,14 +425,14 @@ public class XmlConfigurationTest " <Arg>arg2</Arg> " + " <Arg name=\"first\">arg1</Arg> " + "</Configure>"); - + AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); - + Assert.assertEquals("first parameter not wired correctly","arg1", atc.getFirst()); Assert.assertEquals("second parameter not wired correctly","arg2", atc.getSecond()); Assert.assertEquals("third parameter not wired correctly","arg3", atc.getThird()); } - + @Test public void testNestedConstructorNamedInjection() throws Exception { @@ -444,18 +449,18 @@ public class XmlConfigurationTest " </New>" + " </Set>" + "</Configure>"); - + AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); - + Assert.assertEquals("first parameter not wired correctly","arg1", atc.getFirst()); Assert.assertEquals("second parameter not wired correctly","arg2", atc.getSecond()); Assert.assertEquals("third parameter not wired correctly","arg3", atc.getThird()); Assert.assertEquals("nested first parameter not wired correctly","arg1", atc.getNested().getFirst()); Assert.assertEquals("nested second parameter not wired correctly","arg2", atc.getNested().getSecond()); Assert.assertEquals("nested third parameter not wired correctly","arg3", atc.getNested().getThird()); - + } - + @Test public void testNestedConstructorNamedInjectionOrdered() throws Exception { @@ -472,9 +477,9 @@ public class XmlConfigurationTest " </New>" + " </Set>" + "</Configure>"); - + AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); - + Assert.assertEquals("first parameter not wired correctly","arg1", atc.getFirst()); Assert.assertEquals("second parameter not wired correctly","arg2", atc.getSecond()); Assert.assertEquals("third parameter not wired correctly","arg3", atc.getThird()); @@ -482,7 +487,7 @@ public class XmlConfigurationTest Assert.assertEquals("nested second parameter not wired correctly","arg2", atc.getNested().getSecond()); Assert.assertEquals("nested third parameter not wired correctly","arg3", atc.getNested().getThird()); } - + @Test public void testNestedConstructorNamedInjectionUnOrdered() throws Exception { @@ -499,9 +504,9 @@ public class XmlConfigurationTest " </New>" + " </Set>" + "</Configure>"); - + AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); - + Assert.assertEquals("first parameter not wired correctly","arg1", atc.getFirst()); Assert.assertEquals("second parameter not wired correctly","arg2", atc.getSecond()); Assert.assertEquals("third parameter not wired correctly","arg3", atc.getThird()); @@ -509,7 +514,7 @@ public class XmlConfigurationTest Assert.assertEquals("nested second parameter not wired correctly","arg2", atc.getNested().getSecond()); Assert.assertEquals("nested third parameter not wired correctly","arg3", atc.getNested().getThird()); } - + @Test public void testNestedConstructorNamedInjectionOrderedMixed() throws Exception { @@ -526,9 +531,9 @@ public class XmlConfigurationTest " </New>" + " </Set>" + "</Configure>"); - + AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); - + Assert.assertEquals("first parameter not wired correctly","arg1", atc.getFirst()); Assert.assertEquals("second parameter not wired correctly","arg2", atc.getSecond()); Assert.assertEquals("third parameter not wired correctly","arg3", atc.getThird()); @@ -536,7 +541,7 @@ public class XmlConfigurationTest Assert.assertEquals("nested second parameter not wired correctly","arg2", atc.getNested().getSecond()); Assert.assertEquals("nested third parameter not wired correctly","arg3", atc.getNested().getThird()); } - + @Test public void testNestedConstructorNamedInjectionUnorderedMixed() throws Exception { @@ -553,9 +558,9 @@ public class XmlConfigurationTest " </New>" + " </Set>" + "</Configure>"); - + AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); - + Assert.assertEquals("first parameter not wired correctly","arg1", atc.getFirst()); Assert.assertEquals("second parameter not wired correctly","arg2", atc.getSecond()); Assert.assertEquals("third parameter not wired correctly","arg3", atc.getThird()); diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java index 8fbdd9fd2f..746cdc6e61 100644 --- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java +++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java @@ -1,24 +1,29 @@ -// ======================================================================== -// Copyright (c) 2006-2009 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== +// +// ======================================================================== +// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// package org.eclipse.jetty.xml; -import static org.junit.Assert.assertTrue; - import java.net.URL; import org.junit.Test; +import static org.junit.Assert.assertTrue; + public class XmlParserTest { @Test |