| 1 | /* |
| 2 | * Created on Sep 18, 2004 |
| 3 | * |
| 4 | * FIXME To change the template for this generated file go to |
| 5 | * Window - Preferences - Java - Code Style - Code Templates |
| 6 | */ |
| 7 | package biz.xsoftware.buildtemplate.test; |
| 8 | |
| 9 | import java.io.File; |
| 10 | |
| 11 | import biz.xsoftware.buildtemplate.Exit; |
| 12 | import biz.xsoftware.buildtemplate.FileLocator; |
| 13 | import biz.xsoftware.buildtemplate.Main; |
| 14 | import biz.xsoftware.buildtemplate.Version; |
| 15 | import biz.xsoftware.mock.MockObject; |
| 16 | import biz.xsoftware.mock.MockObjectFactory; |
| 17 | |
| 18 | /** |
| 19 | * @author Dean Hiller |
| 20 | * |
| 21 | * FIXME To change the template for this generated type comment go to |
| 22 | * Window - Preferences - Java - Code Style - Code Templates |
| 23 | */ |
| 24 | public class DummyRun { |
| 25 | |
| 26 | public final static String GETFILE = "getFile"; |
| 27 | public final static String GETVERSION = "getVersion"; |
| 28 | |
| 29 | public static void main(String[] args) throws Exception { |
| 30 | MockObject mock = MockObjectFactory.createMock(new Class[] {Version.class, Exit.class, FileLocator.class}); |
| 31 | Main m = new Main(); |
| 32 | m.setFileLocator((FileLocator)mock); |
| 33 | m.setVersion((Version)mock); |
| 34 | if(args.length > 0 && "testing".equals(args[0])) |
| 35 | m.setExit((Exit)mock); |
| 36 | |
| 37 | mock.addReturnValue(GETFILE, "tools"+File.separator+"buildtemplate.jar"); |
| 38 | mock.addReturnValue(GETVERSION, "r1-0-0"); //pretend it is release r1-0-0 |
| 39 | |
| 40 | m.start(new String[] {"-installed", "clean"}); |
| 41 | m.shutdown(); |
| 42 | } |
| 43 | } |