X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fhosttracker_new%2Fimplementation%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fhosttracker%2Ftest%2FMockEntityClassifier.java;fp=opendaylight%2Fhosttracker_new%2Fimplementation%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fhosttracker%2Ftest%2FMockEntityClassifier.java;h=0000000000000000000000000000000000000000;hp=e9f919e7f2aff4bc6bc2655124441981e785cd72;hb=42c32160bfd41de57189bb246fec5ffb48ed8e9e;hpb=edf5bfcee83c750853253ccfd991ba7000f5f65b diff --git a/opendaylight/hosttracker_new/implementation/src/test/java/org/opendaylight/controller/hosttracker/test/MockEntityClassifier.java b/opendaylight/hosttracker_new/implementation/src/test/java/org/opendaylight/controller/hosttracker/test/MockEntityClassifier.java deleted file mode 100644 index e9f919e7f2..0000000000 --- a/opendaylight/hosttracker_new/implementation/src/test/java/org/opendaylight/controller/hosttracker/test/MockEntityClassifier.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2013 Big Switch Networks, Inc. - * - * Licensed under the Eclipse Public License, Version 1.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.eclipse.org/legal/epl-v10.html - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -package org.opendaylight.controller.hosttracker.test; - -import static org.opendaylight.controller.hosttracker.IDeviceService.DeviceField.MAC; -import static org.opendaylight.controller.hosttracker.IDeviceService.DeviceField.SWITCHPORT; -import static org.opendaylight.controller.hosttracker.IDeviceService.DeviceField.VLAN; - -import java.util.EnumSet; - -import org.opendaylight.controller.hosttracker.Entity; -import org.opendaylight.controller.hosttracker.IDeviceService; -import org.opendaylight.controller.hosttracker.IDeviceService.DeviceField; -import org.opendaylight.controller.hosttracker.IEntityClass; -import org.opendaylight.controller.hosttracker.internal.DefaultEntityClassifier; - -/** - * A simple IEntityClassifier. Useful for tests that need IEntityClassifiers and - * IEntityClass'es with switch and/or port key fields - */ -public class MockEntityClassifier extends DefaultEntityClassifier { - public static class TestEntityClass implements IEntityClass { - @Override - public EnumSet getKeyFields() { - return EnumSet.of(MAC, VLAN, SWITCHPORT); - } - - @Override - public String getName() { - return "TestEntityClass"; - } - } - - public static IEntityClass testEC = new MockEntityClassifier.TestEntityClass(); - - @Override - public IEntityClass classifyEntity(Entity entity) { - if (((Long) entity.getPort().getNode().getID()) >= 10L) { - return testEC; - } - return DefaultEntityClassifier.entityClass; - } - - @Override - public EnumSet getKeyFields() { - return EnumSet.of(MAC, VLAN, SWITCHPORT); - } - -} \ No newline at end of file