blob: ee942f041af2b3d37b3f6cdf7aa200bd2132edd5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
package org.eclipse.wst.sse.core.tests;
import junit.framework.TestCase;
import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
/**
*
* @author pavery
*/
public class TestAbstractAdapterFactory extends TestCase {
private AbstractAdapterFactory fFactory = null;
class MyClass implements INodeAdapter {
public boolean isAdapterForType(Object type) {
return type instanceof MyClass;
}
public void notifyChanged(INodeNotifier notifier,int eventType,Object changedFeature,Object oldValue,Object newValue,int pos) {
// noop
}
}
protected void setUp() throws Exception {
super.setUp();
setUpAdapterFactory();
}
private void setUpAdapterFactory() {
fFactory = new AbstractAdapterFactory(TestAbstractAdapterFactory.MyClass.class, false) {
protected INodeAdapter createAdapter(INodeNotifier target) {
return new MyClass();
}
};
}
public void testAdapt() {
fFactory.adapt(null);
}
// public void testAdaptNew() {
// fFactory.adaptNew(null);
// }
// public void testCopy() {
// AdapterFactory f = fFactory.copy();
// assertNotNull(f);
// }
public void testCreate() {
// TODO: create unit test
}
}
|