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

Create RandomText #790

Closed
krzyk opened this issue Apr 27, 2018 · 25 comments
Closed

Create RandomText #790

krzyk opened this issue Apr 27, 2018 · 25 comments

Comments

@krzyk
Copy link
Contributor

krzyk commented Apr 27, 2018

Random strings are quite common in unit tests where one has to produce some kind of a string into TextOf, that is not important in itself.

E.g.:

    new InputOf(
        new BytesOf(
            new TextOf("Hello, друг!")
        )
    )

Could be replaced with:

    new InputOf(
        new BytesOf(
            new RandomText()
        )
    )

RandomText should have two consructors:

  • no-arg - producing random text from ASCII printable characters
  • accepting List - will produce a random text from given list of characters

Each of the above should optionally accept an integer that will be the length of the text generated, without this number RandomText should generate the text with random number of characters.

@0crat
Copy link
Collaborator

0crat commented Apr 27, 2018

@llorllale/z please, pay attention to this issue

@llorllale
Copy link
Contributor

@krzyk good idea, but why have ASCII-only versions?

@krzyk
Copy link
Contributor Author

krzyk commented Apr 28, 2018

@llorllale Well, yeah, I'm just not sure how to limit the number of chars, to make it usefull, there are very limited cases when one would want control characters, so I would limit it to printable ones (new PrintableRndText?) and make new RandomText include all UTF chars?

@llorllale
Copy link
Contributor

@krzyk aren't all utf chars printable?

@krzyk
Copy link
Contributor Author

krzyk commented Apr 28, 2018

@llorllale No, Unicode includes ASCII, and in ASCII you have multiple control characters so by that definition not all are printable (a sample at http://www.utf8-chartable.de/).

@krzyk
Copy link
Contributor Author

krzyk commented May 1, 2018

@llorllale so what's your decision?

@llorllale
Copy link
Contributor

@krzyk I'm thinking just RandomText that will accept an Iterable<Character>.

RandomText can have a default, no-arg ctor with, say, the ASCII printable characters. WDYT?

@krzyk
Copy link
Contributor Author

krzyk commented May 1, 2018

@llorllale Yes it makes sense, I'm only wondering if we want Iterable, choosing a number at random requires ... random access which is given only by List. So either we will be reading the whole Iterable into a List or we could force users to provide a List already.

@llorllale
Copy link
Contributor

@krzyk you're right, let's have a List<Character> instead, thanks

@llorllale
Copy link
Contributor

@krzyk can you modify the description to fit the new requirement?

@krzyk
Copy link
Contributor Author

krzyk commented May 2, 2018

@llorllale done, I also added info about the length of the generated text, we didn't discuss that. It is quite common to limit the length of the text.

@llorllale
Copy link
Contributor

@0crat in

@0crat
Copy link
Collaborator

0crat commented May 2, 2018

There is an unrecoverable failure on my side. Please, submit it here:

PID: 4@ab56d234-9c5a-4a94-9bc9-5e54c14be93d, thread: BkParallel-7
com.mongodb.MongoCollectionImpl[558] com.mongodb.MongoWriteException: quota exceeded

1.0-SNAPSHOT

@0crat
Copy link
Collaborator

0crat commented May 2, 2018

@0crat in (here)

@llorllale Job #790 is now in scope, role is DEV

@llorllale llorllale added the scope label May 2, 2018
@0crat
Copy link
Collaborator

0crat commented May 7, 2018

The job #790 assigned to @proshin-roman/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this

@proshin-roman
Copy link
Contributor

@krzyk The issue has been fixed by pull request #830 that is already merged. Please, close the ticket.

@krzyk
Copy link
Contributor Author

krzyk commented May 8, 2018

@proshin-roman thanks

@krzyk krzyk closed this as completed May 8, 2018
@0crat
Copy link
Collaborator

0crat commented May 8, 2018

@elenavolokhova/z please review this job completed by @proshin-roman/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed

@0crat 0crat removed the scope label May 8, 2018
@0crat
Copy link
Collaborator

0crat commented May 8, 2018

The job #790 is now out of scope

@elenavolokhova
Copy link

@0crat quality good

@0crat
Copy link
Collaborator

0crat commented May 9, 2018

There is an unrecoverable failure on my side. Please, submit it here:

PID: 4@061d9217-0663-479c-8054-de2e25653967, thread: BkParallel-6
com.zerocracy.pm.Claims[112] java.lang.IllegalStateException: Duplicate claims are not allowed in [C63314D6Z](https://www.0crat.com/p/C63314D6Z), can't add this XML to 9 existing ones:
<?xml version="1.0" encoding="UTF-8"?>
<claim id="1290872388">
   <created>2018-05-09T08:54:06.978Z</created>
   <type>Complete `QA` review</type>
   <params>
      <param name="quality">good</param>
      <param name="job">gh:yegor256/cactoos#790</param>
      <param name="repo">yegor256/cactoos</param>
      <param name="issue">790</param>
      <param name="comment">387669592</param>
   </params>
   <token>github;yegor256/cactoos;790;387669592</token>
   <author>elenavolokhova</author>
</claim>

1.0-SNAPSHOT: Issue: #790, Comment: 387669592

@0crat
Copy link
Collaborator

0crat commented May 9, 2018

@0crat quality good (here)

@elenavolokhova Thanks, but quality review is not required in this job

@0crat
Copy link
Collaborator

0crat commented May 9, 2018

Order was finished, quality is "good": +35 point(s) just awarded to @proshin-roman/z

paulodamaso pushed a commit to paulodamaso/cactoos that referenced this issue May 9, 2018
paulodamaso pushed a commit to paulodamaso/cactoos that referenced this issue May 9, 2018
paulodamaso pushed a commit to paulodamaso/cactoos that referenced this issue May 9, 2018
Vatavuk pushed a commit to Vatavuk/cactoos that referenced this issue May 9, 2018
Vatavuk pushed a commit to Vatavuk/cactoos that referenced this issue May 9, 2018
Vatavuk pushed a commit to Vatavuk/cactoos that referenced this issue May 9, 2018
@yegor256
Copy link
Owner

@0crat status

@0crat
Copy link
Collaborator

0crat commented May 21, 2018

@0crat status (here)

@yegor256 This is what I know about this job, as in §32:

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

No branches or pull requests

6 participants