zrhoffman commented on a change in pull request #4857: URL: https://github.com/apache/trafficcontrol/pull/4857#discussion_r466820945
########## File path: traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/util/AbstractResourceWatcherTest.java ########## @@ -0,0 +1,112 @@ +/* + * + * 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 com.comcast.cdn.traffic_control.traffic_router.core.util; + +import com.comcast.cdn.traffic_control.traffic_router.core.TestBase; +import com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringRegistry; +import com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringWatcher; +import com.comcast.cdn.traffic_control.traffic_router.core.edge.CacheRegister; +import com.comcast.cdn.traffic_control.traffic_router.core.loc.*; +import com.comcast.cdn.traffic_control.traffic_router.core.router.TrafficRouter; +import com.comcast.cdn.traffic_control.traffic_router.core.router.TrafficRouterManager; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.apache.log4j.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.springframework.context.ApplicationContext; + +import java.nio.file.Files; +import java.nio.file.Paths; + +import static com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringWatcher.DEFAULT_STEERING_DATA_URL; +import static com.comcast.cdn.traffic_control.traffic_router.core.loc.FederationsWatcher.DEFAULT_FEDERATION_DATA_URL; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.endsWith; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThan; +import static org.junit.Assert.*; + + +@Category(IntegrationTest.class) +public class AbstractResourceWatcherTest { + + private static final Logger LOGGER = Logger.getLogger(com.comcast.cdn.traffic_control.traffic_router.core.util.AbstractResourceWatcherTest.class); + + private FederationsWatcher federationsWatcher; + private SteeringWatcher steeringWatcher; + private TrafficRouterManager trafficRouterManager; + private SteeringRegistry steeringRegistry; + private static ApplicationContext context; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + assertThat("Copy core/src/main/conf/traffic_monitor.properties to core/src/test/conf and set 'traffic_monitor.bootstrap.hosts' to a real traffic monitor", Files.exists(Paths.get(TestBase.monitorPropertiesPath)), equalTo(true)); + context = TestBase.getContext(); + } + + @Before + public void setUp() throws Exception { Review comment: Is the `throws` necessary in this method? ########## File path: traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/util/AbstractResourceWatcherTest.java ########## @@ -0,0 +1,112 @@ +/* + * + * 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 com.comcast.cdn.traffic_control.traffic_router.core.util; + +import com.comcast.cdn.traffic_control.traffic_router.core.TestBase; +import com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringRegistry; +import com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringWatcher; +import com.comcast.cdn.traffic_control.traffic_router.core.edge.CacheRegister; +import com.comcast.cdn.traffic_control.traffic_router.core.loc.*; Review comment: This should be expanded into single class imports. ########## File path: traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/util/AbstractResourceWatcherTest.java ########## @@ -0,0 +1,112 @@ +/* + * + * 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 com.comcast.cdn.traffic_control.traffic_router.core.util; + +import com.comcast.cdn.traffic_control.traffic_router.core.TestBase; +import com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringRegistry; +import com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringWatcher; +import com.comcast.cdn.traffic_control.traffic_router.core.edge.CacheRegister; +import com.comcast.cdn.traffic_control.traffic_router.core.loc.*; +import com.comcast.cdn.traffic_control.traffic_router.core.router.TrafficRouter; +import com.comcast.cdn.traffic_control.traffic_router.core.router.TrafficRouterManager; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.apache.log4j.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.springframework.context.ApplicationContext; + +import java.nio.file.Files; +import java.nio.file.Paths; + +import static com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringWatcher.DEFAULT_STEERING_DATA_URL; +import static com.comcast.cdn.traffic_control.traffic_router.core.loc.FederationsWatcher.DEFAULT_FEDERATION_DATA_URL; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.endsWith; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThan; +import static org.junit.Assert.*; + + +@Category(IntegrationTest.class) +public class AbstractResourceWatcherTest { + + private static final Logger LOGGER = Logger.getLogger(com.comcast.cdn.traffic_control.traffic_router.core.util.AbstractResourceWatcherTest.class); + + private FederationsWatcher federationsWatcher; + private SteeringWatcher steeringWatcher; + private TrafficRouterManager trafficRouterManager; + private SteeringRegistry steeringRegistry; + private static ApplicationContext context; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { Review comment: Is the `throws Exception` necessary? ########## File path: traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/util/AbstractResourceWatcherTest.java ########## @@ -0,0 +1,112 @@ +/* + * + * 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 com.comcast.cdn.traffic_control.traffic_router.core.util; + +import com.comcast.cdn.traffic_control.traffic_router.core.TestBase; +import com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringRegistry; +import com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringWatcher; +import com.comcast.cdn.traffic_control.traffic_router.core.edge.CacheRegister; +import com.comcast.cdn.traffic_control.traffic_router.core.loc.*; +import com.comcast.cdn.traffic_control.traffic_router.core.router.TrafficRouter; +import com.comcast.cdn.traffic_control.traffic_router.core.router.TrafficRouterManager; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.apache.log4j.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.springframework.context.ApplicationContext; + +import java.nio.file.Files; +import java.nio.file.Paths; + +import static com.comcast.cdn.traffic_control.traffic_router.core.ds.SteeringWatcher.DEFAULT_STEERING_DATA_URL; +import static com.comcast.cdn.traffic_control.traffic_router.core.loc.FederationsWatcher.DEFAULT_FEDERATION_DATA_URL; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.endsWith; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThan; +import static org.junit.Assert.*; Review comment: This should be expanded into single class imports. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
