This is an automated email from the ASF dual-hosted git repository.
veithen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-axiom.git
The following commit(s) were added to refs/heads/master by this push:
new bd4f71443 Enforce consistent Java formatting everywhere
bd4f71443 is described below
commit bd4f71443c50af1d1d88de1664766a4d49445510
Author: Andreas Veithen <[email protected]>
AuthorDate: Sat Jan 10 22:31:39 2026 +0000
Enforce consistent Java formatting everywhere
---
axiom-api/pom.xml | 11 --
axiom-compat/pom.xml | 11 --
axiom-jakarta-activation/pom.xml | 11 --
axiom-jakarta-jaxb/pom.xml | 11 --
axiom-legacy-attachments/pom.xml | 11 --
.../axiom/weaver/annotation/FactoryMethod.java | 9 +-
.../org/apache/axiom/weaver/annotation/Inject.java | 4 +-
.../org/apache/axiom/weaver/annotation/Mixin.java | 3 +-
.../apache/axiom/weaver/annotation/Singleton.java | 4 +-
axiom-weaver/pom.xml | 11 --
buildutils/pom.xml | 11 --
components/pom.xml | 11 --
implementations/pom.xml | 11 --
mixins/core-mixins/pom.xml | 16 ---
mixins/pom.xml | 11 --
pom.xml | 45 ++++----
samples/pom.xml | 11 --
.../src/test/java/DOOM2LLOMTest.java | 9 +-
.../src/test/java/LLOM2DOOMTest.java | 11 +-
.../eclipse-tests/src/test/java/EclipseTest.java | 21 ++--
systests/jaxb-tests/pom.xml | 16 ---
systests/jaxws-tests/src/test/java/MTOMTest.java | 65 ++++++-----
.../java/org/apache/axiom/om/NamespaceTest.java | 112 +++++++++---------
.../test/java/org/apache/axiom/om/OMBodyTest.java | 24 ++--
.../java/org/apache/axiom/om/OMCachingTest.java | 12 +-
.../test/java/org/apache/axiom/om/OMTestCase.java | 5 +-
.../org/apache/axiom/om/SerializationTest.java | 9 +-
.../axiom/om/impl/dom/ConvertLLOMToDOOMTest.java | 124 ++++++++++----------
.../apache/axiom/om/impl/llom/OMAttributeTest.java | 11 +-
.../apache/axiom/om/impl/llom/OMOutputTest.java | 18 ++-
.../om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java | 126 +++++++++++----------
.../om/impl/serializer/ElementSerializerTest.java | 10 +-
.../om/impl/serializer/PreserveEnvelopeTest.java | 125 ++++++++++----------
.../soap/SOAP11DefaultFaultConversionTest.java | 43 ++++---
.../soap/impl/llom/CharacterEncoding2Test.java | 53 +++++----
.../soap/impl/llom/CharacterEncodingTest.java | 14 +--
.../apache/axiom/soap/impl/llom/OMElementTest.java | 83 ++++++++------
.../axiom/soap/impl/llom/OMHeaderBlockTest.java | 5 +-
.../util/stax/WrappedTextNodeStreamReaderTest.java | 50 ++++----
systests/osgi-tests/pom.xml | 11 --
.../src/test/java/PsychoPathTest.java | 12 +-
.../springws/AxiomMessageFactoryConfigurator.java | 7 +-
.../springws/AxiomSoapMessageFactoryTest.java | 2 +-
.../systest/springws/AxiomSoapMessageTest.java | 12 +-
.../axiom/systest/springws/SpringWSTest.java | 6 +-
.../apache/axiom/systest/wildfly/DialectTest.java | 24 ++--
systests/wss4j-tests/src/test/java/WSS4JTest.java | 27 ++---
testing/pom.xml | 11 --
48 files changed, 572 insertions(+), 688 deletions(-)
diff --git a/axiom-api/pom.xml b/axiom-api/pom.xml
index f34406320..2818ef78a 100644
--- a/axiom-api/pom.xml
+++ b/axiom-api/pom.xml
@@ -292,17 +292,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/axiom-compat/pom.xml b/axiom-compat/pom.xml
index ae330e6a2..e29887887 100644
--- a/axiom-compat/pom.xml
+++ b/axiom-compat/pom.xml
@@ -116,17 +116,6 @@
<includeClasses>false</includeClasses>
</configuration>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
diff --git a/axiom-jakarta-activation/pom.xml b/axiom-jakarta-activation/pom.xml
index 919b9465b..e67477ae2 100644
--- a/axiom-jakarta-activation/pom.xml
+++ b/axiom-jakarta-activation/pom.xml
@@ -96,17 +96,6 @@
</instructions>
</configuration>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/axiom-jakarta-jaxb/pom.xml b/axiom-jakarta-jaxb/pom.xml
index 0f55d17af..928c18105 100644
--- a/axiom-jakarta-jaxb/pom.xml
+++ b/axiom-jakarta-jaxb/pom.xml
@@ -117,17 +117,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/axiom-legacy-attachments/pom.xml b/axiom-legacy-attachments/pom.xml
index 31df42b26..b8eb7c280 100644
--- a/axiom-legacy-attachments/pom.xml
+++ b/axiom-legacy-attachments/pom.xml
@@ -135,17 +135,6 @@
</instructions>
</configuration>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git
a/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/FactoryMethod.java
b/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/FactoryMethod.java
index 7d4fb67b2..b81bb0375 100644
---
a/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/FactoryMethod.java
+++
b/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/FactoryMethod.java
@@ -25,11 +25,10 @@ import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
- * Indicates that the method is a factory method. The return type of the
method must be an
- * interface and the method must not have any arguments. The weaver will
generate code that
- * creates a new instance of the class implementing the interface.
+ * Indicates that the method is a factory method. The return type of the
method must be an interface
+ * and the method must not have any arguments. The weaver will generate code
that creates a new
+ * instance of the class implementing the interface.
*/
@Retention(CLASS)
@Target(METHOD)
-public @interface FactoryMethod {
-}
+public @interface FactoryMethod {}
diff --git
a/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Inject.java
b/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Inject.java
index 1d35d2624..947265f40 100644
---
a/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Inject.java
+++
b/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Inject.java
@@ -26,6 +26,4 @@ import java.lang.annotation.Target;
@Retention(CLASS)
@Target(METHOD)
-public @interface Inject {
-
-}
+public @interface Inject {}
diff --git
a/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Mixin.java
b/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Mixin.java
index 830fe865e..0871ffd2c 100644
---
a/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Mixin.java
+++
b/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Mixin.java
@@ -26,5 +26,4 @@ import java.lang.annotation.Target;
@Retention(CLASS)
@Target(TYPE)
-public @interface Mixin {
-}
+public @interface Mixin {}
diff --git
a/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Singleton.java
b/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Singleton.java
index 4c1861c73..c361afcba 100644
---
a/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Singleton.java
+++
b/axiom-weaver-annotations/src/main/java/org/apache/axiom/weaver/annotation/Singleton.java
@@ -26,6 +26,4 @@ import java.lang.annotation.Target;
@Retention(CLASS)
@Target(TYPE)
-public @interface Singleton {
-
-}
+public @interface Singleton {}
diff --git a/axiom-weaver/pom.xml b/axiom-weaver/pom.xml
index 426d4ab95..f56237d89 100644
--- a/axiom-weaver/pom.xml
+++ b/axiom-weaver/pom.xml
@@ -87,17 +87,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/buildutils/pom.xml b/buildutils/pom.xml
index ea8cdcf56..382231395 100644
--- a/buildutils/pom.xml
+++ b/buildutils/pom.xml
@@ -90,17 +90,6 @@
<includeClasses>false</includeClasses>
</configuration>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/components/pom.xml b/components/pom.xml
index d26445da2..74f7019f5 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -52,17 +52,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/implementations/pom.xml b/implementations/pom.xml
index e01514108..593a2587f 100644
--- a/implementations/pom.xml
+++ b/implementations/pom.xml
@@ -72,17 +72,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
diff --git a/mixins/core-mixins/pom.xml b/mixins/core-mixins/pom.xml
index ba2a175ea..a0710fc17 100644
--- a/mixins/core-mixins/pom.xml
+++ b/mixins/core-mixins/pom.xml
@@ -48,20 +48,4 @@
<scope>provided</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/mixins/pom.xml b/mixins/pom.xml
index 9e9f9434f..fc01eff48 100644
--- a/mixins/pom.xml
+++ b/mixins/pom.xml
@@ -51,17 +51,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/pom.xml b/pom.xml
index bb52b1dc0..c38b263d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -852,25 +852,6 @@
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <version>2.29</version>
- <configuration>
- <!-- AOSP changes the indentation (from 2 to 4) and
the import order. Since we
- don't want Android conventions for import
ordering, we skip sorting
- imports. -->
- <style>aosp</style>
- <skipSortingImports>true</skipSortingImports>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>com.google.googlejavaformat</groupId>
- <artifactId>google-java-format</artifactId>
- <version>1.33.0</version>
- </dependency>
- </dependencies>
- </plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.5.0</version>
@@ -1189,6 +1170,32 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.spotify.fmt</groupId>
+ <artifactId>fmt-maven-plugin</artifactId>
+ <version>2.29</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <!-- AOSP changes the indentation (from 2 to 4) and the
import order. Since we
+ don't want Android conventions for import ordering,
we skip sorting
+ imports. -->
+ <style>aosp</style>
+ <skipSortingImports>true</skipSortingImports>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.googlejavaformat</groupId>
+ <artifactId>google-java-format</artifactId>
+ <version>1.33.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
diff --git a/samples/pom.xml b/samples/pom.xml
index 75847e82d..b3e66e8ec 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -109,17 +109,6 @@
</includes>
</configuration>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/systests/cross-om-tests/src/test/java/DOOM2LLOMTest.java
b/systests/cross-om-tests/src/test/java/DOOM2LLOMTest.java
index cd1474cd9..d8618cc05 100644
--- a/systests/cross-om-tests/src/test/java/DOOM2LLOMTest.java
+++ b/systests/cross-om-tests/src/test/java/DOOM2LLOMTest.java
@@ -24,10 +24,11 @@ import org.apache.axiom.ts.om.cross.CrossOMTestSuiteBuilder;
public class DOOM2LLOMTest extends TestCase {
public static TestSuite suite() {
- CrossOMTestSuiteBuilder builder = new CrossOMTestSuiteBuilder(
- OMAbstractFactory.getMetaFactory(),
-
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM));
-
+ CrossOMTestSuiteBuilder builder =
+ new CrossOMTestSuiteBuilder(
+ OMAbstractFactory.getMetaFactory(),
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM));
+
return builder.build();
}
}
diff --git a/systests/cross-om-tests/src/test/java/LLOM2DOOMTest.java
b/systests/cross-om-tests/src/test/java/LLOM2DOOMTest.java
index bd488de27..c8c3eddb1 100644
--- a/systests/cross-om-tests/src/test/java/LLOM2DOOMTest.java
+++ b/systests/cross-om-tests/src/test/java/LLOM2DOOMTest.java
@@ -25,13 +25,14 @@ import org.apache.axiom.ts.om.cross.TestInsertSibling;
public class LLOM2DOOMTest extends TestCase {
public static TestSuite suite() {
- CrossOMTestSuiteBuilder builder = new CrossOMTestSuiteBuilder(
-
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM),
- OMAbstractFactory.getMetaFactory());
-
+ CrossOMTestSuiteBuilder builder =
+ new CrossOMTestSuiteBuilder(
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM),
+ OMAbstractFactory.getMetaFactory());
+
// TODO
builder.exclude(TestInsertSibling.class);
-
+
return builder.build();
}
}
diff --git a/systests/eclipse-tests/src/test/java/EclipseTest.java
b/systests/eclipse-tests/src/test/java/EclipseTest.java
index 93d5013fc..df7b0ef29 100644
--- a/systests/eclipse-tests/src/test/java/EclipseTest.java
+++ b/systests/eclipse-tests/src/test/java/EclipseTest.java
@@ -41,9 +41,7 @@ import org.ops4j.pax.exam.spi.reactors.PerClass;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-/**
- * Tests that Axiom works out of the box in an Eclipse platform.
- */
+/** Tests that Axiom works out of the box in an Eclipse platform. */
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
public class EclipseTest {
@@ -59,18 +57,23 @@ public class EclipseTest {
url("link:classpath:org.apache.ws.commons.axiom.axiom-api.link").start(false),
junitBundles());
}
-
+
@Test
public void testLLOM() {
- OMElement element = OMXMLBuilderFactory.createOMBuilder(new
StringReader("<ns:test xmlns:ns='urn:ns'>test</ns:test>")).getDocumentElement();
+ OMElement element =
+ OMXMLBuilderFactory.createOMBuilder(
+ new StringReader("<ns:test
xmlns:ns='urn:ns'>test</ns:test>"))
+ .getDocumentElement();
assertEquals(new QName("urn:ns", "test"), element.getQName());
}
-
+
@Test
public void testDOOM() throws Exception {
- DOMMetaFactory metaFactory =
(DOMMetaFactory)OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM);
- Document document =
metaFactory.newDocumentBuilderFactory().newDocumentBuilder().newDocument();
+ DOMMetaFactory metaFactory =
+ (DOMMetaFactory)
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM);
+ Document document =
+
metaFactory.newDocumentBuilderFactory().newDocumentBuilder().newDocument();
Element element = document.createElementNS("urn:test", "p:root");
- assertEquals(new QName("urn:test", "root"),
((OMElement)element).getQName());
+ assertEquals(new QName("urn:test", "root"), ((OMElement)
element).getQName());
}
}
diff --git a/systests/jaxb-tests/pom.xml b/systests/jaxb-tests/pom.xml
index e73fd3e9a..e880bfaf6 100644
--- a/systests/jaxb-tests/pom.xml
+++ b/systests/jaxb-tests/pom.xml
@@ -68,20 +68,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/systests/jaxws-tests/src/test/java/MTOMTest.java
b/systests/jaxws-tests/src/test/java/MTOMTest.java
index e4867b4e8..5463be9c0 100644
--- a/systests/jaxws-tests/src/test/java/MTOMTest.java
+++ b/systests/jaxws-tests/src/test/java/MTOMTest.java
@@ -47,7 +47,7 @@ import jakarta.xml.ws.soap.MTOMFeature;
public class MTOMTest {
/**
* Regression test for <a
href="https://issues.apache.org/jira/browse/AXIOM-492">AXIOM-492</a>.
- *
+ *
* @throws Exception
*/
@Test
@@ -55,31 +55,35 @@ public class MTOMTest {
Server server = new Server();
ServerConnector connector = new ServerConnector(server);
connector.setPort(0);
- server.setConnectors(new Connector[] { connector });
+ server.setConnectors(new Connector[] {connector});
ServletContextHandler handler = new ServletContextHandler("/");
- HttpServlet servlet = new HttpServlet() {
- @Override
- protected void doPost(HttpServletRequest request,
HttpServletResponse response)
- throws ServletException, IOException {
- MultipartBody mp = MultipartBody.builder()
- .setInputStream(request.getInputStream())
- .setContentType(request.getContentType())
- .build();
- OMXMLBuilderFactory.createSOAPModelBuilder(mp);
- SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
- SOAPMessage message = factory.createDefaultSOAPMessage();
- OMElement responseElement = factory.createOMElement(
- "uploadImageResponse",
factory.createOMNamespace("http://example.org/", "ns"),
- message.getSOAPEnvelope().getBody());
- factory.createOMElement("return", null,
responseElement).setText("OK");
-
response.setContentType(factory.getSOAPVersion().getMediaType().toString());
- try {
- message.serialize(response.getOutputStream());
- } catch (XMLStreamException ex) {
- throw new ServletException(ex);
- }
- }
- };
+ HttpServlet servlet =
+ new HttpServlet() {
+ @Override
+ protected void doPost(HttpServletRequest request,
HttpServletResponse response)
+ throws ServletException, IOException {
+ MultipartBody mp =
+ MultipartBody.builder()
+
.setInputStream(request.getInputStream())
+
.setContentType(request.getContentType())
+ .build();
+ OMXMLBuilderFactory.createSOAPModelBuilder(mp);
+ SOAPFactory factory =
OMAbstractFactory.getSOAP12Factory();
+ SOAPMessage message =
factory.createDefaultSOAPMessage();
+ OMElement responseElement =
+ factory.createOMElement(
+ "uploadImageResponse",
+
factory.createOMNamespace("http://example.org/", "ns"),
+ message.getSOAPEnvelope().getBody());
+ factory.createOMElement("return", null,
responseElement).setText("OK");
+
response.setContentType(factory.getSOAPVersion().getMediaType().toString());
+ try {
+ message.serialize(response.getOutputStream());
+ } catch (XMLStreamException ex) {
+ throw new ServletException(ex);
+ }
+ }
+ };
ServletHolder servletHolder = new ServletHolder(servlet);
servletHolder.setName("test");
servletHolder.setInitOrder(1);
@@ -87,10 +91,13 @@ public class MTOMTest {
server.setHandler(handler);
server.start();
try {
- ImageServicePort imageService = new
ImageService().getImageServicePort(new MTOMFeature());
- ((BindingProvider)imageService).getRequestContext().put(
- BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- String.format("http://localhost:%d/",
connector.getLocalPort()));
+ ImageServicePort imageService =
+ new ImageService().getImageServicePort(new MTOMFeature());
+ ((BindingProvider) imageService)
+ .getRequestContext()
+ .put(
+ BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+ String.format("http://localhost:%d/",
connector.getLocalPort()));
assertThat(imageService.uploadImage(new
byte[4096])).isEqualTo("OK");
} finally {
server.stop();
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java
index 814e55167..274676eb9 100644
--- a/systests/old-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java
+++ b/systests/old-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java
@@ -40,10 +40,11 @@ public class NamespaceTest extends TestCase {
public void testNoPrefixNamespaces()
throws IOException, ParserConfigurationException, SAXException {
- String expectedXML = "<axis2:DocumentElement
xmlns:axis2=\"http://ws.apache.org/axis2\" " +
- "xmlns:axis2ns1=\"http://undefined-ns-1.org\"
xmlns:axis2ns2=\"http://undefined-ns-2.org\">" +
- "<axis2:FirstChild /><axis2ns2:SecondChild
xmlns:axis2ns2=\"http://undefined-ns-2.org\" " +
- "axis2ns1:testAttr=\"testValue\" /></axis2:DocumentElement>";
+ String expectedXML =
+ "<axis2:DocumentElement
xmlns:axis2=\"http://ws.apache.org/axis2\" "
+ + "xmlns:axis2ns1=\"http://undefined-ns-1.org\"
xmlns:axis2ns2=\"http://undefined-ns-2.org\">"
+ + "<axis2:FirstChild /><axis2ns2:SecondChild
xmlns:axis2ns2=\"http://undefined-ns-2.org\" "
+ + "axis2ns1:testAttr=\"testValue\"
/></axis2:DocumentElement>";
OMFactory omFactory = OMAbstractFactory.getOMFactory();
OMNamespace axis2NS =
omFactory.createOMNamespace("http://ws.apache.org/axis2", "axis2");
@@ -54,11 +55,11 @@ public class NamespaceTest extends TestCase {
omFactory.createOMElement("FirstChild", axis2NS, docElement);
- OMElement secondChild = omFactory
- .createOMElement(new QName("http://undefined-ns-2.org",
"SecondChild"), docElement);
+ OMElement secondChild =
+ omFactory.createOMElement(
+ new QName("http://undefined-ns-2.org", "SecondChild"),
docElement);
secondChild.addAttribute("testAttr", "testValue", firstOrphanNS);
-
Iterator allDeclaredNamespaces = docElement.getAllDeclaredNamespaces();
int namespaceCount = 0;
while (allDeclaredNamespaces.hasNext()) {
@@ -67,10 +68,14 @@ public class NamespaceTest extends TestCase {
}
assertTrue(namespaceCount == 3);
- assertTrue(secondChild.getNamespace().getPrefix().equals(
- docElement.findNamespace("http://undefined-ns-2.org",
null).getPrefix()));
-
-
+ assertTrue(
+ secondChild
+ .getNamespace()
+ .getPrefix()
+ .equals(
+ docElement
+
.findNamespace("http://undefined-ns-2.org", null)
+ .getPrefix()));
}
public void attributeNSTest() {
@@ -78,17 +83,20 @@ public class NamespaceTest extends TestCase {
OMNamespace ns1 = fac.createOMNamespace("http://test.org", "");
OMNamespace ns2 = fac.createOMNamespace("http://test2.org", null);
-
OMElement elem = fac.createOMElement("test", ns1);
elem.addAttribute(fac.createOMAttribute("testAttr", ns2, "attrValue"));
OMNamespace namespace = elem.findNamespace("http://test.org", null);
- assertTrue(namespace != null && namespace.getPrefix() != null &&
- "".equals(namespace.getPrefix()));
+ assertTrue(
+ namespace != null
+ && namespace.getPrefix() != null
+ && "".equals(namespace.getPrefix()));
OMNamespace namespace2 = elem.findNamespace("http://test2.org", null);
- assertTrue(namespace2 != null && namespace2.getPrefix() != null &&
- "".equals(namespace2.getPrefix()));
+ assertTrue(
+ namespace2 != null
+ && namespace2.getPrefix() != null
+ && "".equals(namespace2.getPrefix()));
}
/**
@@ -99,12 +107,9 @@ public class NamespaceTest extends TestCase {
public void testNamespaceProblem() throws XMLStreamException {
/**
- * <RootElement xmlns:ns1="http://ws.apache.org/axis2">
- * <ns2:ChildElement xmlns:ns2="http://ws.apache.org/axis2"/>
- * </RootElement>
- *
+ * <RootElement xmlns:ns1="http://ws.apache.org/axis2">
<ns2:ChildElement
+ * xmlns:ns2="http://ws.apache.org/axis2"/> </RootElement>
*/
-
OMFactory omFac = OMAbstractFactory.getOMFactory();
OMElement documentElement = omFac.createOMElement("RootElement", null);
@@ -121,8 +126,8 @@ public class NamespaceTest extends TestCase {
"<soapenv:Envelope
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header
/><soapenv:Body><ns1:createAccountRequest
xmlns:ns1=\"http://www.wso2.com/types\"><clientinfo
xmlns=\"http://www.wso2.com/types\"><name>bob</name><ssn>123456789</ssn></clientinfo><password
xmlns=\"\">passwd</password></ns1:createAccountRequest></soapenv:Body></soapenv:Envelope>";
try {
- OMElement documentElement =
OMXMLBuilderFactory.createOMBuilder(new StringReader(xml))
- .getDocumentElement();
+ OMElement documentElement =
+ OMXMLBuilderFactory.createOMBuilder(new
StringReader(xml)).getDocumentElement();
String actualXML = documentElement.toString();
assertAbout(xml())
.that(actualXML)
@@ -136,15 +141,17 @@ public class NamespaceTest extends TestCase {
}
/**
- * This is re-producing and testing the bug mentioned in
http://issues.apache.org/jira/browse/AXIOM-35
+ * This is re-producing and testing the bug mentioned in
+ * http://issues.apache.org/jira/browse/AXIOM-35
*/
public void testNamespaceProblem7() throws Exception {
- String expectedString = "<person
xmlns=\"http://ws.apache.org/axis2/apacheconasia/06\">" +
- "<name>John</name>" +
- "<age>34</age>" +
- "<weight>50</weight>" +
- "</person>";
+ String expectedString =
+ "<person
xmlns=\"http://ws.apache.org/axis2/apacheconasia/06\">"
+ + "<name>John</name>"
+ + "<age>34</age>"
+ + "<weight>50</weight>"
+ + "</person>";
OMFactory fac = OMAbstractFactory.getOMFactory();
@@ -159,7 +166,7 @@ public class NamespaceTest extends TestCase {
OMElement weightElem = fac.createOMElement("weight", ns);
weightElem.setText("50");
- //Add children to the person element
+ // Add children to the person element
personElem.addChild(nameElem);
personElem.addChild(ageElem);
personElem.addChild(weightElem);
@@ -170,7 +177,8 @@ public class NamespaceTest extends TestCase {
}
/**
- * This is re-producing and testing the bug mentioned in
http://issues.apache.org/jira/browse/AXIOM-35
+ * This is re-producing and testing the bug mentioned in
+ * http://issues.apache.org/jira/browse/AXIOM-35
*/
public void testNamespaceProblem8() throws Exception {
@@ -180,7 +188,7 @@ public class NamespaceTest extends TestCase {
OMNamespace ns =
fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
OMElement personElem = fac.createOMElement("person", ns);
- //Create and add an unqualified element
+ // Create and add an unqualified element
OMElement nameElem = fac.createOMElement("name", null);
nameElem.setText("John");
personElem.addChild(nameElem);
@@ -200,36 +208,34 @@ public class NamespaceTest extends TestCase {
public void testAxis2_3155() {
try {
String xmlString =
- "<outerTag xmlns=\"http://someNamespace\">" +
- "<innerTag>" +
- "<node1>Hello</node1>" +
- "<node2>Hello</node2>" +
- "</innerTag>" +
- "</outerTag>";
+ "<outerTag xmlns=\"http://someNamespace\">"
+ + "<innerTag>"
+ + "<node1>Hello</node1>"
+ + "<node2>Hello</node2>"
+ + "</innerTag>"
+ + "</outerTag>";
OMElement elem = AXIOMUtil.stringToOM(xmlString);
-// System.out.println("--- Calling toStringWithConsume() ---\n");
-// System.out.println(elem.toStringWithConsume());
+ // System.out.println("--- Calling
toStringWithConsume() ---\n");
+ // System.out.println(elem.toStringWithConsume());
xmlString =
- "<outerTag xmlns=\"http://someNamespace\">" +
- "<innerTag>" +
- "<node1>Hello</node1>" +
- "<node2>Hello</node2>" +
- "</innerTag>" +
- "</outerTag>";
+ "<outerTag xmlns=\"http://someNamespace\">"
+ + "<innerTag>"
+ + "<node1>Hello</node1>"
+ + "<node2>Hello</node2>"
+ + "</innerTag>"
+ + "</outerTag>";
elem.close(false);
-
+
elem = AXIOMUtil.stringToOM(xmlString);
-// System.out.println("\n--- Calling toString() ---\n");
-// System.out.println(elem.toString());
-
+ // System.out.println("\n--- Calling toString() ---\n");
+ // System.out.println(elem.toString());
+
elem.close(false);
- }
- catch (Exception e) {
+ } catch (Exception e) {
e.printStackTrace();
}
-
}
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/OMBodyTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/OMBodyTest.java
index cf5a0ef15..d536e01a6 100644
--- a/systests/old-tests/src/test/java/org/apache/axiom/om/OMBodyTest.java
+++ b/systests/old-tests/src/test/java/org/apache/axiom/om/OMBodyTest.java
@@ -38,29 +38,27 @@ public class OMBodyTest extends OMTestCase {
soapBody = soapEnvelope.getBody();
}
- /**
- * Ensure that invoking addChild twice on the same element only
- * adds the child one time.
- */
+ /** Ensure that invoking addChild twice on the same element only adds the
child one time. */
public void testAddChildTwice() {
log.debug("Add Child Twice");
OMElement om1 = soapFactory.createOMElement("child1",
"http://myChild", "pre");
OMElement om2 = soapFactory.createOMElement("child2",
"http://myChild", "pre");
soapBody.addChild(om1);
- soapBody.addChild(om1); // NOOP..Expected behavior: child removed and
then added
+ soapBody.addChild(om1); // NOOP..Expected behavior: child removed and
then added
soapBody.addChild(om2);
-
+
OMElement node = soapBody.getFirstChildWithName(new
QName("http://myChild", "child1"));
node = (OMElement) node.detach();
-
+
assertTrue("Node is missing", node != null);
- assertTrue("Node has the wrong name " + node.getLocalName(),
- node.getLocalName().equals("child1"));
-
+ assertTrue(
+ "Node has the wrong name " + node.getLocalName(),
+ node.getLocalName().equals("child1"));
+
node = soapBody.getFirstChildWithName(new QName("http://myChild",
"child2"));
assertTrue("Node is missing", node != null);
- assertTrue("Node has the wrong name " + node.getLocalName(),
- node.getLocalName().equals("child2"));
+ assertTrue(
+ "Node has the wrong name " + node.getLocalName(),
+ node.getLocalName().equals("child2"));
}
-
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/OMCachingTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/OMCachingTest.java
index 268e41d27..1437cb070 100644
--- a/systests/old-tests/src/test/java/org/apache/axiom/om/OMCachingTest.java
+++ b/systests/old-tests/src/test/java/org/apache/axiom/om/OMCachingTest.java
@@ -33,11 +33,15 @@ public class OMCachingTest extends TestCase {
OMElement documentElement = null;
try {
// first build the OM tree without caching and see whether up can
cosume it again
- OMXMLParserWrapper builder =
OMXMLBuilderFactory.createOMBuilder(SOAPSampleSet.WSA.getMessage(SOAPSpec.SOAP11).getInputStream());
+ OMXMLParserWrapper builder =
+ OMXMLBuilderFactory.createOMBuilder(
+
SOAPSampleSet.WSA.getMessage(SOAPSpec.SOAP11).getInputStream());
documentElement = builder.getDocumentElement();
String envelopeString = documentElement.toStringWithConsume();
} catch (XMLStreamException e) {
- e.printStackTrace(); //To change body of catch statement use File
| Settings | File Templates.
+ e
+ .printStackTrace(); // To change body of catch statement
use File | Settings |
+ // File Templates.
}
try {
@@ -56,7 +60,9 @@ public class OMCachingTest extends TestCase {
OMElement documentElement = null;
try {
// first build the OM tree without caching and see whether up can
cosume it again
- OMXMLParserWrapper builder =
OMXMLBuilderFactory.createOMBuilder(SOAPSampleSet.WSA.getMessage(SOAPSpec.SOAP11).getInputStream());
+ OMXMLParserWrapper builder =
+ OMXMLBuilderFactory.createOMBuilder(
+
SOAPSampleSet.WSA.getMessage(SOAPSpec.SOAP11).getInputStream());
documentElement = builder.getDocumentElement();
String envelopeString = documentElement.toString();
envelopeString = documentElement.toStringWithConsume();
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/OMTestCase.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/OMTestCase.java
index 8b5b66802..2afaa22ed 100644
--- a/systests/old-tests/src/test/java/org/apache/axiom/om/OMTestCase.java
+++ b/systests/old-tests/src/test/java/org/apache/axiom/om/OMTestCase.java
@@ -43,8 +43,9 @@ public abstract class OMTestCase extends TestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
- builder = OMXMLBuilderFactory.createSOAPModelBuilder(
-
SOAPSampleSet.WSA.getMessage(SOAPSpec.SOAP11).getInputStream(), null);
+ builder =
+ OMXMLBuilderFactory.createSOAPModelBuilder(
+
SOAPSampleSet.WSA.getMessage(SOAPSpec.SOAP11).getInputStream(), null);
soapEnvelope = (SOAPEnvelope) builder.getDocumentElement();
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/SerializationTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/SerializationTest.java
index ceffe5fec..a1d5914d7 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/om/SerializationTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/om/SerializationTest.java
@@ -31,16 +31,17 @@ public class SerializationTest extends TestCase {
OMNamespace ns =
fac.createOMNamespace("http://ws.apache.org/axis2/apacheconasia/06", "");
OMElement personElem = fac.createOMElement("person", ns);
- //Create and add using null namespace...this should pick up default
namespace from parent
+ // Create and add using null namespace...this should pick up default
namespace from parent
OMElement nameElem = fac.createOMElement("name", null);
nameElem.setText("John");
personElem.addChild(nameElem);
String xml = personElem.toString();
- assertEquals("Incorrect namespace serialization", 2,
-
xml.split("http://ws.apache.org/axis2/apacheconasia/06").length);
+ assertEquals(
+ "Incorrect namespace serialization",
+ 2,
+
xml.split("http://ws.apache.org/axis2/apacheconasia/06").length);
assertEquals("Incorrect serialization", 2,
xml.split("xmlns=\"\"").length);
-
}
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java
index ca69b20f0..df4d8f9cd 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java
@@ -34,63 +34,67 @@ import java.io.ByteArrayInputStream;
/** This test will test the conversion of a LLOM soap envelope to DOOM */
public class ConvertLLOMToDOOMTest extends TestCase {
public void testConvert() throws Exception {
- String origXML = "<?xml version='1.0' encoding='UTF-8'?>\n" +
- " <soapenv:Envelope
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">\n" +
- " <soapenv:Header>\n" +
- " <wsse:Security
xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"
soapenv:mustUnderstand=\"1\">\n" +
- " <ds:Signature
xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"Signature-6426875\">\n" +
- " <ds:SignedInfo>\n" +
- " <ds:CanonicalizationMethod
Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" />\n" +
- " <ds:SignatureMethod
Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\" />\n" +
- " <ds:Reference URI=\"#id-3083604\">\n" +
- " <ds:Transforms>\n" +
- " <ds:Transform
Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" />\n" +
- " </ds:Transforms>\n" +
- " <ds:DigestMethod
Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" />\n" +
- "
<ds:DigestValue>lDeZJk0/r6u4tOOhOKbN0IEvwi0=</ds:DigestValue>\n" +
- " </ds:Reference>\n" +
- " </ds:SignedInfo>\n" +
- "
<ds:SignatureValue>KhUeWMoUxUFe5jeTlqLdIEIG2Z7Q2q2mh9HT3IAYwbCev+FzXcuLSiPSsb7/+PSDM2SD0gl9tMp+dHjfPxmq7WiduH9mbnP6gkrxxu0T5rR916WsboshJGJKiPlj71bwpMsrrZohx4evHPdQ2SZHthlNb6jZyjq+LS7qFydppHk=</ds:SignatureValue>\n"
+
- " <ds:KeyInfo Id=\"KeyId-2529687\">\n" +
- " <wsse:SecurityTokenReference
xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"
wsu:Id=\"STRId-31966667\">\n" +
- " <ds:X509Data>\n" +
- " <ds:X509IssuerSerial>\n" +
- " <ds:X509IssuerName>CN=OASIS
Interop Test CA,O=OASIS</ds:X509IssuerName>\n" +
- "
<ds:X509SerialNumber>68652640310044618358965661752471103641</ds:X509SerialNumber>\n"
+
- " </ds:X509IssuerSerial>\n" +
- " </ds:X509Data>\n" +
- " </wsse:SecurityTokenReference>\n" +
- " </ds:KeyInfo>\n" +
- " </ds:Signature>\n" +
- " <wsu:Timestamp
xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"
wsu:Id=\"Timestamp-13986615\">\n" +
- "
<wsu:Created>2006-03-31T15:34:38.699Z</wsu:Created>\n" +
- "
<wsu:Expires>2006-03-31T15:39:38.699Z</wsu:Expires>\n" +
- " </wsu:Timestamp>\n" +
- " </wsse:Security>\n" +
- " <wsa:To
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">http://localhost:9080/axis2/services/Service</wsa:To>\n"
+
- " <wsa:ReplyTo
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">\n" +
- "
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>\n" +
- " </wsa:ReplyTo>\n" +
- " <wsa:MessageID
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">urn:uuid:049875A6E153FCAAF011438192785862</wsa:MessageID>\n"
+
- " <wsa:Action
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</wsa:Action>\n"
+
- " </soapenv:Header>\n" +
- " <soapenv:Body
xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"
wsu:Id=\"id-3083604\">\n" +
- " <RequestSecurityToken
xmlns=\"http://schemas.xmlsoap.org/ws/2005/02/trust\"
Context=\"http://get.optional.attrs.working\">\n" +
- "
<TokenType>http://schemas.xmlsoap.org/ws/2005/02/sc/sct</TokenType>\n" +
- "
<RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</RequestType>\n"
+
- " </RequestSecurityToken>\n" +
- " </soapenv:Body>\n" +
- " </soapenv:Envelope>";
-
- SOAPModelBuilder builder =
OMXMLBuilderFactory.createSOAPModelBuilder(new
ByteArrayInputStream(origXML.getBytes()), null);
+ String origXML =
+ "<?xml version='1.0' encoding='UTF-8'?>\n"
+ + " <soapenv:Envelope
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">\n"
+ + " <soapenv:Header>\n"
+ + " <wsse:Security
xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"
soapenv:mustUnderstand=\"1\">\n"
+ + " <ds:Signature
xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"Signature-6426875\">\n"
+ + " <ds:SignedInfo>\n"
+ + " <ds:CanonicalizationMethod
Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" />\n"
+ + " <ds:SignatureMethod
Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\" />\n"
+ + " <ds:Reference
URI=\"#id-3083604\">\n"
+ + " <ds:Transforms>\n"
+ + " <ds:Transform
Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" />\n"
+ + " </ds:Transforms>\n"
+ + " <ds:DigestMethod
Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" />\n"
+ + "
<ds:DigestValue>lDeZJk0/r6u4tOOhOKbN0IEvwi0=</ds:DigestValue>\n"
+ + " </ds:Reference>\n"
+ + " </ds:SignedInfo>\n"
+ + "
<ds:SignatureValue>KhUeWMoUxUFe5jeTlqLdIEIG2Z7Q2q2mh9HT3IAYwbCev+FzXcuLSiPSsb7/+PSDM2SD0gl9tMp+dHjfPxmq7WiduH9mbnP6gkrxxu0T5rR916WsboshJGJKiPlj71bwpMsrrZohx4evHPdQ2SZHthlNb6jZyjq+LS7qFydppHk=</ds:SignatureValue>\n"
+ + " <ds:KeyInfo Id=\"KeyId-2529687\">\n"
+ + " <wsse:SecurityTokenReference
xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"
wsu:Id=\"STRId-31966667\">\n"
+ + " <ds:X509Data>\n"
+ + " <ds:X509IssuerSerial>\n"
+ + "
<ds:X509IssuerName>CN=OASIS Interop Test CA,O=OASIS</ds:X509IssuerName>\n"
+ + "
<ds:X509SerialNumber>68652640310044618358965661752471103641</ds:X509SerialNumber>\n"
+ + " </ds:X509IssuerSerial>\n"
+ + " </ds:X509Data>\n"
+ + " </wsse:SecurityTokenReference>\n"
+ + " </ds:KeyInfo>\n"
+ + " </ds:Signature>\n"
+ + " <wsu:Timestamp
xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"
wsu:Id=\"Timestamp-13986615\">\n"
+ + "
<wsu:Created>2006-03-31T15:34:38.699Z</wsu:Created>\n"
+ + "
<wsu:Expires>2006-03-31T15:39:38.699Z</wsu:Expires>\n"
+ + " </wsu:Timestamp>\n"
+ + " </wsse:Security>\n"
+ + " <wsa:To
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">http://localhost:9080/axis2/services/Service</wsa:To>\n"
+ + " <wsa:ReplyTo
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">\n"
+ + "
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>\n"
+ + " </wsa:ReplyTo>\n"
+ + " <wsa:MessageID
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">urn:uuid:049875A6E153FCAAF011438192785862</wsa:MessageID>\n"
+ + " <wsa:Action
xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</wsa:Action>\n"
+ + " </soapenv:Header>\n"
+ + " <soapenv:Body
xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"
wsu:Id=\"id-3083604\">\n"
+ + " <RequestSecurityToken
xmlns=\"http://schemas.xmlsoap.org/ws/2005/02/trust\"
Context=\"http://get.optional.attrs.working\">\n"
+ + "
<TokenType>http://schemas.xmlsoap.org/ws/2005/02/sc/sct</TokenType>\n"
+ + "
<RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</RequestType>\n"
+ + " </RequestSecurityToken>\n"
+ + " </soapenv:Body>\n"
+ + " </soapenv:Envelope>";
+
+ SOAPModelBuilder builder =
+ OMXMLBuilderFactory.createSOAPModelBuilder(
+ new ByteArrayInputStream(origXML.getBytes()), null);
SOAPEnvelope env = builder.getSOAPEnvelope();
env.build();
- SOAPModelBuilder doomBuilder =
OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM),
- env.getXMLStreamReader());
+ SOAPModelBuilder doomBuilder =
+ OMXMLBuilderFactory.createStAXSOAPModelBuilder(
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM),
+ env.getXMLStreamReader());
SOAPEnvelope doomEnv = doomBuilder.getSOAPEnvelope();
@@ -116,9 +120,10 @@ public class ConvertLLOMToDOOMTest extends TestCase {
fac.createOMElement(new QName("http://test.org", "Test"),
env.getBody());
env.build();
- SOAPModelBuilder doomBuilder =
OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM),
- env.getXMLStreamReader());
+ SOAPModelBuilder doomBuilder =
+ OMXMLBuilderFactory.createStAXSOAPModelBuilder(
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM),
+ env.getXMLStreamReader());
SOAPEnvelope doomEnv = doomBuilder.getSOAPEnvelope();
@@ -126,18 +131,19 @@ public class ConvertLLOMToDOOMTest extends TestCase {
}
public void testAddChild() {
- SOAPFactory fac =
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory();
+ SOAPFactory fac =
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory();
SOAPEnvelope env = fac.getDefaultEnvelope();
fac.createOMElement(new QName("http://test.org", "Test"),
env.getBody());
env.build();
- SOAPFactory llomFac =
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory();
+ SOAPFactory llomFac =
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory();
OMElement elem = llomFac.createOMElement("newDomElement", null);
OMElement firstElement = env.getBody().getFirstElement();
firstElement.addChild(elem);
- assertTrue("New DOM child missing",
- env.toString().indexOf("newDomElement") > 0);
+ assertTrue("New DOM child missing",
env.toString().indexOf("newDomElement") > 0);
}
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java
index 7ec64e52a..7d8df6f3b 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java
@@ -40,13 +40,14 @@ public class OMAttributeTest extends TestCase {
}
private String addAttributeMethod1(String xmlString) throws Exception {
- OMXMLParserWrapper builder2 = OMXMLBuilderFactory.createOMBuilder(new
StringReader(xmlString));
+ OMXMLParserWrapper builder2 =
+ OMXMLBuilderFactory.createOMBuilder(new
StringReader(xmlString));
OMElement doc = builder2.getDocumentElement();
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("http://www.me.com",
"axiom");
- //code line to be tested
+ // code line to be tested
OMAttribute at = factory.createOMAttribute("id", ns, "value");
doc.addAttribute(at);
@@ -54,16 +55,16 @@ public class OMAttributeTest extends TestCase {
}
private String addAttributeMethod2(String xmlString) throws Exception {
- OMXMLParserWrapper builder2 = OMXMLBuilderFactory.createOMBuilder(new
StringReader(xmlString));
+ OMXMLParserWrapper builder2 =
+ OMXMLBuilderFactory.createOMBuilder(new
StringReader(xmlString));
OMElement doc = builder2.getDocumentElement();
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("http://www.me.com",
"axiom");
- //code line to be tested
+ // code line to be tested
doc.addAttribute("id", "value", ns);
return doc.toString();
}
-
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/llom/OMOutputTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/llom/OMOutputTest.java
index 7fecd3302..ad334259c 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/llom/OMOutputTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/llom/OMOutputTest.java
@@ -43,24 +43,20 @@ public class OMOutputTest extends TestCase {
OMFactory fac = OMAbstractFactory.getOMFactory();
- OMNamespace soap = fac.createOMNamespace(
- "http://schemas.xmlsoap.org/soap/envelope/", "soap");
+ OMNamespace soap =
+
fac.createOMNamespace("http://schemas.xmlsoap.org/soap/envelope/", "soap");
envelope = fac.createOMElement("Envelope", soap);
OMElement body = fac.createOMElement("Body", soap);
- OMNamespace dataName = fac.createOMNamespace(
- "http://www.example.org/stuff", "m");
+ OMNamespace dataName =
fac.createOMNamespace("http://www.example.org/stuff", "m");
OMElement data = fac.createOMElement("data", dataName);
- OMNamespace mime = fac.createOMNamespace(
- "http://www.w3.org/2003/06/xmlmime", "mime");
+ OMNamespace mime =
fac.createOMNamespace("http://www.w3.org/2003/06/xmlmime", "mime");
OMElement text = fac.createOMElement("name", dataName);
- OMAttribute cType1 = fac.createOMAttribute("contentType", mime,
- "text/plain");
+ OMAttribute cType1 = fac.createOMAttribute("contentType", mime,
"text/plain");
text.addAttribute(cType1);
- byte[] byteArray = new byte[] { 13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
- 98 };
+ byte[] byteArray = new byte[] {13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
98};
OMText textData = fac.createOMText(Blobs.createBlob(byteArray), false);
envelope.addChild(body);
@@ -78,4 +74,4 @@ public class OMOutputTest extends TestCase {
envelope.serializeAndConsume(NullOutputStream.NULL_OUTPUT_STREAM,
baseOutputFormat);
envelope.serializeAndConsume(NullOutputStream.NULL_OUTPUT_STREAM,
mtomOutputFormat);
}
-}
\ No newline at end of file
+}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
index 88583de94..a7cae7c15 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
@@ -54,10 +54,11 @@ public class MTOMStAXSOAPModelBuilderTest extends TestCase {
}
private OMElement createTestMTOMMessage() throws Exception {
- return
OMXMLBuilderFactory.createSOAPModelBuilder(createAttachmentsForTestMTOMMessage().getMultipartBody()).getDocumentElement();
+ return OMXMLBuilderFactory.createSOAPModelBuilder(
+
createAttachmentsForTestMTOMMessage().getMultipartBody())
+ .getDocumentElement();
}
-
-
+
private void checkSerialization(OMElement root, boolean optimize) throws
Exception {
OMOutputFormat format = new OMOutputFormat();
format.setDoOptimize(optimize);
@@ -73,7 +74,7 @@ public class MTOMStAXSOAPModelBuilderTest extends TestCase {
assertTrue(msg.indexOf("Content-ID: <-1609420109260943731>") < 0);
}
}
-
+
public void testCreateOMElement() throws Exception {
OMElement root = createTestMTOMMessage();
OMElement body = (OMElement) root.getFirstOMChild();
@@ -88,12 +89,11 @@ public class MTOMStAXSOAPModelBuilderTest extends TestCase {
* If it is not he has to use a Custom Defined DataSource to get the
* Object.
*/
- byte[] expectedObject = new byte[] { 13, 56, 65, 32, 12, 12, 7, -3, -2,
- -1, 98 };
+ byte[] expectedObject = new byte[] {13, 56, 65, 32, 12, 12, 7, -3, -2,
-1, 98};
Blob actualBlob = blobNode.getBlob();
- //ByteArrayInputStream object = (ByteArrayInputStream) actualDH
- //.getContent();
- //byte[] actualObject= null;
+ // ByteArrayInputStream object = (ByteArrayInputStream) actualDH
+ // .getContent();
+ // byte[] actualObject= null;
// object.read(actualObject,0,10);
// assertEquals("Object check", expectedObject[5],actualObject[5] );
@@ -102,19 +102,20 @@ public class MTOMStAXSOAPModelBuilderTest extends
TestCase {
/**
* Test that MIME parts are not loaded before requesting the DataHandlers
from the corresponding
* OMText nodes.
- *
+ *
* @throws Exception
*/
public void testDeferredLoadingOfAttachments() throws Exception {
Attachments attachments = createAttachmentsForTestMTOMMessage();
- SOAPModelBuilder builder =
OMXMLBuilderFactory.createSOAPModelBuilder(attachments.getMultipartBody());
+ SOAPModelBuilder builder =
+
OMXMLBuilderFactory.createSOAPModelBuilder(attachments.getMultipartBody());
OMDocument doc = builder.getDocument();
// Find all the binary nodes
List<OMText> binaryNodes = new ArrayList<>();
for (Iterator<OMSerializable> it = doc.getDescendants(false);
it.hasNext(); ) {
OMSerializable node = it.next();
if (node instanceof OMText) {
- OMText text = (OMText)node;
+ OMText text = (OMText) node;
if (text.isBinary()) {
binaryNodes.add(text);
}
@@ -130,87 +131,86 @@ public class MTOMStAXSOAPModelBuilderTest extends
TestCase {
}
assertEquals(binaryNodes.size() + 1,
attachments.getContentIDList().size());
}
-
+
/**
- * Test reading a message containing XOP and ensuring that the
- * the XOP is preserved when it is serialized.
+ * Test reading a message containing XOP and ensuring that the the XOP is
preserved when it is
+ * serialized.
+ *
* @throws Exception
*/
public void testCreateAndSerializeOptimized() throws Exception {
OMElement root = createTestMTOMMessage();
checkSerialization(root, true);
}
-
+
/**
- * Test reading a message containing XOP.
- * Then make a copy of the message.
- * Then ensure that the XOP is preserved when it is serialized.
+ * Test reading a message containing XOP. Then make a copy of the message.
Then ensure that the
+ * XOP is preserved when it is serialized.
+ *
* @throws Exception
*/
public void testCreateCloneAndSerializeOptimized() throws Exception {
OMElement root = createTestMTOMMessage();
-
+
// Create a clone of root
OMElement root2 = root.cloneOMElement();
-
+
// Write out the source
checkSerialization(root, true);
-
+
// Write out the clone
checkSerialization(root2, true);
}
-
+
/**
- * Test reading a message containing XOP.
- * Fully build the tree.
- * Then make a copy of the message.
+ * Test reading a message containing XOP. Fully build the tree. Then make
a copy of the message.
* Then ensure that the XOP is preserved when it is serialized.
+ *
* @throws Exception
*/
public void testCreateBuildCloneAndSerializeOptimized() throws Exception {
OMElement root = createTestMTOMMessage();
-
+
// Fully build the root
root.buildWithAttachments();
-
+
// Create a clone of root
OMElement root2 = root.cloneOMElement();
-
+
// Write out the source
checkSerialization(root, true);
-
+
// Write out the clone
checkSerialization(root2, true);
}
-
+
/**
- * Test reading a message containing XOP.
- * Serialize the tree (with caching).
- * Then ensure that the XOP is preserved when it is serialized again.
- * <p>
- * Regression test for AXIOM-264.
- *
+ * Test reading a message containing XOP. Serialize the tree (with
caching). Then ensure that
+ * the XOP is preserved when it is serialized again.
+ *
+ * <p>Regression test for AXIOM-264.
+ *
* @throws Exception
*/
public void testCreateSerializeAndSerializeOptimized() throws Exception {
OMElement root = createTestMTOMMessage();
-
+
// Serialize the tree (with caching).
root.serialize(new ByteArrayOutputStream());
-
+
// Write out the source
checkSerialization(root, true);
}
-
+
/**
- * Test reading a message containing XOP.
- * Enable inlining serialization
- * Then ensure that the data is inlined when written
+ * Test reading a message containing XOP. Enable inlining serialization
Then ensure that the
+ * data is inlined when written
+ *
* @throws Exception
*/
public void testCreateAndSerializeInlined() throws Exception {
OMElement root = createTestMTOMMessage();
-
+
checkSerialization(root, false);
}
@@ -218,27 +218,35 @@ public class MTOMStAXSOAPModelBuilderTest extends
TestCase {
String contentTypeString =
"multipart/Related; charset=\"UTF-8\";
type=\"application/xop+xml\"; boundary=\"----=_AxIs2_Def_boundary_=42214532\";
start=\"SOAPPart\"";
String cid = "1.urn:uuid:[email protected]";
- String xmlPlusMime1 = "------=_AxIs2_Def_boundary_=42214532\r\n" +
- "Content-Type: application/xop+xml; charset=UTF-16;
type=\"application/soap+xml\"\r\n" +
- "Content-Transfer-Encoding: 8bit\r\n" +
- "Content-ID: SOAPPart\r\n" +
- "\r\n";
- String xmlPlusMime2 = "<soapenv:Envelope
xmlns:soapenv=\"http://www.w3.org/2003/05/soap-envelope\"><soapenv:Body><m:data
xmlns:m=\"http://www.example.org/stuff\"><m:name
m:contentType=\"text/plain\"><xop:Include
xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:" + cid +
"\"></xop:Include></m:name></m:data></soapenv:Body></soapenv:Envelope>\r\n";
- String xmlPlusMime3 = "\r\n------=_AxIs2_Def_boundary_=42214532\r\n" +
- "Content-Transfer-Encoding: binary\r\n" +
- "Content-ID: " + cid + "\r\n" +
- "\r\n" +
- "Foo Bar\r\n" +
- "------=_AxIs2_Def_boundary_=42214532--\r\n";
+ String xmlPlusMime1 =
+ "------=_AxIs2_Def_boundary_=42214532\r\n"
+ + "Content-Type: application/xop+xml; charset=UTF-16;
type=\"application/soap+xml\"\r\n"
+ + "Content-Transfer-Encoding: 8bit\r\n"
+ + "Content-ID: SOAPPart\r\n"
+ + "\r\n";
+ String xmlPlusMime2 =
+ "<soapenv:Envelope
xmlns:soapenv=\"http://www.w3.org/2003/05/soap-envelope\"><soapenv:Body><m:data
xmlns:m=\"http://www.example.org/stuff\"><m:name
m:contentType=\"text/plain\"><xop:Include
xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:"
+ + cid
+ +
"\"></xop:Include></m:name></m:data></soapenv:Body></soapenv:Envelope>\r\n";
+ String xmlPlusMime3 =
+ "\r\n------=_AxIs2_Def_boundary_=42214532\r\n"
+ + "Content-Transfer-Encoding: binary\r\n"
+ + "Content-ID: "
+ + cid
+ + "\r\n"
+ + "\r\n"
+ + "Foo Bar\r\n"
+ + "------=_AxIs2_Def_boundary_=42214532--\r\n";
byte[] bytes1 = xmlPlusMime1.getBytes();
byte[] bytes2 = xmlPlusMime2.getBytes(StandardCharsets.UTF_16);
byte[] bytes3 = xmlPlusMime3.getBytes();
byte[] full = append(bytes1, bytes2);
full = append(full, bytes3);
-
+
InputStream inStream = new BufferedInputStream(new
ByteArrayInputStream(full));
Attachments attachments = new Attachments(inStream, contentTypeString);
- SOAPModelBuilder builder =
OMXMLBuilderFactory.createSOAPModelBuilder(attachments.getMultipartBody());
+ SOAPModelBuilder builder =
+
OMXMLBuilderFactory.createSOAPModelBuilder(attachments.getMultipartBody());
OMElement root = builder.getDocumentElement();
root.build();
}
@@ -249,4 +257,4 @@ public class MTOMStAXSOAPModelBuilderTest extends TestCase {
System.arraycopy(b, 0, z, a.length, b.length);
return z;
}
-}
\ No newline at end of file
+}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/serializer/ElementSerializerTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/serializer/ElementSerializerTest.java
index 16723db9a..4b542d027 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/serializer/ElementSerializerTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/serializer/ElementSerializerTest.java
@@ -46,29 +46,27 @@ public class ElementSerializerTest extends TestCase {
@Override
protected void setUp() throws Exception {
- reader =
StAXUtils.createXMLStreamReader(SOAPSampleSet.WSA.getMessage(SOAPSpec.SOAP11).getInputStream());
+ reader =
+ StAXUtils.createXMLStreamReader(
+
SOAPSampleSet.WSA.getMessage(SOAPSpec.SOAP11).getInputStream());
writer = StAX.createNullXMLStreamWriter();
- builder =
- OMXMLBuilderFactory.createStAXSOAPModelBuilder(reader);
+ builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(reader);
}
public void testElementSerilization() throws Exception {
OMElement elt = builder.getDocumentElement();
elt.serialize(writer);
-
}
public void testElementSerilizationCacheOff() throws Exception {
OMElement elt = builder.getDocumentElement();
elt.serialize(writer);
-
}
public void testElementSerilizationChild() throws Exception {
OMElement elt = builder.getDocumentElement();
OMNode node = elt.getFirstOMChild().getNextOMSibling();
node.serialize(writer);
-
}
public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/serializer/PreserveEnvelopeTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/serializer/PreserveEnvelopeTest.java
index 75fe108ba..4f7ff0256 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/om/impl/serializer/PreserveEnvelopeTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/om/impl/serializer/PreserveEnvelopeTest.java
@@ -29,83 +29,74 @@ import junit.framework.TestCase;
public class PreserveEnvelopeTest extends TestCase {
-
private String originalXML =
- "<Assertion xmlns=\"urn:oasis:names:tc:SAML:1.0:assertion\"
xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\"
xmlns:samlp=\"urn:oasis:names:tc:SAML:1.0:protocol\"
AssertionID=\"ef98507718ea606c6ae1e89d2c0865ee\"
IssueInstant=\"2006-01-03T15:09:35.164Z\" Issuer=\"C=US,O=National Center for
Supercomputing Applications,CN=Hemapani Srinath Perera\" MajorVersion=\"1\"
MinorVersion=\"1\"><Conditions NotBefore=\"2006-01-03T15:09:35.164Z\"
NotOnOrAfter=\"2006-01-03T15:39:35.164Z\" [...]
- "<ds:SignedInfo>\n" +
- "<ds:CanonicalizationMethod
Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"></ds:CanonicalizationMethod>\n"
+
- "<ds:SignatureMethod
Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod>\n"
+
- "<ds:Reference
URI=\"#ef98507718ea606c6ae1e89d2c0865ee\">\n" +
- "<ds:Transforms>\n" +
- "<ds:Transform
Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\"></ds:Transform>\n"
+
- "<ds:Transform
Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces
xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"code ds kind
rw saml samlp typens #default\"></ec:InclusiveNamespaces></ds:Transform>\n" +
- "</ds:Transforms>\n" +
- "<ds:DigestMethod
Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod>\n" +
-
"<ds:DigestValue>0bqebD+zkADcbXleyxpFUySp7cY=</ds:DigestValue>\n" +
- "</ds:Reference>\n" +
- "</ds:SignedInfo>\n" +
- "<ds:SignatureValue>\n" +
-
"HVZDR4InypCICJxbCSrZJsikcpSACZRTt5Ly2gfLBUpdVeq6koHAKo8WGrGHbZVzNFAmxj3i52jQ\n"
+
- "aYeO0J6LIA==\n" +
- "</ds:SignatureValue>\n" +
- "<ds:KeyInfo>\n" +
- "<ds:X509Data>\n" +
- "<ds:X509Certificate>\n" +
-
"MIIClDCCAXygAwIBAwICBEkwDQYJKoZIhvcNAQEEBQAwaTELMAkGA1UEBhMCVVMxODA2BgNVBAoT\n"
+
-
"L05hdGlvbmFsIENlbnRlciBmb3IgU3VwZXJjb21wdXRpbmcgQXBwbGljYXRpb25zMSAwHgYDVQQD\n"
+
-
"ExdIZW1hcGFuaSBTcmluYXRoIFBlcmVyYTAeFw0wNjAxMDMxNDM2MTFaFw0wNjAxMDQwMjQxMTFa\n"
+
-
"MHkxCzAJBgNVBAYTAlVTMTgwNgYDVQQKEy9OYXRpb25hbCBDZW50ZXIgZm9yIFN1cGVyY29tcHV0\n"
+
-
"aW5nIEFwcGxpY2F0aW9uczEgMB4GA1UEAxMXSGVtYXBhbmkgU3JpbmF0aCBQZXJlcmExDjAMBgNV\n"
+
-
"BAMTBXByb3h5MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALyBo53oJTrVjs/RCFLJaMKektAqeNCi\n"
+
-
"IAhEx+pE0BxL23WV8mhxUNDJevO7lkRuwuDWchbobq8S1WNRYrbOqRkCAwEAATANBgkqhkiG9w0B\n"
+
-
"AQQFAAOCAQEAEZRsxz1izBa8SNw7x1nCttjTDnRM102CTad/uq3vihKmOauBo8lFqklT2xoFv+Nx\n"
+
-
"WX1FXT5AAqedITtUn99zk3Sr5c/SgdO59NxSaWgqxTOd7koZUmz8Sta9IK7d1fDFhDie2W2EtUMk\n"
+
-
"QX0Rr7KHReF6a0knQ+kGlhDuA2YN27CpNg+gBTq0+p1yaVA79qf2BVDYBklPG2N5tWn2GekHoUMs\n"
+
-
"7nlU9WlUI0tRUKuGGdQ+2WLTW0w2UuqsJuHvDaquZRnTOjhdiRw5/Mg62LqkSwo99Dc3JiJusqoY\n"
+
- "16Unq8wp5gVJbj36UoVvqnVOyBltseIaU5bLS5LIrv11hXA6fg==\n" +
- "</ds:X509Certificate>\n" +
- "<ds:X509Certificate>\n" +
-
"MIIEVzCCAz+gAwIBAgICBEkwDQYJKoZIhvcNAQEEBQAwaTELMAkGA1UEBhMCVVMxODA2BgNVBAoT\n"
+
-
"L05hdGlvbmFsIENlbnRlciBmb3IgU3VwZXJjb21wdXRpbmcgQXBwbGljYXRpb25zMSAwHgYDVQQD\n"
+
-
"ExdDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNTEwMjUxOTMxMzRaFw0wNzEwMjUxOTMxMzRa\n"
+
-
"MGkxCzAJBgNVBAYTAlVTMTgwNgYDVQQKEy9OYXRpb25hbCBDZW50ZXIgZm9yIFN1cGVyY29tcHV0\n"
+
-
"aW5nIEFwcGxpY2F0aW9uczEgMB4GA1UEAxMXSGVtYXBhbmkgU3JpbmF0aCBQZXJlcmEwggEiMA0G\n"
+
-
"CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/pkVn4ZUEM5BjfocwiiQVF4ivFpJJ8u1m8vq0WNlc\n"
+
-
"bw4rjMOet1YArC46fZ1Gg652A1dF92+8hHNeBa6chll5HRZkx5FLN7XEGY4EcHhXA6lHmjklpf8N\n"
+
-
"Iy6/91ElOT1pVoLRpOeJ1TFT/nQxMBMJbMyhycrUV49M8oL3O/CYAm1YVQjCtdieK/ibFXzgP2iX\n"
+
-
"R8oOrAX/Ogp+FilUkdrZlhhhzV/NdGdQrPQxxpWbXsLOgiyEU4W1BWSHHI1E1cs0KUoYvaboAYaq\n"
+
-
"E+0WZlhqDxQy3SKOZVPYk9fJu9+qAb0gaDIgtN4FrZFYvTrlNMcrmyaC2ozr43nxwVMlq9dnAgMB\n"
+
-
"AAGjggEHMIIBAzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIE8DAdBgNVHQ4EFgQU90FgTLg4k1yN3yJu\n"
+
-
"d4TZIbxUGigwgZMGA1UdIwSBizCBiIAU8r6NqmFJES25W3IkKhjSwoXGmIGhbaRrMGkxCzAJBgNV\n"
+
-
"BAYTAlVTMTgwNgYDVQQKEy9OYXRpb25hbCBDZW50ZXIgZm9yIFN1cGVyY29tcHV0aW5nIEFwcGxp\n"
+
-
"Y2F0aW9uczEgMB4GA1UEAxMXQ2VydGlmaWNhdGlvbiBBdXRob3JpdHmCAQAwNAYDVR0fBC0wKzAp\n"
+
-
"oCegJYYjaHR0cDovL2NhLm5jc2EudWl1Yy5lZHUvNGE2Y2Q4YjEucjAwDQYJKoZIhvcNAQEEBQAD\n"
+
-
"ggEBAHnFMFeZTHjuq/juH3qw1jDrr4IuKnljuLHWSi8GuMt1mxOs/vR7rMg0OAs16gMJP3X2uSK5\n"
+
-
"0miXqsbZ4AQuBJqo5Pm8UaSzeJlBle02SUvt2Fxhze9odLgoUXHp/1hKm9blHbp5cZqlbsmckk8y\n"
+
-
"4xOPgNYh1G3oxdv2OcadmJBMlYwcBK+TkO8GbemqXqdFt6itGkkhLGQdspw9c1r38bXd9lhLbVR8\n"
+
-
"7yif8ffqIgouVe/wj3NIjSbxgjff88Hz6CCuOWiafvfpgmrU906yOZqe6jBDBTKF5xmqyCNKKFAJ\n"
+
- "UbmPCX2vMKCpWrLU+MotR2HSbljslSUhfKCjHvFb/AA=\n" +
- "</ds:X509Certificate>\n" +
- "</ds:X509Data>\n" +
- "</ds:KeyInfo></ds:Signature></Assertion>";
-
+ "<Assertion xmlns=\"urn:oasis:names:tc:SAML:1.0:assertion\"
xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\"
xmlns:samlp=\"urn:oasis:names:tc:SAML:1.0:protocol\"
AssertionID=\"ef98507718ea606c6ae1e89d2c0865ee\"
IssueInstant=\"2006-01-03T15:09:35.164Z\" Issuer=\"C=US,O=National Center for
Supercomputing Applications,CN=Hemapani Srinath Perera\" MajorVersion=\"1\"
MinorVersion=\"1\"><Conditions NotBefore=\"2006-01-03T15:09:35.164Z\"
NotOnOrAfter=\"2006-01-03T15:39:35.164Z\" [...]
+ + "<ds:SignedInfo>\n"
+ + "<ds:CanonicalizationMethod
Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"></ds:CanonicalizationMethod>\n"
+ + "<ds:SignatureMethod
Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod>\n"
+ + "<ds:Reference
URI=\"#ef98507718ea606c6ae1e89d2c0865ee\">\n"
+ + "<ds:Transforms>\n"
+ + "<ds:Transform
Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\"></ds:Transform>\n"
+ + "<ds:Transform
Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces
xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"code ds kind
rw saml samlp typens #default\"></ec:InclusiveNamespaces></ds:Transform>\n"
+ + "</ds:Transforms>\n"
+ + "<ds:DigestMethod
Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod>\n"
+ +
"<ds:DigestValue>0bqebD+zkADcbXleyxpFUySp7cY=</ds:DigestValue>\n"
+ + "</ds:Reference>\n"
+ + "</ds:SignedInfo>\n"
+ + "<ds:SignatureValue>\n"
+ +
"HVZDR4InypCICJxbCSrZJsikcpSACZRTt5Ly2gfLBUpdVeq6koHAKo8WGrGHbZVzNFAmxj3i52jQ\n"
+ + "aYeO0J6LIA==\n"
+ + "</ds:SignatureValue>\n"
+ + "<ds:KeyInfo>\n"
+ + "<ds:X509Data>\n"
+ + "<ds:X509Certificate>\n"
+ +
"MIIClDCCAXygAwIBAwICBEkwDQYJKoZIhvcNAQEEBQAwaTELMAkGA1UEBhMCVVMxODA2BgNVBAoT\n"
+ +
"L05hdGlvbmFsIENlbnRlciBmb3IgU3VwZXJjb21wdXRpbmcgQXBwbGljYXRpb25zMSAwHgYDVQQD\n"
+ +
"ExdIZW1hcGFuaSBTcmluYXRoIFBlcmVyYTAeFw0wNjAxMDMxNDM2MTFaFw0wNjAxMDQwMjQxMTFa\n"
+ +
"MHkxCzAJBgNVBAYTAlVTMTgwNgYDVQQKEy9OYXRpb25hbCBDZW50ZXIgZm9yIFN1cGVyY29tcHV0\n"
+ +
"aW5nIEFwcGxpY2F0aW9uczEgMB4GA1UEAxMXSGVtYXBhbmkgU3JpbmF0aCBQZXJlcmExDjAMBgNV\n"
+ +
"BAMTBXByb3h5MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALyBo53oJTrVjs/RCFLJaMKektAqeNCi\n"
+ +
"IAhEx+pE0BxL23WV8mhxUNDJevO7lkRuwuDWchbobq8S1WNRYrbOqRkCAwEAATANBgkqhkiG9w0B\n"
+ +
"AQQFAAOCAQEAEZRsxz1izBa8SNw7x1nCttjTDnRM102CTad/uq3vihKmOauBo8lFqklT2xoFv+Nx\n"
+ +
"WX1FXT5AAqedITtUn99zk3Sr5c/SgdO59NxSaWgqxTOd7koZUmz8Sta9IK7d1fDFhDie2W2EtUMk\n"
+ +
"QX0Rr7KHReF6a0knQ+kGlhDuA2YN27CpNg+gBTq0+p1yaVA79qf2BVDYBklPG2N5tWn2GekHoUMs\n"
+ +
"7nlU9WlUI0tRUKuGGdQ+2WLTW0w2UuqsJuHvDaquZRnTOjhdiRw5/Mg62LqkSwo99Dc3JiJusqoY\n"
+ + "16Unq8wp5gVJbj36UoVvqnVOyBltseIaU5bLS5LIrv11hXA6fg==\n"
+ + "</ds:X509Certificate>\n"
+ + "<ds:X509Certificate>\n"
+ +
"MIIEVzCCAz+gAwIBAgICBEkwDQYJKoZIhvcNAQEEBQAwaTELMAkGA1UEBhMCVVMxODA2BgNVBAoT\n"
+ +
"L05hdGlvbmFsIENlbnRlciBmb3IgU3VwZXJjb21wdXRpbmcgQXBwbGljYXRpb25zMSAwHgYDVQQD\n"
+ +
"ExdDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNTEwMjUxOTMxMzRaFw0wNzEwMjUxOTMxMzRa\n"
+ +
"MGkxCzAJBgNVBAYTAlVTMTgwNgYDVQQKEy9OYXRpb25hbCBDZW50ZXIgZm9yIFN1cGVyY29tcHV0\n"
+ +
"aW5nIEFwcGxpY2F0aW9uczEgMB4GA1UEAxMXSGVtYXBhbmkgU3JpbmF0aCBQZXJlcmEwggEiMA0G\n"
+ +
"CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/pkVn4ZUEM5BjfocwiiQVF4ivFpJJ8u1m8vq0WNlc\n"
+ +
"bw4rjMOet1YArC46fZ1Gg652A1dF92+8hHNeBa6chll5HRZkx5FLN7XEGY4EcHhXA6lHmjklpf8N\n"
+ +
"Iy6/91ElOT1pVoLRpOeJ1TFT/nQxMBMJbMyhycrUV49M8oL3O/CYAm1YVQjCtdieK/ibFXzgP2iX\n"
+ +
"R8oOrAX/Ogp+FilUkdrZlhhhzV/NdGdQrPQxxpWbXsLOgiyEU4W1BWSHHI1E1cs0KUoYvaboAYaq\n"
+ +
"E+0WZlhqDxQy3SKOZVPYk9fJu9+qAb0gaDIgtN4FrZFYvTrlNMcrmyaC2ozr43nxwVMlq9dnAgMB\n"
+ +
"AAGjggEHMIIBAzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIE8DAdBgNVHQ4EFgQU90FgTLg4k1yN3yJu\n"
+ +
"d4TZIbxUGigwgZMGA1UdIwSBizCBiIAU8r6NqmFJES25W3IkKhjSwoXGmIGhbaRrMGkxCzAJBgNV\n"
+ +
"BAYTAlVTMTgwNgYDVQQKEy9OYXRpb25hbCBDZW50ZXIgZm9yIFN1cGVyY29tcHV0aW5nIEFwcGxp\n"
+ +
"Y2F0aW9uczEgMB4GA1UEAxMXQ2VydGlmaWNhdGlvbiBBdXRob3JpdHmCAQAwNAYDVR0fBC0wKzAp\n"
+ +
"oCegJYYjaHR0cDovL2NhLm5jc2EudWl1Yy5lZHUvNGE2Y2Q4YjEucjAwDQYJKoZIhvcNAQEEBQAD\n"
+ +
"ggEBAHnFMFeZTHjuq/juH3qw1jDrr4IuKnljuLHWSi8GuMt1mxOs/vR7rMg0OAs16gMJP3X2uSK5\n"
+ +
"0miXqsbZ4AQuBJqo5Pm8UaSzeJlBle02SUvt2Fxhze9odLgoUXHp/1hKm9blHbp5cZqlbsmckk8y\n"
+ +
"4xOPgNYh1G3oxdv2OcadmJBMlYwcBK+TkO8GbemqXqdFt6itGkkhLGQdspw9c1r38bXd9lhLbVR8\n"
+ +
"7yif8ffqIgouVe/wj3NIjSbxgjff88Hz6CCuOWiafvfpgmrU906yOZqe6jBDBTKF5xmqyCNKKFAJ\n"
+ + "UbmPCX2vMKCpWrLU+MotR2HSbljslSUhfKCjHvFb/AA=\n"
+ + "</ds:X509Certificate>\n"
+ + "</ds:X509Data>\n"
+ + "</ds:KeyInfo></ds:Signature></Assertion>";
public void testOMNS() {
OMXMLParserWrapper builder =
OMXMLBuilderFactory.createOMBuilder(new
StringReader(originalXML));
OMElement documentElement = builder.getDocumentElement();
- //assertXMLEqual(originalXML, documentElement.toString());
+ // assertXMLEqual(originalXML, documentElement.toString());
documentElement.build();
String outstr = documentElement.toString();
assertTrue(outstr.indexOf("xmlns:saml=") > 0);
assertTrue(outstr.indexOf("<Assertion") == 0);
}
-
-
}
-
-
-
-
-
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/soap/SOAP11DefaultFaultConversionTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/soap/SOAP11DefaultFaultConversionTest.java
index 3d868b69e..419ea6778 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/soap/SOAP11DefaultFaultConversionTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/soap/SOAP11DefaultFaultConversionTest.java
@@ -22,7 +22,6 @@ package org.apache.axiom.soap;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.soap.SOAPEnvelope;
import junit.framework.TestCase;
@@ -31,44 +30,42 @@ import junit.framework.TestCase;
* http://issues.apache.org/jira/browse/AXIOM-113
*/
public class SOAP11DefaultFaultConversionTest extends TestCase {
-
+
public void testConversion() {
-
+
String faultCode = "soapenv" + ":" + "Server";
String faultReason = "/ by zero";
- String faultDetail = "org.apache.axis2.AxisFault: / by zero \n" +
- "... 24 more)";
-
+ String faultDetail = "org.apache.axis2.AxisFault: / by zero \n" + "...
24 more)";
+
SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-
+
SOAPEnvelope envelope = factory.getDefaultFaultEnvelope();
SOAPFault fault = envelope.getBody().getFault();
-
+
fault.getCode().setText(faultCode);
-
+
fault.getReason().setText(faultReason);
-
+
OMElement exception = factory.createOMElement("Exception", null);
exception.setText(faultDetail);
-
+
fault.getDetail().addDetailEntry(exception);
-
+
envelope.build();
-
- SOAPModelBuilder stAXSOAPModelBuilder =
OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM),
- envelope.getXMLStreamReader());
+
+ SOAPModelBuilder stAXSOAPModelBuilder =
+ OMXMLBuilderFactory.createStAXSOAPModelBuilder(
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM),
+ envelope.getXMLStreamReader());
SOAPEnvelope env = stAXSOAPModelBuilder.getSOAPEnvelope();
env.getParent().build();
-
+
fault = env.getBody().getFault();
-
+
assertEquals(faultCode, fault.getCode().getText());
- assertEquals(faultReason,fault.getReason().getText());
-
- exception = (OMElement)fault.getDetail().getFirstOMChild();
+ assertEquals(faultReason, fault.getReason().getText());
+
+ exception = (OMElement) fault.getDetail().getFirstOMChild();
assertEquals(faultDetail, exception.getText());
-
}
-
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncoding2Test.java
b/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncoding2Test.java
index 2e782cb73..9a5abf4ab 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncoding2Test.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncoding2Test.java
@@ -35,32 +35,35 @@ import java.nio.charset.StandardCharsets;
import junit.framework.TestCase;
public class CharacterEncoding2Test extends TestCase {
- String xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>" +
- "<soap:Envelope
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
- "<soap:Body>" +
- "<AgendaPesquisa>" +
- "<status>0</status>" +
- "<ListaContatosPesquisa>" +
- "<tipo>C</tipo>" +
- "<dono>lucia</dono>" +
- "<posicao>177</posicao>" +
- "<nome>Abric� Gimar�es</nome>" +
- "<email></email>" +
- "</ListaContatosPesquisa>" +
- "</AgendaPesquisa>" +
- "</soap:Body>" +
- "</soap:Envelope>";
+ String xml =
+ "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"
+ + "<soap:Envelope
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+ + "<soap:Body>"
+ + "<AgendaPesquisa>"
+ + "<status>0</status>"
+ + "<ListaContatosPesquisa>"
+ + "<tipo>C</tipo>"
+ + "<dono>lucia</dono>"
+ + "<posicao>177</posicao>"
+ + "<nome>Abric� Gimar�es</nome>"
+ + "<email></email>"
+ + "</ListaContatosPesquisa>"
+ + "</AgendaPesquisa>"
+ + "</soap:Body>"
+ + "</soap:Envelope>";
public void testISO99591() throws Exception {
- ByteArrayInputStream byteInStr = new
ByteArrayInputStream(xml.getBytes(StandardCharsets.ISO_8859_1));
+ ByteArrayInputStream byteInStr =
+ new
ByteArrayInputStream(xml.getBytes(StandardCharsets.ISO_8859_1));
- SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(
- byteInStr, null);
+ SOAPModelBuilder builder =
OMXMLBuilderFactory.createSOAPModelBuilder(byteInStr, null);
SOAPEnvelope envelope = builder.getSOAPEnvelope();
envelope.build();
- assertEquals("iso-8859-1",
builder.getDocument().getXMLStreamReader().getCharacterEncodingScheme());
+ assertEquals(
+ "iso-8859-1",
+
builder.getDocument().getXMLStreamReader().getCharacterEncodingScheme());
ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
OMOutputFormat outputFormat = new OMOutputFormat();
@@ -68,9 +71,15 @@ public class CharacterEncoding2Test extends TestCase {
envelope.serialize(byteOutStr, outputFormat);
assertAbout(xml())
- .that(new InputStreamReader(new
ByteArrayInputStream(byteOutStr.toByteArray()), StandardCharsets.ISO_8859_1))
- .hasSameContentAs(new InputStreamReader(new
ByteArrayInputStream(xml.getBytes(StandardCharsets.ISO_8859_1)),
StandardCharsets.ISO_8859_1));
-
+ .that(
+ new InputStreamReader(
+ new
ByteArrayInputStream(byteOutStr.toByteArray()),
+ StandardCharsets.ISO_8859_1))
+ .hasSameContentAs(
+ new InputStreamReader(
+ new
ByteArrayInputStream(xml.getBytes(StandardCharsets.ISO_8859_1)),
+ StandardCharsets.ISO_8859_1));
+
builder.close();
}
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncodingTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncodingTest.java
index 2c9590617..86dda2cbf 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncodingTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/CharacterEncodingTest.java
@@ -59,7 +59,6 @@ public class CharacterEncodingTest extends TestCase {
envelope.getBody().addChild(bodyChild);
-
ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
OMOutputFormat outputFormat = new OMOutputFormat();
@@ -68,8 +67,7 @@ public class CharacterEncodingTest extends TestCase {
ByteArrayInputStream byteInStr = new
ByteArrayInputStream(byteOutStr.toByteArray());
- SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(
- byteInStr, UTF_16);
+ SOAPModelBuilder builder =
OMXMLBuilderFactory.createSOAPModelBuilder(byteInStr, UTF_16);
SOAPEnvelope resultEnv = builder.getSOAPEnvelope();
@@ -115,7 +113,8 @@ public class CharacterEncodingTest extends TestCase {
}
public void testFrenchAccents() throws Exception {
-
runtest("\u00e0\u00e2\u00e4\u00e7\u00e8\u00e9\u00ea\u00eb\u00ee\u00ef\u00f4\u00f6\u00f9\u00fb\u00fc");
+ runtest(
+
"\u00e0\u00e2\u00e4\u00e7\u00e8\u00e9\u00ea\u00eb\u00ee\u00ef\u00f4\u00f6\u00f9\u00fb\u00fc");
}
public void testGermanUmlauts() throws Exception {
@@ -124,8 +123,7 @@ public class CharacterEncodingTest extends TestCase {
public void testWelcomeUnicode() throws Exception {
// welcome in several languages
- runtest(
- "Chinese (trad.) : \u6b61\u8fce ");
+ runtest("Chinese (trad.) : \u6b61\u8fce ");
}
public void testWelcomeUnicode2() throws Exception {
@@ -136,8 +134,6 @@ public class CharacterEncodingTest extends TestCase {
public void testWelcomeUnicode3() throws Exception {
// welcome in several languages
- runtest(
- "Japanese : \u3088\u3046\u3053\u305d");
+ runtest("Japanese : \u3088\u3046\u3053\u305d");
}
-
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
index 8e6e9b919..ddf36b832 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
@@ -41,35 +41,41 @@ public class OMElementTest extends OMTestCase {
*/
@Override
protected void setUp() throws Exception {
- OMNamespace testingNamespace = factory.createOMNamespace(
- "http://testing.ws.org", "ws");
+ OMNamespace testingNamespace =
factory.createOMNamespace("http://testing.ws.org", "ws");
firstElement = factory.createOMElement("FirstElement",
testingNamespace);
- secondElement = factory.createOMElement("SecondElement",
factory.createOMNamespace(
- "http://moretesting.ws.org", "ws"), firstElement);
+ secondElement =
+ factory.createOMElement(
+ "SecondElement",
+ factory.createOMNamespace("http://moretesting.ws.org",
"ws"),
+ firstElement);
}
-
+
@Override
- protected void tearDown() throws Exception {
- }
+ protected void tearDown() throws Exception {}
public void testChildDetachment() {
OMNamespace testNamespace2 =
factory.createOMNamespace("ftp://anotherTest.ws.org", "ws");
secondElement.detach();
- assertTrue("OMElement children detachment has not worked properly",
- !secondElement.equals(firstElement.getFirstElement()));
- assertNull("First Element should not contain elements after detaching.
",
- firstElement.getFirstElement());
- assertNull("First Element should not contain elements after detaching.
",
- firstElement.getFirstOMChild());
-
assertNull(secondElement.findNamespace(testNamespace2.getNamespaceURI(),
- testNamespace2.getPrefix()));
+ assertTrue(
+ "OMElement children detachment has not worked properly",
+ !secondElement.equals(firstElement.getFirstElement()));
+ assertNull(
+ "First Element should not contain elements after detaching. ",
+ firstElement.getFirstElement());
+ assertNull(
+ "First Element should not contain elements after detaching. ",
+ firstElement.getFirstOMChild());
+ assertNull(
+ secondElement.findNamespace(
+ testNamespace2.getNamespaceURI(),
testNamespace2.getPrefix()));
firstElement.addChild(secondElement);
factory.createOMText(firstElement, "Some Sample Text");
- assertTrue("First added child must be the first child",
- secondElement.equals(firstElement.getFirstOMChild()));
+ assertTrue(
+ "First added child must be the first child",
+ secondElement.equals(firstElement.getFirstOMChild()));
Iterator children = firstElement.getChildren();
int childCount = 0;
while (children.hasNext()) {
@@ -79,13 +85,14 @@ public class OMElementTest extends OMTestCase {
assertEquals("Children count should be two", childCount, 2);
secondElement.detach();
- assertTrue("First child should be the text child",
- firstElement.getFirstOMChild() instanceof OMText);
-
+ assertTrue(
+ "First child should be the text child",
+ firstElement.getFirstOMChild() instanceof OMText);
}
public void testAddDOOMElementAsChild() throws XMLStreamException {
- OMFactory doomFactory =
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
+ OMFactory doomFactory =
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
OMFactory llomFactory = OMAbstractFactory.getOMFactory();
String text = "This was a DOOM Text";
@@ -94,8 +101,10 @@ public class OMElementTest extends OMTestCase {
doomElement.setText(text);
llomRoot.addChild(doomElement);
- OMElement newElement =
(OMXMLBuilderFactory.createStAXOMBuilder(this.factory, llomRoot
- .getXMLStreamReader())).getDocumentElement();
+ OMElement newElement =
+ (OMXMLBuilderFactory.createStAXOMBuilder(
+ this.factory, llomRoot.getXMLStreamReader()))
+ .getDocumentElement();
newElement.build();
OMElement secondElement = newElement.getFirstElement();
assertNotNull(secondElement);
@@ -103,7 +112,8 @@ public class OMElementTest extends OMTestCase {
}
public void testAddDOOMTextAsChild() throws XMLStreamException {
- OMFactory doomFactory =
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
+ OMFactory doomFactory =
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
OMFactory llomFactory = OMAbstractFactory.getOMFactory();
String text = "This was a DOOM Text";
@@ -111,14 +121,17 @@ public class OMElementTest extends OMTestCase {
OMText doomText = doomFactory.createOMText(text);
llomRoot.addChild(doomText);
- OMElement newElement =
(OMXMLBuilderFactory.createStAXOMBuilder(this.factory, llomRoot
- .getXMLStreamReader())).getDocumentElement();
+ OMElement newElement =
+ (OMXMLBuilderFactory.createStAXOMBuilder(
+ this.factory, llomRoot.getXMLStreamReader()))
+ .getDocumentElement();
newElement.build();
assertEquals(newElement.getText(), text);
}
public void testAddLLOMElementChildToDOOM() throws XMLStreamException {
- OMFactory doomFactory =
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
+ OMFactory doomFactory =
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
OMFactory llomFactory = OMAbstractFactory.getOMFactory();
String text = "This was a LLOM Text";
@@ -127,8 +140,10 @@ public class OMElementTest extends OMTestCase {
llomElement.setText(text);
doomRoot.addChild(llomElement);
- OMElement newElement =
(OMXMLBuilderFactory.createStAXOMBuilder(this.factory, doomRoot
- .getXMLStreamReader())).getDocumentElement();
+ OMElement newElement =
+ (OMXMLBuilderFactory.createStAXOMBuilder(
+ this.factory, doomRoot.getXMLStreamReader()))
+ .getDocumentElement();
newElement.build();
OMElement secondElement = newElement.getFirstElement();
assertNotNull(secondElement);
@@ -136,7 +151,8 @@ public class OMElementTest extends OMTestCase {
}
public void testAddLLOMTextChildToDOOM() throws XMLStreamException {
- OMFactory doomFactory =
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
+ OMFactory doomFactory =
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
OMFactory llomFactory = OMAbstractFactory.getOMFactory();
String text = "This was a DOOM Text";
@@ -146,10 +162,11 @@ public class OMElementTest extends OMTestCase {
doomRoot.addChild(llomText);
doomRoot.addChild(comment);
- OMElement newElement =
(OMXMLBuilderFactory.createStAXOMBuilder(this.factory, doomRoot
- .getXMLStreamReader())).getDocumentElement();
+ OMElement newElement =
+ (OMXMLBuilderFactory.createStAXOMBuilder(
+ this.factory, doomRoot.getXMLStreamReader()))
+ .getDocumentElement();
newElement.build();
assertEquals(newElement.getText(), text);
}
-
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMHeaderBlockTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMHeaderBlockTest.java
index aecaf8be0..cde7c2887 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMHeaderBlockTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMHeaderBlockTest.java
@@ -42,7 +42,8 @@ public class OMHeaderBlockTest extends OMTestCase {
public void testSetAndGetActor() {
String newActorURI = "http://newActor.org";
soapHeaderElement.setRole(newActorURI);
- assertTrue("Actor was not properly set",
- soapHeaderElement.getRole().equalsIgnoreCase(newActorURI));
+ assertTrue(
+ "Actor was not properly set",
+ soapHeaderElement.getRole().equalsIgnoreCase(newActorURI));
}
}
diff --git
a/systests/old-tests/src/test/java/org/apache/axiom/util/stax/WrappedTextNodeStreamReaderTest.java
b/systests/old-tests/src/test/java/org/apache/axiom/util/stax/WrappedTextNodeStreamReaderTest.java
index 32d0a3d16..9afa0041f 100644
---
a/systests/old-tests/src/test/java/org/apache/axiom/util/stax/WrappedTextNodeStreamReaderTest.java
+++
b/systests/old-tests/src/test/java/org/apache/axiom/util/stax/WrappedTextNodeStreamReaderTest.java
@@ -32,32 +32,30 @@ import junit.framework.TestCase;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.util.stax.WrappedTextNodeStreamReader;
public class WrappedTextNodeStreamReaderTest extends TestCase {
//
// Tests that construct the Axiom tree and check the result
//
-
- private void testUsingBuilder(QName wrapperElementName,
- String testString,
- int chunkSize) {
+
+ private void testUsingBuilder(QName wrapperElementName, String testString,
int chunkSize) {
StringReader reader = new StringReader(testString);
- XMLStreamReader xmlStreamReader
- = new WrappedTextNodeStreamReader(wrapperElementName, reader,
chunkSize);
- OMElement element =
OMXMLBuilderFactory.createStAXOMBuilder(xmlStreamReader).getDocumentElement();
+ XMLStreamReader xmlStreamReader =
+ new WrappedTextNodeStreamReader(wrapperElementName, reader,
chunkSize);
+ OMElement element =
+
OMXMLBuilderFactory.createStAXOMBuilder(xmlStreamReader).getDocumentElement();
assertEquals(wrapperElementName, element.getQName());
assertEquals(wrapperElementName.getPrefix(),
element.getQName().getPrefix());
assertEquals(testString, element.getText());
}
-
+
public void testShortStringUsingBuilder() {
testUsingBuilder(
new QName("urn:test", "test"),
"This is a test string for WrappedTextNodeStreamReader",
4096);
}
-
+
public void testLongStringUsingBuilder() {
// "Long" is relative to the chunk size
testUsingBuilder(
@@ -65,41 +63,37 @@ public class WrappedTextNodeStreamReaderTest extends
TestCase {
"This is a test string for WrappedTextNodeStreamReader",
10);
}
-
+
public void testWrapperElementWithoutNamespaceUsingBuilder() {
testUsingBuilder(
- new QName("test"),
- "This is a test string for WrappedTextNodeStreamReader",
- 4096);
+ new QName("test"), "This is a test string for
WrappedTextNodeStreamReader", 4096);
}
-
+
public void testWrapperElementWithPrefixUsingBuilder() {
testUsingBuilder(
new QName("urn:test", "bar", "foo"),
"This is a test string for WrappedTextNodeStreamReader",
4096);
}
-
+
//
// Tests that construct the Axiom tree, serialize it using
serializeAndConsume and
// compare with the expected result.
//
-
- private void testUsingSerializeAndConsume(QName wrapperElementName,
- String testString,
- int chunkSize,
- String expectedXML) throws
Exception {
+
+ private void testUsingSerializeAndConsume(
+ QName wrapperElementName, String testString, int chunkSize, String
expectedXML)
+ throws Exception {
StringReader reader = new StringReader(testString);
- XMLStreamReader xmlStreamReader
- = new WrappedTextNodeStreamReader(wrapperElementName, reader,
chunkSize);
- OMElement element =
OMXMLBuilderFactory.createStAXOMBuilder(xmlStreamReader).getDocumentElement();
+ XMLStreamReader xmlStreamReader =
+ new WrappedTextNodeStreamReader(wrapperElementName, reader,
chunkSize);
+ OMElement element =
+
OMXMLBuilderFactory.createStAXOMBuilder(xmlStreamReader).getDocumentElement();
StringWriter writer = new StringWriter();
element.serializeAndConsume(writer);
- assertAbout(xml())
- .that(writer.toString())
- .hasSameContentAs(expectedXML);
+
assertAbout(xml()).that(writer.toString()).hasSameContentAs(expectedXML);
}
-
+
public void testShortStringUsingSerializeAndConsume() throws Exception {
String testString = "This is a test string for
WrappedTextNodeStreamReader";
testUsingSerializeAndConsume(
diff --git a/systests/osgi-tests/pom.xml b/systests/osgi-tests/pom.xml
index dd1b98f3d..70d41387f 100644
--- a/systests/osgi-tests/pom.xml
+++ b/systests/osgi-tests/pom.xml
@@ -230,17 +230,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/systests/psychopath-tests/src/test/java/PsychoPathTest.java
b/systests/psychopath-tests/src/test/java/PsychoPathTest.java
index f215a708c..f2ea12f61 100644
--- a/systests/psychopath-tests/src/test/java/PsychoPathTest.java
+++ b/systests/psychopath-tests/src/test/java/PsychoPathTest.java
@@ -39,23 +39,25 @@ public class PsychoPathTest {
private static ResultSequence evaluate(String xpath) throws Exception {
InputStream is = PsychoPathTest.class.getResourceAsStream("test.xml");
try {
- OMFactory factory =
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
- Document doc =
(Document)OMXMLBuilderFactory.createOMBuilder(factory, is).getDocument();
+ OMFactory factory =
+
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
+ Document doc =
+ (Document) OMXMLBuilderFactory.createOMBuilder(factory,
is).getDocument();
StaticContextBuilder scb = new StaticContextBuilder();
XPath2Expression expr = new Engine().parseExpression(xpath, scb);
- return expr.evaluate(new DynamicContextBuilder(scb), new Object[]
{ doc });
+ return expr.evaluate(new DynamicContextBuilder(scb), new Object[]
{doc});
} finally {
is.close();
}
}
-
+
@Test
public void testSingleNodeResult() throws Exception {
ResultSequence rs = evaluate("/Persons/Person[1]/Name");
assertEquals(1, rs.size());
assertEquals("Albert Einstein", rs.item(0).getStringValue());
}
-
+
@Ignore // TODO: doesn't work yet because Node#compareDocumentPosition is
not implemented
@Test
public void testNodeSetResult() throws Exception {
diff --git
a/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomMessageFactoryConfigurator.java
b/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomMessageFactoryConfigurator.java
index 5765b5483..113d8f2aa 100644
---
a/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomMessageFactoryConfigurator.java
+++
b/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomMessageFactoryConfigurator.java
@@ -30,7 +30,10 @@ public final class AxiomMessageFactoryConfigurator extends
MessageFactoryConfigu
@Override
public void configure(GenericApplicationContext context) {
- new XmlBeanDefinitionReader(context).loadBeanDefinitions(new
ClassPathResource(
- "axiom-message-factory.xml",
AxiomMessageFactoryConfigurator.class));
+ new XmlBeanDefinitionReader(context)
+ .loadBeanDefinitions(
+ new ClassPathResource(
+ "axiom-message-factory.xml",
+ AxiomMessageFactoryConfigurator.class));
}
}
diff --git
a/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageFactoryTest.java
b/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageFactoryTest.java
index e56e98418..1bf04e819 100644
---
a/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageFactoryTest.java
+++
b/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageFactoryTest.java
@@ -27,7 +27,7 @@ import
org.springframework.ws.soap.axiom.AxiomSoapMessageFactory;
public class AxiomSoapMessageFactoryTest extends TestCase {
/**
* Regression test for <a
href="https://issues.apache.org/jira/browse/AXIOM-444">AXIOM-444</a>.
- *
+ *
* @throws Exception
*/
public void testCreateWebServiceMessage() throws Exception {
diff --git
a/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageTest.java
b/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageTest.java
index 5737cf19a..a1f5a0da0 100644
---
a/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageTest.java
+++
b/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/AxiomSoapMessageTest.java
@@ -37,7 +37,7 @@ public class AxiomSoapMessageTest extends TestCase {
* Tests that {@link AxiomSoapMessage#setDocument(Document)} works
correctly. There have been
* issues with that method because Spring-WS instantiates {@link
SOAPFactory} implementations
* directly instead of using {@link OMAbstractFactory}.
- *
+ *
* @throws Exception
*/
public void testSetDocument() throws Exception {
@@ -46,9 +46,15 @@ public class AxiomSoapMessageTest extends TestCase {
AxiomSoapMessage message = mf.createWebServiceMessage();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
- Document document =
dbf.newDocumentBuilder().parse(AxiomSoapMessageTest.class.getResource("soap-message.xml").toString());
+ Document document =
+ dbf.newDocumentBuilder()
+ .parse(
+ AxiomSoapMessageTest.class
+ .getResource("soap-message.xml")
+ .toString());
message.setDocument(document);
- Iterator<SoapHeaderElement> it =
message.getEnvelope().getHeader().examineAllHeaderElements();
+ Iterator<SoapHeaderElement> it =
+ message.getEnvelope().getHeader().examineAllHeaderElements();
assertTrue(it.hasNext());
SoapHeaderElement headerElement = it.next();
assertEquals(new QName("urn:test", "myHeader"),
headerElement.getName());
diff --git
a/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/SpringWSTest.java
b/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/SpringWSTest.java
index c6d409325..b730de806 100644
---
a/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/SpringWSTest.java
+++
b/systests/spring-ws-tests/src/test/java/org/apache/axiom/systest/springws/SpringWSTest.java
@@ -27,9 +27,9 @@ import
org.apache.axiom.ts.springws.soap.messagefactory.TestCreateWebServiceMess
public class SpringWSTest extends TestCase {
public static TestSuite suite() {
- SpringWSTestSuiteBuilder builder = new SpringWSTestSuiteBuilder(
- new AxiomMessageFactoryConfigurator(),
- MessageFactoryConfigurator.SAAJ);
+ SpringWSTestSuiteBuilder builder =
+ new SpringWSTestSuiteBuilder(
+ new AxiomMessageFactoryConfigurator(),
MessageFactoryConfigurator.SAAJ);
// Since Spring-WS 3.1.4, the behavior differs between the Axiom and
SAAJ implementations.
builder.exclude(TestCreateWebServiceMessageFromInputStreamVersionMismatch.class);
diff --git
a/systests/wildfly-tests/src/test/java/org/apache/axiom/systest/wildfly/DialectTest.java
b/systests/wildfly-tests/src/test/java/org/apache/axiom/systest/wildfly/DialectTest.java
index 0059b61ae..9c4c24f8a 100644
---
a/systests/wildfly-tests/src/test/java/org/apache/axiom/systest/wildfly/DialectTest.java
+++
b/systests/wildfly-tests/src/test/java/org/apache/axiom/systest/wildfly/DialectTest.java
@@ -45,29 +45,37 @@ public class DialectTest {
return ShrinkWrap.create(WebArchive.class, "dialect-test.war")
.addAsLibraries(new File("target/deps").listFiles());
}
-
+
/**
* Directly tests {@link StAXDialectDetector}.
- *
+ *
* @throws Exception
*/
@Test
public void testStAXDialectDetector() throws Exception {
-
assertFalse(StAXDialectDetector.getDialect(XMLInputFactory.newInstance()).getName().equals("Unknown"));
-
assertFalse(StAXDialectDetector.getDialect(XMLOutputFactory.newInstance()).getName().equals("Unknown"));
+ assertFalse(
+ StAXDialectDetector.getDialect(XMLInputFactory.newInstance())
+ .getName()
+ .equals("Unknown"));
+ assertFalse(
+ StAXDialectDetector.getDialect(XMLOutputFactory.newInstance())
+ .getName()
+ .equals("Unknown"));
}
-
+
/**
* Tests that Axiom is able to read a DOCTYPE declaration. Since accessing
the information in
* the DOCTYPE declaration is not standardized by the StAX specification,
this will fail if the
* StAX dialect is not detected correctly.
- *
+ *
* @throws Exception
*/
@Test
public void testDTD() throws Exception {
- OMDocument document = OMXMLBuilderFactory.createOMBuilder(new
StringReader("<!DOCTYPE root><root/>")).getDocument();
- OMDocType dtd = (OMDocType)document.getFirstOMChild();
+ OMDocument document =
+ OMXMLBuilderFactory.createOMBuilder(new
StringReader("<!DOCTYPE root><root/>"))
+ .getDocument();
+ OMDocType dtd = (OMDocType) document.getFirstOMChild();
assertEquals("root", dtd.getRootName());
}
}
diff --git a/systests/wss4j-tests/src/test/java/WSS4JTest.java
b/systests/wss4j-tests/src/test/java/WSS4JTest.java
index 0bbacb0b2..e8e63f75c 100644
--- a/systests/wss4j-tests/src/test/java/WSS4JTest.java
+++ b/systests/wss4j-tests/src/test/java/WSS4JTest.java
@@ -39,18 +39,19 @@ import org.w3c.dom.Document;
public class WSS4JTest {
private Crypto crypto;
-
+
@Before
public void setUp() throws WSSecurityException {
crypto = CryptoFactory.getInstance();
}
-
+
private static SOAPMessage load(String file) {
OMMetaFactory metaFactory =
OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM);
- return OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory,
- WSS4JTest.class.getResourceAsStream(file),
null).getSOAPMessage();
+ return OMXMLBuilderFactory.createSOAPModelBuilder(
+ metaFactory,
WSS4JTest.class.getResourceAsStream(file), null)
+ .getSOAPMessage();
}
-
+
private void testSignature(String file, Vector<WSEncryptionPart> parts)
throws Exception {
WSSecSignature sign = new WSSecSignature();
sign.setUserInfo("key1", "password");
@@ -58,17 +59,17 @@ public class WSS4JTest {
sign.setParts(parts);
SOAPMessage message = load(file);
- Document doc = (Document)message;
-
+ Document doc = (Document) message;
+
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
-
+
Document signedDoc = sign.build(doc, crypto, secHeader);
-
+
WSSecurityEngine secEngine = new WSSecurityEngine();
assertThat(secEngine.processSecurityHeader(signedDoc, null, null,
crypto)).hasSize(2);
}
-
+
@Test
public void testSignHeaderAndBody() throws Exception {
Vector<WSEncryptionPart> parts = new Vector<WSEncryptionPart>();
@@ -76,14 +77,14 @@ public class WSS4JTest {
parts.add(new WSEncryptionPart("Body",
"http://schemas.xmlsoap.org/soap/envelope/", ""));
testSignature("envelope1.xml", parts);
}
-
+
@Test
public void testSignPartById() throws Exception {
Vector<WSEncryptionPart> parts = new Vector<WSEncryptionPart>();
parts.add(new WSEncryptionPart("my-id"));
testSignature("envelope2.xml", parts);
}
-
+
@Test
public void testEncryptHeader() throws Exception {
Vector<WSEncryptionPart> parts = new Vector<WSEncryptionPart>();
@@ -93,7 +94,7 @@ public class WSS4JTest {
encrypt.setEncryptSymmKey(false);
encrypt.setParts(parts);
SOAPMessage message = load("envelope1.xml");
- Document doc = (Document)message;
+ Document doc = (Document) message;
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
encrypt.build(doc, crypto, secHeader);
diff --git a/testing/pom.xml b/testing/pom.xml
index dfc6d8c6d..efeb7022e 100644
--- a/testing/pom.xml
+++ b/testing/pom.xml
@@ -57,17 +57,6 @@
<includeClasses>false</includeClasses>
</configuration>
</plugin>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>