From 9e7885c76acfe4848258f6b2201a0ee0cb25831f Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Thu, 5 Jan 2017 16:43:24 +0000 Subject: [PATCH] Add (ignored) test suite for probing ordering issues --- .../function/deployer/AdhocTestSuite.java | 35 +++++++++++++++++++ ...unctionExtractingFunctionCatalogTests.java | 10 +++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 spring-cloud-function-deployer/src/test/java/org/springframework/cloud/function/deployer/AdhocTestSuite.java diff --git a/spring-cloud-function-deployer/src/test/java/org/springframework/cloud/function/deployer/AdhocTestSuite.java b/spring-cloud-function-deployer/src/test/java/org/springframework/cloud/function/deployer/AdhocTestSuite.java new file mode 100644 index 000000000..5fc611692 --- /dev/null +++ b/spring-cloud-function-deployer/src/test/java/org/springframework/cloud/function/deployer/AdhocTestSuite.java @@ -0,0 +1,35 @@ +/* + * Copyright 2012-2015 the original author or authors. + * + * 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.springframework.cloud.function.deployer; + +import org.junit.Ignore; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +/** + * A test suite for probing weird ordering problems in the tests. + * + * @author Dave Syer + */ +@RunWith(Suite.class) +@SuiteClasses({ FunctionAppDeployerTests.class, + FunctionExtractingFunctionCatalogIntegrationTests.class }) +@Ignore +public class AdhocTestSuite { + +} diff --git a/spring-cloud-function-deployer/src/test/java/org/springframework/cloud/function/deployer/FunctionExtractingFunctionCatalogTests.java b/spring-cloud-function-deployer/src/test/java/org/springframework/cloud/function/deployer/FunctionExtractingFunctionCatalogTests.java index 0b335c856..01a7260fd 100644 --- a/spring-cloud-function-deployer/src/test/java/org/springframework/cloud/function/deployer/FunctionExtractingFunctionCatalogTests.java +++ b/spring-cloud-function-deployer/src/test/java/org/springframework/cloud/function/deployer/FunctionExtractingFunctionCatalogTests.java @@ -18,6 +18,7 @@ package org.springframework.cloud.function.deployer; import java.util.Arrays; import java.util.Collections; +import org.junit.AfterClass; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -59,6 +60,13 @@ public class FunctionExtractingFunctionCatalogTests { } } + @AfterClass + public static void close() { + if (id != null) { + deployer.undeploy(id); + } + } + @Test public void deployAndExtractFunctions() throws Exception { // This one can only work if you change the boot classpath to contain reactor-core @@ -80,7 +88,7 @@ public class FunctionExtractingFunctionCatalogTests { assertThat(deployer.lookupSupplier("words")).isNotNull(); } - private String deploy(String jarName, String... args) throws Exception { + private static String deploy(String jarName, String... args) throws Exception { Resource resource = new FileSystemResource( ArchiveUtils.getArchiveRoot(ArchiveUtils.getArchive(jarName))); AppDefinition definition = new AppDefinition(resource.getFilename(),