Skip to content

Commit

Permalink
Add demo of UniformItemPath.EMPTY_PATH nullity
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Mar 5, 2020
1 parent 042a10d commit d25728d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Expand Up @@ -35,6 +35,15 @@ public class TestPath extends AbstractPrismTest {
creators.put('R', seq -> creators.get("CSN".charAt((int) (Math.random() * 3))).apply(seq));
}

/**
* See TestEditSchema.testEmptyPath()
*/
@Test
public void testEmptyPath() {
System.out.println("UniformItemPath.EMPTY_PATH = " + UniformItemPath.EMPTY_PATH);
System.out.println("UniformItemPathImpl.EMPTY_PATH = " + UniformItemPathImpl.EMPTY_PATH);
}

@Test
public void testPathNormalize() {
PrismContext prismContext = getPrismContext();
Expand Down
Expand Up @@ -18,6 +18,8 @@
import com.evolveum.midpoint.prism.delta.DeltaFactory;
import com.evolveum.midpoint.prism.path.ItemName;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.prism.path.UniformItemPath;
import com.evolveum.midpoint.prism.path.UniformItemPathImpl;
import com.evolveum.midpoint.schema.*;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

Expand Down Expand Up @@ -1721,4 +1723,23 @@ private void assertUntouchedUserDefinition() {
assertTrue("Password not modifiable", passwdValDef.canModify());

}

@Test
public void testEmptyPath() {
/*
* Strange: The output of this method is
*
* UniformItemPath.EMPTY_PATH = null
* UniformItemPathImpl.EMPTY_PATH =
*
* although both values should be equal (and non-null).
*
* Also strange is that TestPath.testEmptyPath produces expected result:
*
* UniformItemPath.EMPTY_PATH =
* UniformItemPathImpl.EMPTY_PATH =
*/
System.out.println("UniformItemPath.EMPTY_PATH = " + UniformItemPath.EMPTY_PATH);
System.out.println("UniformItemPathImpl.EMPTY_PATH = " + UniformItemPathImpl.EMPTY_PATH);
}
}

0 comments on commit d25728d

Please sign in to comment.