Skip to content

Commit

Permalink
No limit for themes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonherrmann committed Oct 25, 2018
1 parent b8e3c8b commit 589da23
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public class TopologyErrorXmlWriter implements TopologyErrorCollector {

private static final String TOPOX_ERROR_NS = "http://www.interactive-instruments.de/etf/topology-error/1.0";
private static final String TOPOX_ERROR_NS_PREFIX = "ete";
private final Theme theme;
private final String themeName;
private final XMLStreamWriter writer;
private int counter = 0;

public TopologyErrorXmlWriter(final Theme theme, final XMLStreamWriter writer) {
this.theme = theme;
public TopologyErrorXmlWriter(final String themeName, final XMLStreamWriter writer) {
this.themeName = themeName;
this.writer = writer;
}

Expand All @@ -46,10 +46,7 @@ public void init() {
writer.writeStartElement(TOPOX_ERROR_NS_PREFIX, "TopologicalErrors", TOPOX_ERROR_NS);
writer.setPrefix(TOPOX_ERROR_NS_PREFIX, TOPOX_ERROR_NS);
writer.writeNamespace(TOPOX_ERROR_NS_PREFIX, TOPOX_ERROR_NS);
writer.writeAttribute("id", theme.getIdentifier());
writer.writeAttribute("theme", theme.getName());
writer.writeAttribute("geometry", theme.getGeometry());
writer.writeAttribute("selection", theme.getSelection());
writer.writeAttribute("theme", themeName);
} catch (final XMLStreamException e) {
throw new IllegalStateException("Initialization failed: ", e);
}
Expand All @@ -70,7 +67,7 @@ public void collectError(final TopologyErrorType topologyErrorType, final String
}
writer.writeEndElement();
} catch (final XMLStreamException e) {
final String message = theme.getName() + " " +
final String message = themeName + " " +
topologyErrorType.toString() + " : " + SUtils.concatStr(" ", parameter);
throw new IllegalStateException("Error writing topological error: " + message, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public void compare(final IFile resultFile) {
.ignoreElementContentWhitespace()
.build();


if (diff.hasDifferences()) {
final Difference difference = diff.getDifferences().iterator().next();
assertEquals(formatter.getControlDetailDescription(difference.getComparison()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* Copyright 2010-2018 interactive instruments GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package de.interactive_instruments.etf.bsxm;

import org.xmlunit.diff.Comparison;
Expand All @@ -36,20 +35,14 @@ public String getTestDetailDescription(final Comparison comparison) {
private String getDetailDescription(final Comparison difference, final Comparison.Detail detail) {
final ComparisonType type = difference.getType();
String description = type.getDescription();
final String target =
getShortString(detail.getTarget(), detail.getXPath(),
type);
final String target = getShortString(detail.getTarget(), detail.getXPath(),
type);

if (type == ComparisonType.ATTR_NAME_LOOKUP ) {
return new StringBuilder().
append(description).append(" ").
append(detail.getXPath()).append(" ").
append(target).toString();
if (type == ComparisonType.ATTR_NAME_LOOKUP) {
return new StringBuilder().append(description).append(" ").append(detail.getXPath()).append(" ").append(target)
.toString();
}
return new StringBuilder().
append(description).append(" ").
append(getValue(detail.getValue(), type)).append(" ").
append(target).
toString();
return new StringBuilder().append(description).append(" ").append(getValue(detail.getValue(), type)).append(" ")
.append(target).toString();
}
}

0 comments on commit 589da23

Please sign in to comment.