Skip to content

Commit

Permalink
Fix more failing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lhstrh committed Oct 13, 2023
1 parent 2c98113 commit 23d65a5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions core/src/main/java/org/lflang/AbstractTargetProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,14 @@ public void update(TargetConfig config, Element node, MessageReporter reporter)
public void update(TargetConfig config, String value, MessageReporter reporter) {
this.update(config, fromString(value, reporter));
}

@Override
public boolean equals(Object obj) {
return obj.getClass().getName().equals(this.getClass().getName());
}

@Override
public int hashCode() {
return this.getClass().getName().hashCode();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,11 @@ private void analyzeFederates(Reactor federation, LFGeneratorContext context) {
&& !federation.getHost().getAddr().equals("localhost")) {
rtiConfig.setHost(federation.getHost().getAddr());
}

var d = new DockerProperty();
var x = targetConfig.get(d);
// If the federation is dockerized, use "rti" as the hostname.
if (rtiConfig.getHost().equals("localhost") && targetConfig.get(new DockerProperty()).enabled) {
if (rtiConfig.getHost().equals("localhost") && x.enabled) {
rtiConfig.setHost("rti");
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/lflang/target/TargetConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public <T, S extends TargetPropertyType> void override(

/** Reset this target property to its initial value (and mark it as unset). */
public void reset(AbstractTargetProperty<?, ?> property) {
this.properties.remove(property);
this.properties.put(property, property.initialValue());
this.setProperties.remove(property);
}

Expand Down

0 comments on commit 23d65a5

Please sign in to comment.