|
Added
Link Here
|
| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2009 EclipseSource and others. All rights reserved. |
| 3 |
* This program and the accompanying materials are made available under the |
| 4 |
* terms of the Eclipse Public License v1.0 which accompanies this distribution, |
| 5 |
* and is available at http://www.eclipse.org/legal/epl-v10.html |
| 6 |
* |
| 7 |
* Contributors: |
| 8 |
* EclipseSource - initial API and implementation |
| 9 |
******************************************************************************/ |
| 10 |
package org.eclipse.swt.internal.widgets.clabelkit; |
| 11 |
|
| 12 |
import java.io.IOException; |
| 13 |
|
| 14 |
import junit.framework.TestCase; |
| 15 |
|
| 16 |
import org.eclipse.rwt.Fixture; |
| 17 |
import org.eclipse.rwt.lifecycle.*; |
| 18 |
import org.eclipse.swt.RWTFixture; |
| 19 |
import org.eclipse.swt.SWT; |
| 20 |
import org.eclipse.swt.custom.CLabel; |
| 21 |
import org.eclipse.swt.widgets.Display; |
| 22 |
import org.eclipse.swt.widgets.Shell; |
| 23 |
|
| 24 |
|
| 25 |
public class CLabelLCA_Test extends TestCase { |
| 26 |
|
| 27 |
/* |
| 28 |
* 280291: [CLabel] causes NullPointerException when rendered uninitialized |
| 29 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=280291 |
| 30 |
*/ |
| 31 |
public void testWriteText() throws IOException { |
| 32 |
Display display = new Display(); |
| 33 |
Shell shell = new Shell( display ); |
| 34 |
CLabel label = new CLabel( shell, SWT.NONE ); |
| 35 |
AbstractWidgetLCA lca = WidgetUtil.getLCA( label ); |
| 36 |
lca.renderChanges( label ); |
| 37 |
// the purpose of this test is to ensure that the LCA works without throwing |
| 38 |
// an exception - thus there is no assert |
| 39 |
} |
| 40 |
|
| 41 |
protected void setUp() throws Exception { |
| 42 |
RWTFixture.setUp(); |
| 43 |
Fixture.fakeResponseWriter(); |
| 44 |
} |
| 45 |
|
| 46 |
protected void tearDown() throws Exception { |
| 47 |
RWTFixture.tearDown(); |
| 48 |
} |
| 49 |
} |