Giter Club home page Giter Club logo

Comments (18)

serpro69 avatar serpro69 commented on May 14, 2024 1

Thanks @eugenio1590, I'll check it out.

from kotlin-faker.

eugenio1590 avatar eugenio1590 commented on May 14, 2024 1

I get the same error. You can close this issue for now if you want. Thanks for your help.

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

Hi. Thanks for reporting. I haven't tried using it in an Android project, but I'll look into it.

from kotlin-faker.

eugenio1590 avatar eugenio1590 commented on May 14, 2024

Hi. Thanks for reporting. I haven't tried using it in an Android project, but I'll look into it.

Perfect. Thanks.

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

I can't seem to reproduce this issue using latest Android Studio

I used this sample project to run the tests: https://github.com/android/testing-samples/tree/master/unit/BasicSample

And the test:

public class EmailValidatorTest {
    @Test
    public void testKotlinFaker() {
        Faker faker = new Faker();

        String name = faker.getInternet().email();
        System.out.println("name = " + name);
    }
}

prints out:

name = [email protected]

Process finished with exit code 0

Tried running both from command line and the IDE.
Can you provide a minimal reproducible example for the issue you're facing?

from kotlin-faker.

eugenio1590 avatar eugenio1590 commented on May 14, 2024

Hi @serpro69 , I replicated this issue on my android project but I do not have time now to replicate using another project of Android. I am sorry for that. But If you see this "test" project you can see the same problem. This is a maven project with spring. Please let me know if it is a missing dependency or if I need to use another version of the Faker library. Thanks.

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

I couldn't reproduce the issue with your test project either.

Here's the full output of the test run (I've added a printout for the name variable) which you can also see in the console output.

✓ ~/Projects/personal/clones/issues/maven-kotlin-faker→ ./mvnw clean test                                                                                                                                                           [17:11:16]
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ demo ---
[INFO] Deleting /home/sergio/Projects/personal/clones/issues/maven-kotlin-faker/target
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- kotlin-maven-plugin:1.3.61:compile (compile) @ demo ---
[INFO] Applied plugin: 'spring'
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/sergio/Projects/personal/clones/issues/maven-kotlin-faker/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ demo ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- kotlin-maven-plugin:1.3.61:test-compile (test-compile) @ demo ---
[INFO] Applied plugin: 'spring'
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ demo ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.example.demo.DemoApplicationTests
[email protected]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.058 s - in com.example.demo.DemoApplicationTests
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.051 s
[INFO] Finished at: 2020-02-06T17:11:25+01:00
[INFO] ------------------------------------------------------------------------

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

Could this #20 be related? Can you try explicitly setting the jackson-module-kotlin version to 2.10.1?

from kotlin-faker.

eugenio1590 avatar eugenio1590 commented on May 14, 2024

Ok, I am using Intellij to run the tests. I can try using the command line to verify it.

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

I tried both actually. But yes, it could be something wrong with your intellij setup.

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

I don't mind keeping it open for awhile, but I need more details to reproduce it.
I'll try to reproduce it on a VM box when I have some time. If it works there as well it must be something with your setup.

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

I've tried to reproduce it on a VM box with a spring-boot maven project and it works there as well, hence closing this as not reproducible.
Feel free to re-open if you can provide more details on how to reproduce this.

from kotlin-faker.

mcheung610 avatar mcheung610 commented on May 14, 2024

I ran into the same problem. I think this is a bug that only happens in the windows environment.

@serpro69 Is it possible to re-open this?

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

@mcheung610 , I've re-opened this, but I'm not sure how to reproduce it. I don't have a windows machine and virtualbox was broken in Ubuntu 2004 for me last time that I checked it. I'll try to check it once more when I have the time, but feel free to submit a PR for the fix also.
What version are you using?

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

@mcheung610 / @eugenio1590 , I've made another fix for android in #90 . Can you try to run latest version and see if this issue still persists with that fix?

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

This issue has been w/o action for quite some time now, so I'm going to close it.
If you still face problems with android @mcheung610 / @eugenio1590 - feel free to re-open.
Thanks

from kotlin-faker.

drindt avatar drindt commented on May 14, 2024

I have a maybe similar problem. By invoke faker.address.city() the stack trace is the result. It is clear to me that the compose tooling framework is a bit different to the instrumentation test. The question is why the others work but not the city()?

from kotlin-faker.

serpro69 avatar serpro69 commented on May 14, 2024

Hi @drindt ,
That looks strange. address.city() makes a call to Name provider (ref:

city:
- "#{city_prefix} #{Name.first_name}#{city_suffix}"
- "#{city_prefix} #{Name.first_name}"
- "#{Name.first_name}#{city_suffix}"
- "#{Name.last_name}#{city_suffix}"
), which for some reason is not found and hence the exception is thrown.
I suppose the "others" that do work for you don't invoke functions from other providers (like in this case address.city() will call i.e. name.firstName()), which is why they might work and city() not. The question is, why city() doesn't work... :)
Would you be able to provide an example repo where this can be reproduced?

from kotlin-faker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.