You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Main.java 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* $Id$ */
  17. package org.apache.fop.threading;
  18. import java.io.File;
  19. import org.apache.avalon.framework.ExceptionUtil;
  20. import org.apache.avalon.framework.configuration.Configuration;
  21. import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
  22. import org.apache.avalon.framework.container.ContainerUtil;
  23. import org.apache.avalon.framework.logger.ConsoleLogger;
  24. public class Main {
  25. public static void main(String[] args) {
  26. try {
  27. //Read configuration
  28. File cfgFile = new File(args[0]);
  29. DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
  30. Configuration cfg = builder.buildFromFile(cfgFile);
  31. //Setup testbed
  32. FOPTestbed testbed = new FOPTestbed();
  33. ContainerUtil.enableLogging(testbed, new ConsoleLogger(ConsoleLogger.LEVEL_INFO));
  34. ContainerUtil.configure(testbed, cfg);
  35. ContainerUtil.initialize(testbed);
  36. //Start tests
  37. testbed.doStressTest();
  38. System.exit(0);
  39. } catch (Exception e) {
  40. System.err.println(ExceptionUtil.printStackTrace(e));
  41. System.exit(-1);
  42. }
  43. }
  44. }