public static final String CONTROLLER_MODELS = "org.opendaylight.controller.model";
public static final String YANGTOOLS_MODELS = "org.opendaylight.yangtools.model";
- private static final String OPENDAYLIGHT_SNAPSHOT = "http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/";
- private static final String OPENDAYLIGHT_RELEASE = "http://nexus.opendaylight.org/content/repositories/opendaylight.release/";
public static Option mdSalCoreBundles() {
return new DefaultCompositeOption( //
import com.google.common.collect.ImmutableSet;
public class RoutingUtils {
-
+
public static <C,P> RouteChange<C,P> removalChange(C context,P path) {
final ImmutableMap<C, Set<P>> announcements = ImmutableMap.<C,Set<P>>of();
final ImmutableMap<C, Set<P>> removals = ImmutableMap.<C,Set<P>>of(context, ImmutableSet.of(path));
return new RouteChangeImpl<C,P>(announcements, removals);
}
-
+
public static <C,P> RouteChange<C,P> announcementChange(C context,P path) {
final ImmutableMap<C, Set<P>> announcements = ImmutableMap.<C,Set<P>>of(context, ImmutableSet.of(path));
final ImmutableMap<C, Set<P>> removals = ImmutableMap.<C,Set<P>>of();
return new RouteChangeImpl<C,P>(announcements, removals);
}
-
-
+
+
public static <C,P> RouteChange<C,P> change(Map<C, Set<P>> announcements,
Map<C, Set<P>> removals) {
final ImmutableMap<C, Set<P>> immutableAnnouncements = ImmutableMap.<C,Set<P>>copyOf(announcements);
final ImmutableMap<C, Set<P>> immutableRemovals = ImmutableMap.<C,Set<P>>copyOf(removals);
return new RouteChangeImpl<C,P>(immutableAnnouncements, immutableRemovals);
}
-
-
+
+
private static class RouteChangeImpl<C,P> implements RouteChange<C, P> {
private final Map<C, Set<P>> removal;
private final Map<C, Set<P>> announcement;
public Map<C, Set<P>> getAnnouncements() {
return announcement;
}
-
+
@Override
public Map<C, Set<P>> getRemovals() {
return removal;
if (getClass() != obj.getClass()) {
return false;
}
- RouteChangeImpl other = (RouteChangeImpl) obj;
+ RouteChangeImpl<?, ?> other = (RouteChangeImpl<?, ?>) obj;
if (announcement == null) {
if (other.announcement != null)
return false;
}
-
+
}
*/
package org.opendaylight.controller.netconf.it;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
+import static junit.framework.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
import io.netty.channel.ChannelFuture;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetSocketAddress;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+
import org.apache.commons.lang3.StringUtils;
import org.junit.After;
import org.junit.Assert;
import org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler;
import org.opendaylight.controller.netconf.util.test.XmlFileLoader;
import org.opendaylight.controller.netconf.util.xml.XmlUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
-import javax.management.InstanceNotFoundException;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.InetSocketAddress;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-import static junit.framework.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyLong;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
public class NetconfConfigPersisterITTest extends AbstractNetconfConfigTest {
- private static final Logger logger = LoggerFactory.getLogger(NetconfConfigPersisterITTest.class);
-
private static final InetSocketAddress tcpAddress = new InetSocketAddress("127.0.0.1", 12023);
public VerifyingPersister() throws IOException {
Persister mockedAggregator = mock(Persister.class);
- doAnswer(new Answer() {
+ doAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
ConfigSnapshotHolder configSnapshot = (ConfigSnapshotHolder) invocation.getArguments()[0];
*/
package org.opendaylight.controller.netconf.it;
-import com.google.common.base.Charsets;
-import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
import io.netty.channel.ChannelFuture;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
import junit.framework.Assert;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.matchers.JUnitMatchers;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import static org.mockito.Matchers.anyLong;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
+import com.google.common.base.Charsets;
+import com.google.common.base.Optional;
+import com.google.common.collect.Sets;
public class NetconfMonitoringITTest extends AbstractNetconfConfigTest {
}
}
+ sock.close();
+
org.junit.Assert.assertThat(responseBuilder.toString(), JUnitMatchers.containsString("<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>"));
org.junit.Assert.assertThat(responseBuilder.toString(), JUnitMatchers.containsString("<username>tomas</username>"));
}