/** * File: IzPackTest.java * * Initial version: Feb 14, 2007 * * Modifications: */ package izpacktest; import java.util.ResourceBundle; /** * @author rdg * */ public class IzPackTest { private static final String RESOURCE_BUNDLE = "resources.MyResources"; /** * */ public IzPackTest(String[] args) { System.out.println("This is the IzPack Test Application."); if (args.length < 3) { throw new IllegalArgumentException( "On or more of the three expected arguments are missing."); } else if (args.length > 3) { throw new IllegalArgumentException( "Two many arguments - three expected."); } String argument1 = args[0]; String argument2 = args[1]; String argument3 = args[2]; System.out.println("Argument1 = '" + argument1 + "'"); System.out.println("Argument2 = '" + argument2 + "'"); System.out.println("Argument3 = '" + argument3 + "'"); ResourceBundle myResources = ResourceBundle.getBundle(RESOURCE_BUNDLE); String resource1 = myResources.getString("Resource1"); String resource2 = myResources.getString("Resource2"); String resource3 = myResources.getString("Resource3"); if ((resource1 == null) || (resource2 == null) || (resource3 == null)) { throw new IllegalArgumentException( "One or more of the three expected resources are missing."); } System.out.println("Resource1 = '" + resource1 + "'"); System.out.println("Resource2 = '" + resource2 + "'"); System.out.println("Resource3 = '" + resource3 + "'"); System.out.println("Waiting a second ..."); try { Thread.sleep(1000); } catch (InterruptedException e) { } System.out.println("All done. Exiting."); } /** * @param args */ public static void main(String[] args) { new IzPackTest(args); } }