Commit f872a12e authored by Romain Bioteau's avatar Romain Bioteau
Browse files

move to tycho 0.22

parent a3ea113f
......@@ -422,9 +422,6 @@
<plugin
id="org.bonitasoft.studio.expression.editor.win32"
os="win32"
ws="win32"
arch="x86,x86_64"
download-size="0"
install-size="0"
version="0.0.0"
......
......@@ -14,13 +14,16 @@
*/
package org.bonitasoft.studio.common.jface;
import static org.mockito.Mockito.doCallRealMethod;
import java.lang.reflect.InvocationTargetException;
import org.assertj.core.api.Assertions;
import org.bonitasoft.studio.swt.AbstractSWTTestCase;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -29,16 +32,27 @@ import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class BonitaErrorDialogTest {
public class BonitaErrorDialogTest extends AbstractSWTTestCase {
@Mock
private BonitaErrorDialog bed;
private List list;
@Before
public void init() throws Exception {
final Composite composite = createDisplayAndRealm();
list = new List(composite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
}
@After
public void tearDown() throws Exception {
dispose();
}
@Test
public void testPopulateStackDetailsSimple() {
Mockito.doCallRealMethod().when(bed).populateStackDetails(Mockito.any(List.class));
doCallRealMethod().when(bed).populateStackDetails(Mockito.any(List.class));
final RuntimeException runtimeException = new RuntimeException("plop");
final StackTraceElement stackTraceElement = new StackTraceElement(this.getClass().getName(), "plopMethod", "fileName", 100);
runtimeException.setStackTrace(new StackTraceElement[] { stackTraceElement });
......@@ -52,7 +66,7 @@ public class BonitaErrorDialogTest {
@Test
public void testPopulateStackDetailsWithInvocationTargetException() {
Mockito.doCallRealMethod().when(bed).populateStackDetails(Mockito.any(List.class));
doCallRealMethod().when(bed).populateStackDetails(Mockito.any(List.class));
final Throwable targetException = new RuntimeException("targetException");
final StackTraceElement stackTraceElement = new StackTraceElement("targetClassName", "plopMethod", "fileName", 100);
targetException.setStackTrace(new StackTraceElement[] { stackTraceElement });
......@@ -66,10 +80,4 @@ public class BonitaErrorDialogTest {
Assertions.assertThat(list.getItem(2)).isEqualTo("targetClassName.plopMethod(fileName:100)");
}
@Before
public void init() {
final Shell shell = new Shell(Display.getDefault());
list = new List(shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
}
}
......@@ -47,10 +47,9 @@
<configuration>
<dependency-resolution>
<extraRequirements>
<!-- product IU under test -->
<requirement>
<type>p2-installable-unit</type>
<id>org.bonitasoft.studio.product</id>
<type>eclipse-feature</type>
<id>studio-feature</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
......@@ -62,7 +61,6 @@
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tychoVersion}</version>
<configuration>
<testRuntime>p2Installed</testRuntime>
<useUIThread>true</useUIThread>
<useUIHarness>true</useUIHarness>
<application>org.bonitasoft.studio.application.application</application>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment