Skip to content

Commit

Permalink
Update dependencies/plugins, remove module dependency on java.desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeEdgar committed May 23, 2020
1 parent ca6ce36 commit 19163db
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 14 deletions.
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>xlate</sonar.organization>

<version.jakarta.xml.bind.api>2.3.2</version.jakarta.xml.bind.api>
<version.jakarta.xml.bind.api>2.3.3</version.jakarta.xml.bind.api>
</properties>

<build>
Expand All @@ -63,7 +63,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<version>3.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -176,42 +176,42 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.5.2</version>
<version>5.6.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.5.2</version>
<version>5.6.2</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>1.5.2</version>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>3.2.4</version>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.0.0</version>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>2.6.3</version>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-matchers</artifactId>
<version>2.6.3</version>
<version>2.7.0</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
1 change: 0 additions & 1 deletion src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module io.xlate.staedi {
requires java.base;
requires java.desktop;
requires java.logging;
requires transitive java.xml;

Expand Down
31 changes: 29 additions & 2 deletions src/test/java/io/xlate/edi/internal/bind/TransactionBindTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static org.junit.jupiter.api.Assertions.fail;

import java.beans.Introspector;
import java.io.IOException;
import java.io.StringWriter;
import java.lang.annotation.Annotation;
Expand Down Expand Up @@ -101,7 +100,7 @@ QName getRootElementName(Class<?> type) {

if (rootElement != null) {
if ("##default".equals(rootElement.name())) {
localName = Introspector.decapitalize(type.getSimpleName());
localName = decapitalize(type.getSimpleName());
} else {
localName = rootElement.name();
}
Expand All @@ -117,6 +116,34 @@ QName getRootElementName(Class<?> type) {
throw new IllegalStateException("Missing XmlRootElement annotation on root class");
}

/**
* Utility method to take a string and convert it to normal Java variable
* name capitalization. This normally means converting the first
* character from upper case to lower case, but in the (unusual) special
* case when there is more than one character and both the first and
* second characters are upper case, we leave it alone.
* <p>
* Thus "FooBah" becomes "fooBah" and "X" becomes "x", but "URL" stays
* as "URL".
*
* COPYIED FROM java.beans.Introspector
*
* @param name The string to be decapitalized.
* @return The decapitalized version of the string.
*/
static String decapitalize(String name) {
if (name == null || name.length() == 0) {
return name;
}
if (name.length() > 1 && Character.isUpperCase(name.charAt(1)) &&
Character.isUpperCase(name.charAt(0))){
return name;
}
char chars[] = name.toCharArray();
chars[0] = Character.toLowerCase(chars[0]);
return new String(chars);
}

Stream<Element> elementStream(NodeList nodes) {
return IntStream.range(0, nodes.getLength()).mapToObj(nodes::item).map(Element.class::cast);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ void testAnyElementType() throws EDISchemaException {
}

@Test
void testAnySegmentTypeInvalid() throws EDISchemaException {
void testAnySegmentTypeInvalid() {
SchemaFactory factory = SchemaFactory.newFactory();
InputStream stream = new ByteArrayInputStream((""
+ "<schema xmlns='" + StaEDISchemaFactory.XMLNS_V3 + "'>"
Expand Down

0 comments on commit 19163db

Please sign in to comment.