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
Ray Milkey
2014-11-12 13:18:35 -0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
506455f368f66ccf643a1b9b72d9fc91a5cd1101
506455f3
1 parent
02093df7
Unit tests for FlowId class.
Change-Id: Ic281d5a17da9d8623473a0dfe2b29ba3cd07724f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
1 deletions
core/api/src/main/java/org/onlab/onos/event/AbstractEvent.java
core/net/src/test/java/org/onlab/onos/net/flow/FlowIdTest.java
core/api/src/main/java/org/onlab/onos/event/AbstractEvent.java
View file @
506455f
...
...
@@ -26,7 +26,7 @@ public class AbstractEvent<T extends Enum, S extends Object> implements Event<T,
private
final
long
time
;
private
final
T
type
;
private
S
subject
;
private
final
S
subject
;
/**
* Creates an event of a given type and for the specified subject and the
...
...
core/net/src/test/java/org/onlab/onos/net/flow/FlowIdTest.java
0 → 100644
View file @
506455f
/*
* Copyright 2014 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
*
* 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
.
onlab
.
onos
.
net
.
flow
;
import
org.junit.Test
;
import
com.google.common.testing.EqualsTester
;
import
static
org
.
hamcrest
.
MatcherAssert
.
assertThat
;
import
static
org
.
hamcrest
.
Matchers
.
is
;
import
static
org
.
hamcrest
.
Matchers
.
notNullValue
;
import
static
org
.
onlab
.
junit
.
ImmutableClassChecker
.
assertThatClassIsImmutable
;
/**
* Unit tests for flow id class.
*/
public
class
FlowIdTest
{
final
FlowId
flowId1
=
FlowId
.
valueOf
(
1
);
final
FlowId
sameAsFlowId1
=
FlowId
.
valueOf
(
1
);
final
FlowId
flowId2
=
FlowId
.
valueOf
(
2
);
/**
* Checks that the DefaultFlowRule class is immutable.
*/
@Test
public
void
testImmutability
()
{
assertThatClassIsImmutable
(
FlowId
.
class
);
}
/**
* Checks the operation of equals(), hashCode and toString() methods.
*/
@Test
public
void
testEquals
()
{
new
EqualsTester
()
.
addEqualityGroup
(
flowId1
,
sameAsFlowId1
)
.
addEqualityGroup
(
flowId2
)
.
testEquals
();
}
/**
* Checks the construction of a FlowId object.
*/
@Test
public
void
testConstruction
()
{
final
long
flowIdValue
=
7777L
;
final
FlowId
flowId
=
FlowId
.
valueOf
(
flowIdValue
);
assertThat
(
flowId
,
is
(
notNullValue
()));
assertThat
(
flowId
.
value
(),
is
(
flowIdValue
));
}
}
Please
register
or
login
to post a comment