Skip to content

Commit

Permalink
tried again with runtime system tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Nov 28, 2023
1 parent 1e55457 commit 99daae7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
* Contributors:
* Lorenzo Bettini - Initial contribution and API
*******************************************************************************/

/**
*
*/
package org.eclipse.xsemantics.dsl.tests.runtime;

import org.eclipse.xsemantics.runtime.RuleApplicationTrace
Expand All @@ -24,6 +20,7 @@ import org.junit.After
import org.junit.Assert
import org.junit.Before
import org.junit.Test
import static org.junit.Assert.*

/**
* @author Lorenzo Bettini
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import org.eclipse.xsemantics.runtime.ErrorInformation;
import org.eclipse.xsemantics.runtime.RuleFailedException;

import static org.junit.Assert.*;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@
*/
package org.eclipse.xsemantics.dsl.tests.runtime;

import org.eclipse.xsemantics.dsl.tests.XsemanticsAbstractTests;
import org.eclipse.xsemantics.runtime.Result2;
import org.eclipse.xsemantics.runtime.RuleFailedException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.eclipse.emf.common.util.WrappedException;
import org.eclipse.xsemantics.dsl.tests.EmfFactoryUtils;
import org.eclipse.xsemantics.runtime.Result2;
import org.eclipse.xsemantics.runtime.RuleFailedException;
import org.junit.Assert;

/**
* @author bettini
*
*/
public class XsemanticsRuntimeAbstractTests extends XsemanticsAbstractTests {
public class XsemanticsRuntimeAbstractTests {

protected EmfFactoryUtils emfUtils = new EmfFactoryUtils();

protected <LeftT, RightT> void assertLeftRightPair(
Result2<LeftT, RightT> result, LeftT expectedLeft,
Expand Down Expand Up @@ -57,4 +62,11 @@ protected RuleFailedException assertRuleFailedException(Exception exception,
assertEquals(expectedIssue, ((RuleFailedException)exception).getIssue());
return (RuleFailedException) exception;
}

protected void assertEqualsStrings(Object expected, Object actual) {
Assert.assertEquals(
("" + expected).replaceAll("\r", ""),
("" + actual).replaceAll("\r", "")
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
* Contributors:
* Lorenzo Bettini - Initial contribution and API
*******************************************************************************/

/**
*
*/
package org.eclipse.xsemantics.dsl.tests.runtime;

import static org.junit.Assert.*;

import java.util.LinkedList;
import java.util.List;

Expand Down

0 comments on commit 99daae7

Please sign in to comment.