You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by mf...@apache.org on 2014/07/28 16:17:38 UTC
[1/4] git commit: RAVE-1097 - Upgraded to spring mongo 1.1.2 to
resolve dependency issue - Fixed unit test that was failing after upgrade.
Repository: rave
Updated Branches:
refs/heads/angular 7ac9d69d3 -> 3ae74e7aa
RAVE-1097
- Upgraded to spring mongo 1.1.2 to resolve dependency issue
- Fixed unit test that was failing after upgrade.
Project: http://git-wip-us.apache.org/repos/asf/rave/repo
Commit: http://git-wip-us.apache.org/repos/asf/rave/commit/18d5ae2b
Tree: http://git-wip-us.apache.org/repos/asf/rave/tree/18d5ae2b
Diff: http://git-wip-us.apache.org/repos/asf/rave/diff/18d5ae2b
Branch: refs/heads/angular
Commit: 18d5ae2b6d6b3741f1c9828cd5f8ea317fa39194
Parents: 1e068c5
Author: Chris Geer <ch...@cxtsoftware.com>
Authored: Sun Jul 6 14:03:55 2014 -0700
Committer: Chris Geer <ch...@cxtsoftware.com>
Committed: Sun Jul 6 14:03:55 2014 -0700
----------------------------------------------------------------------
pom.xml | 2 +-
.../portal/repository/impl/MongoDbRegionWidgetRepositoryTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/rave/blob/18d5ae2b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1df8300..706915a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,7 +47,7 @@
<org.springframework.version>3.2.3.RELEASE</org.springframework.version>
<org.springframework.security.version>3.1.4.RELEASE</org.springframework.security.version>
<org.springframework.mobile.version>1.0.1.RELEASE</org.springframework.mobile.version>
- <org.springframework.data.mongodb.version>1.0.3.RELEASE</org.springframework.data.mongodb.version>
+ <org.springframework.data.mongodb.version>1.1.2.RELEASE</org.springframework.data.mongodb.version>
<jstl.version>1.2</jstl.version>
<javax.servlet.version>2.5</javax.servlet.version>
<jsp-api.version>2.1</jsp-api.version>
http://git-wip-us.apache.org/repos/asf/rave/blob/18d5ae2b/rave-components/rave-mongodb/src/test/java/org/apache/rave/portal/repository/impl/MongoDbRegionWidgetRepositoryTest.java
----------------------------------------------------------------------
diff --git a/rave-components/rave-mongodb/src/test/java/org/apache/rave/portal/repository/impl/MongoDbRegionWidgetRepositoryTest.java b/rave-components/rave-mongodb/src/test/java/org/apache/rave/portal/repository/impl/MongoDbRegionWidgetRepositoryTest.java
index 0ec2d95..3adde54 100644
--- a/rave-components/rave-mongodb/src/test/java/org/apache/rave/portal/repository/impl/MongoDbRegionWidgetRepositoryTest.java
+++ b/rave-components/rave-mongodb/src/test/java/org/apache/rave/portal/repository/impl/MongoDbRegionWidgetRepositoryTest.java
@@ -305,7 +305,7 @@ public class MongoDbRegionWidgetRepositoryTest {
}
private Query getQuery(String id) {
- return new Query(new Criteria().orOperator(where("subPages").elemMatch(where("regions").elemMatch(where("regionWidgets").elemMatch(where("_id").is(id)))),where("regions").elemMatch(where("regionWidgets").elemMatch(where("_id").is(id)))));
+ return new Query(new Criteria().orOperator(where("regions").elemMatch(where("regionWidgets").elemMatch(where("_id").is(id))),where("subPages").elemMatch(where("regions").elemMatch(where("regionWidgets").elemMatch(where("_id").is(id))))));
}
@Test
[4/4] git commit: Merged master into angular branch
Posted by mf...@apache.org.
Merged master into angular branch
Project: http://git-wip-us.apache.org/repos/asf/rave/repo
Commit: http://git-wip-us.apache.org/repos/asf/rave/commit/3ae74e7a
Tree: http://git-wip-us.apache.org/repos/asf/rave/tree/3ae74e7a
Diff: http://git-wip-us.apache.org/repos/asf/rave/diff/3ae74e7a
Branch: refs/heads/angular
Commit: 3ae74e7aad1c673cd2d19505232520b597213291
Parents: 7ac9d69 aab1719
Author: Matt Franklin <mf...@apache.org>
Authored: Mon Jul 28 10:17:24 2014 -0400
Committer: Matt Franklin <mf...@apache.org>
Committed: Mon Jul 28 10:17:24 2014 -0400
----------------------------------------------------------------------
pom.xml | 2 +-
.../rave/rest/model/JsonResponseWrapper.java | 11 +-
.../java/org/apache/rave/rest/model/Person.java | 97 +++++++++++++-
.../portal/repository/PersonRepository.java | 8 ++
.../apache/rave/portal/service/UserService.java | 7 +
.../portal/service/impl/DefaultUserService.java | 5 +
.../service/impl/DefaultUserServiceTest.java | 8 ++
.../impl/MongoDbRegionWidgetRepositoryTest.java | 2 +-
rave-integration-tests/pom.xml | 27 +++-
.../rave-webservice-tests/pom.xml | 128 +++++++++++++++++++
.../webservice/StateManager.java | 37 ++++++
.../integrationtests/webservice/Stories.java | 101 +++++++++++++++
.../webservice/steps/CommonSteps.java | 63 +++++++++
.../webservice/steps/PeopleSteps.java | 122 ++++++++++++++++++
.../integrationtests/webservice/people.story | 40 ++++++
.../WEB-INF/applicationContext-security.xml | 1 +
16 files changed, 642 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/rave/blob/3ae74e7a/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/rave/blob/3ae74e7a/rave-integration-tests/pom.xml
----------------------------------------------------------------------
[3/4] git commit: Adds Vagrant.
Posted by mf...@apache.org.
Adds Vagrant.
Project: http://git-wip-us.apache.org/repos/asf/rave/repo
Commit: http://git-wip-us.apache.org/repos/asf/rave/commit/aab1719e
Tree: http://git-wip-us.apache.org/repos/asf/rave/tree/aab1719e
Diff: http://git-wip-us.apache.org/repos/asf/rave/diff/aab1719e
Branch: refs/heads/angular
Commit: aab1719e577b18af822fa10cb760040e9c9e1d53
Parents: b7cd8de
Author: Jmeas <je...@gmail.com>
Authored: Tue Jul 22 09:25:11 2014 -0400
Committer: Jmeas <je...@gmail.com>
Committed: Tue Jul 22 11:59:42 2014 -0400
----------------------------------------------------------------------
.gitignore | 1 +
README.txt | 32 +++++----------
Vagrantfile | 33 ++++++++++++++++
deploy/ansible/rave-local-playbook.yml | 10 +++++
deploy/ansible/roles/maven/tasks/main.yml | 41 ++++++++++++++++++++
deploy/ansible/roles/maven/templates/maven.sh | 8 ++++
deploy/ansible/roles/maven/vars/main.yml | 10 +++++
.../ansible/roles/oracle-java7/tasks/main.yml | 21 ++++++++++
deploy/ansible/roles/oracle-java7/vars/main.yml | 3 ++
9 files changed, 136 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/rave/blob/aab1719e/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 7ad6bbd..29010a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
.idea/
overlays/
target/
+.vagrant
http://git-wip-us.apache.org/repos/asf/rave/blob/aab1719e/README.txt
----------------------------------------------------------------------
diff --git a/README.txt b/README.txt
index 9550d84..acedf9e 100644
--- a/README.txt
+++ b/README.txt
@@ -38,32 +38,18 @@ Building and running
To build from source code:
- Requirements:
- Sources compilation require Java SE 6 or higher.
- The project is built with Apache Maven 3+ (suggested is 3.0.3).
- You need to download and install Maven 3 from: http://maven.apache.org/
+ Vagrant v1.6.3+, Ansible 1.6.5+
- - The Rave project itself (this one) depends on the separate Rave Master project
- which defines general and global settings for the whole of the Rave project,
- independent of a specific release.
- As its rave-master-pom is already published to the Apache Snapshots repository,
- there is no need to check it out manually and build it locally yourself,
- unless changes are needed on general and global level.
-
- If so needed, the Rave Master project can be checked out from:
- http://svn.apache.org/repos/asf/rave/rave-master-pom/trunk rave-master-pom
+ - Install the `vagrant-hostsupdater` plugin by performing `vagrant plugin install vagrant-hostsupdater`.
+
+ - Add `192.168.13.37 localhost` to the top of your hosts file.
- After check out, cd into rave-master-pom and invoke maven to install it using:
- $mvn install
+ - To build the virtual machine, simply run `vagrant up`.
- - To build the Rave project invoke maven in the root directory:
- $mvn install
+ - To run Rave, ssh onto the Vagrantbox with the command `vagrant ssh`, then run the command:
+ `sudo mvn cargo:run -f /rave/rave-portal/pom.xml`
-To run a local Tomcat instance with rave-shindig and rave-portal deployed:
+ - Navigate to http://localhost:8080/ in a browser
- - from the top-level rave directory, use the command
- $mvn cargo:run -f rave-portal/pom.xml
- - alternatively, navigate to the rave-portal subdirectory and invoke:
- $mvn cargo:run
- - open url http://localhost:8080/ in a browser
- - press Ctrl-C in the console to stop Tomcat again
+ - press Ctrl-C from within the Vagrant box to stop the app
--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/rave/blob/aab1719e/Vagrantfile
----------------------------------------------------------------------
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644
index 0000000..8d36732
--- /dev/null
+++ b/Vagrantfile
@@ -0,0 +1,33 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Pathing variables
+vagrant_dir = File.expand_path(File.dirname(__FILE__))
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+
+ config.vm.provider :virtualbox do |v|
+ v.customize ["modifyvm", :id, "--memory", 1024]
+ end
+
+ config.ssh.forward_agent = true
+ config.vm.hostname = "rave.dev"
+ config.vm.network :private_network, ip: "192.168.13.37"
+ config.vm.box = "hashicorp/precise64"
+
+ # load the project into the Vagrant
+ config.vm.synced_folder vagrant_dir, "/rave/", :mount_options => [ "dmode=775", "fmode=774" ]
+
+ if defined? VagrantPlugins::HostsUpdater
+ config.hostsupdater.aliases = ["rave.dev"]
+ end
+
+ # Provision
+ config.vm.provision "ansible" do |ansible|
+ ansible.playbook = "deploy/ansible/rave-local-playbook.yml"
+ end
+
+end
http://git-wip-us.apache.org/repos/asf/rave/blob/aab1719e/deploy/ansible/rave-local-playbook.yml
----------------------------------------------------------------------
diff --git a/deploy/ansible/rave-local-playbook.yml b/deploy/ansible/rave-local-playbook.yml
new file mode 100644
index 0000000..97b47ed
--- /dev/null
+++ b/deploy/ansible/rave-local-playbook.yml
@@ -0,0 +1,10 @@
+---
+-
+ hosts: all
+ sudo: yes
+ vars:
+ app_base_path: "/rave/"
+ default_user: "rave"
+ roles:
+ - oracle-java7
+ - maven
http://git-wip-us.apache.org/repos/asf/rave/blob/aab1719e/deploy/ansible/roles/maven/tasks/main.yml
----------------------------------------------------------------------
diff --git a/deploy/ansible/roles/maven/tasks/main.yml b/deploy/ansible/roles/maven/tasks/main.yml
new file mode 100644
index 0000000..083a759
--- /dev/null
+++ b/deploy/ansible/roles/maven/tasks/main.yml
@@ -0,0 +1,41 @@
+# install maven
+- name: Check whether or not maven is currently installed
+ shell: "[ -d {{ maven_install_dir }}/{{ maven_extracted_dirname }} ] && echo 'Found' || echo ''"
+ register: mvn_installed
+ changed_when: mvn_installed.stdout == ""
+ tags: maven
+
+- name: Create a maven directory
+ file: path={{ maven_install_dir }} owner=root group=root mode=0775 state=directory
+ when: (not mvn_installed.stdout)
+ tags: maven
+
+- name: Download maven
+ get_url: dest={{ maven_install_dir }}/{{ maven_download_filename }} url={{ maven_download_url }}
+ when: (not mvn_installed.stdout)
+ tags: maven
+
+- name: Extract maven archive file
+ command: creates={{ maven_install_dir }}/{{ maven_extracted_dirname }} chdir={{ maven_install_dir }} tar zxvf {{ maven_install_dir }}/{{ maven_download_filename }} --owner=root
+ when: (not mvn_installed.stdout)
+ tags: maven
+
+- name: Create a maven latest symlink
+ file: src={{ maven_install_dir }}/{{ maven_extracted_dirname }} dest={{ maven_install_dir }}/latest owner=root group=root state=link
+ when: (not mvn_installed.stdout)
+ tags: maven
+
+- name: Copy config maven.sh
+ action: template src=maven.sh dest=/etc/profile.d/maven.sh owner=root group=root mode=0644
+ when: (not mvn_installed.stdout)
+ tags: maven
+
+- name: Cleanup maven archive file
+ file: path={{ maven_install_dir }}/{{ maven_download_filename }} state=absent
+ when: (not mvn_installed.stdout)
+ tags: maven
+
+- name: Install maven dependencies for apache rave
+ command: /usr/local/maven/latest/bin/mvn -DskipTests=true -DskipIntegrationTests=true clean install chdir={{ maven_rave_dir }} creates={{ maven_rave_dir }}/target
+ sudo: yes
+ tags: maven
http://git-wip-us.apache.org/repos/asf/rave/blob/aab1719e/deploy/ansible/roles/maven/templates/maven.sh
----------------------------------------------------------------------
diff --git a/deploy/ansible/roles/maven/templates/maven.sh b/deploy/ansible/roles/maven/templates/maven.sh
new file mode 100644
index 0000000..354221e
--- /dev/null
+++ b/deploy/ansible/roles/maven/templates/maven.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# {{ ansible_managed }}
+
+export M3_HOME={{ maven_install_dir }}/latest
+export M3=$M3_HOME/bin
+export MAVEN_OPTS="-Xms{{ maven_min_memory }} -Xmx{{ maven_max_memory }}"
+export PATH=$M3:$PATH
+~
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/rave/blob/aab1719e/deploy/ansible/roles/maven/vars/main.yml
----------------------------------------------------------------------
diff --git a/deploy/ansible/roles/maven/vars/main.yml b/deploy/ansible/roles/maven/vars/main.yml
new file mode 100644
index 0000000..44d272c
--- /dev/null
+++ b/deploy/ansible/roles/maven/vars/main.yml
@@ -0,0 +1,10 @@
+maven_version: 3.1.1
+maven_min_memory: 256m
+maven_max_memory: 512m
+maven_install_dir: /usr/local/maven
+maven_rave_dir: /rave
+maven_major_version: 3
+maven_base_download_url: "http://apache.mirrors.tds.net/maven/maven-{{ maven_major_version }}/{{ maven_version }}/binaries/"
+maven_extracted_dirname: "apache-maven-{{ maven_version }}"
+maven_download_filename: "apache-maven-{{ maven_version }}-bin.tar.gz"
+maven_download_url: "{{ maven_base_download_url }}/{{ maven_download_filename }}"
http://git-wip-us.apache.org/repos/asf/rave/blob/aab1719e/deploy/ansible/roles/oracle-java7/tasks/main.yml
----------------------------------------------------------------------
diff --git a/deploy/ansible/roles/oracle-java7/tasks/main.yml b/deploy/ansible/roles/oracle-java7/tasks/main.yml
new file mode 100644
index 0000000..64d7b16
--- /dev/null
+++ b/deploy/ansible/roles/oracle-java7/tasks/main.yml
@@ -0,0 +1,21 @@
+- name: Check whether or not oracle-java7 is currently installed
+ shell: "[ -d /usr/lib/jvm/java-7-oracle ] && echo 'Found' || echo ''"
+ register: oracle_java_installed
+ changed_when: oracle_java_installed.stdout == ""
+ tags: oracle-java7
+
+- name: Add oracle java repository
+ apt_repository: repo="ppa:webupd8team/java" update_cache=yes
+ when: (not oracle_java_installed.stdout)
+ tags: oracle-java7
+
+- name: Accept the oracle license
+ debconf: name="oracle-java7-installer" question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
+ when: (not oracle_java_installed.stdout)
+ tags: oracle-java7
+
+- name: Install packages
+ apt: name={{item}} state=present update_cache=yes
+ with_items: oracle_packages
+ when: (not oracle_java_installed.stdout)
+ tags: oracle-java7
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/rave/blob/aab1719e/deploy/ansible/roles/oracle-java7/vars/main.yml
----------------------------------------------------------------------
diff --git a/deploy/ansible/roles/oracle-java7/vars/main.yml b/deploy/ansible/roles/oracle-java7/vars/main.yml
new file mode 100644
index 0000000..6093750
--- /dev/null
+++ b/deploy/ansible/roles/oracle-java7/vars/main.yml
@@ -0,0 +1,3 @@
+oracle_packages:
+ - oracle-java7-installer
+ - oracle-java7-set-default
\ No newline at end of file
[2/4] git commit: RAVE-978 - Added getAll method for Users/People -
Added basic authentication to support web service calls - Added a webservice
itest framework - Added simple people webservice itest for getting all users
Posted by mf...@apache.org.
RAVE-978
- Added getAll method for Users/People
- Added basic authentication to support web service calls
- Added a webservice itest framework
- Added simple people webservice itest for getting all users
Project: http://git-wip-us.apache.org/repos/asf/rave/repo
Commit: http://git-wip-us.apache.org/repos/asf/rave/commit/b7cd8dea
Tree: http://git-wip-us.apache.org/repos/asf/rave/tree/b7cd8dea
Diff: http://git-wip-us.apache.org/repos/asf/rave/diff/b7cd8dea
Branch: refs/heads/angular
Commit: b7cd8deaee9d88d602a8f1fe7870d28038fc3ac9
Parents: 18d5ae2
Author: Chris Geer <ch...@cxtsoftware.com>
Authored: Sun Jul 6 14:26:35 2014 -0700
Committer: Chris Geer <ch...@cxtsoftware.com>
Committed: Sun Jul 6 14:26:35 2014 -0700
----------------------------------------------------------------------
.../rave/rest/model/JsonResponseWrapper.java | 11 +-
.../java/org/apache/rave/rest/model/Person.java | 97 +++++++++++++-
.../portal/repository/PersonRepository.java | 8 ++
.../apache/rave/portal/service/UserService.java | 7 +
.../portal/service/impl/DefaultUserService.java | 5 +
.../service/impl/DefaultUserServiceTest.java | 8 ++
rave-integration-tests/pom.xml | 27 +++-
.../rave-webservice-tests/pom.xml | 128 +++++++++++++++++++
.../webservice/StateManager.java | 37 ++++++
.../integrationtests/webservice/Stories.java | 101 +++++++++++++++
.../webservice/steps/CommonSteps.java | 63 +++++++++
.../webservice/steps/PeopleSteps.java | 122 ++++++++++++++++++
.../integrationtests/webservice/people.story | 40 ++++++
.../WEB-INF/applicationContext-security.xml | 1 +
14 files changed, 640 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/JsonResponseWrapper.java
----------------------------------------------------------------------
diff --git a/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/JsonResponseWrapper.java b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/JsonResponseWrapper.java
index ec2fe08..c2efb69 100644
--- a/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/JsonResponseWrapper.java
+++ b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/JsonResponseWrapper.java
@@ -22,18 +22,15 @@ package org.apache.rave.rest.model;
import java.util.HashMap;
import java.util.List;
-/**
- * Created with IntelliJ IDEA.
- * User: erinnp
- * Date: 7/19/13
- * Time: 11:37 AM
- * To change this template use File | Settings | File Templates.
- */
public class JsonResponseWrapper {
private HashMap<String, String> metadata;
private Object data;
+ public JsonResponseWrapper() {
+
+ }
+
public JsonResponseWrapper(SearchResult searchResult) {
this.metadata = new HashMap<String, String>();
this.data = searchResult.getResultSet();
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Person.java
----------------------------------------------------------------------
diff --git a/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Person.java b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Person.java
index 1820647..e91b7a2 100644
--- a/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Person.java
+++ b/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/model/Person.java
@@ -35,12 +35,36 @@ public class Person implements RestEntity{
private String displayName;
@XmlElement(name = "EmailAddress")
private String emailAddress;
+ @XmlElement(name = "AboutMe")
+ private String aboutMe;
+ @XmlElement(name = "PreferredName")
+ private String preferredName;
+ @XmlElement(name = "Status")
+ private String status;
+ @XmlElement(name = "AdditionalName")
+ private String additionalName;
+ @XmlElement(name = "FamilyName")
+ private String familyName;
+ @XmlElement(name = "GivenName")
+ private String givenName;
+ @XmlElement(name = "HonorificPrefix")
+ private String honorificPrefix;
+ @XmlElement(name = "HonorificSuffix")
+ private String honorificSuffix;
public Person(org.apache.rave.model.Person person) {
id = person.getId();
username = person.getUsername();
displayName = person.getDisplayName();
emailAddress = person.getEmail();
+ aboutMe = person.getAboutMe();
+ preferredName = person.getPreferredName();
+ status = person.getStatus();
+ additionalName = person.getAdditionalName();
+ familyName = person.getFamilyName();
+ givenName = person.getGivenName();
+ honorificPrefix = person.getHonorificPrefix();
+ honorificSuffix = person.getHonorificSuffix();
}
public Person() {
@@ -78,6 +102,70 @@ public class Person implements RestEntity{
this.emailAddress = emailAddress;
}
+ public String getAboutMe() {
+ return aboutMe;
+ }
+
+ public void setAboutMe(String aboutMe) {
+ this.aboutMe = aboutMe;
+ }
+
+ public String getPreferredName() {
+ return preferredName;
+ }
+
+ public void setPreferredName(String preferredName) {
+ this.preferredName = preferredName;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getAdditionalName() {
+ return additionalName;
+ }
+
+ public void setAdditionalName(String additionalName) {
+ this.additionalName = additionalName;
+ }
+
+ public String getFamilyName() {
+ return familyName;
+ }
+
+ public void setFamilyName(String familyName) {
+ this.familyName = familyName;
+ }
+
+ public String getGivenName() {
+ return givenName;
+ }
+
+ public void setGivenName(String givenName) {
+ this.givenName = givenName;
+ }
+
+ public String getHonorificPrefix() {
+ return honorificPrefix;
+ }
+
+ public void setHonorificPrefix(String honorificPrefix) {
+ this.honorificPrefix = honorificPrefix;
+ }
+
+ public String getHonorificSuffix() {
+ return honorificSuffix;
+ }
+
+ public void setHonorificSuffix(String honorificSuffix) {
+ this.honorificSuffix = honorificSuffix;
+ }
+
public void saveToPerson(org.apache.rave.model.Person person) {
if (person.getId() != null && !person.getId().equals(id)) {
throw new RuntimeException("You cannot change the ID of a Person object");
@@ -86,6 +174,13 @@ public class Person implements RestEntity{
if (username != null) { person.setUsername(username); }
if (displayName != null) { person.setDisplayName(displayName); }
if (emailAddress != null) { person.setEmail(emailAddress); }
+ if (aboutMe != null) { person.setAboutMe(aboutMe); }
+ if (preferredName != null) { person.setPreferredName(preferredName); }
+ if (additionalName != null) { person.setAdditionalName(additionalName); }
+ if (familyName != null) { person.setFamilyName(familyName); }
+ if (givenName != null) { person.setGivenName(givenName); }
+ if (honorificPrefix != null) { person.setHonorificPrefix(honorificPrefix); }
+ if (honorificSuffix != null) { person.setHonorificSuffix(honorificSuffix); }
+ if (status != null) { person.setStatus(status); }
}
-
}
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/PersonRepository.java
----------------------------------------------------------------------
diff --git a/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/PersonRepository.java b/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/PersonRepository.java
index 176c2ed..e81ecc2 100644
--- a/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/PersonRepository.java
+++ b/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/PersonRepository.java
@@ -28,6 +28,14 @@ import org.apache.rave.model.Person;
public interface PersonRepository extends Repository<Person> {
+
+ /**
+ * Gets a list of all the people
+ *
+ * @return
+ */
+ List<Person> getAll();
+
/**
* Gets a user by their username
*
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/UserService.java
----------------------------------------------------------------------
diff --git a/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/UserService.java b/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/UserService.java
index 9f2df7d..b0bacbc 100644
--- a/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/UserService.java
+++ b/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/UserService.java
@@ -235,4 +235,11 @@ public interface UserService extends UserDetailsService, AuthenticationUserDetai
*/
SearchResult<Person> getPersonsByFreeTextSearch(String searchTerm, int offset, int pageSize);
+ /**
+ * Gets the {@link Person} list containing all the people
+ *
+ * @return
+ */
+ List<Person> getAllPeople();
+
}
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultUserService.java
----------------------------------------------------------------------
diff --git a/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultUserService.java b/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultUserService.java
index 3b4f520..fd25291 100644
--- a/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultUserService.java
+++ b/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultUserService.java
@@ -280,6 +280,11 @@ public class DefaultUserService implements UserService {
}
@Override
+ public List<Person> getAllPeople() {
+ return personRepository.getAll();
+ }
+
+ @Override
@Transactional
// TODO RAVE-300: add security check that is is called by admin or the user itself
public void deleteUser(String userId) {
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultUserServiceTest.java
----------------------------------------------------------------------
diff --git a/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultUserServiceTest.java b/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultUserServiceTest.java
index 4080022..053ea3f 100644
--- a/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultUserServiceTest.java
+++ b/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultUserServiceTest.java
@@ -393,4 +393,12 @@ public class DefaultUserServiceTest {
service.registerNewUser(user);
verify(userRepository, pageTemplateRepository, pageRepository);
}
+
+ @Test
+ public void getAllPeople() {
+ expect(personRepository.getAll()).andReturn(new ArrayList<Person>());
+ replay(personRepository);
+ service.getAllPeople();
+ verify(personRepository);
+ }
}
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/rave-integration-tests/pom.xml b/rave-integration-tests/pom.xml
index 2552328..24b2859 100644
--- a/rave-integration-tests/pom.xml
+++ b/rave-integration-tests/pom.xml
@@ -216,7 +216,7 @@
</includes>
<excludes />
<generateViewAfterStories>true</generateViewAfterStories>
- <ignoreFailureInStories>true</ignoreFailureInStories>
+ <ignoreFailureInStories>false</ignoreFailureInStories>
<ignoreFailureInView>true</ignoreFailureInView>
<metaFilters>
<metaFilter>${meta.filter}</metaFilter>
@@ -233,6 +233,19 @@
</build>
<profiles>
<profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>rave-webservice-tests</module>
+ <module>rave-core-tests</module>
+ <module>rave-newuser-tests</module>
+ <module>rave-admin-tests</module>
+ <module>rave-default-account-tests</module>
+ </modules>
+ </profile>
+ <profile>
<id>integration-tests</id>
<build>
<defaultGoal>integration-test</defaultGoal>
@@ -374,11 +387,11 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>webservice</id>
+ <modules>
+ <module>rave-webservice-tests</module>
+ </modules>
+ </profile>
</profiles>
- <modules>
- <module>rave-core-tests</module>
- <module>rave-newuser-tests</module>
- <module>rave-admin-tests</module>
- <module>rave-default-account-tests</module>
- </modules>
</project>
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-integration-tests/rave-webservice-tests/pom.xml
----------------------------------------------------------------------
diff --git a/rave-integration-tests/rave-webservice-tests/pom.xml b/rave-integration-tests/rave-webservice-tests/pom.xml
new file mode 100644
index 0000000..995b220
--- /dev/null
+++ b/rave-integration-tests/rave-webservice-tests/pom.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>rave-integration-tests</artifactId>
+ <groupId>org.apache.rave.integration-tests</groupId>
+ <version>0.24-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.rave.integration-tests</groupId>
+ <artifactId>rave-webservice-tests</artifactId>
+ <version>0.24-SNAPSHOT</version>
+ <name>Apache Rave :: rave-webservice-tests</name>
+ <description>Integration tests verifying webservice functionality</description>
+
+
+ <properties>
+ <embeddables>**/*Stories.java</embeddables>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.rave</groupId>
+ <artifactId>rave-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jbehave</groupId>
+ <artifactId>jbehave-core</artifactId>
+ <version>${jbehave.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbehave.site</groupId>
+ <artifactId>jbehave-site-resources</artifactId>
+ <version>${jbehave.site.version}</version>
+ <type>zip</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ <filtering>true</filtering>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>notest</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ </profile>
+ <profile>
+ <id>integration-tests</id>
+ <build>
+ <defaultGoal>integration-test</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.jbehave</groupId>
+ <artifactId>jbehave-maven-plugin</artifactId>
+ <version>${jbehave.core.version}</version>
+ <executions>
+ <execution>
+ <id>unpack-view-resources</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>unpack-view-resources</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>embeddable-stories</id>
+ <phase>integration-test</phase>
+ <configuration>
+ <includes>
+ <include>${embeddables}</include>
+ </includes>
+ <excludes/>
+ <ignoreFailureInStories>false</ignoreFailureInStories>
+ <ignoreFailureInView>false</ignoreFailureInView>
+ <threads>1</threads>
+ <storyTimeoutInSecs>600</storyTimeoutInSecs>
+ <metaFilters>
+ <metaFilter></metaFilter>
+ </metaFilters>
+ </configuration>
+ <goals>
+ <goal>run-stories-as-embeddables</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/StateManager.java
----------------------------------------------------------------------
diff --git a/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/StateManager.java b/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/StateManager.java
new file mode 100644
index 0000000..ff7c761
--- /dev/null
+++ b/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/StateManager.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.rave.integrationtests.webservice;
+
+import java.util.HashMap;
+
+public class StateManager {
+ private static HashMap<String, HashMap<String, Object>> stateMap = new HashMap<String, HashMap<String, Object>>();
+
+ public StateManager() {
+ throw new AssertionError("Instantiating utility class...");
+ }
+
+ public static HashMap<String, Object> getStateStore(String instanceID) {
+ if (!stateMap.containsKey(instanceID)) {
+ stateMap.put(instanceID, new HashMap<String, Object>());
+ }
+
+ return stateMap.get(instanceID);
+ }
+}
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/Stories.java
----------------------------------------------------------------------
diff --git a/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/Stories.java b/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/Stories.java
new file mode 100644
index 0000000..1757cf8
--- /dev/null
+++ b/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/Stories.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.rave.integrationtests.webservice;
+
+import org.apache.rave.integrationtests.webservice.steps.CommonSteps;
+import org.apache.rave.integrationtests.webservice.steps.PeopleSteps;
+import org.jbehave.core.Embeddable;
+import org.jbehave.core.configuration.Configuration;
+import org.jbehave.core.configuration.MostUsefulConfiguration;
+import org.jbehave.core.i18n.LocalizedKeywords;
+import org.jbehave.core.io.CodeLocations;
+import org.jbehave.core.io.LoadFromClasspath;
+import org.jbehave.core.io.StoryFinder;
+import org.jbehave.core.junit.JUnitStories;
+import org.jbehave.core.model.ExamplesTableFactory;
+import org.jbehave.core.parsers.RegexStoryParser;
+import org.jbehave.core.reporters.StoryReporterBuilder;
+import org.jbehave.core.steps.InjectableStepsFactory;
+import org.jbehave.core.steps.InstanceStepsFactory;
+import org.jbehave.core.steps.ParameterConverters;
+import org.jbehave.core.steps.ParameterConverters.DateConverter;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+import static org.jbehave.core.io.CodeLocations.codeLocationFromClass;
+import static org.jbehave.core.reporters.Format.*;
+
+/**
+ * <p>
+ * {@link Embeddable} class to run multiple textual steps via JUnit.
+ * </p>
+ * <p>
+ * Stories are specified in classpath and correspondingly the {@link LoadFromClasspath} story loader is configured.
+ * </p>
+ */
+public class Stories extends JUnitStories {
+
+ public Stories() {
+ configuredEmbedder().embedderControls().doGenerateViewAfterStories(true).doIgnoreFailureInStories(true)
+ .doIgnoreFailureInView(false).useThreads(1).useStoryTimeoutInSecs(600);
+ }
+
+ @Override
+ public Configuration configuration() {
+ Class<? extends Embeddable> embeddableClass = this.getClass();
+ // Start from default ParameterConverters instance
+ ParameterConverters parameterConverters = new ParameterConverters();
+ // factory to allow parameter conversion and loading from external resources (used by StoryParser too)
+ ExamplesTableFactory examplesTableFactory = new ExamplesTableFactory(new LocalizedKeywords(), new LoadFromClasspath(embeddableClass), parameterConverters);
+ // add custom converters
+ parameterConverters.addConverters(
+ new DateConverter(new SimpleDateFormat("yyyy-MM-dd")),
+ new ParameterConverters.EnumConverter()
+ );
+ return new MostUsefulConfiguration()
+ .useStoryLoader(new LoadFromClasspath(embeddableClass))
+ .useStoryParser(new RegexStoryParser(examplesTableFactory))
+ .useStoryReporterBuilder(new StoryReporterBuilder()
+ .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
+ .withDefaultFormats()
+ .withFormats(CONSOLE, TXT, HTML, XML))
+ .useParameterConverters(parameterConverters);
+ }
+
+ @Override
+ public InjectableStepsFactory stepsFactory() {
+ return new InstanceStepsFactory(configuration(),
+ new CommonSteps(),
+ new PeopleSteps()
+ );
+ }
+
+ @Override
+ protected List<String> storyPaths() {
+ String story = System.getProperty("story");
+ if (story != null && !story.isEmpty()) {
+ return new StoryFinder().findPaths(codeLocationFromClass(this.getClass()), "**/" + story + ".story", "**/excluded*.story");
+ } else {
+ return new StoryFinder().findPaths(codeLocationFromClass(this.getClass()), "**/*.story", "**/excluded*.story");
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/steps/CommonSteps.java
----------------------------------------------------------------------
diff --git a/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/steps/CommonSteps.java b/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/steps/CommonSteps.java
new file mode 100644
index 0000000..9b2a45d
--- /dev/null
+++ b/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/steps/CommonSteps.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.rave.integrationtests.webservice.steps;
+
+import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.rave.integrationtests.webservice.StateManager;
+import org.jbehave.core.annotations.Given;
+import org.jbehave.core.annotations.When;
+
+import javax.ws.rs.core.MediaType;
+import java.util.Collections;
+import java.util.HashMap;
+
+public class CommonSteps {
+ public static final String KEY_WEB_CLIENT = "webclient";
+ private final String baseURL = "http://localhost:8080/portal/api/rest";
+
+ @Given("the user \"$username\" with the password of \"$password\" is logged into the system expecting \"$datatype\"")
+ public void userIsLoggedIn(String username, String password, String datatype) {
+ WebClient client;
+
+ if (datatype.equals("JSON")) {
+ JacksonJsonProvider json = new JacksonJsonProvider();
+
+ client = WebClient.create(baseURL, Collections.singletonList(json), true);
+ client.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE);
+ } else {
+ client = WebClient.create(baseURL, true);
+ client.type(MediaType.APPLICATION_XML_TYPE).accept(MediaType.APPLICATION_XML_TYPE);
+ }
+ String authorizationHeader = "Basic " +
+ org.apache.cxf.common.util.Base64Utility.encode((username + ":" + password).getBytes());
+ client.header("Authorization", authorizationHeader);
+
+ getState().put(KEY_WEB_CLIENT, client);
+ }
+
+ @When("the user waits \"$count\" seconds")
+ public void userWaits(int seconds) throws Exception {
+ Thread.sleep(seconds * 1000);
+ }
+
+ private HashMap<String, Object> getState() {
+ return StateManager.getStateStore(new String(Long.toString(Thread.currentThread().getId())));
+ }
+}
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/steps/PeopleSteps.java
----------------------------------------------------------------------
diff --git a/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/steps/PeopleSteps.java b/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/steps/PeopleSteps.java
new file mode 100644
index 0000000..f6829ab
--- /dev/null
+++ b/rave-integration-tests/rave-webservice-tests/src/main/java/org/apache/rave/integrationtests/webservice/steps/PeopleSteps.java
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.rave.integrationtests.webservice.steps;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.rave.integrationtests.webservice.StateManager;
+import org.apache.rave.rest.model.JsonResponseWrapper;
+import org.apache.rave.rest.model.Person;
+import org.jbehave.core.annotations.Given;
+import org.jbehave.core.annotations.Then;
+import org.jbehave.core.annotations.When;
+
+import javax.ws.rs.core.Response;
+
+import static junit.framework.TestCase.fail;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.*;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+
+public class PeopleSteps {
+
+ private static final String URL_PEOPLE = "/people/";
+
+ private static final String KEY_ACTIVE_PERSON = "active_person";
+
+ private static ObjectMapper mapper = new ObjectMapper();
+
+ @Given("the system contains \"$count\" people")
+ @Then("there should be \"$count\" people in the system")
+ public void countPeople(int count) throws Exception {
+ assertThat("Wrong number of people", getAllPeople().size(), equalTo(count));
+ }
+
+ @When("the user retrieves the full person record for the display name of \"$displayName\"")
+ public void getUserByDisplayName(String displayName) throws Exception {
+ for (Person person : getAllPeople()) {
+ if (person.getDisplayName().equals(displayName)) {
+ getState().put(KEY_ACTIVE_PERSON, getPerson(person.getId()));
+ return;
+ }
+ }
+
+ assert false;
+ }
+
+ @Then("the \"$field\" field on the active person object is \"$value\"")
+ public void validateFieldOnActivePersonWithValue(String field, String value) {
+ validateFieldOnActivePerson(field, value);
+ }
+
+ @Then("the \"$field\" field on the active person object is null")
+ public void validateFieldOnActivePersonIsNull(String field) {
+ validateFieldOnActivePerson(field, null);
+ }
+
+ private void validateFieldOnActivePerson(String field, String value) {
+ Person person = (Person)getState().get(KEY_ACTIVE_PERSON);
+ assertThat("Active Person is Null", person, notNullValue());
+
+ for (Method method : person.getClass().getMethods()) {
+ if (method.getName().toLowerCase().equals("get" + field.toLowerCase())) {
+ try {
+ String val = (String)method.invoke(person);
+ assertThat("Value doesn't match", val, equalTo(value));
+ return;
+ } catch (Exception ex) {
+ fail("Exception thrown");
+ }
+ }
+ }
+
+ fail("Method not found");
+ }
+
+ private List<Person> getAllPeople() throws Exception {
+ WebClient webClient = getClient();
+ List<Person> people = new ArrayList<Person>();
+ for (Object obj : (List<Object>)webClient.path(URL_PEOPLE).get(JsonResponseWrapper.class).getData()) {
+ people.add(mapper.readValue(mapper.writeValueAsString(obj), Person.class));
+ }
+ return people;
+ }
+
+ private Person getPerson(String id) throws Exception {
+ WebClient webClient = getClient();
+ Object person = webClient.path(URL_PEOPLE + id).get(JsonResponseWrapper.class).getData();
+ return mapper.readValue(mapper.writeValueAsString(person), Person.class);
+ }
+
+ private WebClient getClient() {
+ WebClient client = (WebClient) getState().get(CommonSteps.KEY_WEB_CLIENT);
+ client.back(true);
+ client.resetQuery();
+ return client;
+ }
+
+ private HashMap<String, Object> getState() {
+ return StateManager.getStateStore(new String(Long.toString(Thread.currentThread().getId())));
+ }
+}
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-integration-tests/rave-webservice-tests/src/main/resources/org/apache/rave/integrationtests/webservice/people.story
----------------------------------------------------------------------
diff --git a/rave-integration-tests/rave-webservice-tests/src/main/resources/org/apache/rave/integrationtests/webservice/people.story b/rave-integration-tests/rave-webservice-tests/src/main/resources/org/apache/rave/integrationtests/webservice/people.story
new file mode 100644
index 0000000..b9818cb
--- /dev/null
+++ b/rave-integration-tests/rave-webservice-tests/src/main/resources/org/apache/rave/integrationtests/webservice/people.story
@@ -0,0 +1,40 @@
+!--
+!-- Licensed to the Apache Software Foundation (ASF) under one
+!-- or more contributor license agreements. See the NOTICE file
+!-- distributed with this work for additional information
+!-- regarding copyright ownership. The ASF licenses this file
+!-- to you under the Apache License, Version 2.0 (the
+!-- "License"); you may not use this file except in compliance
+!-- with the License. You may obtain a copy of the License at
+!--
+!-- http://www.apache.org/licenses/LICENSE-2.0
+!--
+!-- Unless required by applicable law or agreed to in writing,
+!-- software distributed under the License is distributed on an
+!-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+!-- KIND, either express or implied. See the License for the
+!-- specific language governing permissions and limitations
+!-- under the License.
+!--
+
+Scenario: The system is set to a known state
+
+Given the user "canonical" with the password of "canonical" is logged into the system expecting "JSON"
+Then there should be "13" people in the system
+
+
+Scenario: The user finds their record in the list and retrieves their full record
+
+Given the system contains "13" people
+When the user retrieves the full person record for the display name of "Canonical User"
+Then the "username" field on the active person object is "canonical"
+And the "emailAddress" field on the active person object is "canonical@example.com"
+And the "displayName" field on the active person object is "Canonical User"
+And the "aboutMe" field on the active person object is null
+And the "preferredName" field on the active person object is null
+And the "status" field on the active person object is "Single"
+And the "additionalName" field on the active person object is "canonical"
+And the "familyName" field on the active person object is "User"
+And the "givenName" field on the active person object is "Canonical"
+And the "honorificPrefix" field on the active person object is null
+And the "honorificSuffix" field on the active person object is null
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/rave/blob/b7cd8dea/rave-portal-resources/src/main/webapp/WEB-INF/applicationContext-security.xml
----------------------------------------------------------------------
diff --git a/rave-portal-resources/src/main/webapp/WEB-INF/applicationContext-security.xml b/rave-portal-resources/src/main/webapp/WEB-INF/applicationContext-security.xml
index 6f94437..bd7c23f 100644
--- a/rave-portal-resources/src/main/webapp/WEB-INF/applicationContext-security.xml
+++ b/rave-portal-resources/src/main/webapp/WEB-INF/applicationContext-security.xml
@@ -61,6 +61,7 @@
<security:openid-attribute name="fullname" type="http://schema.openid.net/namePerson" required="true"/>
</security:attribute-exchange>
</security:openid-login>
+ <security:http-basic/>
<security:form-login login-page="/login" default-target-url="/" authentication-failure-url="/login?authfail=form" />
<security:logout/>
<security:remember-me user-service-ref="userService" />