Commit 800a2902 authored by Arpad Lovassy's avatar Arpad Lovassy
Browse files

fixed indentation


Signed-off-by: Arpad Lovassy's avatarzlovarp <arpad.lovassy@semcon.com>
parent 2afdff6b
...@@ -24,10 +24,10 @@ import org.junit.Test; ...@@ -24,10 +24,10 @@ import org.junit.Test;
* JniExecutorIllegalArgException is expected. * JniExecutorIllegalArgException is expected.
*/ */
public class HostControllerErrorIllegalArgTest { public class HostControllerErrorIllegalArgTest {
@Test @Test
public void testHostControllerConstructor() { public void testHostControllerConstructor() {
// working dir null // working dir null
try { try {
new HostController(null, null, TestConstants.EXECUTABLE); new HostController(null, null, TestConstants.EXECUTABLE);
...@@ -35,7 +35,7 @@ public class HostControllerErrorIllegalArgTest { ...@@ -35,7 +35,7 @@ public class HostControllerErrorIllegalArgTest {
} catch (JniExecutorIllegalArgumentException e) { } catch (JniExecutorIllegalArgumentException e) {
//expected //expected
} }
// executable null // executable null
try { try {
new HostController(null, TestConstants.WORKINGDIR, null); new HostController(null, TestConstants.WORKINGDIR, null);
...@@ -43,7 +43,7 @@ public class HostControllerErrorIllegalArgTest { ...@@ -43,7 +43,7 @@ public class HostControllerErrorIllegalArgTest {
} catch (JniExecutorIllegalArgumentException e) { } catch (JniExecutorIllegalArgumentException e) {
//expected //expected
} }
// working dir does NOT exist // working dir does NOT exist
try { try {
new HostController(null, TestConstants.WORKINGDIR + TestConstants.NONEXISTENTFILENAMEEXT, TestConstants.EXECUTABLE); new HostController(null, TestConstants.WORKINGDIR + TestConstants.NONEXISTENTFILENAMEEXT, TestConstants.EXECUTABLE);
...@@ -51,7 +51,7 @@ public class HostControllerErrorIllegalArgTest { ...@@ -51,7 +51,7 @@ public class HostControllerErrorIllegalArgTest {
} catch (JniExecutorIllegalArgumentException e) { } catch (JniExecutorIllegalArgumentException e) {
//expected //expected
} }
// working dir exists, but not a directory // working dir exists, but not a directory
try { try {
new HostController(null, TestConstants.EXISTS_BUT_NOT_DIR_WORKINGDIR, TestConstants.EXECUTABLE); new HostController(null, TestConstants.EXISTS_BUT_NOT_DIR_WORKINGDIR, TestConstants.EXECUTABLE);
...@@ -59,7 +59,7 @@ public class HostControllerErrorIllegalArgTest { ...@@ -59,7 +59,7 @@ public class HostControllerErrorIllegalArgTest {
} catch (JniExecutorIllegalArgumentException e) { } catch (JniExecutorIllegalArgumentException e) {
//expected //expected
} }
// executable does NOT exist // executable does NOT exist
try { try {
new HostController(null, TestConstants.WORKINGDIR, TestConstants.EXECUTABLE + TestConstants.NONEXISTENTFILENAMEEXT); new HostController(null, TestConstants.WORKINGDIR, TestConstants.EXECUTABLE + TestConstants.NONEXISTENTFILENAMEEXT);
...@@ -67,7 +67,7 @@ public class HostControllerErrorIllegalArgTest { ...@@ -67,7 +67,7 @@ public class HostControllerErrorIllegalArgTest {
} catch (JniExecutorIllegalArgumentException e) { } catch (JniExecutorIllegalArgumentException e) {
//expected //expected
} }
// executable exists, but not a file (it's a directory) // executable exists, but not a file (it's a directory)
try { try {
new HostController(null, TestConstants.EXISTS_BUT_NOT_FILE_WORKINGDIR, TestConstants.EXISTS_BUT_NOT_FILE_EXECUTABLE); new HostController(null, TestConstants.EXISTS_BUT_NOT_FILE_WORKINGDIR, TestConstants.EXISTS_BUT_NOT_FILE_EXECUTABLE);
......
...@@ -25,7 +25,7 @@ import org.junit.Test; ...@@ -25,7 +25,7 @@ import org.junit.Test;
* JniExecutorIllegalArgException is expected. * JniExecutorIllegalArgException is expected.
*/ */
public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTest { public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTest {
private void testIllegalArgAddHostController( final JniExecutor je ) { private void testIllegalArgAddHostController( final JniExecutor je ) {
try { try {
je.addHostController( null ); je.addHostController( null );
...@@ -36,7 +36,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -36,7 +36,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
fail(); fail();
} }
} }
private void testIllegalArgSetConfigFileName( final JniExecutor je ) { private void testIllegalArgSetConfigFileName( final JniExecutor je ) {
try { try {
je.setConfigFileName( null ); je.setConfigFileName( null );
...@@ -46,7 +46,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -46,7 +46,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
} catch (JniExecutorWrongStateException e) { } catch (JniExecutorWrongStateException e) {
fail(); fail();
} }
try { try {
je.setConfigFileName( "" ); je.setConfigFileName( "" );
fail("JniExecutorIllegalArgumentException expected"); fail("JniExecutorIllegalArgumentException expected");
...@@ -56,7 +56,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -56,7 +56,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
fail(); fail();
} }
} }
private void testIllegalArgSetObserver( final JniExecutor je, final TestData td ) { private void testIllegalArgSetObserver( final JniExecutor je, final TestData td ) {
try { try {
je.setObserver(td.mObserver); je.setObserver(td.mObserver);
...@@ -66,7 +66,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -66,7 +66,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
fail(); fail();
} }
} }
private void testIllegalArgExecuteControl( final JniExecutor je ) { private void testIllegalArgExecuteControl( final JniExecutor je ) {
try { try {
je.executeControl(null); je.executeControl(null);
...@@ -76,7 +76,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -76,7 +76,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
} catch (JniExecutorWrongStateException e) { } catch (JniExecutorWrongStateException e) {
fail(); fail();
} }
try { try {
je.executeControl(""); je.executeControl("");
fail("JniExecutorIllegalArgumentException expected"); fail("JniExecutorIllegalArgumentException expected");
...@@ -86,7 +86,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -86,7 +86,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
fail(); fail();
} }
} }
private void testIllegalArgExecuteTestcase( final JniExecutor je, final TestData td ) { private void testIllegalArgExecuteTestcase( final JniExecutor je, final TestData td ) {
try { try {
je.executeTestcase( null, td.mTestcases.get(0)); je.executeTestcase( null, td.mTestcases.get(0));
...@@ -121,7 +121,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -121,7 +121,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
fail(); fail();
} }
} }
private void testIllegalArgExecuteCfg( final JniExecutor je ) { private void testIllegalArgExecuteCfg( final JniExecutor je ) {
try { try {
je.executeCfg( -1 ); je.executeCfg( -1 );
...@@ -131,7 +131,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -131,7 +131,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
} catch (JniExecutorWrongStateException e) { } catch (JniExecutorWrongStateException e) {
fail(); fail();
} }
try { try {
final int executeCfgLen = je.getExecuteCfgLen(); final int executeCfgLen = je.getExecuteCfgLen();
je.executeCfg( executeCfgLen ); je.executeCfg( executeCfgLen );
...@@ -142,7 +142,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -142,7 +142,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
fail(); fail();
} }
} }
/** /**
* disconnected (before init()) * disconnected (before init())
*/ */
...@@ -150,7 +150,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -150,7 +150,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
public void testExecutorIllegalArgDisconnected() { public void testExecutorIllegalArgDisconnected() {
//nothing to test in disconnected state //nothing to test in disconnected state
} }
/** /**
* connected MC_INACTIVE state (after init()) * connected MC_INACTIVE state (after init())
*/ */
...@@ -165,12 +165,12 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -165,12 +165,12 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
testIllegalArgAddHostController(je); testIllegalArgAddHostController(je);
testIllegalArgSetConfigFileName(je); testIllegalArgSetConfigFileName(je);
testIllegalArgSetObserver(je, td); testIllegalArgSetObserver(je, td);
// -------------- // --------------
je.shutdownSession(); je.shutdownSession();
je.waitForCompletion(); je.waitForCompletion();
} }
/** /**
* MC_LISTENING state (after startSession()) * MC_LISTENING state (after startSession())
*/ */
...@@ -178,9 +178,9 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -178,9 +178,9 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
public void testExecutorIllegalArgListening() { public void testExecutorIllegalArgListening() {
final TestData td = createTestData1(); final TestData td = createTestData1();
final JniExecutor je = JniExecutor.getInstance(); final JniExecutor je = JniExecutor.getInstance();
gotoListening(je, td); gotoListening(je, td);
// we are now in MC_LISTENING, test all the functions, which has argument // we are now in MC_LISTENING, test all the functions, which has argument
testIllegalArgAddHostController(je); testIllegalArgAddHostController(je);
testIllegalArgSetObserver(je, td); testIllegalArgSetObserver(je, td);
...@@ -189,7 +189,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -189,7 +189,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
je.shutdownSession(); je.shutdownSession();
je.waitForCompletion(); je.waitForCompletion();
} }
/** /**
* MC_HC_CONNECTED after startHostControllers() * MC_HC_CONNECTED after startHostControllers()
*/ */
...@@ -197,9 +197,9 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -197,9 +197,9 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
public void testExecutorIllegalArgHcConnected() { public void testExecutorIllegalArgHcConnected() {
final TestData td = createTestData1(); final TestData td = createTestData1();
final JniExecutor je = JniExecutor.getInstance(); final JniExecutor je = JniExecutor.getInstance();
gotoHcConnected(je, td); gotoHcConnected(je, td);
// we are now in MC_HC_CONNECTED, test all the functions, which has argument // we are now in MC_HC_CONNECTED, test all the functions, which has argument
testIllegalArgSetObserver(je, td); testIllegalArgSetObserver(je, td);
...@@ -207,7 +207,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -207,7 +207,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
je.shutdownSession(); je.shutdownSession();
je.waitForCompletion(); je.waitForCompletion();
} }
/** /**
* MC_LISTENING_CONFIGURED state (after configure()) * MC_LISTENING_CONFIGURED state (after configure())
*/ */
...@@ -217,7 +217,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -217,7 +217,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
final JniExecutor je = JniExecutor.getInstance(); final JniExecutor je = JniExecutor.getInstance();
gotoListeningConfigured(je, td); gotoListeningConfigured(je, td);
// we are now in MC_LISTENING_CONFIGURED, test all the functions, which has argument // we are now in MC_LISTENING_CONFIGURED, test all the functions, which has argument
testIllegalArgAddHostController(je); testIllegalArgAddHostController(je);
testIllegalArgSetObserver(je, td); testIllegalArgSetObserver(je, td);
...@@ -226,7 +226,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -226,7 +226,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
je.shutdownSession(); je.shutdownSession();
je.waitForCompletion(); je.waitForCompletion();
} }
/** /**
* MC_ACTIVE after configure() * MC_ACTIVE after configure()
*/ */
...@@ -236,7 +236,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -236,7 +236,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
final JniExecutor je = JniExecutor.getInstance(); final JniExecutor je = JniExecutor.getInstance();
gotoActive(je, td); gotoActive(je, td);
// we are now in MC_ACTIVE, test all the functions, which has argument // we are now in MC_ACTIVE, test all the functions, which has argument
testIllegalArgSetObserver(je, td); testIllegalArgSetObserver(je, td);
...@@ -244,7 +244,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -244,7 +244,7 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
je.shutdownSession(); je.shutdownSession();
je.waitForCompletion(); je.waitForCompletion();
} }
/** /**
* MC_READY after createMTC() * MC_READY after createMTC()
*/ */
...@@ -252,15 +252,15 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe ...@@ -252,15 +252,15 @@ public class JniExecutorAsyncErrorIllegalArgTest extends JniExecutorAsyncErrorTe
public void testExecutorIllegalArgReady() { public void testExecutorIllegalArgReady() {
final TestData td = createTestData1(); final TestData td = createTestData1();
final JniExecutor je = JniExecutor.getInstance(); final JniExecutor je = JniExecutor.getInstance();
gotoReady(je, td); gotoReady(je, td);
// we are now in MC_READY, test all the functions, which has argument // we are now in MC_READY, test all the functions, which has argument
testIllegalArgSetObserver(je, td); testIllegalArgSetObserver(je, td);
testIllegalArgExecuteControl(je); testIllegalArgExecuteControl(je);
testIllegalArgExecuteTestcase(je, td); testIllegalArgExecuteTestcase(je, td);
testIllegalArgExecuteCfg(je); testIllegalArgExecuteCfg(je);
// -------------- // --------------
je.shutdownSession(); je.shutdownSession();
je.waitForCompletion(); je.waitForCompletion();
......
...@@ -34,7 +34,7 @@ import org.eclipse.titan.executorapi.util.Log; ...@@ -34,7 +34,7 @@ import org.eclipse.titan.executorapi.util.Log;
* Base class of asynchronous JniExecutor error tests. * Base class of asynchronous JniExecutor error tests.
*/ */
public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest { public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest {
/** /**
* structure to hold all the needed data to run tests * structure to hold all the needed data to run tests
* *
...@@ -46,7 +46,7 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest { ...@@ -46,7 +46,7 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest {
public List<String> mTestcases = null; public List<String> mTestcases = null;
public IJniExecutorObserver mObserver = null; public IJniExecutorObserver mObserver = null;
} }
protected TestData createTestData1() { protected TestData createTestData1() {
HostController hc1 = null; HostController hc1 = null;
try { try {
...@@ -59,10 +59,10 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest { ...@@ -59,10 +59,10 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest {
final List<String> testcases = new ArrayList<String>(); final List<String> testcases = new ArrayList<String>();
testcases.add(TestConstants.TESTCASE1); testcases.add(TestConstants.TESTCASE1);
testcases.add(TestConstants.TESTCASE2); testcases.add(TestConstants.TESTCASE2);
final JniExecutor je = JniExecutor.getInstance(); final JniExecutor je = JniExecutor.getInstance();
IJniExecutorObserver o1 = new Test1Observer(je, module, testcases); IJniExecutorObserver o1 = new Test1Observer(je, module, testcases);
TestData td = new TestData(); TestData td = new TestData();
td.mHc = hc1; td.mHc = hc1;
td.mCfgFileName = cfgFileName; td.mCfgFileName = cfgFileName;
...@@ -71,9 +71,9 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest { ...@@ -71,9 +71,9 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest {
td.mObserver = o1; td.mObserver = o1;
return td; return td;
} }
// functions to get to different states // functions to get to different states
protected void gotoInactive( final JniExecutor je, final TestData td ) { protected void gotoInactive( final JniExecutor je, final TestData td ) {
Log.fi(); Log.fi();
// get to connected MC_INACTIVE // get to connected MC_INACTIVE
...@@ -85,24 +85,24 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest { ...@@ -85,24 +85,24 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest {
} }
Log.fo(); Log.fo();
} }
protected void gotoListening( final JniExecutor je, final TestData td ) { protected void gotoListening( final JniExecutor je, final TestData td ) {
Log.fi(); Log.fi();
// get to MC_LISTENING // get to MC_LISTENING
gotoInactive(je, td); gotoInactive(je, td);
try { try {
TestUtil.assertState( McStateEnum.MC_INACTIVE ); TestUtil.assertState( McStateEnum.MC_INACTIVE );
je.addHostController( td.mHc ); je.addHostController( td.mHc );
TestUtil.assertState( McStateEnum.MC_INACTIVE ); TestUtil.assertState( McStateEnum.MC_INACTIVE );
je.setConfigFileName( td.mCfgFileName ); je.setConfigFileName( td.mCfgFileName );
TestUtil.assertState( McStateEnum.MC_INACTIVE ); TestUtil.assertState( McStateEnum.MC_INACTIVE );
je.setObserver(null); je.setObserver(null);
TestUtil.assertState( McStateEnum.MC_INACTIVE ); TestUtil.assertState( McStateEnum.MC_INACTIVE );
je.startSession(); je.startSession();
TestUtil.assertState( McStateEnum.MC_LISTENING ); TestUtil.assertState( McStateEnum.MC_LISTENING );
} catch (JniExecutorIllegalArgumentException | JniExecutorWrongStateException | JniExecutorStartSessionException e) { } catch (JniExecutorIllegalArgumentException | JniExecutorWrongStateException | JniExecutorStartSessionException e) {
...@@ -110,12 +110,12 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest { ...@@ -110,12 +110,12 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest {
} }
Log.fo(); Log.fo();
} }
protected void gotoListeningConfigured( final JniExecutor je, final TestData td ) { protected void gotoListeningConfigured( final JniExecutor je, final TestData td ) {
Log.fi(); Log.fi();
// get to MC_LISTENING_CONFIGURED // get to MC_LISTENING_CONFIGURED
gotoListening(je, td); gotoListening(je, td);
try { try {
TestUtil.assertState( McStateEnum.MC_LISTENING ); TestUtil.assertState( McStateEnum.MC_LISTENING );
final Object lock = new Object(); final Object lock = new Object();
...@@ -130,21 +130,21 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest { ...@@ -130,21 +130,21 @@ public abstract class JniExecutorAsyncErrorTest extends JniExecutorAsyncTest {
} }
Log.fo(); Log.fo();
} }
protected void gotoListeningWithoutAddHostController( final JniExecutor je, final TestData td ) { protected void gotoListeningWithoutAddHostController( final JniExecutor je, final TestData td ) {
Log.fi(); Log.fi();
// get to MC_LISTENING // get to MC_LISTENING
gotoInactive(je, td); gotoInactive(je, td);
try { try {
TestUtil.assertState( McStateEnum.MC_INACTIVE ); TestUtil.assertState( McStateEnum.MC_INACTIVE );
je.setConfigFileName( td.mCfgFileName ); je.setConfigFileName( td.mCfgFileName );
TestUtil.assertState( McStateEnum.MC_INACTIVE ); TestUtil.assertState( McStateEnum.MC_INACTIVE );
je.setObserver(null); je.setObserver(null);
TestUtil.assertState( McStateEnum.MC_INACTIVE ); TestUtil.assertState( McStateEnum.MC_INACTIVE );