JeffGrigg

NumberOfBottlesOfBeerOnTheWallTest

Feb 17th, 2020
11,351
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 4.29 KB | None | 0 0
  1. import junit.framework.TestCase;
  2.  
  3. import java.io.ByteArrayOutputStream;
  4. import java.io.PrintStream;
  5.  
  6. public class NumberOfBottlesOfBeerOnTheWallTest extends TestCase {
  7.  
  8.     private static final String NL = System.lineSeparator();
  9.  
  10.     public void testZeroBottlesOfBeerOnTheWall() {
  11.         final String actualOutput = captureStandardOutput(() -> NumberOfBottlesOfBeerOnTheWall.singNumberOfBottlesOfBeerOnTheWall(0));
  12.  
  13.         assertEquals(
  14.                 "No bottles of beer" + " on the wall. "
  15.                         + "No bottles of beer. "
  16.                         + "There are no more to pass around. "
  17.                         + "No bottles of beer" + " on the wall." + NL,
  18.                 actualOutput);
  19.     }
  20.  
  21.     public void testOneBottleOfBeerOnTheWall() {
  22.         final String actualOutput = captureStandardOutput(() -> NumberOfBottlesOfBeerOnTheWall.singNumberOfBottlesOfBeerOnTheWall(1));
  23.  
  24.         assertEquals(
  25.                 "1 bottle of beer on the wall. "
  26.                         + "1 bottle of beer. "
  27.                         + "Take it down and pass it around. "
  28.                         + "No bottles of beer" + " on the wall." + NL
  29.                         //
  30.                         + "No bottles of beer" + " on the wall. "
  31.                         + "No bottles of beer. "
  32.                         + "There are no more to pass around. "
  33.                         + "No bottles of beer" + " on the wall." + NL,
  34.                 actualOutput);
  35.     }
  36.  
  37.     public void testTwoBottleOfBeerOnTheWall() {
  38.         final String actualOutput = captureStandardOutput(() -> NumberOfBottlesOfBeerOnTheWall.singNumberOfBottlesOfBeerOnTheWall(2));
  39.  
  40.         assertEquals(
  41.                 "2 bottles of beer" + " on the wall. "
  42.                         + "2 bottles of beer. "
  43.                         + "Take one down and pass it around. "
  44.                         + "1 bottle of beer on the wall." + NL
  45.                         //
  46.                         + "1 bottle of beer on the wall. "
  47.                         + "1 bottle of beer. "
  48.                         + "Take it down and pass it around. "
  49.                         + "No bottles of beer" + " on the wall." + NL
  50.                         //
  51.                         + "No bottles of beer" + " on the wall. "
  52.                         + "No bottles of beer. "
  53.                         + "There are no more to pass around. "
  54.                         + "No bottles of beer" + " on the wall." + NL,
  55.                 actualOutput);
  56.     }
  57.  
  58.     public void testThreeBottleOfBeerOnTheWall() {
  59.         final String actualOutput = captureStandardOutput(() -> NumberOfBottlesOfBeerOnTheWall.singNumberOfBottlesOfBeerOnTheWall(3));
  60.  
  61.         assertEquals(
  62.                 "3 bottles of beer on the wall. "
  63.                         + "3 bottles of beer. "
  64.                         + "Take one down and pass it around. "
  65.                         + "2 bottles of beer on the wall." + NL
  66.                         //
  67.                         + "2 bottles of beer" + " on the wall. "
  68.                         + "2 bottles of beer. "
  69.                         + "Take one down and pass it around. "
  70.                         + "1 bottle of beer on the wall." + NL
  71.                         //
  72.                         + "1 bottle of beer on the wall. "
  73.                         + "1 bottle of beer. "
  74.                         + "Take it down and pass it around. "
  75.                         + "No bottles of beer" + " on the wall." + NL
  76.                         //
  77.                         + "No bottles of beer" + " on the wall. "
  78.                         + "No bottles of beer. "
  79.                         + "There are no more to pass around. "
  80.                         + "No bottles of beer" + " on the wall." + NL,
  81.                 actualOutput);
  82.     }
  83.  
  84.     private String captureStandardOutput(final Runnable callback) {
  85.         final PrintStream oldSystemOut = System.out;
  86.         final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
  87.         final PrintStream printStream = new PrintStream(byteArrayOutputStream);
  88.         System.setOut(printStream);
  89.         try {
  90.             callback.run();
  91.         } finally {
  92.             System.setOut(oldSystemOut);
  93.             printStream.close();
  94.         }
  95.  
  96.         return byteArrayOutputStream.toString();
  97.     }
  98.  
  99. }
Advertisement
Comments
  • User was banned
  • Xorfidar
    213 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • User was banned
Add Comment
Please, Sign In to add comment