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
2016-04-06 17:38:25 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7c25182db99af5a61eac9ef2c10faa76f3f55f85
7c25182d
1 parent
8aec1a16
Fix buck tests
Change-Id: I3d681e6e5c1d3e98c87ccb3d20a619b216ae6133
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
265 additions
and
92 deletions
BUCK
apps/aaa/BUCK
apps/acl/BUCK
apps/cpman/api/BUCK
apps/cpman/app/BUCK
apps/cpman/app/pom.xml
apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsCollectorResourceTest.java
apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsResourceTest.java
apps/dhcp/app/BUCK
apps/faultmanagement/BUCK
apps/flowanalyzer/BUCK
apps/graphitemetrics/BUCK
apps/influxdbmetrics/BUCK
apps/routing-api/BUCK
apps/routing/BUCK
apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java
apps/sdnip/BUCK
apps/segmentrouting/BUCK
apps/test/BUCK
apps/vpls/BUCK
apps/vtn/BUCK
apps/vtn/vtnweb/pom.xml
apps/vtn/vtnweb/src/test/java/org/onosproject/vtnweb/resources/FlowClassifierResourceTest.java
apps/vtn/vtnweb/src/test/java/org/onosproject/vtnweb/resources/PortChainResourceTest.java
apps/vtn/vtnweb/src/test/java/org/onosproject/vtnweb/resources/PortPairGroupResourceTest.java
apps/vtn/vtnweb/src/test/java/org/onosproject/vtnweb/resources/PortPairResourceTest.java
apps/vtn/vtnweb/src/test/java/org/onosproject/vtnweb/resources/VtnResourceTest.java
bucklets/onos.bucklet
core/api/BUCK
core/api/src/test/java/org/onosproject/net/intent/MockIdGenerator.java
core/net/BUCK
core/store/dist/BUCK
incubator/api/BUCK
incubator/net/BUCK
incubator/store/BUCK
lib/BUCK
providers/bgp/topology/BUCK
providers/lldp/BUCK
providers/netcfglinks/BUCK
providers/openflow/device/BUCK
providers/pcep/tunnel/BUCK
utils/osgi/BUCK
web/api/BUCK
web/api/src/test/java/org/onosproject/rest/resources/IntentsResourceTest.java
web/api/src/test/java/org/onosproject/rest/resources/ResourceTest.java
BUCK
View file @
7c25182
...
...
@@ -160,4 +160,4 @@ java_library(
name = 'install',
visibility = ['PUBLIC'],
deps = INSTALL
)
\ No newline at end of file
)
...
...
apps/aaa/BUCK
View file @
7c25182
...
...
@@ -11,7 +11,8 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST_ADAPTERS',
'//core/common:onos-core-common',
]
java_library(
...
...
apps/acl/BUCK
View file @
7c25182
...
...
@@ -12,7 +12,8 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST_REST',
'//lib:jersey-server',
]
java_library(
...
...
apps/cpman/api/BUCK
View file @
7c25182
...
...
@@ -10,7 +10,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
java_library(
...
...
apps/cpman/app/BUCK
View file @
7c25182
...
...
@@ -16,7 +16,8 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST_REST',
'//web/api:onos-rest-tests',
]
java_library(
...
...
@@ -33,4 +34,6 @@ java_test(
TEST_DEPS +
[CURRENT_TARGET],
source_under_test = [CURRENT_TARGET],
resources_root = 'src/test/resources',
resources = glob(['src/test/resources/**']),
)
...
...
apps/cpman/app/pom.xml
View file @
7c25182
...
...
@@ -154,6 +154,13 @@
<classifier>
tests
</classifier>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.onosproject
</groupId>
<artifactId>
onos-rest
</artifactId>
<version>
${project.version}
</version>
<classifier>
tests
</classifier>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
...
...
@@ -181,4 +188,4 @@
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
</project>
...
...
apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsCollectorResourceTest.java
View file @
7c25182
...
...
@@ -15,8 +15,16 @@
*/
package
org
.
onosproject
.
cpman
.
rest
;
import
java.io.InputStream
;
import
java.net.HttpURLConnection
;
import
java.util.Optional
;
import
javax.ws.rs.client.Entity
;
import
javax.ws.rs.client.WebTarget
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
org.glassfish.jersey.server.ResourceConfig
;
import
org.glassfish.jersey.test.JerseyTest
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.onlab.osgi.ServiceDirectory
;
...
...
@@ -26,14 +34,7 @@ import org.onosproject.cpman.ControlPlaneMonitorService;
import
org.onosproject.cpman.SystemInfo
;
import
org.onosproject.cpman.impl.SystemInfoFactory
;
import
org.onosproject.net.DeviceId
;
import
javax.ws.rs.client.Entity
;
import
javax.ws.rs.client.WebTarget
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
java.io.InputStream
;
import
java.net.HttpURLConnection
;
import
java.util.Optional
;
import
org.onosproject.rest.resources.ResourceTest
;
import
static
org
.
easymock
.
EasyMock
.
anyInt
;
import
static
org
.
easymock
.
EasyMock
.
anyObject
;
...
...
@@ -48,7 +49,7 @@ import static org.junit.Assert.assertThat;
/**
* Unit test for ControlMetricsCollector.
*/
public
class
ControlMetricsCollectorResourceTest
extends
Jersey
Test
{
public
class
ControlMetricsCollectorResourceTest
extends
Resource
Test
{
final
ControlPlaneMonitorService
mockControlPlaneMonitorService
=
createMock
(
ControlPlaneMonitorService
.
class
);
...
...
apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsResourceTest.java
View file @
7c25182
...
...
@@ -15,9 +15,12 @@
*/
package
org
.
onosproject
.
cpman
.
rest
;
import
com.google.common.collect.ImmutableSet
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
import
javax.ws.rs.client.WebTarget
;
import
org.glassfish.jersey.server.ResourceConfig
;
import
org.glassfish.jersey.test.JerseyTest
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.onlab.osgi.ServiceDirectory
;
...
...
@@ -32,10 +35,9 @@ import org.onosproject.codec.impl.CodecManager;
import
org.onosproject.cpman.ControlLoad
;
import
org.onosproject.cpman.ControlPlaneMonitorService
;
import
org.onosproject.cpman.codec.ControlLoadCodec
;
import
org.onosproject.rest.resources.ResourceTest
;
import
javax.ws.rs.client.WebTarget
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
import
com.google.common.collect.ImmutableSet
;
import
static
org
.
easymock
.
EasyMock
.
anyObject
;
import
static
org
.
easymock
.
EasyMock
.
anyString
;
...
...
@@ -49,7 +51,7 @@ import static org.junit.Assert.assertThat;
/**
* Unit test for ControlMetrics REST API.
*/
public
class
ControlMetricsResourceTest
extends
Jersey
Test
{
public
class
ControlMetricsResourceTest
extends
Resource
Test
{
final
ControlPlaneMonitorService
mockControlPlaneMonitorService
=
createMock
(
ControlPlaneMonitorService
.
class
);
...
...
apps/dhcp/app/BUCK
View file @
7c25182
...
...
@@ -15,7 +15,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
java_library(
...
...
apps/faultmanagement/BUCK
View file @
7c25182
...
...
@@ -11,7 +11,11 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST_ADAPTERS',
'//lib:jersey-test-framework-core',
'//lib:jersey-test-framework-grizzly2',
'//utils/osgi:onlab-osgi-tests',
'//web/api:onos-rest-tests',
]
java_library(
...
...
apps/flowanalyzer/BUCK
View file @
7c25182
...
...
@@ -11,7 +11,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
java_library(
...
...
apps/graphitemetrics/BUCK
View file @
7c25182
...
...
@@ -12,7 +12,7 @@ COMPILE_DEPS = [
TEST_DEPS = [
'//lib:TEST',
'//core/api:onos-api',
'//core/api:onos-api
-tests
',
]
java_library(
...
...
apps/influxdbmetrics/BUCK
View file @
7c25182
...
...
@@ -13,7 +13,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
java_library(
...
...
apps/routing-api/BUCK
View file @
7c25182
...
...
@@ -9,7 +9,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
java_library(
...
...
@@ -20,10 +20,11 @@ java_library(
)
java_test(
name = 'tests',
name = '
onos-app-routing-api-
tests',
srcs = glob([TEST + '/*.java']),
deps = COMPILE_DEPS +
TEST_DEPS +
[CURRENT_TARGET],
source_under_test = [CURRENT_TARGET],
visibility = ['PUBLIC'],
)
...
...
apps/routing/BUCK
View file @
7c25182
...
...
@@ -15,7 +15,9 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST_ADAPTERS',
'//incubator/api:onos-incubator-api-tests',
'//apps/routing-api:onos-app-routing-api-tests',
]
java_library(
...
...
apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
View file @
7c25182
...
...
@@ -238,9 +238,9 @@ public class BgpSessionManagerTest {
}
@SuppressWarnings
(
"unchecked"
)
private
Dictionary
<
String
,
String
>
private
Dictionary
getDictionaryMock
(
ComponentContext
componentContext
)
{
Dictionary
<
String
,
String
>
dictionary
=
createMock
(
Dictionary
.
class
);
Dictionary
dictionary
=
createMock
(
Dictionary
.
class
);
expect
(
dictionary
.
get
(
"bgpPort"
)).
andReturn
(
"0"
);
replay
(
dictionary
);
expect
(
componentContext
.
getProperties
()).
andReturn
(
dictionary
);
...
...
@@ -264,7 +264,7 @@ public class BgpSessionManagerTest {
bgpSessionManager
=
new
BgpSessionManager
();
// NOTE: We use port 0 to bind on any available port
ComponentContext
componentContext
=
createMock
(
ComponentContext
.
class
);
Dictionary
<
String
,
String
>
dictionary
=
getDictionaryMock
(
componentContext
);
Dictionary
dictionary
=
getDictionaryMock
(
componentContext
);
replay
(
componentContext
);
bgpSessionManager
.
activate
(
componentContext
);
bgpSessionManager
.
start
(
dummyRouteListener
);
...
...
apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java
View file @
7c25182
...
...
@@ -131,7 +131,7 @@ public class SingleSwitchFibInstallerTest extends AbstractIntentTest {
//component context
ComponentContext
mockContext
=
EasyMock
.
createMock
(
ComponentContext
.
class
);
Dictionary
<
String
,
Boolean
>
properties
=
null
;
Dictionary
properties
=
null
;
expect
(
mockContext
.
getProperties
()).
andReturn
(
properties
);
replay
(
mockContext
);
...
...
apps/sdnip/BUCK
View file @
7c25182
...
...
@@ -11,7 +11,9 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST_ADAPTERS',
'//incubator/api:onos-incubator-api-tests',
'//apps/routing-api:onos-app-routing-api-tests',
]
java_library(
...
...
apps/segmentrouting/BUCK
View file @
7c25182
...
...
@@ -16,7 +16,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
java_library(
...
...
@@ -35,4 +35,6 @@ java_test(
TEST_DEPS +
[CURRENT_TARGET],
source_under_test = [CURRENT_TARGET],
resources_root = 'src/test/resources',
resources = glob(['src/test/resources/**']),
)
...
...
apps/test/BUCK
View file @
7c25182
SRC = 'src/main/java/org/onosproject/**/'
#FIXME there are some tests in main
TEST = 'src/
main
/java/org/onosproject/**/'
TEST = 'src/
test
/java/org/onosproject/**/'
COMPILE_DEPS = [
'//lib:CORE_DEPS',
...
...
apps/vpls/BUCK
View file @
7c25182
...
...
@@ -16,7 +16,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
java_library(
...
...
apps/vtn/BUCK
View file @
7c25182
...
...
@@ -12,7 +12,9 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST_REST',
'//utils/osgi:onlab-osgi-tests',
'//web/api:onos-rest-tests',
]
java_library(
...
...
apps/vtn/vtnweb/pom.xml
View file @
7c25182
...
...
@@ -44,6 +44,13 @@
<artifactId>
onos-app-vtn-rsc
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.onosproject
</groupId>
<artifactId>
onos-rest
</artifactId>
<version>
${project.version}
</version>
<classifier>
tests
</classifier>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
...
...
@@ -67,4 +74,4 @@
</plugins>
</build>
</project>
\ No newline at end of file
</project>
...
...
apps/vtn/vtnweb/src/test/java/org/onosproject/vtnweb/resources/FlowClassifierResourceTest.java
View file @
7c25182
...
...
@@ -295,7 +295,7 @@ public class FlowClassifierResourceTest extends VtnResourceTest {
String
location
=
"flow_classifiers/4a334cd4-fe9c-4fae-af4b-321c5e2eb051"
;
Response
deleteResponse
=
wt
.
path
(
location
)
.
request
(
MediaType
.
APPLICATION_JSON_TYPE
)
.
request
(
MediaType
.
APPLICATION_JSON_TYPE
,
MediaType
.
TEXT_PLAIN_TYPE
)
.
delete
();
assertThat
(
deleteResponse
.
getStatus
(),
is
(
HttpURLConnection
.
HTTP_NO_CONTENT
));
...
...
apps/vtn/vtnweb/src/test/java/org/onosproject/vtnweb/resources/PortChainResourceTest.java
View file @
7c25182
...
...
@@ -279,7 +279,7 @@ public class PortChainResourceTest extends VtnResourceTest {
String
location
=
"port_chains/1278dcd4-459f-62ed-754b-87fc5e4a6751"
;
Response
deleteResponse
=
wt
.
path
(
location
)
.
request
(
MediaType
.
APPLICATION_JSON_TYPE
)
.
request
(
MediaType
.
APPLICATION_JSON_TYPE
,
MediaType
.
TEXT_PLAIN_TYPE
)
.
delete
();
assertThat
(
deleteResponse
.
getStatus
(),
is
(
HttpURLConnection
.
HTTP_NO_CONTENT
));
...
...
apps/vtn/vtnweb/src/test/java/org/onosproject/vtnweb/resources/PortPairGroupResourceTest.java
View file @
7c25182
...
...
@@ -239,7 +239,7 @@ public class PortPairGroupResourceTest extends VtnResourceTest {
String
location
=
"port_pair_groups/4512d643-24fc-4fae-af4b-321c5e2eb3d1"
;
Response
deleteResponse
=
wt
.
path
(
location
)
.
request
(
MediaType
.
APPLICATION_JSON_TYPE
)
.
request
(
MediaType
.
APPLICATION_JSON_TYPE
,
MediaType
.
TEXT_PLAIN_TYPE
)
.
delete
();
assertThat
(
deleteResponse
.
getStatus
(),
is
(
HttpURLConnection
.
HTTP_NO_CONTENT
));
...
...
apps/vtn/vtnweb/src/test/java/org/onosproject/vtnweb/resources/PortPairResourceTest.java
View file @
7c25182
...
...
@@ -231,7 +231,7 @@ public class PortPairResourceTest extends VtnResourceTest {
String
location
=
"port_pairs/78dcd363-fc23-aeb6-f44b-56dc5e2fb3ae"
;
Response
deleteResponse
=
wt
.
path
(
location
)
.
request
(
MediaType
.
APPLICATION_JSON_TYPE
)
.
request
(
MediaType
.
APPLICATION_JSON_TYPE
,
MediaType
.
TEXT_PLAIN_TYPE
)
.
delete
();
assertThat
(
deleteResponse
.
getStatus
(),
is
(
HttpURLConnection
.
HTTP_NO_CONTENT
));
...
...
apps/vtn/vtnweb/src/test/java/org/onosproject/vtnweb/resources/VtnResourceTest.java
View file @
7c25182
...
...
@@ -16,12 +16,12 @@
package
org
.
onosproject
.
vtnweb
.
resources
;
import
org.glassfish.jersey.server.ResourceConfig
;
import
org.
glassfish.jersey.test.Jersey
Test
;
import
org.
onosproject.rest.resources.Resource
Test
;
/**
* Base class for VTN REST API tests. Performs common configuration operations.
*/
public
class
VtnResourceTest
extends
Jersey
Test
{
public
class
VtnResourceTest
extends
Resource
Test
{
/**
* Creates a new web-resource test.
...
...
bucklets/onos.bucklet
View file @
7c25182
...
...
@@ -24,7 +24,7 @@ def osgi_jar(
name = bare_jar_name,
srcs = srcs,
deps = deps,
visibility = [
], #intentially, not visible
visibility = [
'PUBLIC'],
**kwargs
)
...
...
core/api/BUCK
View file @
7c25182
...
...
@@ -18,8 +18,6 @@ osgi_jar(
name = CURRENT_NAME,
srcs = glob([SRC + '/*.java']),
deps = COMPILE_DEPS,
resources_root = 'src/test/resources',
resources = glob(['src/test/resources/**']),
visibility = ['PUBLIC'],
)
...
...
@@ -31,4 +29,6 @@ java_test(
TEST_DEPS +
[CURRENT_TARGET],
source_under_test = [CURRENT_TARGET],
resources_root = 'src/test/resources',
resources = glob(['src/test/resources/**']),
)
...
...
core/api/src/test/java/org/onosproject/net/intent/MockIdGenerator.java
View file @
7c25182
...
...
@@ -23,6 +23,14 @@ import java.util.concurrent.atomic.AtomicLong;
* Mock id generator for testing.
*/
public
class
MockIdGenerator
implements
IdGenerator
{
private
static
boolean
generatorIsBound
=
false
;
public
static
void
bindNewGenerator
()
{
if
(!
generatorIsBound
)
{
generatorIsBound
=
true
;
Intent
.
bindIdGenerator
(
new
MockIdGenerator
());
}
}
private
AtomicLong
nextId
=
new
AtomicLong
(
0
);
@Override
...
...
core/net/BUCK
View file @
7c25182
...
...
@@ -9,7 +9,10 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST_ADAPTERS',
'//core/common:onos-core-common',
'//core/store/dist:onos-core-dist',
'//core/store/dist:onos-core-dist-tests',
]
osgi_jar(
...
...
@@ -26,4 +29,6 @@ java_test(
TEST_DEPS +
[CURRENT_TARGET],
source_under_test = [CURRENT_TARGET],
resources_root = 'src/test/resources',
resources = glob(['src/test/resources/**']),
)
...
...
core/store/dist/BUCK
View file @
7c25182
...
...
@@ -30,10 +30,11 @@ osgi_jar(
)
java_test(
name= 'tests',
name= '
onos-core-dist-
tests',
srcs = glob([TEST + '/*.java']),
deps = COMPILE_DEPS +
TEST_DEPS +
[CURRENT_TARGET],
source_under_test = [CURRENT_TARGET],
visibility = ['PUBLIC'],
)
...
...
incubator/api/BUCK
View file @
7c25182
...
...
@@ -8,7 +8,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
osgi_jar(
...
...
@@ -19,10 +19,11 @@ osgi_jar(
)
java_test(
name = 'tests',
name = '
onos-incubator-api-
tests',
srcs = glob([TEST + '/*.java']),
deps = COMPILE_DEPS +
TEST_DEPS +
[CURRENT_TARGET],
source_under_test = [CURRENT_TARGET],
visibility = ['PUBLIC'],
)
...
...
incubator/net/BUCK
View file @
7c25182
...
...
@@ -9,7 +9,11 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
'//core/common:onos-core-common-tests',
'//incubator/store:onos-incubator-store',
'//core/store/serializers:onos-core-serializers',
]
osgi_jar(
...
...
incubator/store/BUCK
View file @
7c25182
SRC = 'src/main/java/org/onosproject/incubator/**/'
TEST = 'src/test/java/org/onosproject/incubator/**/'
SRC = 'src/main/java/org/onosproject/incubator/
store/
**/'
TEST = 'src/test/java/org/onosproject/incubator/
store/
**/'
CURRENT_NAME = 'onos-incubator-store'
CURRENT_TARGET = ':' + CURRENT_NAME
...
...
@@ -12,7 +12,9 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
'//core/common:onos-core-common-tests',
]
osgi_jar(
...
...
lib/BUCK
View file @
7c25182
...
...
@@ -76,6 +76,47 @@ java_library(
],
)
java_library(
name = 'TEST_ADAPTERS',
visibility = ['PUBLIC'],
exported_deps = [
':TEST',
'//core/common:onos-core-common',
'//core/api:onos-api-tests',
'//core/common:onos-core-common-tests',
],
)
java_library(
name = 'TEST_REST',
visibility = ['PUBLIC'],
exported_deps = [
':TEST_ADAPTERS',
'//lib:jersey-client',
'//lib:jersey-server',
'//lib:jersey-common',
'//lib:jersey-test-framework-core',
'//lib:jersey-test-framework-grizzly2',
'//lib:jersey-guava',
'//lib:hk2-api',
'//lib:hk2-locator',
'//lib:hk2-utils',
'//lib:javax.inject',
'//lib:hk2-osgi-resource-locator',
'//lib:jersey-container-grizzly2-http',
'//lib:grizzly-http-server',
'//lib:grizzly-framework',
'//lib:grizzly-http',
'//lib:javax.annotation-api',
'//lib:validation-api',
'//core/common:onos-core-common',
'//core/api:onos-api-tests',
'//core/common:onos-core-common-tests',
'//utils/osgi:onlab-osgi-tests',
],
)
maven_jar(
name = 'minimal-json',
id = 'com.eclipsesource.minimal-json:minimal-json:0.9.4',
...
...
@@ -448,16 +489,23 @@ maven_jar(
)
maven_jar(
name = '
aopalliance-repackaged
',
id = 'org.glassfish.hk2
.external:aopalliance-repackaged
:2.4.0-b34',
sha1 = '
3d5e856dbc91a3a2b0bcb3a3424f8b62421ae4cf
',
name = '
hk2-locator
',
id = 'org.glassfish.hk2
:hk2-locator
:2.4.0-b34',
sha1 = '
1451fc3e5b7f00d7a5ca0feaff2c1bf68be5ac91
',
license = 'Apache2.0',
)
maven_jar(
name = 'jersey-guava',
id = 'org.glassfish.jersey.bundles.repackaged:jersey-guava:2.22.2',
sha1 = '7422c693c89640c9685dfa99dbef2da745aa4617',
name = 'hk2-utils',
id = 'org.glassfish.hk2:hk2-utils:2.4.0-b34',
sha1 = 'aacce18411fffef9621d8fc91464ca0477119c38',
license = 'Apache2.0',
)
maven_jar(
name = 'hk2-osgi-resource-locator',
id = 'org.glassfish.hk2:osgi-resource-locator:1.0.1',
sha1 = '4ed2b2d4738aed5786cfa64cba5a332779c4c708',
license = 'Apache2.0',
)
...
...
@@ -468,6 +516,61 @@ maven_jar(
license = 'Apache2.0',
)
maven_jar(
name = 'jersey-container-grizzly2-http',
id = 'org.glassfish.jersey.containers:jersey-container-grizzly2-http:2.22.2',
sha1 = '7f4f0cb7cfad277a4a6d91298d9f2ac309e4383b',
license = 'Apache2.0',
)
maven_jar(
name = 'grizzly-http-server',
id = 'org.glassfish.grizzly:grizzly-http-server:2.3.23',
sha1 = '4aaf209163d8dca1bfb1907f19c7fd1f2f3ebbf9',
license = 'Apache2.0',
)
maven_jar(
name = 'grizzly-http',
id = 'org.glassfish.grizzly:grizzly-http:2.3.23',
sha1 = '287ea2c8a765b14fbc494749570ff3889ecd7b83',
license = 'Apache2.0',
)
maven_jar(
name = 'grizzly-framework',
id = 'org.glassfish.grizzly:grizzly-framework:2.3.23',
sha1 = '262913b1a7ec4156e7e6aa3f8854a4d1a54940b0',
license = 'Apache2.0',
)
maven_jar(
name = 'javax.annotation-api',
id = 'javax.annotation:javax.annotation-api:1.2',
sha1 = '479c1e06db31c432330183f5cae684163f186146',
license = 'Apache2.0',
)
maven_jar(
name = 'validation-api',
id = 'javax.validation:validation-api:1.1.0.Final',
sha1 = '8613ae82954779d518631e05daa73a6a954817d5',
license = 'Apache2.0',
)
maven_jar(
name = 'aopalliance-repackaged',
id = 'org.glassfish.hk2.external:aopalliance-repackaged:2.4.0-b34',
sha1 = '3d5e856dbc91a3a2b0bcb3a3424f8b62421ae4cf',
license = 'Apache2.0',
)
maven_jar(
name = 'jersey-guava',
id = 'org.glassfish.jersey.bundles.repackaged:jersey-guava:2.22.2',
sha1 = '7422c693c89640c9685dfa99dbef2da745aa4617',
license = 'Apache2.0',
)
maven_jar(
name = 'servlet-api',
...
...
providers/bgp/topology/BUCK
View file @
7c25182
...
...
@@ -8,10 +8,11 @@ COMPILE_DEPS = [
'//lib:CORE_DEPS',
'//protocols/bgp/api:onos-bgp-api',
'//protocols/bgp/bgpio:onos-bgpio',
'//incubator/store:onos-incubator-store',
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
osgi_jar(
...
...
providers/lldp/BUCK
View file @
7c25182
...
...
@@ -10,7 +10,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
osgi_jar(
...
...
providers/netcfglinks/BUCK
View file @
7c25182
...
...
@@ -10,7 +10,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
osgi_jar(
...
...
providers/openflow/device/BUCK
View file @
7c25182
...
...
@@ -11,7 +11,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
osgi_jar(
...
...
providers/pcep/tunnel/BUCK
View file @
7c25182
...
...
@@ -15,7 +15,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_ADAPTERS
',
]
osgi_jar(
...
...
utils/osgi/BUCK
View file @
7c25182
...
...
@@ -19,10 +19,11 @@ osgi_jar(
)
java_test(
name = 'tests',
name = '
onlab-osgi-
tests',
srcs = glob([TEST + '/*.java']),
deps = COMPILE_DEPS +
TEST_DEPS +
[CURRENT_TARGET],
source_under_test = [CURRENT_TARGET],
visibility = ['PUBLIC'],
)
...
...
web/api/BUCK
View file @
7c25182
...
...
@@ -13,7 +13,7 @@ COMPILE_DEPS = [
]
TEST_DEPS = [
'//lib:TEST',
'//lib:TEST
_REST
',
]
osgi_jar(
...
...
@@ -27,11 +27,15 @@ osgi_jar(
web_context = '/onos/v1'
)
SOURCE_JAR = CURRENT_TARGET + '-jar'
java_test(
name = 'tests',
name = '
onos-rest-
tests',
srcs = glob([TEST + '/*.java']),
deps = COMPILE_DEPS +
TEST_DEPS +
[CURRENT_TARGET],
source_under_test = [CURRENT_TARGET],
[SOURCE_JAR],
source_under_test = [SOURCE_JAR],
visibility = ['PUBLIC'],
resources_root = 'src/test/resources',
resources = glob(['src/test/resources/**']),
)
...
...
web/api/src/test/java/org/onosproject/rest/resources/IntentsResourceTest.java
View file @
7c25182
...
...
@@ -15,10 +15,17 @@
*/
package
org
.
onosproject
.
rest
.
resources
;
import
com.eclipsesource.json.Json
;
import
com.eclipsesource.json.JsonArray
;
import
com.eclipsesource.json.JsonObject
;
import
com.eclipsesource.json.JsonValue
;
import
java.io.InputStream
;
import
java.net.HttpURLConnection
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
javax.ws.rs.NotFoundException
;
import
javax.ws.rs.client.Entity
;
import
javax.ws.rs.client.WebTarget
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
org.hamcrest.Description
;
import
org.hamcrest.Matchers
;
import
org.hamcrest.TypeSafeMatcher
;
...
...
@@ -40,17 +47,11 @@ import org.onosproject.net.intent.Intent;
import
org.onosproject.net.intent.IntentService
;
import
org.onosproject.net.intent.IntentState
;
import
org.onosproject.net.intent.Key
;
import
org.onosproject.net.intent.MockIdGenerator
;
import
javax.ws.rs.NotFoundException
;
import
javax.ws.rs.client.Entity
;
import
javax.ws.rs.client.WebTarget
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
java.io.InputStream
;
import
java.net.HttpURLConnection
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
com.eclipsesource.json.Json
;
import
com.eclipsesource.json.JsonArray
;
import
com.eclipsesource.json.JsonObject
;
import
com.eclipsesource.json.JsonValue
;
import
static
org
.
easymock
.
EasyMock
.
anyObject
;
import
static
org
.
easymock
.
EasyMock
.
createMock
;
...
...
@@ -65,6 +66,7 @@ import static org.hamcrest.Matchers.notNullValue;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
junit
.
Assert
.
fail
;
import
static
org
.
onosproject
.
net
.
intent
.
IntentTestsMocks
.
MockIntent
;
import
static
org
.
onosproject
.
net
.
intent
.
MockIdGenerator
.
bindNewGenerator
;
/**
* Unit tests for Intents REST APIs.
...
...
@@ -255,8 +257,7 @@ public class IntentsResourceTest extends ResourceTest {
BaseResource
.
setServiceDirectory
(
testDirectory
);
mockGenerator
=
new
MockIdGenerator
();
Intent
.
bindIdGenerator
(
mockGenerator
);
bindNewGenerator
();
}
/**
...
...
@@ -265,7 +266,6 @@ public class IntentsResourceTest extends ResourceTest {
@After
public
void
tearDownTest
()
{
verify
(
mockIntentService
);
Intent
.
unbindIdGenerator
(
mockGenerator
);
}
/**
...
...
@@ -456,7 +456,7 @@ public class IntentsResourceTest extends ResourceTest {
WebTarget
wt
=
target
();
Response
response
=
wt
.
path
(
"intents/app/0x2"
)
.
request
(
MediaType
.
APPLICATION_JSON
_TYPE
)
.
request
(
MediaType
.
APPLICATION_JSON
,
MediaType
.
TEXT_PLAIN
)
.
delete
();
assertThat
(
response
.
getStatus
(),
is
(
HttpURLConnection
.
HTTP_NO_CONTENT
));
}
...
...
@@ -484,7 +484,7 @@ public class IntentsResourceTest extends ResourceTest {
WebTarget
wt
=
target
();
Response
response
=
wt
.
path
(
"intents/app/0x2"
)
.
request
(
MediaType
.
APPLICATION_JSON
_TYPE
)
.
request
(
MediaType
.
APPLICATION_JSON
,
MediaType
.
TEXT_PLAIN
)
.
delete
();
assertThat
(
response
.
getStatus
(),
is
(
HttpURLConnection
.
HTTP_NO_CONTENT
));
}
...
...
web/api/src/test/java/org/onosproject/rest/resources/ResourceTest.java
View file @
7c25182
...
...
@@ -36,6 +36,14 @@ public class ResourceTest extends JerseyTest {
}
/**
* Creates a new web-resource test.
*/
public
ResourceTest
(
ResourceConfig
config
)
{
super
(
config
);
this
.
set
(
"jersey.config.test.container.port"
,
getRandomPort
(
DEFAULT_PORT
));
}
/**
* Returns an unused port number to make sure that each unit test runs in
* different port number.
*
...
...
Please
register
or
login
to post a comment