-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
151 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version=2.1.3-SNAPSHOT | ||
version=2.2.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/test/groovy/ru/vyarus/dropwizard/guice/order/InstallersOrderTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package ru.vyarus.dropwizard.guice.order | ||
|
||
import com.google.inject.Inject | ||
import ru.vyarus.dropwizard.guice.AbstractTest | ||
import ru.vyarus.dropwizard.guice.module.installer.feature.ManagedInstaller | ||
import ru.vyarus.dropwizard.guice.module.installer.feature.jersey.provider.JerseyProviderInstaller | ||
import ru.vyarus.dropwizard.guice.module.installer.internal.FeaturesHolder | ||
import ru.vyarus.dropwizard.guice.module.installer.order.Order | ||
import ru.vyarus.dropwizard.guice.support.installerorder.DummyInstaller | ||
import ru.vyarus.dropwizard.guice.support.installerorder.OrderedInstallersApplication | ||
import ru.vyarus.dropwizard.guice.test.spock.UseGuiceyApp | ||
|
||
/** | ||
* @author Vyacheslav Rusakov | ||
* @since 17.04.2015 | ||
*/ | ||
@UseGuiceyApp(OrderedInstallersApplication) | ||
class InstallersOrderTest extends AbstractTest { | ||
|
||
@Inject | ||
FeaturesHolder holder | ||
|
||
def "Check default installers order"() { | ||
|
||
def pos = 0; | ||
holder.getInstallers().each { | ||
int instPos = it.class.getAnnotation(Order).value() | ||
assert instPos > pos | ||
pos = instPos | ||
} | ||
expect: | ||
pos == 100 | ||
} | ||
|
||
def "Check custom installer position correct"() { | ||
|
||
expect: | ||
holder.getInstallers()[1] instanceof ManagedInstaller | ||
holder.getInstallers()[2] instanceof DummyInstaller | ||
holder.getInstallers()[3] instanceof JerseyProviderInstaller | ||
|
||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/test/groovy/ru/vyarus/dropwizard/guice/support/installerorder/DummyInstaller.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package ru.vyarus.dropwizard.guice.support.installerorder | ||
|
||
import ru.vyarus.dropwizard.guice.module.installer.FeatureInstaller | ||
import ru.vyarus.dropwizard.guice.module.installer.order.Order | ||
|
||
/** | ||
* Installer should run after ManagedInstaller(20) and before JerseyProviderInstaller(30) | ||
* | ||
* @author Vyacheslav Rusakov | ||
* @since 17.04.2015 | ||
*/ | ||
@Order(25) | ||
class DummyInstaller implements FeatureInstaller<DummyInstaller>{ | ||
|
||
@Override | ||
boolean matches(Class<?> type) { | ||
return false | ||
} | ||
|
||
@Override | ||
void report() { | ||
} | ||
} |
Oops, something went wrong.