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
Thomas Vachuska
2014-11-12 15:43:01 -0800
Browse Files
Options
Browse Files
Download
Plain Diff
Committed by
Gerrit Code Review
2014-11-12 15:43:01 -0800
Commit
98ebd1bb6d08bf353a06513bed89080ef15d9f84
98ebd1bb
2 parents
c379fa54
506455f3
Merge "Unit tests for FlowId class."
Hide 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 @
98ebd1b
...
...
@@ -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 @
98ebd1b
/*
* 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