Skip to content

Commit

Permalink
Axiom: fixed tests failing to duplicate defitions
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
  • Loading branch information
tonydamage committed May 25, 2020
1 parent fc21899 commit eb7d929
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Expand Up @@ -12,7 +12,6 @@
import com.evolveum.axiom.lang.spi.AxiomItemStreamTreeBuilder.ValueBuilder;
import com.evolveum.axiom.reactor.Dependency;
import com.google.common.base.Preconditions;

import java.util.Collection;
import java.util.HashSet;
import java.util.Optional;
Expand All @@ -24,6 +23,7 @@
public class ValueContext<V> extends AbstractContext<ItemContext<V>> implements AxiomValueContext<V>, ValueBuilder, Dependency<AxiomItemValue<V>> {

private Dependency<AxiomItemValue<V>> result;
V originalValue;
Collection<Dependency<?>> dependencies = new HashSet<>();

public ValueContext(SourceLocation loc, IdentifierSpaceHolder space) {
Expand All @@ -33,6 +33,7 @@ public ValueContext(SourceLocation loc, IdentifierSpaceHolder space) {

public ValueContext(ItemContext<V> itemContext, V value, SourceLocation loc) {
super(itemContext, loc, AxiomIdentifierDefinition.Scope.LOCAL);
originalValue = value;
result = new Result(parent().type(), value);
}

Expand Down Expand Up @@ -220,8 +221,10 @@ public boolean isMutable() {

@Override
public String toString() {
return "value("+ parent().name() +";" + result +")";
return new StringBuffer().append(parent().definition().name().getLocalName())
.append(" ")
.append(originalValue != null ? originalValue : "")
.toString();
}


}
5 changes: 0 additions & 5 deletions infra/axiom/src/test/resources/base-example.axiom
Expand Up @@ -50,11 +50,6 @@ model model-header {
}
}

object {
name User2;
itemName user;
}

// Alternative representation of a prism object definition
// (doesn't interfere with item <name> { type ... } in structured types)
object {
Expand Down
7 changes: 4 additions & 3 deletions infra/axiom/src/test/resources/common-core.axiom
Expand Up @@ -1192,7 +1192,7 @@ model common-core {
type ReferentialIntegrity;

// ???
type Extension;
// type Extension;

// common-3
type OperationResult;
Expand All @@ -1205,7 +1205,8 @@ model common-core {
type Activation;

// should exist because of "container XXX"
type Trigger;
type Assignment;
// Already defined
// type Trigger;
// type Assignment;

}

0 comments on commit eb7d929

Please sign in to comment.