Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix more jenkins tests #13427

Merged
merged 10 commits into from
Jan 18, 2018

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -286,22 +286,23 @@ public void delete() throws Exception {
* Add action to scheme step1
*/
WorkflowAction newAction = new WorkflowAction();
newAction.setSchemeId(ws.getId());
newAction.setName("Edit");
newAction.setAssignable(true);
newAction.setCommentable(true);
newAction.setIcon("workflowIcon");
newAction.setNextStep(workflowStep2.getId());
newAction.setStepId(workflowStep1.getId());
newAction.setCondition("");
newAction.setRequiresCheckout(false);
newAction.setRoleHierarchyForAssign(false);
newAction.setNextAssign(newUserUserRole.getId());

List<Permission> permissionsNewAction = new ArrayList<Permission>();
List<Permission> permissionsNewAction = new ArrayList<>();
permissionsNewAction.add(new Permission( newAction.getId(), newRole.getId(), PermissionAPI.PERMISSION_USE ));

workflowAPI.saveAction(newAction, permissionsNewAction);

workflowAPI.saveAction(newAction.getId(), workflowStep1.getId(), systemUser);

List<WorkflowAction> actions1= workflowAPI.findActions(workflowStep1, systemUser);
Assert.assertTrue(actions1.size()==1);
WorkflowAction action1 = actions1.get(0);
Expand All @@ -310,21 +311,22 @@ public void delete() throws Exception {
* Add action to scheme step2
*/
WorkflowAction newAction2 = new WorkflowAction();
newAction2.setSchemeId(ws.getId());
newAction2.setName("Publish");
newAction2.setAssignable(true);
newAction2.setCommentable(true);
newAction2.setIcon("workflowIcon");
newAction2.setNextStep(workflowStep2.getId());
newAction2.setStepId(workflowStep2.getId());
newAction2.setCondition("");
newAction2.setRequiresCheckout(false);
newAction2.setRoleHierarchyForAssign(false);
newAction2.setNextAssign(newUserUserRole.getId());

List<Permission> permissionsNewAction2 = new ArrayList<Permission>();
List<Permission> permissionsNewAction2 = new ArrayList<>();
permissionsNewAction2.add(new Permission( newAction2.getId(), newRole.getId(), PermissionAPI.PERMISSION_USE ));

workflowAPI.saveAction(newAction2, permissionsNewAction2);
workflowAPI.saveAction(newAction2.getId(), workflowStep2.getId(), systemUser);

List<WorkflowAction> actions2= workflowAPI.findActions(workflowStep2, systemUser);
Assert.assertTrue(actions2.size()==1);
Expand Down Expand Up @@ -389,6 +391,7 @@ public void delete() throws Exception {
template.setTitle(templateTitle);
template.setBody(templateBody);
template.setOwner(newUser.getUserId());
template.setDrawedBody(templateBody);
template = templateAPI.saveTemplate(template, host, newUser, false);
PublishFactory.publishAsset(template, newUser, false, false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ public void testGetLinks() throws Exception {
template.setTitle(templateTitle);
template.setBody(templateBody);
template.setOwner(user.getUserId());
template.setDrawedBody(templateBody);
template = templateAPI.saveTemplate(template, host, user, false);
PublishFactory.publishAsset(template, user, false, false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public void testGetLinkChildrenByCondition() throws Exception {
template.setTitle(templateTitle);
template.setBody(templateBody);
template.setOwner(systemUser.getUserId());
template.setDrawedBody(templateBody);
template = templateAPI.saveTemplate(template, host, systemUser, false);
PublishFactory.publishAsset(template, systemUser, false, false);

Expand Down Expand Up @@ -170,10 +171,6 @@ public void testGetLinkChildrenByCondition() throws Exception {
Assert.assertEquals(link.getInode(), result.getInode());
Assert.assertTrue(link.getOwner() != null && link.getOwner().equals(result.getOwner()));
} finally {
if (ftest != null) {
folderAPI.delete(ftest, systemUser, false);
}

if (container != null && container.getInode() != null) {
containerAPI.delete(container, systemUser, false);
}
Expand All @@ -185,6 +182,10 @@ public void testGetLinkChildrenByCondition() throws Exception {
if (contentAsset != null && contentAsset.getInode() != null) {
contentletAPI.delete(contentAsset, systemUser, false);
}

if (ftest != null) {
folderAPI.delete(ftest, systemUser, false);
}
}

}
Expand Down
2 changes: 1 addition & 1 deletion dotCMS/src/main/enterprise
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,6 @@ public List<Map<String, Object>> getRolePermissions(String roleId) throws DotDat
}

public void saveRolePermission(String roleId, String folderHostId, Map<String, String> permissions, boolean cascade) throws DotDataException, DotSecurityException, PortalException, SystemException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Remove the declaration of thrown exception 'com.liferay.portal.PortalException', as it cannot be thrown from method's body. rule
MINOR Remove the declaration of thrown exception 'com.liferay.portal.SystemException', as it cannot be thrown from method's body. rule

User user = getAdminUser();
Logger.info(this, "Applying role permissions for role " + roleId + " and folder/host id " + folderHostId);

UserAPI userAPI = APILocator.getUserAPI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,13 @@ public void updateUserReferences(String userId, String replacementUserId)throws
String identifier = ident.get("identifier");
if (UtilMethods.isSet(identifier)) {

final VersionInfo info =
this.identifierCache.getVersionInfo(identifier);
final VersionInfo info = APILocator.getVersionableAPI().getVersionInfo(identifier);

if (null != info && UtilMethods.isSet(info.getLiveInode())) {

CacheLocator.getContainerCache().remove(info.getLiveInode());
}

CacheLocator.getContainerCache().remove(identifier);
}
}
} catch (DotDataException e) {
Expand Down