package org.jcon.test;

import org.jcon.util.GenLib;
import java.util.Calendar;

/**
 * java org.jcon.test.TestMisc
 */
public class TestMisc {

//---------- Initialization ------------------------------
public static void main(String args[]) {
    new TestMisc().testDateTime();
}
//---------- Public Methods ------------------------------
public void testDateTime() {
    String dateTime = GenLib.createCurrentDateTime();
    print("Current DateTime is: " + dateTime);
}    
public void testException() {
     IllegalArgumentException ex = new IllegalArgumentException("Test");   
     GenLib.exception("TestMisc.testException()",
         "Problem...", ex);
}    
public void testMaxStringLength() {
    // Max size? Out of memory at 1MB, default memory size.
    String chunk = "";
    String ten = "1234567890";

    for (int i = 1000; --i >= 0;) {
        chunk += ten;
    }

    String text = "";
    for (int i = 1; i < 10000; i++) {
        text += chunk;
        print("length = " + text.length());
    }
}
//---------- Private Methods -----------------------------

//--- Std
private static void print(String text) {
    System.out.println(text);
}

}
