Skip to content

Commit

Permalink
added regression test for issue #199
Browse files Browse the repository at this point in the history
  • Loading branch information
S1artie committed Sep 27, 2018
1 parent 28fbb8a commit 5399c9d
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,7 @@ packagedef integrity.fixtures.basic.noop with
testdef throwAbortExceptionTest uses de.gebit.integrity.tests.fixtures.basic.NoOpFixture#throwAbortException

calldef generateCharacter uses de.gebit.integrity.tests.fixtures.basic.NoOpFixture#generateCharacter

calldef generateArray uses de.gebit.integrity.tests.fixtures.basic.NoOpFixture#generateArray

packageend
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ packagedef integrity.basic with

suiteend


suitedef simpleArrayCreationAndPassing with

// This failed because of issue 199
variable someVariable
call integrity.fixtures.basic.noop.generateArray -> someVariable
call integrity.fixtures.basic.noop.echoObject echo: someVariable

suiteend



packageend
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,19 @@ public void testSimpleFixtureCallWithTwoParams() throws ModelLoadException, IOEx
assertDocumentMatchesReference(tempResult);
}

/**
* Performs a suite which does tests and checks the resulting XML document.
*
* @throws ModelLoadException
* @throws IOException
* @throws JDOMException
*/
@Test
public void testSimpleArrayCreationAndPassing() throws ModelLoadException, IOException, JDOMException {
Document tempResult = executeIntegritySuite(
new String[] { "integrity/suites/basic/simpleFixtureCalls.integrity" },
"integrity.basic.simpleArrayCreationAndPassing", null);
assertDocumentMatchesReference(tempResult);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<integrity name="Integrity JUnit Testing" timestamp="27.09.18 15:05" isotimestamp="2018-09-27T15:05:32" duration="1.244">
<variables />
<suite id="0" name="integrity.basic.simpleArrayCreationAndPassing" timestamp="27.09.18 15:05:32.0137">
<setup />
<variables>
<variable name="someVariable" />
</variables>
<statements>
<call id="1" line="75" name="generateArray" description="Creates an array" fixture="de.gebit.integrity.tests.fixtures.basic.NoOpFixture#generateArray" timestamp="27.09.18 15:05:32.0138">
<parameters />
<result duration="0.030" type="success">
<variableUpdate name="someVariable" value="0, 1, 2, 3, 4" />
</result>
</call>
<call id="2" line="76" name="echoObject" description="Echoes an object" fixture="de.gebit.integrity.tests.fixtures.basic.NoOpFixture#echoObject" timestamp="27.09.18 15:05:32.0138">
<parameters>
<parameter name="echo" value="0, 1, 2, 3, 4" />
</parameters>
<result duration="0.146" type="success" />
</call>
</statements>
<returns />
<teardown />
<result duration="1.081" successCount="0" failureCount="0" exceptionCount="0" testExceptionCount="0" callExceptionCount="0" />
</suite>
</integrity>

Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ public String generateCharacter(@FixtureParameter(name = "code") int aCharacterC
return tempChar;
}

@FixtureMethod(description = "Creates an array")
public Long[] generateArray() {
Long[] tempTestArray = new Long[5];
for (int i = 0; i < 5; i++) {
tempTestArray[i] = new Long(i);
}
return tempTestArray;
}

public enum Enum {

VALUE1,
Expand Down

0 comments on commit 5399c9d

Please sign in to comment.