Merge "Bug 5543 - Bo: Update JUnit tests part_9"
[openflowplugin.git] / applications / notification-supplier / src / test / java / org / opendaylight / openflowplugin / applications / notification / supplier / impl / helper / TestData.java
1 /*
2  * Copyright (c) 2016 Ericsson Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper;
10
11 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
12 import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
13 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
14 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
15 import org.opendaylight.yangtools.yang.binding.*;
16
17
18 import javax.annotation.Nonnull;
19 import javax.annotation.Nullable;
20 import java.util.Collection;
21
22 /**
23  * Created by eshuvka on 6/7/2016.
24  */
25 public class TestData<T extends DataObject> implements DataTreeModification<T> {
26
27     private final DataTreeIdentifier<T> path;
28     private final DataObjectModification<T> rootNode;
29
30     public TestData (final InstanceIdentifier<T> path, final T dataBefore, final T dataAfter,DataObjectModification.ModificationType modType) {
31         this.path = new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, path);
32         this.rootNode = new Test(dataBefore, dataAfter, modType);
33     }
34
35     @Nonnull
36     @Override
37     public DataTreeIdentifier<T> getRootPath() {
38         return path;
39     }
40
41     @Nonnull
42     @Override
43     public DataObjectModification<T> getRootNode() {
44         return rootNode;
45     }
46 }
47
48 class Test <T extends DataObject> implements DataObjectModification<T>{
49
50     private final T dataObjBefore;
51     private final T dataObjAfter;
52     private final ModificationType modification;
53
54     Test(final T dataBefore,final T dataAfter, ModificationType modType){
55         dataObjBefore = dataBefore;
56         dataObjAfter = dataAfter;
57         modification = modType;
58     }
59
60     @Override
61     public InstanceIdentifier.PathArgument getIdentifier() {
62         return null;
63     }
64
65     @Nonnull
66     @Override
67     public Class<T> getDataType() {
68         return null;
69     }
70
71     @Nonnull
72     @Override
73     public ModificationType getModificationType() {
74         return modification;
75     }
76
77     @Nullable
78     @Override
79     public T getDataBefore() {
80         return dataObjBefore;
81     }
82
83     @Nullable
84     @Override
85     public T getDataAfter() {
86         return dataObjAfter;
87     }
88
89     @Nonnull
90     @Override
91     public Collection<DataObjectModification<? extends DataObject>> getModifiedChildren() {
92         return null;
93     }
94
95     @Nullable
96     @Override
97     public <C extends ChildOf<? super T>> DataObjectModification<C> getModifiedChildContainer(@Nonnull Class<C> aClass) {
98         return null;
99     }
100
101     @Nullable
102     @Override
103     public <C extends Augmentation<T> & DataObject> DataObjectModification<C> getModifiedAugmentation(@Nonnull Class<C> aClass) {
104         return null;
105     }
106
107     @Override
108     public <C extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<C>> DataObjectModification<C> getModifiedChildListItem(@Nonnull Class<C> aClass, @Nonnull K k) {
109         return null;
110     }
111
112     @Nullable
113     @Override
114     public DataObjectModification<? extends DataObject> getModifiedChild(InstanceIdentifier.PathArgument pathArgument) {
115         return null;
116     }
117 }