Skip to content

Commit

Permalink
Merge branch 'v0.14.x_bugfix' into v0.14.x
Browse files Browse the repository at this point in the history
  • Loading branch information
S1artie committed Nov 30, 2015
2 parents cd83c6d + 1b79cfb commit b57fe80
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ protected Object convertPlainValueToTargetType(Class<?> aTargetType, Class<?> aP
aConversionContext, someVisitedValues);
}
} else {
Class<?> tempCurrentArrayType = aValue.getClass().getComponentType();
Class<?> tempCurrentArrayType = transformPrimitiveTypes(aValue.getClass().getComponentType());
Class<?> tempTargetArrayType;

if (tempCurrentArrayType == Object.class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ packagedef integrity.fixtures.basic.beans with

testdef echoEnumValueFromTestBean uses de.gebit.integrity.tests.fixtures.basic.beans.BeanFixture#echoEnumValueFromTestBean
calldef echoEnumValueFromTestBeanCall uses de.gebit.integrity.tests.fixtures.basic.beans.BeanFixture#echoEnumValueFromTestBean

testdef echoMap uses de.gebit.integrity.tests.fixtures.basic.beans.BeanFixture#echoMap
calldef echoMapCall uses de.gebit.integrity.tests.fixtures.basic.beans.BeanFixture#echoMap

calldef createPrimitiveTypeArrayTestBean uses de.gebit.integrity.tests.fixtures.basic.beans.BeanFixture#createPrimitiveTypeArrayTestBean

packageend
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import integrity.fixtures.basic.beans.*

packagedef integrity.basic.beans with

suitedef primitiveArrayBeanTest with

variable testvar

call createPrimitiveTypeArrayTestBean -> testvar

// This converts the resulting map to a string for inclusion into the results, therefore the map is tested
call echoMapCall bean: testvar -> testvar

suiteend

packageend
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*******************************************************************************
* Copyright (c) 2013 Rene Schneider, GEBIT Solutions GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package de.gebit.integrity.tests.junit.basic.beans;

import java.io.IOException;

import org.jdom.Document;
import org.jdom.JDOMException;
import org.junit.Test;

import de.gebit.integrity.runner.exceptions.ModelLoadException;
import de.gebit.integrity.tests.junit.IntegrityJUnitTest;

/**
* JUnit test which checks bean calls.
*
*
* @author Rene Schneider - initial API and implementation
*
*/
public class PrimitiveArrayBeanTest extends IntegrityJUnitTest {

/**
* Performs a suite which does fixture calls with bean values and checks the resulting XML document.
*
* @throws ModelLoadException
* @throws IOException
* @throws JDOMException
*/
@Test
public void test() throws ModelLoadException, IOException, JDOMException {
Document tempResult = executeIntegritySuite(
new String[] { "integrity/suites/basic/beans/primitiveArrayBeanTest.integrity" },
"integrity.basic.beans.primitiveArrayBeanTest", null);
assertDocumentMatchesReference(tempResult);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<integrity name="Integrity JUnit Testing" timestamp="30.11.15 09:55" isotimestamp="2015-11-30T09:55:56" duration="25.182">
<variables />
<suite id="0" name="integrity.basic.beans.primitiveArrayBeanTest" timestamp="30.11.15 09:55:56.0458">
<setup />
<variables>
<variable name="testvar" />
</variables>
<statements>
<call id="1" line="9" name="createPrimitiveTypeArrayTestBean" description="creates an instance of PrimitiveTypeArrayTestBean" fixture="de.gebit.integrity.tests.fixtures.basic.beans.BeanFixture#createPrimitiveTypeArrayTestBean" timestamp="30.11.15 09:55:56.0474">
<parameters />
<result duration="0.816" type="success">
<variableUpdate name="testvar" value="de.gebit.integrity.tests.fixtures.basic.beans.PrimitiveTypeArrayTestBean@78f6e005" />
</result>
</call>
<call id="2" line="12" name="echoMapCall" description="echoes the input as a map converted by Integrity" fixture="de.gebit.integrity.tests.fixtures.basic.beans.BeanFixture#echoMap" timestamp="30.11.15 09:55:56.0474">
<parameters>
<parameter name="bean" value="de.gebit.integrity.tests.fixtures.basic.beans.PrimitiveTypeArrayTestBean@78f6e005" />
</parameters>
<result duration="3.052" type="success">
<variableUpdate name="testvar" value="[FORMATTED]{[NL][T]primitiveBoolean = true, false[NL|, ][T]primitiveByte = 1, 2, 3[NL|, ][T]primitiveChar = a, b, c[NL|, ][T]primitiveDouble = 1.0, 1.1, 1.2[NL|, ][T]primitiveFloat = 1.0, 1.1, 1.2[NL|, ][T]primitiveInt = 1, 2, 3[NL|, ][T]primitiveLong = 1, 2, 3[NL|, ][T]primitiveShort = 1, 2, 3[NL]}" />
</result>
</call>
</statements>
<teardown />
<result duration="18.766" successCount="0" failureCount="0" exceptionCount="0" testExceptionCount="0" callExceptionCount="0" />
</suite>
</integrity>

Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,23 @@ public InnerEnum echoEnumValueFromTestBean(@FixtureParameter(name = "bean") Enum
return aTestBean.getEnumValue();
}

@FixtureMethod(description = "echoes the input as a map converted by Integrity")
public Map<String, Object> echoMap(@FixtureParameter(name = "bean") Map<String, Object> aBean) {
return aBean;
}

@FixtureMethod(description = "creates an instance of PrimitiveTypeArrayTestBean")
public PrimitiveTypeArrayTestBean createPrimitiveTypeArrayTestBean() {
PrimitiveTypeArrayTestBean tempBean = new PrimitiveTypeArrayTestBean();
tempBean.setPrimitiveBoolean(new boolean[] { true, false });
tempBean.setPrimitiveByte(new byte[] { 1, 2, 3 });
tempBean.setPrimitiveChar(new char[] { 'a', 'b', 'c' });
tempBean.setPrimitiveDouble(new double[] { 1.0, 1.1, 1.2 });
tempBean.setPrimitiveFloat(new float[] { 1.0f, 1.1f, 1.2f });
tempBean.setPrimitiveInt(new int[] { 1, 2, 3 });
tempBean.setPrimitiveLong(new long[] { 1, 2, 3 });
tempBean.setPrimitiveShort(new short[] { 1, 2, 3 });

return tempBean;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*******************************************************************************
* Copyright (c) 2013 Rene Schneider, GEBIT Solutions GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package de.gebit.integrity.tests.fixtures.basic.beans;

//SUPPRESS CHECKSTYLE LONG Javadoc
public class PrimitiveTypeArrayTestBean {

private int[] primitiveInt;

private long[] primitiveLong;

private short[] primitiveShort;

private byte[] primitiveByte;

private double[] primitiveDouble;

private float[] primitiveFloat;

private char[] primitiveChar;

private boolean[] primitiveBoolean;

public int[] getPrimitiveInt() {
return primitiveInt;
}

public void setPrimitiveInt(int[] primitiveInt) {
this.primitiveInt = primitiveInt;
}

public long[] getPrimitiveLong() {
return primitiveLong;
}

public void setPrimitiveLong(long[] primitiveLong) {
this.primitiveLong = primitiveLong;
}

public short[] getPrimitiveShort() {
return primitiveShort;
}

public void setPrimitiveShort(short[] primitiveShort) {
this.primitiveShort = primitiveShort;
}

public byte[] getPrimitiveByte() {
return primitiveByte;
}

public void setPrimitiveByte(byte[] primitiveByte) {
this.primitiveByte = primitiveByte;
}

public double[] getPrimitiveDouble() {
return primitiveDouble;
}

public void setPrimitiveDouble(double[] primitiveDouble) {
this.primitiveDouble = primitiveDouble;
}

public float[] getPrimitiveFloat() {
return primitiveFloat;
}

public void setPrimitiveFloat(float[] primitiveFloat) {
this.primitiveFloat = primitiveFloat;
}

public char[] getPrimitiveChar() {
return primitiveChar;
}

public void setPrimitiveChar(char[] primitiveChar) {
this.primitiveChar = primitiveChar;
}

public boolean[] getPrimitiveBoolean() {
return primitiveBoolean;
}

public void setPrimitiveBoolean(boolean[] primitiveBoolean) {
this.primitiveBoolean = primitiveBoolean;
}

}

0 comments on commit b57fe80

Please sign in to comment.