Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot run tests #3

Closed
bogdanpredescu opened this issue May 26, 2016 · 2 comments
Closed

cannot run tests #3

bogdanpredescu opened this issue May 26, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@bogdanpredescu
Copy link

[ERROR] Failed to execute goal com.igormaznitsa:mvn-golang-wrapper:2.0.0:test (default-test) on project myproject: Execution default-test of goal com.igormaznitsa:mvn-golang-wrapper:2.0.0:test failed: String index out of range: -1
-> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.igormaznitsa:mvn-golang-wrapper:2.0.0:test (default-test) on project myproject: Execution default-test of goal com.igormaznitsa:mvn-golang-wrapper:2
.0.0:test failed: String index out of range: -1
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-test of goal com.igormaznitsa:mvn-golang-wrapper:2.0.0:test failed: String index out of range: -1
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1931)
at com.igormaznitsa.mvngolang.GolangTestMojo.getPackages(GolangTestMojo.java:72)
at com.igormaznitsa.mvngolang.AbstractPackageGolangMojo.getTailArguments(AbstractPackageGolangMojo.java:44)
at com.igormaznitsa.mvngolang.AbstractGolangMojo.prepareExecutor(AbstractGolangMojo.java:1047)
at com.igormaznitsa.mvngolang.AbstractGolangMojo.execute(AbstractGolangMojo.java:863)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
... 20 more

@raydac
Copy link
Owner

raydac commented May 26, 2016

what is the absolute path to folder with tests? and what is the OS?

@raydac raydac added the bug label May 26, 2016
@raydac raydac self-assigned this May 26, 2016
@bogdanpredescu
Copy link
Author

bogdanpredescu commented May 26, 2016

D:\workspace\mymavenparentproject\myproject\src\program
in case you suspect the path's length, the actual project names are shorter.

Windows 7

It's a very basic project following the example available here on the site (math.go)

In the "program" folder there are two files:

program. go

and

program_test.go which has this content (it actually doesn't test anything from the other file) :

package main

import (
"testing"
)

func TestHelloWorld(t *testing.T) {
str := HelloWorld("xxx")
if str != "xxx" {
t.Fail()
}

}

@raydac raydac added this to the 2.0.1 milestone May 26, 2016
@raydac raydac closed this as completed in 88c11c6 May 26, 2016
@raydac raydac added this to the 2.1.0 milestone May 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants