You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/01/23 17:43:11 UTC
[1/5] syncope git commit: [SYNCOPE-629] Format + safely delete role
Repository: syncope
Updated Branches:
refs/heads/1_2_X 3328bb68e -> 4bdf7d781
refs/heads/master b2cac7971 -> 9df1e03de
[SYNCOPE-629] Format + safely delete role
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/4efca7c3
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/4efca7c3
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/4efca7c3
Branch: refs/heads/1_2_X
Commit: 4efca7c3ec3973ab4b774a1f43e4403daf3354b7
Parents: f2d45fd
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Jan 21 06:54:34 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Jan 21 06:54:34 2015 +0100
----------------------------------------------------------------------
.../core/rest/ConfigurationTestITCase.java | 79 +++++++++++---------
1 file changed, 42 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/4efca7c3/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java b/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java
index cbe13d5..1f981ac 100644
--- a/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java
+++ b/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java
@@ -151,22 +151,22 @@ public class ConfigurationTestITCase extends AbstractTest {
assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name()));
}
}
-
+
@Test
- public void issueSYNCOPE629() throws IOException{
+ public void issueSYNCOPE629() throws IOException {
SchemaTO membershipKey = new SchemaTO();
- membershipKey.setName("membershipKey"+getUUIDString());
+ membershipKey.setName("membershipKey" + getUUIDString());
membershipKey.setType(AttributeSchemaType.String);
createSchema(AttributableType.MEMBERSHIP, SchemaType.NORMAL, membershipKey);
-
+
SchemaTO roleKey = new SchemaTO();
- roleKey.setName("roleKey"+getUUIDString());
+ roleKey.setName("roleKey" + getUUIDString());
roleKey.setType(AttributeSchemaType.String);
- createSchema(AttributableType.ROLE, SchemaType.NORMAL, roleKey);
-
+ createSchema(AttributableType.ROLE, SchemaType.NORMAL, roleKey);
+
RoleTO roleTO = new RoleTO();
roleTO.setName("aRole" + getUUIDString());
- roleTO.setParent(8L);
+ roleTO.setParent(8L);
// verify inheritance password and account policies
roleTO.setInheritAccountPolicy(false);
// not inherited so setter execution shouldn't be ignored
@@ -176,39 +176,44 @@ public class ConfigurationTestITCase extends AbstractTest {
roleTO.setPasswordPolicy(2L);
roleTO.getRAttrTemplates().add("icon");
roleTO.getAttrs().add(attributeTO("icon", "anIcon"));
- roleTO.getResources().add(RESOURCE_NAME_LDAP);
+ roleTO.getResources().add(RESOURCE_NAME_LDAP);
roleTO.getMAttrTemplates().add(membershipKey.getName());
roleTO.getRAttrTemplates().add(roleKey.getName());
RoleTO testRole = createRole(roleTO);
-
- Response response = configurationService.export();
- assertNotNull(response);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
- assertTrue(response.getMediaType().toString().startsWith(MediaType.TEXT_XML));
- String contentDisposition = response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION);
- assertNotNull(contentDisposition);
- Object entity = response.getEntity();
- assertTrue(entity instanceof InputStream);
- String configExport = IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING);
- assertFalse(configExport.isEmpty());
- assertTrue(configExport.length() > 1000);
-
- String[] result = StringUtils.substringsBetween(configExport, "<RATTRTEMPLATE", "/>");
- boolean rattrExists = false;
- for(String entry : result){
- if(entry.contains(roleKey.getName())) rattrExists = true;
- }
- assertTrue(rattrExists);
-
- result = StringUtils.substringsBetween(configExport, "<MATTRTEMPLATE", "/>");
- boolean mattrExists = false;
- for(String entry : result){
- if(entry.contains(membershipKey.getName())) mattrExists = true;
+ try {
+ Response response = configurationService.export();
+ assertNotNull(response);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
+ assertTrue(response.getMediaType().toString().startsWith(MediaType.TEXT_XML));
+ String contentDisposition = response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION);
+ assertNotNull(contentDisposition);
+
+ Object entity = response.getEntity();
+ assertTrue(entity instanceof InputStream);
+ String configExport = IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING);
+ assertFalse(configExport.isEmpty());
+ assertTrue(configExport.length() > 1000);
+
+ String[] result = StringUtils.substringsBetween(configExport, "<RATTRTEMPLATE", "/>");
+ boolean rattrExists = false;
+ for (String entry : result) {
+ if (entry.contains(roleKey.getName())) {
+ rattrExists = true;
+ }
+ }
+ assertTrue(rattrExists);
+
+ result = StringUtils.substringsBetween(configExport, "<MATTRTEMPLATE", "/>");
+ boolean mattrExists = false;
+ for (String entry : result) {
+ if (entry.contains(membershipKey.getName())) {
+ mattrExists = true;
+ }
+ }
+ assertTrue(mattrExists);
+ } finally {
+ deleteRole(testRole.getId());
}
- assertTrue(mattrExists);
-
- deleteRole(testRole.getId());
-
}
}
[5/5] syncope git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/syncope
Posted by il...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/syncope
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/9df1e03d
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/9df1e03d
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/9df1e03d
Branch: refs/heads/master
Commit: 9df1e03de222148e3e2bdc62d8e2870c555293fe
Parents: 336d8d6 b2cac79
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Fri Jan 23 17:43:00 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Fri Jan 23 17:43:00 2015 +0100
----------------------------------------------------------------------
cli/pom.xml | 186 +++++++++++++++++++
.../java/org/apache/syncope/cli/SyncopeAdm.java | 78 ++++++++
.../org/apache/syncope/cli/SyncopeServices.java | 41 ++++
.../syncope/cli/commands/LoggerCommand.java | 117 ++++++++++++
.../cli/validators/DebugLevelValidator.java | 61 ++++++
cli/src/main/resources/log4j2.xml | 58 ++++++
cli/src/main/resources/syncope.properties | 19 ++
pom.xml | 9 +-
8 files changed, 568 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[4/5] syncope git commit: Merge branch '1_2_X' of
https://git-wip-us.apache.org/repos/asf/syncope into 1_2_X
Posted by il...@apache.org.
Merge branch '1_2_X' of https://git-wip-us.apache.org/repos/asf/syncope into 1_2_X
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/4bdf7d78
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/4bdf7d78
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/4bdf7d78
Branch: refs/heads/1_2_X
Commit: 4bdf7d781d106177d282254a06affe0916961f38
Parents: 4efca7c 3328bb6
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Fri Jan 23 17:42:49 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Fri Jan 23 17:42:49 2015 +0100
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
[2/5] syncope git commit: [SYNCOPE-629] Format + safely delete role
Posted by il...@apache.org.
[SYNCOPE-629] Format + safely delete role
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/4efca7c3
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/4efca7c3
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/4efca7c3
Branch: refs/heads/master
Commit: 4efca7c3ec3973ab4b774a1f43e4403daf3354b7
Parents: f2d45fd
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Jan 21 06:54:34 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Jan 21 06:54:34 2015 +0100
----------------------------------------------------------------------
.../core/rest/ConfigurationTestITCase.java | 79 +++++++++++---------
1 file changed, 42 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/4efca7c3/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java b/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java
index cbe13d5..1f981ac 100644
--- a/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java
+++ b/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java
@@ -151,22 +151,22 @@ public class ConfigurationTestITCase extends AbstractTest {
assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name()));
}
}
-
+
@Test
- public void issueSYNCOPE629() throws IOException{
+ public void issueSYNCOPE629() throws IOException {
SchemaTO membershipKey = new SchemaTO();
- membershipKey.setName("membershipKey"+getUUIDString());
+ membershipKey.setName("membershipKey" + getUUIDString());
membershipKey.setType(AttributeSchemaType.String);
createSchema(AttributableType.MEMBERSHIP, SchemaType.NORMAL, membershipKey);
-
+
SchemaTO roleKey = new SchemaTO();
- roleKey.setName("roleKey"+getUUIDString());
+ roleKey.setName("roleKey" + getUUIDString());
roleKey.setType(AttributeSchemaType.String);
- createSchema(AttributableType.ROLE, SchemaType.NORMAL, roleKey);
-
+ createSchema(AttributableType.ROLE, SchemaType.NORMAL, roleKey);
+
RoleTO roleTO = new RoleTO();
roleTO.setName("aRole" + getUUIDString());
- roleTO.setParent(8L);
+ roleTO.setParent(8L);
// verify inheritance password and account policies
roleTO.setInheritAccountPolicy(false);
// not inherited so setter execution shouldn't be ignored
@@ -176,39 +176,44 @@ public class ConfigurationTestITCase extends AbstractTest {
roleTO.setPasswordPolicy(2L);
roleTO.getRAttrTemplates().add("icon");
roleTO.getAttrs().add(attributeTO("icon", "anIcon"));
- roleTO.getResources().add(RESOURCE_NAME_LDAP);
+ roleTO.getResources().add(RESOURCE_NAME_LDAP);
roleTO.getMAttrTemplates().add(membershipKey.getName());
roleTO.getRAttrTemplates().add(roleKey.getName());
RoleTO testRole = createRole(roleTO);
-
- Response response = configurationService.export();
- assertNotNull(response);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
- assertTrue(response.getMediaType().toString().startsWith(MediaType.TEXT_XML));
- String contentDisposition = response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION);
- assertNotNull(contentDisposition);
- Object entity = response.getEntity();
- assertTrue(entity instanceof InputStream);
- String configExport = IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING);
- assertFalse(configExport.isEmpty());
- assertTrue(configExport.length() > 1000);
-
- String[] result = StringUtils.substringsBetween(configExport, "<RATTRTEMPLATE", "/>");
- boolean rattrExists = false;
- for(String entry : result){
- if(entry.contains(roleKey.getName())) rattrExists = true;
- }
- assertTrue(rattrExists);
-
- result = StringUtils.substringsBetween(configExport, "<MATTRTEMPLATE", "/>");
- boolean mattrExists = false;
- for(String entry : result){
- if(entry.contains(membershipKey.getName())) mattrExists = true;
+ try {
+ Response response = configurationService.export();
+ assertNotNull(response);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
+ assertTrue(response.getMediaType().toString().startsWith(MediaType.TEXT_XML));
+ String contentDisposition = response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION);
+ assertNotNull(contentDisposition);
+
+ Object entity = response.getEntity();
+ assertTrue(entity instanceof InputStream);
+ String configExport = IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING);
+ assertFalse(configExport.isEmpty());
+ assertTrue(configExport.length() > 1000);
+
+ String[] result = StringUtils.substringsBetween(configExport, "<RATTRTEMPLATE", "/>");
+ boolean rattrExists = false;
+ for (String entry : result) {
+ if (entry.contains(roleKey.getName())) {
+ rattrExists = true;
+ }
+ }
+ assertTrue(rattrExists);
+
+ result = StringUtils.substringsBetween(configExport, "<MATTRTEMPLATE", "/>");
+ boolean mattrExists = false;
+ for (String entry : result) {
+ if (entry.contains(membershipKey.getName())) {
+ mattrExists = true;
+ }
+ }
+ assertTrue(mattrExists);
+ } finally {
+ deleteRole(testRole.getId());
}
- assertTrue(mattrExists);
-
- deleteRole(testRole.getId());
-
}
}
[3/5] syncope git commit: Merge branch '1_2_X'
Posted by il...@apache.org.
Merge branch '1_2_X'
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/336d8d6f
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/336d8d6f
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/336d8d6f
Branch: refs/heads/master
Commit: 336d8d6f29b96e25ea2994868d945c89c3ac3e91
Parents: 8d270a1 4efca7c
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Jan 21 06:54:51 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Jan 21 06:54:51 2015 +0100
----------------------------------------------------------------------
.../core/rest/ConfigurationTestITCase.java | 79 +++++++++++---------
1 file changed, 42 insertions(+), 37 deletions(-)
----------------------------------------------------------------------