OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / libcore / luni / src / test / java / org / apache / harmony / prefs / tests / java / util / prefs / NodeChangeListenerTest.java
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements.  See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License.  You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.apache.harmony.prefs.tests.java.util.prefs;
18
19 import dalvik.annotation.TestLevel;
20 import dalvik.annotation.TestTargetClass;
21 import dalvik.annotation.TestTargetNew;
22 import junit.framework.TestCase;
23
24 import java.util.prefs.NodeChangeEvent;
25 import java.util.prefs.NodeChangeListener;
26 import java.util.prefs.Preferences;
27
28 /**
29  *
30  */
31 @TestTargetClass(NodeChangeListener.class)
32 public class NodeChangeListenerTest extends TestCase {
33
34     NodeChangeListener l;
35
36     /*
37      * @see TestCase#setUp()
38      */
39     @Override
40     protected void setUp() throws Exception {
41         super.setUp();
42         l = new NodeChangeListenerImpl();
43     }
44
45     /*
46      * @see TestCase#tearDown()
47      */
48     @Override
49     protected void tearDown() throws Exception {
50         super.tearDown();
51     }
52
53     @TestTargetNew(
54         level = TestLevel.COMPLETE,
55         notes = "Testing Interface",
56         method = "childAdded",
57         args = {java.util.prefs.NodeChangeEvent.class}
58     )
59     public void testChildAdded() {
60         l.childAdded(new NodeChangeEvent(Preferences.userRoot(), Preferences
61                 .userRoot()));
62     }
63
64     @TestTargetNew(
65         level = TestLevel.COMPLETE,
66         notes = "Testing Interface",
67         method = "childRemoved",
68         args = {java.util.prefs.NodeChangeEvent.class}
69     )
70     public void testChildRemoved() {
71         l.childRemoved(new NodeChangeEvent(Preferences.userRoot(), Preferences
72                 .userRoot()));
73     }
74
75     public static class NodeChangeListenerImpl implements NodeChangeListener {
76
77         public void childAdded(NodeChangeEvent e) {
78         }
79
80         public void childRemoved(NodeChangeEvent e) {
81         }
82
83     }
84
85 }