Advertisement
Guest User

Untitled

a guest
Sep 24th, 2010
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. package com.kdeveloper.javaBBCode.parser;
  2.  
  3. import org.junit.Test;
  4. import static org.junit.Assert.*;
  5.  
  6. public class BBCodeParserTest {
  7.  
  8.     /**
  9.      * Test of parse method, of class BBCodeParser.
  10.      */
  11.     @Test
  12.     public void testParse_String() throws Exception {
  13.  
  14.         // ERROR:
  15.         doParse("a[b]aa[/b]aa[b]aa[/b]aaa");
  16.  
  17.         // OK:
  18.         doParse("aa[b]aa[/b]aa[b]aa[/b]aaa");
  19.  
  20.         assertTrue(true);
  21.     }
  22.  
  23.     public String doParse(String text) throws Exception {
  24.         System.out.println("in:");
  25.         System.out.println(text);
  26.         System.out.println("out:");
  27.         BBCodeParser parser = new BBCodeParser(text);
  28.         String value =  parser.parse();
  29.         System.out.println(value);
  30.         System.out.println("-----------------------------------");
  31.         return value;
  32.     }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement