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

Regex Problem #82

Closed
silvanopessoa opened this issue Nov 25, 2015 · 3 comments
Closed

Regex Problem #82

silvanopessoa opened this issue Nov 25, 2015 · 3 comments

Comments

@silvanopessoa
Copy link

Regex invalid?

    Fixture.of(User.class).addTemplate("valid", new Rule(){{
        add("name",regex("[A-Z]"));
    }});

Problem:

java.util.regex.PatternSyntaxException: Unclosed character class near index 3
[A-Z
^
at java.util.regex.Pattern.error(Pattern.java:1924)
at java.util.regex.Pattern.clazz(Pattern.java:2493)
at java.util.regex.Pattern.sequence(Pattern.java:2030)
at java.util.regex.Pattern.expr(Pattern.java:1964)
at java.util.regex.Pattern.compile(Pattern.java:1665)
at java.util.regex.Pattern.(Pattern.java:1337)
at java.util.regex.Pattern.compile(Pattern.java:1022)
at br.com.six2six.bfgex.interpreter.Parser.parse(Parser.java:34)
at br.com.six2six.bfgex.interpreter.Parser.parse(Parser.java:113)
at br.com.six2six.bfgex.RegexGen.of(RegexGen.java:8)
at br.com.six2six.fixturefactory.function.impl.RegexFunction.generateValue(RegexFunction.java:17)
at br.com.six2six.fixturefactory.Property.getValue(Property.java:37)
at br.com.six2six.fixturefactory.ObjectFactory.generateConstructorParamValue(ObjectFactory.java:180)
at br.com.six2six.fixturefactory.ObjectFactory.processArguments(ObjectFactory.java:208)
at br.com.six2six.fixturefactory.ObjectFactory.processConstructorArguments(ObjectFactory.java:186)
at br.com.six2six.fixturefactory.ObjectFactory.createObject(ObjectFactory.java:108)
at br.com.six2six.fixturefactory.ObjectFactory.createObjects(ObjectFactory.java:137)
at br.com.six2six.fixturefactory.ObjectFactory.gimme(ObjectFactory.java:71)
at br.com.six2six.fixturefactory.function.FixtureFunction.gimmeWithQuantity(FixtureFunction.java:65)
at br.com.six2six.fixturefactory.function.FixtureFunction.generate(FixtureFunction.java:56)
at br.com.six2six.fixturefactory.function.FixtureFunction.generateValue(FixtureFunction.java:45)
at br.com.six2six.fixturefactory.function.impl.AssociationFunctionImpl.generateValue(AssociationFunctionImpl.java:49)
at br.com.six2six.fixturefactory.Property.getValue(Property.java:45)
at br.com.six2six.fixturefactory.ObjectFactory.processPropertyValue(ObjectFactory.java:230)
at br.com.six2six.fixturefactory.ObjectFactory.createObject(ObjectFactory.java:116)
at br.com.six2six.fixturefactory.ObjectFactory.gimme(ObjectFactory.java:58)
at br.com.silvanopessoa.rest.model.UsuarioTest.loadUsuario(UsuarioTest.java:56)
at br.com.silvanopessoa.rest.model.UsuarioTest.deve_gerar_um_usuario_valido(UsuarioTest.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

@ahirata
Copy link
Member

ahirata commented Nov 25, 2015

@silvanopessoa Hi, can you check if you're using the latest version (3.1.0)? It is supposed to fix this problem.

@silvanopessoa
Copy link
Author

tks, problem fixed.

@nykolaslima
Copy link
Member

Thanks @silvanopessoa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants