Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Sep 3, 2019
2 parents dfb4af9 + d9f54f5 commit c023c65
Show file tree
Hide file tree
Showing 3 changed files with 209 additions and 7 deletions.
Expand Up @@ -195,10 +195,10 @@ public boolean isHeaderMenuItem(){

}

private void runConfirmPerformed(AjaxRequestTarget target, ReportType reportType, PrismContainer<ReportParameterType> reportParam,
Task task, OperationResult result) {
private void runConfirmPerformed(AjaxRequestTarget target, ReportType reportType, PrismContainer<ReportParameterType> reportParam) {
OperationResult result = new OperationResult(OPERATION_RUN_REPORT);
Task task = createSimpleTask(OPERATION_RUN_REPORT);
try {

getReportManager().runReport(reportType.asPrismObject(), reportParam, task, result);
} catch (Exception ex) {
result.recordFatalError(ex);
Expand All @@ -213,10 +213,9 @@ private void runConfirmPerformed(AjaxRequestTarget target, ReportType reportType
}

protected void runReportPerformed(AjaxRequestTarget target, ReportType report) {
OperationResult result = new OperationResult(OPERATION_RUN_REPORT);
Task task = createSimpleTask(OPERATION_RUN_REPORT);

if(report.getReportEngine() != null && report.getReportEngine().equals(ReportEngineSelectionType.DASHBOARD)) {
runConfirmPerformed(target, report, null, task, result);
runConfirmPerformed(target, report, null);
return;
}

Expand All @@ -225,7 +224,7 @@ protected void runReportPerformed(AjaxRequestTarget target, ReportType report) {
private static final long serialVersionUID = 1L;

protected void runConfirmPerformed(AjaxRequestTarget target, ReportType reportType, PrismContainer<ReportParameterType> reportParam) {
PageReports.this.runConfirmPerformed(target, reportType, reportParam, task, result);
PageReports.this.runConfirmPerformed(target, reportType, reportParam);
hideMainPopup(target);

};
Expand Down
64 changes: 64 additions & 0 deletions model/model-intest/src/test/resources/strange/case-approval.xml
@@ -0,0 +1,64 @@
<!--
~ Copyright (c) 2019 Evolveum
~
~ Licensed 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.
-->
<case oid="402d844c-66c5-4070-8608-f0c4010284b9"
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance/10000000-0000-0000-0000-000000000004"
xmlns:piracy="http://midpoint.evolveum.com/xml/ns/samples/piracy">
<name>
<!-- No orig, no norm. MID-5577 -->
<t:translation>
<t:key>DefaultPolicyConstraint.Short.assignmentModification.toBeAdded</t:key>
<t:argument>
<t:translation>
<t:key>ObjectSpecification</t:key>
<t:argument>
<t:translation>
<t:key>ObjectTypeLowercase.RoleType</t:key>
<t:fallback>RoleType</t:fallback>
</t:translation>
</t:argument>
<t:argument>
<t:value>Manager</t:value>
</t:argument>
</t:translation>
</t:argument>
<t:argument>
<t:translation>
<t:key>ObjectSpecification</t:key>
<t:argument>
<t:translation>
<t:key>ObjectTypeLowercase.UserType</t:key>
<t:fallback>UserType</t:fallback>
</t:translation>
</t:argument>
<t:argument>
<t:value>vera</t:value>
</t:argument>
</t:translation>
</t:argument>
</t:translation>
</name>
<assignment id="1">
<targetRef oid="00000000-0000-0000-0000-000000000342" relation="org:default" type="ArchetypeType">
<!-- Approval case archetype -->
</targetRef>
</assignment>
<!-- No parentRef or objectRef or other things. This is just fake case. -->
<state>open</state>
</case>
@@ -0,0 +1,139 @@
/**
* Copyright (c) 2019 Evolveum
*
* Licensed 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 com.evolveum.midpoint.test.asserter;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.test.asserter.prism.PolyStringAsserter;
import com.evolveum.midpoint.test.asserter.prism.PrismObjectAsserter;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType;

/**
* @author semancik
*
*/
public class CaseAsserter<RA> extends PrismObjectAsserter<CaseType,RA> {

public CaseAsserter(PrismObject<CaseType> focus) {
super(focus);
}

public CaseAsserter(PrismObject<CaseType> focus, String details) {
super(focus, details);
}

public CaseAsserter(PrismObject<CaseType> focus, RA returnAsserter, String details) {
super(focus, returnAsserter, details);
}

public static CaseAsserter<Void> forCase(PrismObject<CaseType> object) {
return new CaseAsserter<>(object);
}

public static CaseAsserter<Void> forCase(PrismObject<CaseType> object, String details) {
return new CaseAsserter<>(object, details);
}

// It is insane to override all those methods from superclass.
// But there is no better way to specify something like <SELF> type in Java.
// This is lesser evil.
@Override
public CaseAsserter<RA> assertOid() {
super.assertOid();
return this;
}

@Override
public CaseAsserter<RA> assertOid(String expected) {
super.assertOid(expected);
return this;
}

@Override
public CaseAsserter<RA> assertOidDifferentThan(String oid) {
super.assertOidDifferentThan(oid);
return this;
}

@Override
public CaseAsserter<RA> assertName() {
super.assertName();
return this;
}

@Override
public CaseAsserter<RA> assertName(String expectedOrig) {
super.assertName(expectedOrig);
return this;
}

@Override
public CaseAsserter<RA> assertDescription(String expected) {
super.assertDescription(expected);
return this;
}

@Override
public CaseAsserter<RA> assertNoDescription() {
super.assertNoDescription();
return this;
}

@Override
public CaseAsserter<RA> assertSubtype(String... expected) {
super.assertSubtype(expected);
return this;
}

@Override
public CaseAsserter<RA> assertTenantRef(String expectedOid) {
super.assertTenantRef(expectedOid);
return this;
}

@Override
public CaseAsserter<RA> assertLifecycleState(String expected) {
super.assertLifecycleState(expected);
return this;
}

@Override
public CaseAsserter<RA> assertActiveLifecycleState() {
super.assertActiveLifecycleState();
return this;
}

public CaseAsserter<RA> display() {
super.display();
return this;
}

public CaseAsserter<RA> display(String message) {
super.display(message);
return this;
}


@Override
public PolyStringAsserter<CaseAsserter<RA>> name() {
return (PolyStringAsserter<CaseAsserter<RA>>)super.name();
}

@Override
public CaseAsserter<RA> assertNoTrigger() {
super.assertNoTrigger();
return this;
}
}

0 comments on commit c023c65

Please sign in to comment.