Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[hudson-dev] Porting back Gerrit Trigger plugin

Hi everybody.

I've been porting back the Gerrit Trigger from Jenkins to Hudson.  My work in progress, which actually works, is at:


I encountered a couple of problems in running the tests:

*** HudsonTestCase#recipeLoadCurrentPlugin() fails to load the plugin


*** HudsonTestCase#recipeLoadCurrentPlugin() results in NPE due to null MavenRequest

Fixing the above, the tests then eventually fail:

-------------------------------------------------------------------------------
Test set: com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual.ManualTriggerActionPermissionTest
-------------------------------------------------------------------------------
Tests run: 7, Failures: 0, Errors: 7, Skipped: 0, Time elapsed: 2.413 sec <<< FAILURE!
testGetGetUrlNameNotPermitted(com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual.ManualTriggerActionPermissionTest)  Time elapsed: 1.513 sec  <<< ERROR!
java.lang.NullPointerException
        at hudson.maven.MavenEmbedderUtils.buildPlexusContainer(MavenEmbedderUtils.java:131)
        at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:111)
        at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:138)
        at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritPluginTestCase$1.decorateHome(GerritPluginTestCase.java:67)
        at org.jvnet.hudson.test.HudsonTestCase.newHudson(HudsonTestCase.java:377)
        at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:240)
        at junit.framework.TestCase.runBare(TestCase.java:132)
        at org.jvnet.hudson.test.HudsonTestCase.runBare(HudsonTestCase.java:220)
 

MevenEmbedderUtils is from hudson-maven-embedder-3.2.

The cause is that the mavenRequest = null, passed in from the following line in HudsonTestCase#recipeLoadCurrentPlugin():

MavenEmbedder embedder = new MavenEmbedder(getClass()
.getClassLoader(), null);

Changing that last argument to a "new MavenRequest()" seems to get this moving, but is likely not correct since it leads to the following error…

*** NoSuchMethodErrors during Tests

Most of the tests run fine, but I get a set of NoSuchMethodErrors like the following:

-------------------------------------------------------------------------------
Test set: com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual.ManualTriggerActionPermissionTest
-------------------------------------------------------------------------------
Tests run: 7, Failures: 0, Errors: 7, Skipped: 0, Time elapsed: 2.498 sec <<< FAILURE!
testGetGetUrlNameNotPermitted(com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual.ManualTriggerActionPermissionTest)  Time elapsed: 1.504 sec  <<< ERROR!
com.google.inject.CreationException: Guice creation errors:

1) Error injecting method, java.lang.NoSuchMethodError: com.google.inject.Injector.getTypeConverterBindings()Ljava/util/List;
  at org.sonatype.guice.plexus.converters.PlexusXmlBeanConverter.setTypeConverterBindings(Unknown Source)
  at org.codehaus.plexus.DefaultPlexusContainer$SetupModule.configure(DefaultPlexusContainer.java:781)

1 error
        at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435)
        at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:175)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
        at com.google.inject.Guice.createInjector(Guice.java:95)
        at com.google.inject.Guice.createInjector(Guice.java:72)
        at com.google.inject.Guice.createInjector(Guice.java:62)
        at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:456)
        at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:190)
        at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:149)
        at hudson.maven.MavenEmbedderUtils.buildPlexusContainer(MavenEmbedderUtils.java:148)
        at hudson.maven.MavenEmbedderUtils.buildPlexusContainer(MavenEmbedderUtils.java:141)
        at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:111)
        at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:138)
        at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritPluginTestCase$1.decorateHome(GerritPluginTestCase.java:68)
        at org.jvnet.hudson.test.HudsonTestCase.newHudson(HudsonTestCase.java:377)
        at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:240)
        at junit.framework.TestCase.runBare(TestCase.java:132)
        at org.jvnet.hudson.test.HudsonTestCase.runBare(HudsonTestCase.java:220)
        at junit.framework.TestResult$1.protect(TestResult.java:110)

PlexusXmlBeanConverter comes from sisu-inject-plexus-1.4.3.1.
Injector comes from sisu-guice-3.03-no_aop

Here's the dependency information from m2e:


That doesn't seem good!

Any ideas?

Brian.

Back to the top