/*******************************************************************************
* Copyright (c) 2011, 2014 EclipseSource 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
*
* Contributors:
* EclipseSource - initial API and implementation
******************************************************************************/
package org.eclipse.swt.custom;
import static org.eclipse.rap.rwt.testfixture.internal.SerializationTestUtil.serializeAndDeserialize;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.eclipse.rap.rwt.internal.lifecycle.PhaseId;
import org.eclipse.rap.rwt.testfixture.internal.Fixture;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class ControlEditor_Test {
private Display display;
private Shell shell;
@Before
public void setUp() {
Fixture.setUp();
Fixture.fakePhase( PhaseId.PROCESS_ACTION );
display = new Display();
shell = new Shell( display, SWT.NONE );
}
@After
public void tearDown() {
Fixture.tearDown();
}
@Test
public void testIsSerializable() throws Exception {
ControlEditor controlEditor = new ControlEditor( new CLabel( shell, SWT.NONE ) );
controlEditor.minimumHeight = 6;
ControlEditor deserialized = serializeAndDeserialize( controlEditor );
assertNotNull( deserialized.parent );
assertEquals( 6, deserialized.minimumHeight );
}
}