Skip to content

Commit

Permalink
TestGroovyExpressions cleanup + skip tests using exec on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Jan 28, 2020
1 parent 7fafe80 commit 73ccc3f
Showing 1 changed file with 20 additions and 12 deletions.
Expand Up @@ -9,19 +9,21 @@
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;

import com.evolveum.midpoint.repo.common.expression.ExpressionVariables;
import com.evolveum.midpoint.util.exception.ExpressionEvaluationException;
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;
import java.io.File;

import org.apache.commons.lang3.SystemUtils;
import org.testng.AssertJUnit;
import org.testng.SkipException;
import org.testng.annotations.Test;

import com.evolveum.midpoint.model.common.expression.script.groovy.GroovyScriptEvaluator;
import com.evolveum.midpoint.prism.PrimitiveType;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.crypto.Protector;
import com.evolveum.midpoint.prism.util.PrismTestUtil;

import org.testng.AssertJUnit;
import org.testng.annotations.Test;

import java.io.File;
import com.evolveum.midpoint.repo.common.expression.ExpressionVariables;
import com.evolveum.midpoint.util.exception.ExpressionEvaluationException;
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;

/**
* @author Radovan Semancik
Expand Down Expand Up @@ -462,8 +464,8 @@ public void testDrinkPoison() throws Exception {

} catch (ExpressionEvaluationException ex) {
// THEN
assertTrue("Expected that exception message will contain "+Poison.POISON_DRINK_ERROR_MESSAGE+
", but it did not. It was: "+ex.getMessage(), ex.getMessage().contains(Poison.POISON_DRINK_ERROR_MESSAGE));
assertTrue("Expected that exception message will contain " + Poison.POISON_DRINK_ERROR_MESSAGE +
", but it did not. It was: " + ex.getMessage(), ex.getMessage().contains(Poison.POISON_DRINK_ERROR_MESSAGE));
Error error = (Error) ex.getCause();
assertEquals("Wrong error message", Poison.POISON_DRINK_ERROR_MESSAGE, error.getMessage());
}
Expand Down Expand Up @@ -498,10 +500,13 @@ public void testSyntaxError() throws Exception {
}

/**
* Allmighty script can execute a process from string.
* Almighty script can execute a process from string.
*/
@Test
public void testStringExec() throws Exception {
if (SystemUtils.IS_OS_WINDOWS) {
throw new SkipException("Skipped for Windows");
}

// WHEN
evaluateAndAssertStringScalarExpresssion(
Expand All @@ -515,10 +520,13 @@ public void testStringExec() throws Exception {
}

/**
* Allmighty script can execute a process from list.
* Almighty script can execute a process from list.
*/
@Test
public void testListExec() throws Exception {
if (SystemUtils.IS_OS_WINDOWS) {
throw new SkipException("Skipped for Windows");
}

// WHEN
evaluateAndAssertStringScalarExpresssion(
Expand Down

0 comments on commit 73ccc3f

Please sign in to comment.