Search in sources :

Example 31 with Environment

use of com.evolveum.midpoint.studio.impl.Environment in project midpoint-studio by Evolveum.

the class ClientBackgroundableTask method setupMidpointClient.

private MidPointClient setupMidpointClient() {
    LOG.debug("Setting up MidPoint client");
    Environment env = getEnvironment();
    midPointService.printToConsole(env, getClass(), "Setting up midPoint client");
    MidPointClient client = new MidPointClient(getProject(), env);
    LOG.debug("MidPoint client setup done");
    return client;
}
Also used : MidPointClient(com.evolveum.midpoint.studio.impl.MidPointClient) Environment(com.evolveum.midpoint.studio.impl.Environment)

Example 32 with Environment

use of com.evolveum.midpoint.studio.impl.Environment in project midpoint-studio by Evolveum.

the class ExpanderTest method testExpandFile.

private void testExpandFile(String fileExpected, String fileToExpand, String... expandChunkFiles) {
    for (String s : expandChunkFiles) {
        myFixture.configureByFile(s);
    }
    PsiFile file = myFixture.configureByFile(fileToExpand);
    Editor editor = myFixture.getEditor();
    String text = editor.getDocument().getText();
    Project project = getProject();
    Environment environment = new Environment();
    EnvironmentService es = EnvironmentService.getInstance(project);
    es.add(environment);
    EncryptionService cm = project != null ? EncryptionService.getInstance(project) : null;
    Expander expander = new Expander(environment, cm, project);
    String result = expander.expand(text, file.getVirtualFile());
    LOG.info("Expanded result:\n" + result);
    Diff d = DiffBuilder.compare(Input.fromFile(new File(getTestDataPath(), fileExpected))).withTest(Input.fromString(result)).build();
    if (d.hasDifferences()) {
        LOG.error(d.fullDescription());
        fail();
    }
}
Also used : Project(com.intellij.openapi.project.Project) Expander(com.evolveum.midpoint.studio.impl.Expander) Diff(org.xmlunit.diff.Diff) EncryptionService(com.evolveum.midpoint.studio.impl.EncryptionService) Environment(com.evolveum.midpoint.studio.impl.Environment) PsiFile(com.intellij.psi.PsiFile) EnvironmentService(com.evolveum.midpoint.studio.impl.EnvironmentService) Editor(com.intellij.openapi.editor.Editor) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) PsiFile(com.intellij.psi.PsiFile)

Aggregations

Environment (com.evolveum.midpoint.studio.impl.Environment)32 EnvironmentService (com.evolveum.midpoint.studio.impl.EnvironmentService)13 Project (com.intellij.openapi.project.Project)10 MidPointClient (com.evolveum.midpoint.studio.impl.MidPointClient)8 IOException (java.io.IOException)8 ArrayList (java.util.ArrayList)7 VirtualFile (com.intellij.openapi.vfs.VirtualFile)6 MidPointService (com.evolveum.midpoint.studio.impl.MidPointService)5 PrismContext (com.evolveum.midpoint.prism.PrismContext)4 ObjectTypes (com.evolveum.midpoint.schema.constants.ObjectTypes)4 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)4 NotNull (org.jetbrains.annotations.NotNull)4 ComboObjectTypes (com.evolveum.midpoint.studio.action.browse.ComboObjectTypes)3 MidPointObject (com.evolveum.midpoint.studio.client.MidPointObject)3 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)3 BufferedWriter (java.io.BufferedWriter)3 OutputStreamWriter (java.io.OutputStreamWriter)3 Writer (java.io.Writer)3 List (java.util.List)3 PrismPropertyDefinition (com.evolveum.midpoint.prism.PrismPropertyDefinition)2