blob: a7f9117624f45684ff0e8216c38d71cc212c1b29 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 by SAP AG, Walldorf.
* 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:
* SAP AG - initial API and implementation
*******************************************************************************/
package org.eclipse.jst.ws.jaxws.dom.integration.tests.navigator;
import junit.framework.TestCase;
import org.eclipse.jst.ws.jaxws.dom.integration.navigator.DOMAdapterFactoryContentProvider;
import org.eclipse.jst.ws.jaxws.dom.integration.navigator.DOMPropertyViewAdapterFactory;
import org.eclipse.jst.ws.jaxws.dom.runtime.api.IWebService;
import org.eclipse.ui.views.properties.IPropertySourceProvider;
public class DOMPropertyViewAdapterFactoryTest extends TestCase
{
public void testGetAdapter()
{
DOMPropertyViewAdapterFactory propertyAdapterFactory = new DOMPropertyViewAdapterFactory();
assertNotNull(propertyAdapterFactory.getAdapter(propertyAdapterFactory, IPropertySourceProvider.class));
assertNull(propertyAdapterFactory.getAdapter(propertyAdapterFactory, IWebService.class));
assertTrue(propertyAdapterFactory.getAdapter(propertyAdapterFactory, IPropertySourceProvider.class) instanceof DOMAdapterFactoryContentProvider);
assertTrue(propertyAdapterFactory.getAdapter(propertyAdapterFactory, DOMPropertyViewAdapterFactory.class) instanceof DOMPropertyViewAdapterFactory);
}
public void testGetAdapterList()
{
DOMPropertyViewAdapterFactory propertyAdapterFactory = new DOMPropertyViewAdapterFactory();
assertNotNull(propertyAdapterFactory.getAdapterList());
assertEquals(propertyAdapterFactory.getAdapterList().length, 1);
assertEquals(propertyAdapterFactory.getAdapterList()[0], DOMAdapterFactoryContentProvider.class);
}
public void testGetAdapterUsesSameFactory()
{
DOMPropertyViewAdapterFactory propertyAdapterFactory = new DOMPropertyViewAdapterFactory();
Object adapter1 = propertyAdapterFactory.getAdapter(propertyAdapterFactory, IPropertySourceProvider.class);
assertNotNull(adapter1);
Object adapter2 = propertyAdapterFactory.getAdapter(propertyAdapterFactory, IPropertySourceProvider.class);
assertTrue(adapter1==adapter2);
}
}