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>
<properties>
<thin-jar.version>1.0.0.RELEASE</thin-jar.version>
<thin-jar.version>1.0.1.RELEASE</thin-jar.version>
</properties>
<modules>

View File

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

View File

@@ -72,6 +72,15 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</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>
</build>
</project>

View File

@@ -41,7 +41,7 @@ public class DeployerApplication {
private static final Logger logger = LoggerFactory
.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;
@@ -100,7 +100,7 @@ public class DeployerApplication {
}
}
private String getVersion() {
String getVersion() {
Package pkg = DeployerApplication.class.getPackage();
return (pkg != null ? pkg.getImplementationVersion() == null ? DEFAULT_VERSION
: pkg.getImplementationVersion() : DEFAULT_VERSION);

View File

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

View File

@@ -30,6 +30,15 @@ public class DeployerApplicationTests {
@Rule
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
public void testCreateClassLoaderAndListDeployables() throws Exception {
new DeployerApplication("--launcher.list=true").run();