<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>
- <!-- Java Versions -->
- <maven.compiler.source>1.7</maven.compiler.source>
- <maven.compiler.target>1.7</maven.compiler.target>
<!-- Plugin Versions -->
<bundle.plugin.version>2.4.0</bundle.plugin.version>
- <releaseplugin.version>2.3.2</releaseplugin.version>
+ <maven.clean.plugin.version>2.5</maven.clean.plugin.version>
<!-- Dependency Versions -->
- <slf4j.version>1.7.2</slf4j.version>
- <guava.version>14.0.1</guava.version>
- <osgi.core.version>5.0.0</osgi.core.version>
- <junit.version>4.8.1</junit.version>
<mockito.version>1.9.5</mockito.version>
<xtend.version>2.4.3</xtend.version>
- <maven.clean.plugin.version>2.5</maven.clean.plugin.version>
- <jacoco.version>0.5.3.201107060350</jacoco.version>
<!-- Sonar properties using jacoco to retrieve integration test results -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sal.version>0.7.1-SNAPSHOT</sal.version>
</properties>
- <pluginRepositories>
- <!-- OpenDayLight Repo Mirror -->
- <pluginRepository>
- <id>opendaylight-mirror</id>
- <name>opendaylight-mirror</name>
- <url>${nexusproxy}/groups/public/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </releases>
- </pluginRepository>
- <!-- OpenDayLight Snapshot artifact -->
- <pluginRepository>
- <id>opendaylight-snapshot</id>
- <name>opendaylight-snapshot</name>
- <url> ${nexusproxy}/repositories/opendaylight.snapshot/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </pluginRepository>
- </pluginRepositories>
-
-
- <repositories>
- <!-- OpenDayLight Repo Mirror -->
- <repository>
- <id>opendaylight-mirror</id>
- <name>opendaylight-mirror</name>
- <url>${nexusproxy}/groups/public/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </releases>
- </repository>
- <!-- OpenDayLight Snapshot artifact -->
- <repository>
- <id>opendaylight-snapshot</id>
- <name>opendaylight-snapshot</name>
- <url> ${nexusproxy}/repositories/opendaylight.snapshot/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
- </repositories>
-
- <distributionManagement>
- <!-- OpenDayLight Released artifact -->
- <repository>
- <id>opendaylight-release</id>
- <url>${nexusproxy}/repositories/opendaylight.release/</url>
- </repository>
- <!-- OpenDayLight Snapshot artifact -->
- <snapshotRepository>
- <id>opendaylight-snapshot</id>
- <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
- </snapshotRepository>
- <!-- Site deployment -->
- <site>
- <id>website</id>
- <url>${sitedeploy}</url>
- </site>
- </distributionManagement>
-
-
<dependencyManagement>
<dependencies>
<dependency>
<version>1.4.01</version>
</dependency>
- <!-- YANG Tools Dependencies -->
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-binding</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-model-util</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-common</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-api</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-impl</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-model-api</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-util</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
<!-- SAL Dependencies -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>${guava.version}</version>
- </dependency>
<dependency>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.lib</artifactId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi.core.version}</version>
</dependency>
- <!-- Testing Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>${mockito.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>binding-generator-impl</artifactId>
<artifactId>yang-parser-impl</artifactId>
<version>${yangtools.version}</version>
</dependency>
+
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>${mockito.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>${releaseplugin.version}</version>
- </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
* {@link org.opendaylight.controller.sal.core.Property} attached to
* it.
*
- * <pre>
+ * <pre>
*
* Example:
*
* Type of the node connector being programmed (Eg. 'OF')
* @param nodeConnectorId
* NodeConnector Identifier as specified by
- * {@link org.opendaylight.controller.sal.core.NodeConnector}
- * (Eg. '2')
+ * {@link org.opendaylight.controller.sal.core.NodeConnector}.
+ * (Eg. '2'). If nodeConnecterId contains forward slash(/),
+ * replace forward slash with underscore(_) in the URL. (Eg. for
+ * Ethernet1/2, use Ethernet1_2)
* @param propertyName
* Name of the Property specified by
* {@link org.opendaylight.controller.sal.core.Property} and its
* extended classes
* @return Response as dictated by the HTTP Response Status code
*
- * <pre>
+ * <pre>
*
* Example:
*
handleNodeAvailability(containerName, nodeType, nodeId);
Node node = Node.fromString(nodeType, nodeId);
+ if (nodeConnectorId.contains("_")) {
+ nodeConnectorId = nodeConnectorId.replace("_", "/");
+ }
+
handleNodeConnectorAvailability(containerName, node, nodeConnectorType, nodeConnectorId);
NodeConnector nc = NodeConnector.fromStringNoNode(nodeConnectorType, nodeConnectorId, node);
* @param nodeConnectorId
* NodeConnector Identifier as specified by
* {@link org.opendaylight.controller.sal.core.NodeConnector}
- * (Eg. '1')
+ * (Eg. '1'). If nodeConnecterId contains forward slash(/),
+ * replace forward slash with underscore(_) in the URL. (Eg. for
+ * Ethernet1/2, use Ethernet1_2)
* @param propertyName
* Name of the Property specified by
* {@link org.opendaylight.controller.sal.core.Property} and its
* extended classes. Property that can be deleted is bandwidth
* @return Response as dictated by the HTTP Response Status code
*
- * <pre>
+ * <pre>
*
* Example:
*
handleNodeAvailability(containerName, nodeType, nodeId);
Node node = Node.fromString(nodeType, nodeId);
+ if (nodeConnectorId.contains("_")) {
+ nodeConnectorId = nodeConnectorId.replace("_", "/");
+ }
+
handleNodeConnectorAvailability(containerName, node, nodeConnectorType, nodeConnectorId);
NodeConnector nc = NodeConnector.fromStringNoNode(nodeConnectorType, nodeConnectorId, node);
Status ret = switchManager.removeNodeConnectorProp(nc, propertyName);
-
/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013-2014 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
Assert.assertTrue(NetUtils
.isIPAddressValid("2001:420:281:1004:407a:57f4:4d15:c355"));
}
+
+ @Test
+ public void testGetUnsignedByte() {
+ Assert.assertEquals(0, NetUtils.getUnsignedByte((byte) 0x00));
+ Assert.assertEquals(1, NetUtils.getUnsignedByte((byte) 0x01));
+ Assert.assertEquals(127, NetUtils.getUnsignedByte((byte) 0x7f));
+
+ Assert.assertEquals(128, NetUtils.getUnsignedByte((byte) 0x80));
+ Assert.assertEquals(255, NetUtils.getUnsignedByte((byte) 0xff));
+ }
+
+ @Test
+ public void testGetUnsignedShort() {
+ Assert.assertEquals(0, NetUtils.getUnsignedShort((short) 0x0000));
+ Assert.assertEquals(1, NetUtils.getUnsignedShort((short) 0x0001));
+ Assert.assertEquals(32767, NetUtils.getUnsignedShort((short) 0x7fff));
+
+ Assert.assertEquals(32768, NetUtils.getUnsignedShort((short) 0x8000));
+ Assert.assertEquals(65535, NetUtils.getUnsignedShort((short) 0xffff));
+ }
}