Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Yuta HIGUCHI
2014-10-05 00:03:47 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9ee0d5b1332b78a7f2c5140fa0743b5b19ce9a40
9ee0d5b1
1 parent
adcafb6e
Fix unit test issue
Change-Id: Ie0809591652a22379e59cd5f80b7cddb3896459d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
core/api/src/test/java/org/onlab/onos/net/device/DeviceEventTest.java
core/store/serializers/src/test/java/org/onlab/onos/store/serializers/KryoSerializerTests.java → core/store/serializers/src/test/java/org/onlab/onos/store/serializers/KryoSerializerTest.java
core/api/src/test/java/org/onlab/onos/net/device/DeviceEventTest.java
View file @
9ee0d5b
...
...
@@ -39,7 +39,7 @@ public class DeviceEventTest extends AbstractEventTest {
Device
device
=
createDevice
();
Port
port
=
new
DefaultPort
(
device
,
PortNumber
.
portNumber
(
123
),
true
);
long
before
=
System
.
currentTimeMillis
();
DeviceEvent
event
=
new
DeviceEvent
(
DeviceEvent
.
Type
.
DEVICE_ADDED
,
device
);
DeviceEvent
event
=
new
DeviceEvent
(
DeviceEvent
.
Type
.
DEVICE_ADDED
,
device
,
port
);
long
after
=
System
.
currentTimeMillis
();
validateEvent
(
event
,
DeviceEvent
.
Type
.
DEVICE_ADDED
,
device
,
before
,
after
);
}
...
...
core/store/serializers/src/test/java/org/onlab/onos/store/serializers/KryoSerializerTest
s
.java
→
core/store/serializers/src/test/java/org/onlab/onos/store/serializers/KryoSerializerTest.java
View file @
9ee0d5b
...
...
@@ -34,7 +34,8 @@ import com.google.common.collect.ImmutableMap;
import
com.google.common.collect.ImmutableSet
;
import
com.google.common.testing.EqualsTester
;
public
class
KryoSerializerTests
{
public
class
KryoSerializerTest
{
private
static
final
ProviderId
PID
=
new
ProviderId
(
"of"
,
"foo"
);
private
static
final
ProviderId
PIDA
=
new
ProviderId
(
"of"
,
"foo"
,
true
);
private
static
final
DeviceId
DID1
=
deviceId
(
"of:foo"
);
...
...
@@ -92,7 +93,7 @@ public class KryoSerializerTests {
@Test
public
final
void
test
()
{
public
final
void
test
Serialization
()
{
testSerialized
(
new
ConnectPoint
(
DID1
,
P1
));
testSerialized
(
new
DefaultLink
(
PID
,
CP1
,
CP2
,
Link
.
Type
.
DIRECT
));
testSerialized
(
new
DefaultPort
(
DEV1
,
P1
,
true
));
...
...
@@ -119,6 +120,7 @@ public class KryoSerializerTests {
}
}
@Test
public
final
void
testAnnotations
()
{
// Annotations does not have equals defined, manually test equality
final
byte
[]
a1Bytes
=
kryos
.
serialize
(
A1
);
...
...
@@ -132,9 +134,9 @@ public class KryoSerializerTests {
// code clone
public
static
void
assertAnnotationsEquals
(
Annotations
actual
,
SparseAnnotations
...
annotations
)
{
Default
Annotations
expected
=
DefaultAnnotations
.
builder
().
build
();
Sparse
Annotations
expected
=
DefaultAnnotations
.
builder
().
build
();
for
(
SparseAnnotations
a
:
annotations
)
{
expected
=
DefaultAnnotations
.
merge
(
expected
,
a
);
expected
=
DefaultAnnotations
.
union
(
expected
,
a
);
}
assertEquals
(
expected
.
keys
(),
actual
.
keys
());
for
(
String
key
:
expected
.
keys
())
{
...
...
Please
register
or
login
to post a comment