Skip to content

Commit b55c8a8

Browse files
author
eugenp
committed
major marshalling work
1 parent 557ac04 commit b55c8a8

17 files changed

Lines changed: 149 additions & 40 deletions

File tree

‎api/.project‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@
2525
<arguments>
2626
</arguments>
2727
</buildCommand>
28+
<buildCommand>
29+
<name>org.zeroturnaround.eclipse.rebelXmlBuilder</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
2833
</buildSpec>
2934
<natures>
3035
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
3136
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
3237
<nature>org.eclipse.jdt.core.javanature</nature>
3338
<nature>org.eclipse.m2e.core.maven2Nature</nature>
3439
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
40+
<nature>org.zeroturnaround.eclipse.jrebelNature</nature>
3541
</natures>
3642
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding//src/main/java/rebel.xml=UTF-8

‎api/src/main/java/rebel.xml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
3+
4+
<classpath>
5+
<dir name="/opt/git/github/REST/api/target/classes">
6+
</dir>
7+
</classpath>
8+
9+
</application>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding//src/main/java/rebel.xml=UTF-8

‎common/pom.xml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@
149149
<!-- marshalling -->
150150

151151
<dependency>
152-
<groupId>org.codehaus.jackson</groupId>
153-
<artifactId>jackson-mapper-asl</artifactId>
154-
<version>${jackson-mapper-asl.version}</version>
152+
<groupId>com.fasterxml.jackson.core</groupId>
153+
<artifactId>jackson-databind</artifactId>
154+
<version>${jackson.version}</version>
155155
</dependency>
156-
156+
157157
<!-- persistence -->
158158

159159
<dependency>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package org.rest.common.util;
2+
3+
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
4+
import static org.hamcrest.Matchers.equalTo;
5+
import static org.junit.Assert.assertNotNull;
6+
import static org.junit.Assert.assertThat;
7+
8+
import org.junit.Test;
9+
10+
public final class LinkUtilTest {
11+
12+
// tests
13+
14+
@Test
15+
public final void whenGatheringLinks_thenNoException() {
16+
LinkUtil.gatherLinkHeaders("");
17+
}
18+
19+
@Test
20+
public final void whenGatheringOneLink_thenResultIsCorrect() {
21+
final String uri = randomAlphabetic(6);
22+
final String linkHeader = LinkUtil.createLinkHeader(uri, LinkUtil.REL_COLLECTION);
23+
24+
// When
25+
final String links = LinkUtil.gatherLinkHeaders(linkHeader);
26+
27+
// Then
28+
assertThat(links, equalTo(linkHeader));
29+
}
30+
31+
@Test
32+
public final void whenGatheringTwoLink_thenResultIsCorrect() {
33+
final String uri1 = randomAlphabetic(6);
34+
final String uri2 = randomAlphabetic(6);
35+
String linkHeader1 = LinkUtil.createLinkHeader(uri1, LinkUtil.REL_COLLECTION);
36+
String linkHeader2 = LinkUtil.createLinkHeader(uri2, LinkUtil.REL_COLLECTION);
37+
38+
// When
39+
final String links = LinkUtil.gatherLinkHeaders(linkHeader1, linkHeader2);
40+
41+
// Then
42+
assertNotNull(links);
43+
}
44+
45+
}

‎common/src/main/java/rebel.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
33

44
<classpath>
5-
<dir name="C:/opt/git/github/REST/common/target/classes">
5+
<dir name="/opt/git/github/REST/common/target/classes">
66
</dir>
77
</classpath>
88

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
<aspectjweaver.version>1.7.0</aspectjweaver.version>
7070

71-
<jackson-mapper-asl.version>1.9.9</jackson-mapper-asl.version>
71+
<jackson.version>2.0.5</jackson.version>
7272
<jaxb-api.version>2.2.6</jaxb-api.version>
7373
<xstream.version>1.4.3</xstream.version>
7474

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
eclipse.preferences.version=1
22
encoding//sec/src/main/resources/rebel.xml=UTF-8
3+
encoding//src/main/java/rebel.xml=UTF-8

‎sec/.settings/org.eclipse.wst.common.component‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project-modules id="moduleCoreId" project-version="1.5.0">
23
<wb-module deploy-name="rest">
34
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
45
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>

0 commit comments

Comments
 (0)