kandi background
Explore Kits

easy-random | The simple , stupid random Java beans/records generator | Generator Utils library

 by   j-easy Java Version: easy-random-5.0.0 License: MIT

 by   j-easy Java Version: easy-random-5.0.0 License: MIT

Download this library from

kandi X-RAY | easy-random Summary

easy-random is a Java library typically used in Generator, Generator Utils, Unity applications. easy-random has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub, Maven.
Easy Random is a library that generates random Java beans. You can think of it as an ObjectMother for the JVM. Let's say you have a class Person and you want to generate a random instance of it, here we go:. The method EasyRandom#nextObject is able to generate random instances of any given type.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • easy-random has a medium active ecosystem.
  • It has 1133 star(s) with 168 fork(s). There are 42 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 9 open issues and 276 have been closed. On average issues are closed in 104 days. There are no pull requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of easy-random is easy-random-5.0.0
easy-random Support
Best in #Generator Utils
Average in #Generator Utils
easy-random Support
Best in #Generator Utils
Average in #Generator Utils

quality kandi Quality

  • easy-random has 0 bugs and 0 code smells.
easy-random Quality
Best in #Generator Utils
Average in #Generator Utils
easy-random Quality
Best in #Generator Utils
Average in #Generator Utils

securitySecurity

  • easy-random has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • easy-random code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
easy-random Security
Best in #Generator Utils
Average in #Generator Utils
easy-random Security
Best in #Generator Utils
Average in #Generator Utils

license License

  • easy-random is licensed under the MIT License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
easy-random License
Best in #Generator Utils
Average in #Generator Utils
easy-random License
Best in #Generator Utils
Average in #Generator Utils

buildReuse

  • easy-random releases are available to install and integrate.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • It has 13882 lines of code, 2082 functions and 329 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
easy-random Reuse
Best in #Generator Utils
Average in #Generator Utils
easy-random Reuse
Best in #Generator Utils
Average in #Generator Utils
Top functions reviewed by kandi - BETA

kandi has reviewed easy-random and discovered the below as its top functions. This is intended to give you an instant insight into easy-random implemented functionality, and help decide if they suit your requirements.

  • Creates a new instance of the given type .
    • Checks if is a primitive field with default value .
      • Generate a random value .
        • Copy parameters .
          • Creates a new instance of the specified type .
            • Convert a string value to the target type .
              • Returns a list of all printable characters of a given charset .
                • Retrieves a randomizer for a given field .
                  • Gets the random bean .
                    • Returns true if the field should be excluded .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      easy-random Key Features

                      The simple, stupid random Java beans/records generator

                      easy-random Examples and Code Snippets

                      See all related Code Snippets

                      What is Easy Random ?

                      copy iconCopydownload iconDownload
                      EasyRandom easyRandom = new EasyRandom();
                      Person person = easyRandom.nextObject(Person.class);
                      

                      What is this EasyRandom API ?

                      copy iconCopydownload iconDownload
                      EasyRandomParameters parameters = new EasyRandomParameters()
                         .seed(123L)
                         .objectPoolSize(100)
                         .randomizationDepth(3)
                         .charset(forName("UTF-8"))
                         .timeRange(nine, five)
                         .dateRange(today, tomorrow)
                         .stringLengthRange(5, 50)
                         .collectionSizeRange(1, 10)
                         .scanClasspathForConcreteTypes(true)
                         .overrideDefaultInitialization(false)
                         .ignoreRandomizationErrors(true);
                      
                      EasyRandom easyRandom = new EasyRandom(parameters);
                      

                      Why Easy Random ?

                      copy iconCopydownload iconDownload
                      Street street = new Street(12, (byte) 1, "Oxford street");
                      Address address = new Address(street, "123456", "London", "United Kingdom");
                      Person person = new Person("Foo", "Bar", "foo.bar@gmail.com", Gender.MALE, address);
                      

                      How can this be useful ?

                      copy iconCopydownload iconDownload
                      @org.junit.Test
                      public void testSortAlgorithm() {
                      
                         // Given
                         int[] ints = easyRandom.nextObject(int[].class);
                      
                         // When
                         int[] sortedInts = myAwesomeSortAlgo.sort(ints);
                      
                         // Then
                         assertThat(sortedInts).isSorted(); // fake assertion
                      
                      }
                      

                      Maven multiple modules with Spring Data JPA / Spring Boot / Log4j2

                      copy iconCopydownload iconDownload
                      mvn dependency:tree
                      

                      See all related Code Snippets

                      Community Discussions

                      Trending Discussions on easy-random
                      • Maven multiple modules with Spring Data JPA / Spring Boot / Log4j2
                      Trending Discussions on easy-random

                      QUESTION

                      Maven multiple modules with Spring Data JPA / Spring Boot / Log4j2

                      Asked 2020-Mar-24 at 09:48

                      I'm split a spring project with Spring Data JPA into multiple modules

                      • project-root-folder

                        • project-data
                          • src/main/java/project.test/App.java
                          • src/main/ressources/log4j2.xml
                          • pom.xml
                        • project-ui
                          • src/main/java/project.test/App.java
                          • src/main/ressources/log4j2.xml
                          • pom.xml
                      • pom.xml

                      project-root-folder/pom.xml

                      <?xml version="1.0" encoding="UTF-8"?>
                      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
                          <modelVersion>4.0.0</modelVersion>
                      
                          <groupId>project.test</groupId>
                          <artifactId>testapp</artifactId>
                          <version>0.0.1</version>
                          <name>testapp </name>
                          <description>...</description>
                      
                          <modules>
                              <module>project-data</module>
                              <module>project-ui</module>
                          </modules>
                      
                          <packaging>pom</packaging>
                      
                          <parent>
                              <groupId>org.springframework.boot</groupId>
                              <artifactId>spring-boot-starter-parent</artifactId>
                              <version>2.2.5.RELEASE</version>
                              <relativePath/> <!-- lookup parent from repository -->
                          </parent>
                      
                          <properties>
                              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                              <java.version>13</java.version>
                              <maven.compiler.source>${java.version}</maven.compiler.source>
                              <maven.compiler.target>${java.version}</maven.compiler.target>
                          </properties>
                      
                          <build>
                              <plugins>
                                  <plugin>
                                      <groupId>org.springframework.boot</groupId>
                                      <artifactId>spring-boot-maven-plugin</artifactId>
                                  </plugin>
                              </plugins>
                          </build>
                      </project>
                      

                      project-root-folder/project-data/pom.xml

                      <?xml version="1.0" encoding="UTF-8"?>
                      <project xmlns="http://maven.apache.org/POM/4.0.0"
                               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                          <parent>
                              <groupId>project.test</groupId>
                              <artifactId>testapp</artifactId>
                              <version>0.0.1</version>
                          </parent>
                          <modelVersion>4.0.0</modelVersion>
                      
                          <artifactId>project-data</artifactId>
                      
                          <properties>
                              <spring-boot.repackage.skip>false</spring-boot.repackage.skip>
                          </properties>
                      
                          <dependencies>
                              <dependency>
                                  <groupId>org.springframework.boot</groupId>
                                  <artifactId>spring-boot-starter-data-jpa</artifactId>
                                  <exclusions>
                                      <exclusion>
                                          <groupId>org.springframework.boot</groupId>
                                          <artifactId>spring-boot-starter-logging</artifactId>
                                      </exclusion>
                                  </exclusions>
                              </dependency>
                              <dependency>
                                  <groupId>org.springframework.boot</groupId>
                                  <artifactId>spring-boot-starter-log4j2</artifactId>
                              </dependency>
                      
                              <dependency>
                                  <groupId>org.springframework.boot</groupId>
                                  <artifactId>spring-boot-starter-test</artifactId>
                                  <scope>test</scope>
                                  <exclusions>
                                      <exclusion>
                                          <groupId>org.junit.vintage</groupId>
                                          <artifactId>junit-vintage-engine</artifactId>
                                      </exclusion>
                                  </exclusions>
                              </dependency>
                          </dependencies>
                      
                          <build>
                              <plugins>
                                  <plugin>
                                      <groupId>org.springframework.boot</groupId>
                                      <artifactId>spring-boot-maven-plugin</artifactId>
                                      <executions>
                                          <execution>
                                              <goals>
                                                  <goal>repackage</goal>
                                              </goals>
                                          </execution>
                                      </executions>
                                  </plugin>
                              </plugins>
                          </build>
                      </project>
                      

                      myproject-root-folder/project-ui/pom.xml

                      <?xml version="1.0" encoding="UTF-8"?>
                      <project xmlns="http://maven.apache.org/POM/4.0.0"
                               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                          <parent>
                              <groupId>project.test</groupId>
                              <artifactId>testapp</artifactId>
                              <version>0.0.1</version>
                          </parent>
                          <modelVersion>4.0.0</modelVersion>
                      
                          <artifactId>project-ui</artifactId>
                      
                          <dependencies>
                              <dependency>
                                  <groupId>project.test</groupId>
                                  <artifactId>project-data</artifactId>
                                  <version>0.0.1</version>
                              </dependency>
                      
                              <dependency>
                                  <groupId>org.springframework.boot</groupId>
                                  <artifactId>spring-boot-starter</artifactId>
                                  <exclusions>
                                      <exclusion>
                                          <groupId>org.springframework.boot</groupId>
                                          <artifactId>spring-boot-starter-logging</artifactId>
                                      </exclusion>
                                  </exclusions>
                              </dependency>
                      
                              <dependency>
                                  <groupId>org.openjfx</groupId>
                                  <artifactId>javafx-fxml</artifactId>
                                  <version>11.0.2</version>
                              </dependency>
                              <dependency>
                                  <groupId>org.openjfx</groupId>
                                  <artifactId>javafx-controls</artifactId>
                                  <version>11.0.2</version>
                              </dependency>
                              <dependency>
                                  <groupId>net.rgielen</groupId>
                                  <artifactId>javafx-weaver-spring-boot-starter</artifactId>
                                  <version>1.3.0</version>
                              </dependency>
                      
                              <dependency>
                                  <groupId>org.springframework.boot</groupId>
                                  <artifactId>spring-boot-configuration-processor</artifactId>
                                  <optional>true</optional>
                              </dependency>
                      
                              <dependency>
                                  <groupId>org.springframework.boot</groupId>
                                  <artifactId>spring-boot-starter-test</artifactId>
                                  <scope>test</scope>
                                  <exclusions>
                                      <exclusion>
                                          <groupId>org.junit.vintage</groupId>
                                          <artifactId>junit-vintage-engine</artifactId>
                                      </exclusion>
                                  </exclusions>
                              </dependency>
                          </dependencies>
                      
                          <build>
                              <plugins>
                                  <plugin>
                                      <groupId>org.springframework.boot</groupId>
                                      <artifactId>spring-boot-maven-plugin</artifactId>
                                      <executions>
                                          <execution>
                                              <goals>
                                                  <goal>repackage</goal>
                                              </goals>
                                          </execution>
                                          <execution>
                                              <id>build-info</id>
                                              <goals>
                                                  <goal>build-info</goal>
                                              </goals>
                                          </execution>
                                      </executions>
                                  </plugin>
                              </plugins>
                          </build>
                      </project>
                      

                      i want to run project-data/app.java which leads to

                      SLF4J: Class path contains multiple SLF4J bindings.
                      SLF4J: Found binding in [jar:file:/C:/Users/kk/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.12.1/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
                      SLF4J: Found binding in [jar:file:/C:/Users/kk/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
                      SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
                      SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
                      Exception in thread "main" java.lang.ExceptionInInitializerError
                      Caused by: org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j
                          at org.apache.logging.slf4j.Log4jLoggerFactory.validateContext(Log4jLoggerFactory.java:49)
                          at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:39)
                          at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:30)
                          at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:54)
                          at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:30)
                          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
                          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
                          at project.test.App.<clinit>(App.java:11)
                      

                      A clean solution would be nice. Thank you.

                      INFO in a fresh generated single project from scratch with the pom similar to that project-root-folder/project-data/pom.xml above, that project is working fine...

                      <?xml version="1.0" encoding="UTF-8"?>
                      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
                          <modelVersion>4.0.0</modelVersion>
                          <parent>
                              <groupId>org.springframework.boot</groupId>
                              <artifactId>spring-boot-starter-parent</artifactId>
                              <version>2.2.5.RELEASE</version>
                              <relativePath/> <!-- lookup parent from repository -->
                          </parent>
                          <groupId>com.example</groupId>
                          <artifactId>demo</artifactId>
                          <version>0.0.1-SNAPSHOT</version>
                          <name>demo</name>
                          <description>Demo project for Spring Boot</description>
                      
                          <properties>
                              <java.version>11</java.version>
                          </properties>
                      
                          <dependencies>
                              <dependency>
                                  <groupId>org.springframework.boot</groupId>
                                  <artifactId>spring-boot-starter</artifactId>
                                  <exclusions>
                                      <exclusion>
                                          <groupId>org.springframework.boot</groupId>
                                          <artifactId>spring-boot-starter-logging</artifactId>
                                      </exclusion>
                                  </exclusions>
                              </dependency>
                              <dependency>
                                  <groupId>org.springframework.boot</groupId>
                                  <artifactId>spring-boot-starter-log4j2</artifactId>
                              </dependency>
                              <dependency>
                                  <groupId>com.getsentry.raven</groupId>
                                  <artifactId>raven-log4j2</artifactId>
                                  <version>7.8.0</version>
                              </dependency>
                      
                              <dependency>
                                  <groupId>org.springframework.boot</groupId>
                                  <artifactId>spring-boot-starter-test</artifactId>
                                  <scope>test</scope>
                                  <exclusions>
                                      <exclusion>
                                          <groupId>org.junit.vintage</groupId>
                                          <artifactId>junit-vintage-engine</artifactId>
                                      </exclusion>
                                  </exclusions>
                              </dependency>
                              <dependency>
                                  <groupId>org.jeasy</groupId>
                                  <artifactId>easy-random-core</artifactId>
                                  <scope>test</scope>
                                  <version>4.1.0</version>
                              </dependency>
                          </dependencies>
                      
                          <build>
                              <plugins>
                                  <plugin>
                                      <groupId>org.springframework.boot</groupId>
                                      <artifactId>spring-boot-maven-plugin</artifactId>
                                      <executions>
                                          <execution>
                                              <goals>
                                                  <goal>repackage</goal>
                                              </goals>
                                          </execution>
                                      </executions>
                                  </plugin>
                              </plugins>
                          </build>
                      </project>
                      

                      ANSWER

                      Answered 2020-Mar-24 at 09:48

                      There are multiple dependencies for a logger on your classpath. One (or more) will need to be excluded with an exclusion in the POM file. For some Spring Boot starters, this is already the case in your example.

                      To check which (direct and transitive) dependencies are on your classpath, you can run the following Maven command:

                      mvn dependency:tree
                      

                      Make sure to only have a single logger dependency in this list.

                      On first sight, I think you will have to add an exclusion for spring-boot-starter-logging to spring-boot-starter-test.

                      Source https://stackoverflow.com/questions/60827783

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install easy-random

                      You can download it from GitHub, Maven.
                      You can use easy-random like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the easy-random component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                      Support

                      You are welcome to contribute to the project with pull requests on GitHub. Please note that Easy Random is in maintenance mode, which means only pull requests for bug fixes will be considered. If you believe you found a bug or have any question, please use the issue tracker.

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Explore Related Topics

                      Share this Page

                      share link
                      Consider Popular Generator Utils Libraries
                      Try Top Libraries by j-easy
                      Compare Generator Utils Libraries with Highest Support
                      Compare Generator Utils Libraries with Highest Quality
                      Compare Generator Utils Libraries with Highest Security
                      Compare Generator Utils Libraries with Permissive License
                      Compare Generator Utils Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.