Skip to content

Commit

Permalink
Merge branch 'v0.13.x_bugfix' into v0.13.x
Browse files Browse the repository at this point in the history
  • Loading branch information
S1artie committed Sep 22, 2014
2 parents db8095b + 99f18d0 commit 03a77fc
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.gebit.integrity.experiments.fixtures;

import java.util.Date;
import java.util.Map;

import de.gebit.integrity.fixtures.FixtureMethod;
import de.gebit.integrity.fixtures.FixtureParameter;
Expand Down Expand Up @@ -64,7 +63,7 @@ public String returnString(@FixtureParameter(name = "echo") String anInput) {
}

@FixtureMethod(description = "echoes $echo$")
public Map<String, Object> returnValue(@FixtureParameter(name = "echo") Map<String, Object> anInput) {
public Object returnValue(@FixtureParameter(name = "echo") Object anInput) {
// throw new RuntimeException("An exception!");
return anInput;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ packagedef mypackage with
calldef wait uses de.gebit.integrity.experiments.fixtures.AdditionFixture#wait

testdef echo uses de.gebit.integrity.experiments.fixtures.AdditionFixture#returnValue
calldef echoCall uses de.gebit.integrity.experiments.fixtures.AdditionFixture#returnValue
testdef echoInteger uses de.gebit.integrity.experiments.fixtures.AdditionFixture#returnInteger
testdef echoString uses de.gebit.integrity.experiments.fixtures.AdditionFixture#returnString

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
Expand Down Expand Up @@ -149,6 +151,26 @@ protected Layout getLayout() {
return tempLayout;
}

/**
* Determines all launch configuration types to be displayed in the list.
*
* @param aLaunchManager
* @return a set of launch config types
*/
protected Set<ILaunchConfigurationType> getValidLaunchConfigTypes(ILaunchManager aLaunchManager) {
Set<ILaunchConfigurationType> tempSet = new HashSet<ILaunchConfigurationType>();
ILaunchConfigurationType tempJavaLaunchConfigType = aLaunchManager
.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
tempSet.add(tempJavaLaunchConfigType);

ILaunchConfigurationType tempBNDLaunchConfigType = aLaunchManager.getLaunchConfigurationType("bndtools.launch");
if (tempBNDLaunchConfigType != null) {
tempSet.add(tempBNDLaunchConfigType);
}

return tempSet;
}

@Override
protected Control createDialogArea(Composite aParent) {
launchConfigList = new List(aParent, SWT.BORDER | SWT.V_SCROLL);
Expand All @@ -161,8 +183,6 @@ protected Control createDialogArea(Composite aParent) {

DebugPlugin tempDebugPlugin = DebugPlugin.getDefault();
ILaunchManager tempLaunchManager = tempDebugPlugin.getLaunchManager();
ILaunchConfigurationType tempJavaLaunchConfigType = tempLaunchManager
.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);

launchConfigurations.clear();
try {
Expand Down Expand Up @@ -196,8 +216,10 @@ public int compare(ILaunchConfiguration aFirstConfig, ILaunchConfiguration aSeco
}
});

Set<ILaunchConfigurationType> tempValidTypes = getValidLaunchConfigTypes(tempLaunchManager);

for (ILaunchConfiguration tempLaunchConfig : tempLaunchConfigList) {
if (tempLaunchConfig.getType() == tempJavaLaunchConfigType) {
if (tempValidTypes.contains(tempLaunchConfig.getType())) {
launchConfigList.add(tempLaunchConfig.getName());
launchConfigurations.add(tempLaunchConfig);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
package de.gebit.integrity.runner.callbacks.console;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import com.google.inject.Inject;
Expand Down Expand Up @@ -84,6 +86,11 @@ public class ConsoleTestCallback extends AbstractTestRunnerCallback {
*/
protected int suiteCount;

/**
* Map remembering suite numbers.
*/
protected Map<Suite, Integer> suiteNumbers = new HashMap<Suite, Integer>();

/**
* The classloader to use.
*/
Expand Down Expand Up @@ -236,13 +243,14 @@ public void onExecutionFinish(TestModel aModel, SuiteSummaryResult aResult) {
@Override
public void onSuiteStart(Suite aSuite) {
suiteCount++;
suiteNumbers.put(aSuite, suiteCount);
println("Now entering suite " + suiteCount + ": "
+ IntegrityDSLUtil.getQualifiedSuiteName(aSuite.getDefinition()));
}

@Override
public void onSuiteFinish(Suite aSuite, SuiteSummaryResult aResult) {
println("Now leaving suite " + suiteCount + ": "
println("Now leaving suite " + suiteNumbers.remove(aSuite) + ": "
+ IntegrityDSLUtil.getQualifiedSuiteName(aSuite.getDefinition()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import de.gebit.integrity.dsl.ForkDefinition;
import de.gebit.integrity.dsl.VariableOrConstantEntity;
import de.gebit.integrity.operations.UnexecutableException;
import de.gebit.integrity.parameter.conversion.ValueConverter;
import de.gebit.integrity.remoting.client.IntegrityRemotingClient;
import de.gebit.integrity.remoting.client.IntegrityRemotingClientListener;
import de.gebit.integrity.remoting.entities.setlist.SetList;
Expand All @@ -36,6 +38,7 @@
import de.gebit.integrity.runner.forking.processes.ProcessTerminator;
import de.gebit.integrity.runner.operations.RandomNumberOperation;
import de.gebit.integrity.utils.IntegrityDSLUtil;
import de.gebit.integrity.utils.ParameterUtil.UnresolvableVariableException;

/**
* A fork is the result of the test runner forking during test execution.
Expand Down Expand Up @@ -149,6 +152,12 @@ public class Fork {
@Inject
protected ConsoleOutputInterceptor consoleInterceptor;

/**
* The value converter, which is used to resolve and convert values before sending them to forks.
*/
@Inject
protected ValueConverter valueConverter;

/**
* The interval in which the fork monitor shall check the liveliness of the fork until a connection has been
* established.
Expand Down Expand Up @@ -377,7 +386,16 @@ protected void transmitVariableUpdates() {
*/
public void updateVariableValue(VariableOrConstantEntity aVariable, Object aValue) {
if (!ignoreVariableUpdates) {
variableUpdates.put(IntegrityDSLUtil.getQualifiedVariableEntityName(aVariable, true), aValue);
String tempKey = IntegrityDSLUtil.getQualifiedVariableEntityName(aVariable, true);
try {
variableUpdates.put(tempKey, valueConverter.convertValue(null, aValue, null));
} catch (UnresolvableVariableException exc) {
System.err.println("SKIPPED SYNCING OF VARIABLE '" + tempKey + "' TO FORK - EXCEPTION OCCURRED");
exc.printStackTrace();
} catch (UnexecutableException exc) {
System.err.println("SKIPPED SYNCING OF VARIABLE '" + tempKey + "' TO FORK - EXCEPTION OCCURRED");
exc.printStackTrace();
}
}
}

Expand Down

0 comments on commit 03a77fc

Please sign in to comment.