587
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
package com.nokia.helium.imaker.tests;
|
|
18 |
|
|
19 |
import java.io.File;
|
628
|
20 |
|
587
|
21 |
import org.junit.Test;
|
628
|
22 |
|
587
|
23 |
import com.nokia.helium.imaker.utils.ParallelExecutor;
|
|
24 |
|
|
25 |
/**
|
|
26 |
* Basic testing of the ParallelExecutor
|
|
27 |
*
|
|
28 |
*/
|
|
29 |
public class TestParallelExecutor {
|
|
30 |
private File testdir = new File(System.getProperty("testdir"));
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Nothing should happen.
|
|
34 |
*/
|
|
35 |
@Test
|
|
36 |
public void executionWithNoArgs() {
|
|
37 |
String args[] = new String[0];
|
|
38 |
ParallelExecutor.main(args);
|
|
39 |
}
|
|
40 |
|
|
41 |
/**
|
|
42 |
* Will list current directory content twice.
|
|
43 |
*/
|
|
44 |
@Test
|
|
45 |
public void executionWithTextFile() {
|
|
46 |
String args[] = new String[1];
|
|
47 |
if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
|
|
48 |
args[0] = new File(testdir, "tests/parallelexecutor_data/windows.txt").getAbsolutePath();
|
|
49 |
} else {
|
|
50 |
args[0] = new File(testdir, "tests/parallelexecutor_data/linux.txt").getAbsolutePath();
|
|
51 |
}
|
|
52 |
ParallelExecutor.main(args);
|
|
53 |
}
|
|
54 |
|
|
55 |
}
|