Ray Milkey
Committed by Gerrit Code Review

Unit tests for packet processing the the AAA app

Change-Id: I51149fdf9ce5bfe4ee8d67564165b94f3e39e379
......@@ -44,36 +44,41 @@
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-junit</artifactId>
<scope>test</scope>
<artifactId>onos-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-api</artifactId>
<artifactId>onos-app-xos-integration</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-osgi</artifactId>
<version>${project.version}</version>
<artifactId>onlab-junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<groupId>org.onosproject</groupId>
<artifactId>onlab-osgi</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-app-xos-integration</artifactId>
<artifactId>onos-api</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
......
......@@ -136,23 +136,23 @@ public class AAA {
@Property(name = "radiusIpAddress", value = DEFAULT_RADIUS_IP,
label = "RADIUS IP Address")
private String radiusIpAddress = DEFAULT_RADIUS_IP;
protected String radiusIpAddress = DEFAULT_RADIUS_IP;
@Property(name = "nasIpAddress", value = DEFAULT_NAS_IP,
label = "NAS IP Address")
private String nasIpAddress = DEFAULT_NAS_IP;
protected String nasIpAddress = DEFAULT_NAS_IP;
@Property(name = "radiusMacAddress", value = RADIUS_MAC_ADDRESS,
label = "RADIUS MAC Address")
private String radiusMacAddress = RADIUS_MAC_ADDRESS;
protected String radiusMacAddress = RADIUS_MAC_ADDRESS;
@Property(name = "nasMacAddress", value = NAS_MAC_ADDRESS,
label = "NAS MAC Address")
private String nasMacAddress = NAS_MAC_ADDRESS;
protected String nasMacAddress = NAS_MAC_ADDRESS;
@Property(name = "radiusSecret", value = DEFAULT_RADIUS_SECRET,
label = "RADIUS shared secret")
private String radiusSecret = DEFAULT_RADIUS_SECRET;
protected String radiusSecret = DEFAULT_RADIUS_SECRET;
@Property(name = "radiusSwitchId", value = DEFAULT_RADIUS_SWITCH,
label = "Radius switch")
......
......@@ -17,10 +17,13 @@ package org.onosproject.cfg;
import java.util.Set;
import com.google.common.collect.ImmutableSet;
/**
* Adapter for testing against component configuration service.
*/
public class ComponentConfigAdapter implements ComponentConfigService {
@Override
public Set<String> getComponentNames() {
return null;
......@@ -38,7 +41,7 @@ public class ComponentConfigAdapter implements ComponentConfigService {
@Override
public Set<ConfigProperty> getProperties(String componentName) {
return null;
return ImmutableSet.of();
}
@Override
......
......@@ -22,14 +22,53 @@ import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.ComponentInstance;
import java.util.Dictionary;
import java.util.Enumeration;
/**
* Adapter implementation of OSGI component context.
*/
public class ComponentContextAdapter implements ComponentContext {
private static class MockDictionary extends Dictionary {
@Override
public int size() {
return 0;
}
@Override
public boolean isEmpty() {
return false;
}
@Override
public Enumeration keys() {
return null;
}
@Override
public Enumeration elements() {
return null;
}
@Override
public Object get(Object key) {
return null;
}
@Override
public Object put(Object key, Object value) {
return null;
}
@Override
public Object remove(Object key) {
return null;
}
}
@Override
public Dictionary getProperties() {
return null;
return new MockDictionary();
}
@Override
......