Skip to content

Commit 909d72d

Browse files
major cleanup work, integration testing and persistence work, event hooks and other improvements
1 parent c883215 commit 909d72d

72 files changed

Lines changed: 593 additions & 325 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎eclipse/BUILD.launch‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
3-
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
4-
<stringAttribute key="M2_GOALS" value="clean install"/>
5-
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
6-
<booleanAttribute key="M2_OFFLINE" value="false"/>
7-
<stringAttribute key="M2_PROFILES" value=""/>
8-
<listAttribute key="M2_PROPERTIES">
9-
<listEntry value="target=dev"/>
10-
<listEntry value="persistenceTarget=mysql"/>
11-
</listAttribute>
12-
<stringAttribute key="M2_RUNTIME" value="/opt/maven/instances/apache-maven-3.0.4"/>
13-
<booleanAttribute key="M2_SKIP_TESTS" value="true"/>
14-
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
15-
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
16-
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/rest}"/>
17-
</launchConfiguration>
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
3+
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
4+
<stringAttribute key="M2_GOALS" value="clean install"/>
5+
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
6+
<booleanAttribute key="M2_OFFLINE" value="false"/>
7+
<stringAttribute key="M2_PROFILES" value=""/>
8+
<listAttribute key="M2_PROPERTIES">
9+
<listEntry value="target=dev"/>
10+
<listEntry value="persistenceTarget=mysql"/>
11+
</listAttribute>
12+
<stringAttribute key="M2_RUNTIME" value="C:\opt\maven\apache-maven-3.0.4"/>
13+
<booleanAttribute key="M2_SKIP_TESTS" value="true"/>
14+
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
15+
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
16+
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/rest}"/>
17+
</launchConfiguration>

‎eclipse/INTEGRATION-ALL.launch‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
3-
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4-
<listEntry value="/rest/src/test/java/org/rest/test/suite/IntegrationTestSuite.java"/>
5-
</listAttribute>
6-
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7-
<listEntry value="1"/>
8-
</listAttribute>
9-
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
10-
<mapEntry key="persistenceTarget" value="test"/>
11-
<mapEntry key="target" value="dev"/>
12-
</mapAttribute>
13-
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
14-
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
15-
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
16-
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
17-
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
18-
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.rest.test.suite.IntegrationTestSuite"/>
19-
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="rest"/>
20-
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
21-
</launchConfiguration>
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
3+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4+
<listEntry value="/rest/src/test/java/org/rest/test/suite/IntegrationTestSuite.java"/>
5+
</listAttribute>
6+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7+
<listEntry value="1"/>
8+
</listAttribute>
9+
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
10+
<mapEntry key="persistenceTarget" value="test"/>
11+
<mapEntry key="target" value="dev"/>
12+
</mapAttribute>
13+
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
14+
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
15+
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
16+
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
17+
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
18+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.rest.test.suite.IntegrationTestSuite"/>
19+
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="rest"/>
20+
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
21+
</launchConfiguration>

‎eclipse/INTEGRATION-BUILD.launch‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
3-
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
4-
<stringAttribute key="M2_GOALS" value="clean install"/>
5-
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
6-
<booleanAttribute key="M2_OFFLINE" value="false"/>
7-
<stringAttribute key="M2_PROFILES" value="integration"/>
8-
<listAttribute key="M2_PROPERTIES">
9-
<listEntry value="target=dev"/>
10-
<listEntry value="persistenceTarget=h2"/>
11-
</listAttribute>
12-
<stringAttribute key="M2_RUNTIME" value="/opt/maven/instances/apache-maven-3.0.4"/>
13-
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
14-
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
15-
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
16-
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/rest}"/>
17-
</launchConfiguration>
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
3+
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
4+
<stringAttribute key="M2_GOALS" value="clean install"/>
5+
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
6+
<booleanAttribute key="M2_OFFLINE" value="false"/>
7+
<stringAttribute key="M2_PROFILES" value="integration"/>
8+
<listAttribute key="M2_PROPERTIES">
9+
<listEntry value="target=dev"/>
10+
<listEntry value="persistenceTarget=h2"/>
11+
</listAttribute>
12+
<stringAttribute key="M2_RUNTIME" value="C:\opt\maven\apache-maven-3.0.4"/>
13+
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
14+
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
15+
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
16+
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/rest}"/>
17+
</launchConfiguration>

‎eclipse/INTEGRATION-SINGLE.launch‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
3-
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4-
<listEntry value="/rest/src/test/java/org/rest/test/suite/UnitTestSuite.java"/>
5-
</listAttribute>
6-
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7-
<listEntry value="1"/>
8-
</listAttribute>
9-
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
10-
<mapEntry key="persistenceTarget" value="test"/>
11-
<mapEntry key="target" value="dev"/>
12-
</mapAttribute>
13-
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
14-
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
15-
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
16-
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
17-
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
18-
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.rest.test.suite.UnitTestSuite"/>
19-
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="rest"/>
20-
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
21-
</launchConfiguration>
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
3+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4+
<listEntry value="/rest/src/test/java/org/rest/test/suite/UnitTestSuite.java"/>
5+
</listAttribute>
6+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7+
<listEntry value="1"/>
8+
</listAttribute>
9+
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
10+
<mapEntry key="persistenceTarget" value="test"/>
11+
<mapEntry key="target" value="dev"/>
12+
</mapAttribute>
13+
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
14+
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
15+
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
16+
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
17+
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
18+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.rest.test.suite.UnitTestSuite"/>
19+
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="rest"/>
20+
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
21+
</launchConfiguration>

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>org</groupId>
44
<artifactId>rest</artifactId>
5-
<version>0.0.1-SNAPSHOT</version>
5+
<version>0.2-SNAPSHOT</version>
66
<packaging>war</packaging>
77

88
<dependencies>

‎src/main/java/org/rest/client/RestTemplateFactoryBean.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.rest.client;
22

33
import org.apache.http.impl.client.DefaultHttpClient;
4-
import org.rest.sec.dto.User;
54
import org.rest.sec.model.Privilege;
5+
import org.rest.sec.model.dto.User;
66
import org.rest.security.BasicHttpComponentsClientHttpRequestFactory;
77
import org.rest.security.DigestHttpComponentsClientHttpRequestFactory;
88
import org.springframework.beans.factory.FactoryBean;
@@ -79,7 +79,7 @@ final XStreamMarshaller xstreamMarshaller() {
7979
xStreamMarshaller.setAnnotatedClass(User.class);
8080
xStreamMarshaller.setAnnotatedClass(Privilege.class);
8181

82-
// this.xstreamMarshaller().getXStream().addDefaultImplementation( java.util.HashSet.class, PersistentSet.class );
82+
// xstreamMarshaller().getXStream().addDefaultImplementation( java.util.HashSet.class, PersistentSet.class );
8383

8484
return xStreamMarshaller;
8585
}

src/main/java/org/rest/common/IRestDao.java renamed to src/main/java/org/rest/common/IOperations.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import java.util.List;
44

5-
public interface IRestDao<T extends IEntity> {
5+
public interface IOperations<T extends IEntity> {
66

77
// get
88

@@ -22,4 +22,6 @@ public interface IRestDao<T extends IEntity> {
2222

2323
void delete(final long id);
2424

25+
void deleteAll();
26+
2527
}

‎src/main/java/org/rest/common/event/PaginatedResultsRetrievedEvent.java‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@ public final class PaginatedResultsRetrievedEvent<T extends Serializable> extend
1717
public PaginatedResultsRetrievedEvent(final Class<T> clazz, final UriComponentsBuilder uriBuilderToSet, final HttpServletResponse responseToSet, final int pageToSet, final int totalPagesToSet, final int pageSizeToSet) {
1818
super(clazz);
1919

20-
this.uriBuilder = uriBuilderToSet;
21-
this.response = responseToSet;
22-
this.page = pageToSet;
23-
this.totalPages = totalPagesToSet;
24-
this.pageSize = pageSizeToSet;
20+
uriBuilder = uriBuilderToSet;
21+
response = responseToSet;
22+
page = pageToSet;
23+
totalPages = totalPagesToSet;
24+
pageSize = pageSizeToSet;
2525
}
2626

2727
// API
2828

2929
public final UriComponentsBuilder getUriBuilder() {
30-
return this.uriBuilder;
30+
return uriBuilder;
3131
}
3232

3333
public final HttpServletResponse getResponse() {
34-
return this.response;
34+
return response;
3535
}
3636

3737
public final int getPage() {
38-
return this.page;
38+
return page;
3939
}
4040

4141
public final int getTotalPages() {
42-
return this.totalPages;
42+
return totalPages;
4343
}
4444

4545
public final int getPageSize() {
46-
return this.pageSize;
46+
return pageSize;
4747
}
4848

4949
@SuppressWarnings("unchecked")

‎src/main/java/org/rest/common/event/ResourceCreatedEvent.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ public ResourceCreatedEvent(final Class<T> clazz, final UriComponentsBuilder uri
2121
Preconditions.checkNotNull(responseToSet);
2222
Preconditions.checkNotNull(idOfNewResourceToSet);
2323

24-
this.uriBuilder = uriBuilderToSet;
25-
this.response = responseToSet;
26-
this.idOfNewResource = idOfNewResourceToSet;
24+
uriBuilder = uriBuilderToSet;
25+
response = responseToSet;
26+
idOfNewResource = idOfNewResourceToSet;
2727
}
2828

2929
//
3030

3131
public final UriComponentsBuilder getUriBuilder() {
32-
return this.uriBuilder;
32+
return uriBuilder;
3333
}
3434

3535
public final HttpServletResponse getResponse() {
36-
return this.response;
36+
return response;
3737
}
3838

3939
public final long getIdOfNewResource() {
40-
return this.idOfNewResource;
40+
return idOfNewResource;
4141
}
4242

4343
@SuppressWarnings("unchecked")

‎src/main/java/org/rest/common/event/SingleResourceRetrievedEvent.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ public final class SingleResourceRetrievedEvent<T extends Serializable> extends
1414
public SingleResourceRetrievedEvent(final Class<T> clazz, final UriComponentsBuilder uriBuilderToSet, final HttpServletResponse responseToSet) {
1515
super(clazz);
1616

17-
this.uriBuilder = uriBuilderToSet;
18-
this.response = responseToSet;
17+
uriBuilder = uriBuilderToSet;
18+
response = responseToSet;
1919
}
2020

2121
//
2222

2323
public final UriComponentsBuilder getUriBuilder() {
24-
return this.uriBuilder;
24+
return uriBuilder;
2525
}
2626

2727
public final HttpServletResponse getResponse() {
28-
return this.response;
28+
return response;
2929
}
3030

3131
@SuppressWarnings("unchecked")
3232
public final Class<T> getClazz() {
33-
return (Class<T>) this.getSource();
33+
return (Class<T>) getSource();
3434
}
3535

3636
}

0 commit comments

Comments
 (0)