Add a test for the version so deployer doesn't get deployed

Also unignore test in dataflow server
This commit is contained in:
Dave Syer
2017-04-26 16:23:07 +01:00
parent ac9cfc1bae
commit a12950bc7a
6 changed files with 23 additions and 5 deletions

View File

@@ -18,7 +18,7 @@
</parent> </parent>
<properties> <properties>
<thin-jar.version>1.0.0.RELEASE</thin-jar.version> <thin-jar.version>1.0.1.RELEASE</thin-jar.version>
</properties> </properties>
<modules> <modules>

View File

@@ -11,7 +11,6 @@ import org.springframework.test.context.junit4.SpringRunner;
@SpringBootTest({ "spring.cloud.bus.enabled=false", "eureka.client.enabled=false" }) @SpringBootTest({ "spring.cloud.bus.enabled=false", "eureka.client.enabled=false" })
public class DeployerApplicationTests { public class DeployerApplicationTests {
@Ignore("dataflox server is not compatible with boot 1.5.3")
@Test @Test
public void contextLoads() { public void contextLoads() {
} }

View File

@@ -72,6 +72,15 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemProperties>
<project.version>${project.version}</project.version>
</systemProperties>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@@ -41,7 +41,7 @@ public class DeployerApplication {
private static final Logger logger = LoggerFactory private static final Logger logger = LoggerFactory
.getLogger(DeployerApplication.class); .getLogger(DeployerApplication.class);
private static final String DEFAULT_VERSION = "1.3.1.BUILD-SNAPSHOT"; private static final String DEFAULT_VERSION = "1.3.2.BUILD-SNAPSHOT";
private String[] args; private String[] args;
@@ -100,7 +100,7 @@ public class DeployerApplication {
} }
} }
private String getVersion() { String getVersion() {
Package pkg = DeployerApplication.class.getPackage(); Package pkg = DeployerApplication.class.getPackage();
return (pkg != null ? pkg.getImplementationVersion() == null ? DEFAULT_VERSION return (pkg != null ? pkg.getImplementationVersion() == null ? DEFAULT_VERSION
: pkg.getImplementationVersion() : DEFAULT_VERSION); : pkg.getImplementationVersion() : DEFAULT_VERSION);

View File

@@ -98,9 +98,10 @@ spring:
deployables: deployables:
configserver: configserver:
properties: properties:
spring.cloud.deployer.thin.profile: rabbit thin.profile: rabbit
application-properties: application-properties:
spring.cloud.bus.enabled: true spring.cloud.bus.enabled: true
debug: true
eureka: eureka:
properties: properties:
spring.cloud.deployer.thin.profile: rabbit spring.cloud.deployer.thin.profile: rabbit

View File

@@ -30,6 +30,15 @@ public class DeployerApplicationTests {
@Rule @Rule
public OutputCapture output = new OutputCapture(); public OutputCapture output = new OutputCapture();
@Test
public void testDefaultLibrary() throws Exception {
DeployerApplication wrapper = new DeployerApplication();
if (System.getProperty("project.version") != null) {
assertThat(wrapper.getVersion(),
containsString(System.getProperty("project.version")));
}
}
@Test @Test
public void testCreateClassLoaderAndListDeployables() throws Exception { public void testCreateClassLoaderAndListDeployables() throws Exception {
new DeployerApplication("--launcher.list=true").run(); new DeployerApplication("--launcher.list=true").run();