Compare commits
2 Commits
master
...
issues/92-
Author | SHA1 | Date |
---|---|---|
R. Tyler Croy | 1feb3f1bee | |
R. Tyler Croy | 5bddc68946 |
|
@ -1,6 +1,10 @@
|
|||
language: java
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
- oraclejdk8
|
||||
- oraclejdk7
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.gradle
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
|
|
|
@ -35,7 +35,7 @@ dependencies {
|
|||
'dropwizard-views-mustache',
|
||||
'dropwizard-testing',
|
||||
].each {
|
||||
compile withSources("io.dropwizard:${it}:0.8.0-rc1")
|
||||
compile withSources("io.dropwizard:${it}:0.8.0")
|
||||
}
|
||||
|
||||
/* Used instead of the default HTTP connector for the Jersey client to
|
||||
|
|
|
@ -759,7 +759,7 @@ the entire environment doesn’t have to be promoted together</p>
|
|||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2015-02-23 15:06:52 EST
|
||||
Last updated 2015-02-20 11:26:52 PST
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -923,7 +923,7 @@ ns = notStarted</pre>
|
|||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2015-02-23 15:06:52 EST
|
||||
Last updated 2015-02-17 15:37:46 PST
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -782,7 +782,7 @@ table.CodeRay td.code>pre{padding:0}
|
|||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2015-02-23 15:06:52 EST
|
||||
Last updated 2015-02-20 11:26:52 PST
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -7,7 +7,7 @@ import io.dropwizard.cli.ServerCommand
|
|||
import io.dropwizard.lifecycle.ServerLifecycleListener
|
||||
import io.dropwizard.setup.Bootstrap
|
||||
import io.dropwizard.setup.Environment
|
||||
import io.dropwizard.testing.junit.ConfigOverride
|
||||
import io.dropwizard.testing.ConfigOverride
|
||||
|
||||
import com.google.common.base.Strings
|
||||
import com.google.common.collect.ImmutableMap
|
||||
|
|
|
@ -8,7 +8,7 @@ import io.dropwizard.cli.ServerCommand
|
|||
import io.dropwizard.lifecycle.ServerLifecycleListener
|
||||
import io.dropwizard.setup.Bootstrap
|
||||
import io.dropwizard.setup.Environment
|
||||
import io.dropwizard.testing.junit.ConfigOverride
|
||||
import io.dropwizard.testing.ConfigOverride
|
||||
import net.sourceforge.argparse4j.inf.Namespace
|
||||
import org.eclipse.jetty.server.Server
|
||||
import org.eclipse.jetty.server.ServerConnector
|
||||
|
@ -125,4 +125,4 @@ public class WebhookTestServerAppRunner<C extends Configuration> {
|
|||
return environment
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package deploydb
|
||||
|
||||
import com.google.common.collect.ImmutableList
|
||||
import com.google.common.collect.ImmutableMap
|
||||
import io.dropwizard.Application
|
||||
import io.dropwizard.assets.AssetsBundle
|
||||
import io.dropwizard.db.DataSourceFactory
|
||||
|
@ -57,10 +58,17 @@ class DeployDBApp extends Application<DeployDBConfiguration> {
|
|||
@Override
|
||||
public void initialize(Bootstrap<DeployDBConfiguration> bootstrap) {
|
||||
bootstrap.addBundle(new AssetsBundle())
|
||||
bootstrap.addBundle(new ViewBundle())
|
||||
bootstrap.addBundle(hibernate)
|
||||
workFlow = new WorkFlow(this)
|
||||
|
||||
|
||||
bootstrap.addBundle(new ViewBundle<DeployDBConfiguration>() {
|
||||
@Override
|
||||
ImmutableMap<String, ImmutableMap<String, String>> getViewConfiguration(DeployDBConfiguration config) {
|
||||
return config.viewRendererConfiguration
|
||||
}
|
||||
})
|
||||
|
||||
/*
|
||||
* Force our default timezone to always be UTC
|
||||
*/
|
||||
|
|
|
@ -5,6 +5,7 @@ import io.dropwizard.db.DataSourceFactory
|
|||
import io.dropwizard.flyway.FlywayFactory
|
||||
import com.github.lookout.whoas.WhoasFactory
|
||||
|
||||
import com.google.common.collect.ImmutableMap
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import javax.validation.Valid
|
||||
import javax.validation.constraints.NotNull
|
||||
|
@ -24,6 +25,9 @@ class DeployDBConfiguration extends Configuration {
|
|||
@NotNull
|
||||
private String configDirectory = ""
|
||||
|
||||
private ImmutableMap<String, ImmutableMap<String, String>> \
|
||||
viewRendererConfiguration = ImmutableMap.of()
|
||||
|
||||
@JsonProperty("database")
|
||||
DataSourceFactory getDataSourceFactory() {
|
||||
return database
|
||||
|
@ -62,6 +66,9 @@ class DeployDBConfiguration extends Configuration {
|
|||
@JsonProperty("whoas")
|
||||
void setWhoasFactory(WhoasFactory whoasFactory) {
|
||||
this.whoasFactory = whoasFactory
|
||||
|
||||
ImmutableMap<String, ImmutableMap<String, String>> getViewRendererConfiguration() {
|
||||
return viewRendererConfiguration
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,19 +50,17 @@ webhooks:
|
|||
environmentRegistry.getAll() == [environment]
|
||||
}
|
||||
|
||||
def "Loading an empty environment config file throws a null pointer exception"() {
|
||||
def "Loading an empty environment config file throws a parsing exception"() {
|
||||
when:
|
||||
String fileContents = ""
|
||||
Environment environment = environmentLoader.loadFromString(fileContents)
|
||||
Environment environment = environmentLoader.loadFromString("")
|
||||
|
||||
then:
|
||||
thrown(NullPointerException)
|
||||
thrown(ConfigurationParsingException)
|
||||
}
|
||||
|
||||
def "Loading a malformed environment config file throws throws a parsing exception"() {
|
||||
when:
|
||||
String fileContents = "j&&&&"
|
||||
Environment environment = environmentLoader.loadFromString(fileContents)
|
||||
Environment environment = environmentLoader.loadFromString('j&&&&')
|
||||
|
||||
then:
|
||||
thrown(ConfigurationParsingException)
|
||||
|
|
|
@ -36,12 +36,12 @@ class PromotionWithArgsSpec extends Specification {
|
|||
promotionRegistry.getAll()== [promotion]
|
||||
}
|
||||
|
||||
def "Loading of empty model promotion throws a null pointer exception"(){
|
||||
def "Loading of empty model promotion throws a parsing exception"(){
|
||||
when:
|
||||
Promotion promotion = promotionLoader.loadFromString("")
|
||||
|
||||
then:
|
||||
thrown(NullPointerException)
|
||||
thrown(ConfigurationParsingException)
|
||||
}
|
||||
|
||||
def "Loading a malformed promotion throws a parsing exception"(){
|
||||
|
@ -62,4 +62,4 @@ class PromotionWithArgsSpec extends Specification {
|
|||
promotion.description == ""
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,13 +55,12 @@ promotions:
|
|||
serviceRegistry.getAll() == [service]
|
||||
}
|
||||
|
||||
def "Loading an empty service config file throws a null pointer exception"() {
|
||||
def "Loading an empty service config file throws a parsing exception"() {
|
||||
when:
|
||||
String fileContents = ""
|
||||
Service service = serviceLoader.loadFromString(fileContents)
|
||||
Service service = serviceLoader.loadFromString('')
|
||||
|
||||
then:
|
||||
thrown(NullPointerException)
|
||||
thrown(ConfigurationParsingException)
|
||||
}
|
||||
|
||||
def "Loading a malformed service config file throws throws a parsing exception"() {
|
||||
|
@ -90,4 +89,4 @@ promotions:
|
|||
then:
|
||||
thrown(NullPointerException)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,12 +60,12 @@ class PipelineWithArgsSpec extends Specification {
|
|||
pipelineRegistry.getAll() == [pipeline]
|
||||
}
|
||||
|
||||
def "Loading of empty model pipeline throws a null pointer exception"() {
|
||||
def "Loading of empty model pipeline throws a parsing exception"() {
|
||||
when:
|
||||
Pipeline pipeline = pipelineLoader.loadFromString("")
|
||||
|
||||
then:
|
||||
thrown(NullPointerException)
|
||||
thrown(ConfigurationParsingException)
|
||||
}
|
||||
|
||||
def "Loading a malformed pipeline throws a parsing exception"() {
|
||||
|
@ -83,4 +83,4 @@ class PipelineWithArgsSpec extends Specification {
|
|||
expect:
|
||||
pipeline.description == ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,12 +40,12 @@ class WebhookWithArgsSpec extends Specification {
|
|||
webhook.promotion.completed == ['http://jenkins.example.com/job/notify-promotion-completed/build']
|
||||
}
|
||||
|
||||
def "Loading an empty webhook throws null pointer exception"() {
|
||||
def "Loading an empty webhook throws parsing exception"() {
|
||||
when:
|
||||
Webhook webhook = webhookModelLoader.load('webhooks/test-empty.yml')
|
||||
|
||||
then:
|
||||
thrown(NullPointerException)
|
||||
thrown(ConfigurationParsingException)
|
||||
}
|
||||
|
||||
def "Loading of empty models webhook config file succeeds"() {
|
||||
|
|
Loading…
Reference in New Issue