Skip to content

Commit

Permalink
MID-8842 copied ninja code to support-4.4 (e6cb5f7) - fixed compilati…
Browse files Browse the repository at this point in the history
…on issues
  • Loading branch information
1azyman committed Jun 20, 2023
1 parent e48089f commit 8d9ac99
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public class AuditFactory {

private static final Trace LOGGER = TraceManager.getTrace(AuditFactory.class);

private static final String CONF_AUDIT_SERVICE = "auditService";
private static final String CONF_AUDIT_SERVICE_FACTORY = "auditServiceFactoryClass";
public static final String CONF_AUDIT_SERVICE = "auditService";
public static final String CONF_AUDIT_SERVICE_FACTORY = "auditServiceFactoryClass";

@Autowired private AutowireCapableBeanFactory autowireCapableBeanFactory;
@Autowired private MidpointConfiguration midpointConfiguration;
Expand Down
5 changes: 3 additions & 2 deletions tools/ninja/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<groupId>com.evolveum.prism</groupId>
<artifactId>prism-impl</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -148,8 +149,8 @@
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio-jvm</artifactId>
<version>3.0.0</version>
<artifactId>okio</artifactId>
<version>1.17.2</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
package com.evolveum.midpoint.ninja.action.mining;

import static com.evolveum.midpoint.common.RoleMiningExportUtils.*;
import static com.evolveum.midpoint.repo.api.RepositoryService.LOGGER;
import static com.evolveum.midpoint.security.api.MidPointPrincipalManager.DOT_CLASS;

import java.io.IOException;
import java.io.Writer;
import java.util.List;
import java.util.concurrent.BlockingQueue;

import com.evolveum.midpoint.util.logging.Trace;

import com.evolveum.midpoint.util.logging.TraceManager;

import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.common.RoleMiningExportUtils;
Expand All @@ -40,6 +43,8 @@

public class ExportMiningConsumerWorker extends AbstractWriterConsumerWorker<ExportMiningOptions, FocusType> {

public static final Trace LOGGER = TraceManager.getTrace(ExportMiningConsumerWorker.class);

OperationResult operationResult = new OperationResult(DOT_CLASS + "searchObjectByCondition");

private PrismSerializer<String> serializer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.evolveum.midpoint.ninja.action.upgrade;

import java.io.File;
import java.util.stream.Collectors;

import org.apache.commons.io.FileUtils;

Expand Down Expand Up @@ -52,7 +53,7 @@ public Void execute() throws Exception {
upgradeRepositoryOpts.setMode(RunSqlOptions.Mode.REPOSITORY);
upgradeRepositoryOpts.setScripts(RunSqlOptions.Mode.REPOSITORY.updateScripts.stream()
.map(f -> new File(installationDirectory, f.getPath()))
.toList());
.collect(Collectors.toList()));

RunSqlAction upgradeRepositoryAction = new RunSqlAction();
upgradeRepositoryAction.init(context, upgradeRepositoryOpts);
Expand All @@ -63,7 +64,7 @@ public Void execute() throws Exception {
upgradeAuditOpts.setMode(RunSqlOptions.Mode.AUDIT);
upgradeRepositoryOpts.setScripts(RunSqlOptions.Mode.AUDIT.updateScripts.stream()
.map(f -> new File(installationDirectory, f.getPath()))
.toList());
.collect(Collectors.toList()));

RunSqlAction upgradeAuditAction = new RunSqlAction();
upgradeAuditAction.init(context, upgradeAuditOpts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static ObjectQuery createObjectQuery(FileReference ref, NinjaContext cont
PrismContext prismContext = context.getPrismContext();
// Experimental Axiom filter support, % is chosen as a marker and will be skipped.
if (filterStr.startsWith("%")) {
ObjectFilter objectFilter = prismContext.createQueryParser().parseFilter(objectClass, filterStr.substring(1));
ObjectFilter objectFilter = prismContext.createQueryParser().parseQuery(objectClass, filterStr.substring(1));
return prismContext.queryFactory().createQuery(objectFilter);
} else {
PrismParserNoIO parser = prismContext.parserFor(filterStr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected void setupMidpointHome() throws IOException {
// Ninja tests don't support test.config.file property as other midPoint tests.
String testConfigFile = System.getProperty("test.config.file");
if (testConfigFile != null) {
System.setProperty(MidpointConfiguration.MIDPOINT_CONFIG_FILE_PROPERTY, testConfigFile);
System.setProperty("midpoint.configFile", testConfigFile);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class VerifyFilesTest {

protected static final File UPGRADE_MIDPOINT_HOME = new File("./target/midpoint-home-upgrade");

@Test(enabled = false)
@Test//wenabled = false)
public void verifyFilesTest() throws Exception {
BaseOptions baseOptions = new BaseOptions();
baseOptions.setVerbose(true);
Expand All @@ -33,8 +33,8 @@ public void verifyFilesTest() throws Exception {

try (NinjaContext context = new NinjaContext(options, action.getApplicationContextLevel(options))) {
action.init(context, verifyFilesOptions);

action.execute();
}

}
}

0 comments on commit 8d9ac99

Please sign in to comment.