| /******************************************************************************* |
| * Copyright (c) 2010, 2011 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.events; |
| |
| import static org.mockito.Mockito.mock; |
| import junit.framework.TestCase; |
| |
| import org.eclipse.rap.rwt.lifecycle.PhaseId; |
| import org.eclipse.rap.rwt.testfixture.Fixture; |
| import org.eclipse.swt.widgets.Display; |
| import org.eclipse.swt.widgets.Event; |
| import org.eclipse.swt.widgets.Widget; |
| |
| |
| public class MenuDetectEvent_Test extends TestCase { |
| |
| private Display display; |
| |
| protected void setUp() throws Exception { |
| Fixture.setUp(); |
| Fixture.fakePhase( PhaseId.PROCESS_ACTION ); |
| display = new Display(); |
| } |
| |
| protected void tearDown() throws Exception { |
| Fixture.tearDown(); |
| } |
| |
| public void testUntypedEventConstructor() throws Exception { |
| Event event = new Event(); |
| event.display = display; |
| event.widget = mock( Widget.class ); |
| event.time = 4325; |
| event.x = 10; |
| event.y = 20; |
| event.doit = true; |
| event.data = new Object(); |
| |
| MenuDetectEvent menuDeteectEvent = new MenuDetectEvent( event ); |
| |
| EventTestHelper.assertFieldsEqual( menuDeteectEvent, event ); |
| } |
| |
| } |