From 0e9f94e49be79f950bb65fb18d18a23447f81125 Mon Sep 17 00:00:00 2001 From: "golla.yadav@oracle.com" Date: Mon, 7 Mar 2022 08:10:15 -0800 Subject: [PATCH 1/6] 7903118: Sanity Tests - Adding four JavaTest GUI newly automated sanity test scripts --- .../Config_SaveEdit/Config_SaveEdit.java | 34 +++++ .../Sanity_Tests/Test_Config_Edit3.java | 119 ++++++++++++++++++ .../Sanity_Tests/Test_Config_Load1.java | 75 +++++++++++ .../Sanity_Tests/Test_Config_New1.java | 68 ++++++++++ .../Sanity_Tests/Test_Config_Save2.java | 89 +++++++++++++ 5 files changed, 385 insertions(+) create mode 100644 gui-tests/src/gui/src/jthtest/Config_SaveEdit/Config_SaveEdit.java create mode 100644 gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java create mode 100644 gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java create mode 100644 gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java create mode 100644 gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java diff --git a/gui-tests/src/gui/src/jthtest/Config_SaveEdit/Config_SaveEdit.java b/gui-tests/src/gui/src/jthtest/Config_SaveEdit/Config_SaveEdit.java new file mode 100644 index 00000000..b7363b65 --- /dev/null +++ b/gui-tests/src/gui/src/jthtest/Config_SaveEdit/Config_SaveEdit.java @@ -0,0 +1,34 @@ +/* + * $Id$ + * + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jthtest.Config_SaveEdit; + +import jthtest.ConfigTools; + +public class Config_SaveEdit extends ConfigTools { + +} diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java new file mode 100644 index 00000000..9565e7c0 --- /dev/null +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java @@ -0,0 +1,119 @@ +/* + * $Id$ + * + * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jthtest.Sanity_Tests; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; + +import org.junit.Test; +import org.junit.runner.JUnitCore; +import org.netbeans.jemmy.JemmyException; +import org.netbeans.jemmy.operators.JButtonOperator; +import org.netbeans.jemmy.operators.JDialogOperator; +import org.netbeans.jemmy.operators.JFrameOperator; +import org.netbeans.jemmy.operators.JTextFieldOperator; +import org.netbeans.jemmy.util.NameComponentChooser; + +import javax.swing.JTextField; + +import jthtest.Tools; +import jthtest.Config_Edit.Config_Edit; + +public class Test_Config_Edit3 extends Config_Edit { + public static void main(String[] args) { + JUnitCore.main("jthtest.gui.Sanity_Tests.Test_Config_Edit3"); + } + + /** + * This test case Verify that \"Done\" button in an empty Configuration Editor + * will bring up a Save Configuration file browser. + * + * @throws ClassNotFoundException If the class does not find it in the + * classpath. + * + * @throws InvocationTargetException Holds an exception thrown by an invoked + * method or constructor. + * + * @throws NoSuchMethodException Occurs when a method is called that exists + * at compile-time, but does not exist at + * runtime. + */ + @SuppressWarnings("deprecation") + @Test + public void testConfig_Edit7() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { + + startJavatestNewDesktop(); + JFrameOperator mainFrame = findMainFrame(); + openTestSuite(mainFrame); + createWorkDirInTemp(mainFrame); + + openConfigFile(openLoadConfigDialogByMenu(mainFrame), CONFIG_NAME); + waitForConfigurationLoading(mainFrame, CONFIG_NAME); + openConfigCreation(mainFrame); + JDialogOperator config = findConfigEditor(mainFrame); + + pushNextConfigEditor(config); + new JTextFieldOperator(config, new NameComponentChooser("str.txt")).typeText("some_jti"); + + pushDoneConfigEditor(config); + saveConfig(); + openConfigDialogByKey(mainFrame); + + if (!findConfigEditor(mainFrame).getTitle().contains("some_jti")) { + File f = new File(LOCAL_PATH + "jt_gui_test_temp_some_jti-this_file_will_be_deleted.jti"); + f.delete(); + throw new JemmyException("Wrong jti filename in config editor: " + findConfigEditor(mainFrame).getTitle()); + } + File f = new File(LOCAL_PATH + "jt_gui_test_temp_some_jti-this_file_will_be_deleted.jti"); + f.delete(); + } + + /** + * This method clicks on OK button on Save Configuration file browser and save + * the configuration (.jti) file. + * + * @throws IOException Input/Output exceptions (I/O), and they occur whenever an + * input or output operation is failed or interpreted. + */ + @SuppressWarnings("deprecation") + private void saveConfig() { + File f = new File(LOCAL_PATH + "jt_gui_test_temp_some_jti-this_file_will_be_deleted.jti"); + if (f.exists()) + f.delete(); + JDialogOperator save = new JDialogOperator(getExecResource("ce.okToClose.title")); + new JButtonOperator(save, "Ok").push(); + save = new JDialogOperator(getExecResource("ce.save.title")); + JTextFieldOperator tf; + + tf = new JTextFieldOperator( + (JTextField) Tools.getComponent(save, new String[] { "Folder name:", "File name:" })); + tf.enterText("jt_gui_test_temp_some_jti-this_file_will_be_deleted"); + } + +} diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java new file mode 100644 index 00000000..fd46c968 --- /dev/null +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java @@ -0,0 +1,75 @@ +/* + * $Id$ + * + * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jthtest.Sanity_Tests; + +import static org.junit.Assert.fail; + +import java.lang.reflect.InvocationTargetException; + +import org.junit.Test; +import org.junit.runner.JUnitCore; +import org.netbeans.jemmy.operators.JFrameOperator; + +import jthtest.Config_Load.Config_Load; + +public class Test_Config_Load1 extends Config_Load { + public static void main(String[] args) { + JUnitCore.main("jthtest.gui.Config_Load.Config_Load1"); + } + + /** + * This test is to verify that Load button under configuration will bring up a + * file browser to select a jti file to be used. + * + * @throws ClassNotFoundException If the class does not find it in the + * classpath. + * + * @throws InvocationTargetException Holds an exception thrown by an invoked + * method or constructor. + * + * @throws NoSuchMethodException Occurs when a method is called that exists + * at compile-time, but does not exist at + * runtime. + */ + @SuppressWarnings("deprecation") + @Test + public void testConfig_Load1() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { + + startJavatestNewDesktop(); + JFrameOperator mainFrame = findMainFrame(); + closeQS(mainFrame); + + openTestSuite(mainFrame); + createWorkDirInTemp(mainFrame); + + if (!(openLoadConfigDialogByMenu(mainFrame).isVisible())) { + fail("Load button under configuration does not bring up a file browser to select a jti file to be used"); + } + + } +} diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java new file mode 100644 index 00000000..9304d68d --- /dev/null +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java @@ -0,0 +1,68 @@ +/* + * $Id$ + * + * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jthtest.Sanity_Tests; + +import java.lang.reflect.InvocationTargetException; + +import jthtest.Test; +import jthtest.tools.ConfigDialog; +import jthtest.tools.JTFrame; + +public class Test_Config_New1 extends Test { + /** + * This test is to verify that menu item \"Configure-> New configuration\" in an + * existing directory and configuration will reset it to an empty state. + * + * @throws ClassNotFoundException If the class does not find it in the + * classpath. + * + * @throws InvocationTargetException Holds an exception thrown by an invoked + * method or constructor. + * + * @throws NoSuchMethodException Occurs when a method is called that exists + * at compile-time, but does not exist at + * runtime. + */ + public void testImpl() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { + + JTFrame frame = JTFrame.startJTWithDefaultWorkDirectory(); + ConfigDialog cd = frame.getConfiguration().openByKey(); + boolean firstly = cd.isFullConfiguration(); + cd.closeByMenu(); + + cd = frame.getConfiguration().create(true); + boolean secondly = cd.isFullConfiguration(); + + if (secondly) { + errors.add("Configuration is full after creation"); + } + if (!firstly) { + errors.add("Warning: configuration was not full before creation"); + } + } +} \ No newline at end of file diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java new file mode 100644 index 00000000..3e53a899 --- /dev/null +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java @@ -0,0 +1,89 @@ +/* + * $Id$ + * + * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jthtest.Sanity_Tests; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; + +import org.junit.Test; +import org.junit.runner.JUnitCore; +import org.netbeans.jemmy.JemmyException; +import org.netbeans.jemmy.operators.JDialogOperator; +import org.netbeans.jemmy.operators.JFrameOperator; + +import jthtest.Config_SaveEdit.Config_SaveEdit; + +public class Test_Config_Save2 extends Config_SaveEdit { + public static void main(String args[]) { + JUnitCore.main("jthtest.gui.Config_SaveEdit.Test_Config_SaveEdit2"); + } + + /** + * Verify that "File->Save" menu item in Configuration Editor will save the + * current configuration in a new file if there is no file name. + * + * @throws ClassNotFoundException If the class does not find it in the + * classpath. + * + * @throws InvocationTargetException Holds an exception thrown by an invoked + * method or constructor. + * + * @throws NoSuchMethodException Occurs when a method is called that exists + * at compile-time, but does not exist at + * runtime. + */ + @SuppressWarnings("deprecation") + @Test + public void testConfig_SaveEdit2() + throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InterruptedException { + File f = new File(LOCAL_PATH + "jt_gui_test_Config_SaveEdit2_test_this_file_will_be_deleted.jti"); + if (f.exists()) + f.delete(); + f = null; + startJavatestNewDesktop(); + JFrameOperator mainFrame = findMainFrame(); + closeQS(mainFrame); + + openTestSuite(mainFrame); + createWorkDirInTemp(mainFrame); + openConfigCreation(mainFrame); + JDialogOperator config = findConfigEditor(mainFrame); + saveConfig(config, "jt_gui_test_Config_SaveEdit2_test_this_file_will_be_deleted"); + + f = new File(LOCAL_PATH + "jt_gui_test_Config_SaveEdit2_test_this_file_will_be_deleted.jti"); + int t = 0; + while (t < 1000 && !f.exists()) { + f = new File(LOCAL_PATH + "jt_gui_test_Config_SaveEdit2_test_this_file_will_be_deleted.jti"); + t += 100; + Thread.sleep(100); + } + if (!f.exists()) + throw new JemmyException("File was not created"); + f.delete(); + } +} From c72fe782cd9f756a1498b3a4ad572d7682da659e Mon Sep 17 00:00:00 2001 From: "golla.yadav@oracle.com" Date: Thu, 24 Mar 2022 13:48:59 -0700 Subject: [PATCH 2/6] 7903118: Sanity Tests - Updated the scripts as per the review comments --- .../Config_SaveEdit/Config_SaveEdit.java | 34 ------------------- .../Sanity_Tests/Test_Config_Edit3.java | 33 +++++++++--------- .../Sanity_Tests/Test_Config_Load1.java | 9 +++-- .../Sanity_Tests/Test_Config_New1.java | 32 ++++++++--------- .../Sanity_Tests/Test_Config_Save2.java | 32 ++++++++--------- 5 files changed, 51 insertions(+), 89 deletions(-) delete mode 100644 gui-tests/src/gui/src/jthtest/Config_SaveEdit/Config_SaveEdit.java diff --git a/gui-tests/src/gui/src/jthtest/Config_SaveEdit/Config_SaveEdit.java b/gui-tests/src/gui/src/jthtest/Config_SaveEdit/Config_SaveEdit.java deleted file mode 100644 index b7363b65..00000000 --- a/gui-tests/src/gui/src/jthtest/Config_SaveEdit/Config_SaveEdit.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * $Id$ - * - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package jthtest.Config_SaveEdit; - -import jthtest.ConfigTools; - -public class Config_SaveEdit extends ConfigTools { - -} diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java index 9565e7c0..cefe1896 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java @@ -50,21 +50,20 @@ public static void main(String[] args) { JUnitCore.main("jthtest.gui.Sanity_Tests.Test_Config_Edit3"); } - /** - * This test case Verify that \"Done\" button in an empty Configuration Editor - * will bring up a Save Configuration file browser. - * - * @throws ClassNotFoundException If the class does not find it in the - * classpath. - * - * @throws InvocationTargetException Holds an exception thrown by an invoked - * method or constructor. - * - * @throws NoSuchMethodException Occurs when a method is called that exists - * at compile-time, but does not exist at - * runtime. - */ - @SuppressWarnings("deprecation") + /** + * This test case Verify that \"Done\" button in an empty Configuration Editor + * will bring up a Save Configuration file browser. + * + * @throws ClassNotFoundException If the class does not find it in the + * classpath. + * + * @throws InvocationTargetException Holds an exception thrown by an invoked + * method or constructor. + * + * @throws NoSuchMethodException Occurs when a method is called that exists + * at compile-time, but does not exist at + * runtime. + */ @Test public void testConfig_Edit7() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { @@ -98,8 +97,8 @@ public void testConfig_Edit7() throws ClassNotFoundException, InvocationTargetEx * This method clicks on OK button on Save Configuration file browser and save * the configuration (.jti) file. * - * @throws IOException Input/Output exceptions (I/O), and they occur whenever an - * input or output operation is failed or interpreted. + * @throws IOException + * */ @SuppressWarnings("deprecation") private void saveConfig() { diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java index fd46c968..d326e1c6 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java @@ -37,7 +37,7 @@ import jthtest.Config_Load.Config_Load; -public class Test_Config_Load1 extends Config_Load { +public class Test_Config_Load1 extends ConfigTools { public static void main(String[] args) { JUnitCore.main("jthtest.gui.Config_Load.Config_Load1"); } @@ -45,18 +45,17 @@ public static void main(String[] args) { /** * This test is to verify that Load button under configuration will bring up a * file browser to select a jti file to be used. - * + * * @throws ClassNotFoundException If the class does not find it in the * classpath. - * + * * @throws InvocationTargetException Holds an exception thrown by an invoked * method or constructor. - * + * * @throws NoSuchMethodException Occurs when a method is called that exists * at compile-time, but does not exist at * runtime. */ - @SuppressWarnings("deprecation") @Test public void testConfig_Load1() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java index 9304d68d..6f456009 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java @@ -34,21 +34,21 @@ import jthtest.tools.JTFrame; public class Test_Config_New1 extends Test { - /** - * This test is to verify that menu item \"Configure-> New configuration\" in an - * existing directory and configuration will reset it to an empty state. - * - * @throws ClassNotFoundException If the class does not find it in the - * classpath. - * - * @throws InvocationTargetException Holds an exception thrown by an invoked - * method or constructor. - * - * @throws NoSuchMethodException Occurs when a method is called that exists - * at compile-time, but does not exist at - * runtime. - */ - public void testImpl() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { + /** + * This test is to verify that menu item \"Configure-> New configuration\" in an + * existing directory and configuration will reset it to an empty state. + * + * @throws ClassNotFoundException If the class does not find it in the + * classpath. + * + * @throws InvocationTargetException Holds an exception thrown by an invoked + * method or constructor. + * + * @throws NoSuchMethodException Occurs when a method is called that exists + * at compile-time, but does not exist at + * runtime. + */ + public void testImpl() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { JTFrame frame = JTFrame.startJTWithDefaultWorkDirectory(); ConfigDialog cd = frame.getConfiguration().openByKey(); @@ -65,4 +65,4 @@ public void testImpl() throws ClassNotFoundException, InvocationTargetException, errors.add("Warning: configuration was not full before creation"); } } -} \ No newline at end of file +} diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java index 3e53a899..304eabd2 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java @@ -38,26 +38,24 @@ import jthtest.Config_SaveEdit.Config_SaveEdit; -public class Test_Config_Save2 extends Config_SaveEdit { +public class Test_Config_Save2 extends ConfigTools { public static void main(String args[]) { JUnitCore.main("jthtest.gui.Config_SaveEdit.Test_Config_SaveEdit2"); } - - /** - * Verify that "File->Save" menu item in Configuration Editor will save the - * current configuration in a new file if there is no file name. - * - * @throws ClassNotFoundException If the class does not find it in the - * classpath. - * - * @throws InvocationTargetException Holds an exception thrown by an invoked - * method or constructor. - * - * @throws NoSuchMethodException Occurs when a method is called that exists - * at compile-time, but does not exist at - * runtime. - */ - @SuppressWarnings("deprecation") + /** + * Verify that "File->Save" menu item in Configuration Editor will save the + * current configuration in a new file if there is no file name. + * + * @throws ClassNotFoundException If the class does not find it in the + * classpath. + * + * @throws InvocationTargetException Holds an exception thrown by an invoked + * method or constructor. + * + * @throws NoSuchMethodException Occurs when a method is called that exists + * at compile-time, but does not exist at + * runtime. + */ @Test public void testConfig_SaveEdit2() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InterruptedException { From c7102d6b7dcf9c334ba3fe7d5546a8adc7aa0d3a Mon Sep 17 00:00:00 2001 From: "golla.yadav@oracle.com" Date: Thu, 24 Mar 2022 13:55:58 -0700 Subject: [PATCH 3/6] 7903118: Sanity Tests - Corrected the whitespace/tabspace errors --- .../Sanity_Tests/Test_Config_Edit3.java | 28 +++++++++---------- .../Sanity_Tests/Test_Config_Load1.java | 6 ++-- .../Sanity_Tests/Test_Config_New1.java | 26 ++++++++--------- .../Sanity_Tests/Test_Config_Save2.java | 26 ++++++++--------- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java index cefe1896..7e141a45 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java @@ -51,19 +51,19 @@ public static void main(String[] args) { } /** - * This test case Verify that \"Done\" button in an empty Configuration Editor - * will bring up a Save Configuration file browser. - * - * @throws ClassNotFoundException If the class does not find it in the - * classpath. - * - * @throws InvocationTargetException Holds an exception thrown by an invoked - * method or constructor. - * - * @throws NoSuchMethodException Occurs when a method is called that exists - * at compile-time, but does not exist at - * runtime. - */ + * This test case Verify that \"Done\" button in an empty Configuration Editor + * will bring up a Save Configuration file browser. + * + * @throws ClassNotFoundException If the class does not find it in the + * classpath. + * + * @throws InvocationTargetException Holds an exception thrown by an invoked + * method or constructor. + * + * @throws NoSuchMethodException Occurs when a method is called that exists + * at compile-time, but does not exist at + * runtime. + */ @Test public void testConfig_Edit7() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { @@ -98,7 +98,7 @@ public void testConfig_Edit7() throws ClassNotFoundException, InvocationTargetEx * the configuration (.jti) file. * * @throws IOException - * + * */ @SuppressWarnings("deprecation") private void saveConfig() { diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java index d326e1c6..12f56877 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java @@ -45,13 +45,13 @@ public static void main(String[] args) { /** * This test is to verify that Load button under configuration will bring up a * file browser to select a jti file to be used. - * + * * @throws ClassNotFoundException If the class does not find it in the * classpath. - * + * * @throws InvocationTargetException Holds an exception thrown by an invoked * method or constructor. - * + * * @throws NoSuchMethodException Occurs when a method is called that exists * at compile-time, but does not exist at * runtime. diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java index 6f456009..76237048 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java @@ -35,19 +35,19 @@ public class Test_Config_New1 extends Test { /** - * This test is to verify that menu item \"Configure-> New configuration\" in an - * existing directory and configuration will reset it to an empty state. - * - * @throws ClassNotFoundException If the class does not find it in the - * classpath. - * - * @throws InvocationTargetException Holds an exception thrown by an invoked - * method or constructor. - * - * @throws NoSuchMethodException Occurs when a method is called that exists - * at compile-time, but does not exist at - * runtime. - */ + * This test is to verify that menu item \"Configure-> New configuration\" in an + * existing directory and configuration will reset it to an empty state. + * + * @throws ClassNotFoundException If the class does not find it in the + * classpath. + * + * @throws InvocationTargetException Holds an exception thrown by an invoked + * method or constructor. + * + * @throws NoSuchMethodException Occurs when a method is called that exists + * at compile-time, but does not exist at + * runtime. + */ public void testImpl() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { JTFrame frame = JTFrame.startJTWithDefaultWorkDirectory(); diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java index 304eabd2..52c17d90 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java @@ -43,19 +43,19 @@ public static void main(String args[]) { JUnitCore.main("jthtest.gui.Config_SaveEdit.Test_Config_SaveEdit2"); } /** - * Verify that "File->Save" menu item in Configuration Editor will save the - * current configuration in a new file if there is no file name. - * - * @throws ClassNotFoundException If the class does not find it in the - * classpath. - * - * @throws InvocationTargetException Holds an exception thrown by an invoked - * method or constructor. - * - * @throws NoSuchMethodException Occurs when a method is called that exists - * at compile-time, but does not exist at - * runtime. - */ + * Verify that "File->Save" menu item in Configuration Editor will save the + * current configuration in a new file if there is no file name. + * + * @throws ClassNotFoundException If the class does not find it in the + * classpath. + * + * @throws InvocationTargetException Holds an exception thrown by an invoked + * method or constructor. + * + * @throws NoSuchMethodException Occurs when a method is called that exists + * at compile-time, but does not exist at + * runtime. + */ @Test public void testConfig_SaveEdit2() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InterruptedException { From 406351a4c1c4b09beac4a1faf7cc428dec750263 Mon Sep 17 00:00:00 2001 From: "golla.yadav@oracle.com" Date: Thu, 24 Mar 2022 14:12:59 -0700 Subject: [PATCH 4/6] 7903118: Sanity Tests - Updated the scripts as per the review comments --- .../jthtest/Sanity_Tests/Test_Config_Edit3.java | 12 ++++-------- .../jthtest/Sanity_Tests/Test_Config_Load1.java | 12 ++++-------- .../src/jthtest/Sanity_Tests/Test_Config_New1.java | 14 +++++--------- .../jthtest/Sanity_Tests/Test_Config_Save2.java | 13 +++++-------- 4 files changed, 18 insertions(+), 33 deletions(-) diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java index 7e141a45..a4859cc6 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Edit3.java @@ -50,19 +50,15 @@ public static void main(String[] args) { JUnitCore.main("jthtest.gui.Sanity_Tests.Test_Config_Edit3"); } - /** + /** * This test case Verify that \"Done\" button in an empty Configuration Editor * will bring up a Save Configuration file browser. * - * @throws ClassNotFoundException If the class does not find it in the - * classpath. + * @throws ClassNotFoundException * - * @throws InvocationTargetException Holds an exception thrown by an invoked - * method or constructor. + * @throws InvocationTargetException * - * @throws NoSuchMethodException Occurs when a method is called that exists - * at compile-time, but does not exist at - * runtime. + * @throws NoSuchMethodException */ @Test public void testConfig_Edit7() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java index 12f56877..bb8eceff 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java @@ -42,19 +42,15 @@ public static void main(String[] args) { JUnitCore.main("jthtest.gui.Config_Load.Config_Load1"); } - /** + /** * This test is to verify that Load button under configuration will bring up a * file browser to select a jti file to be used. * - * @throws ClassNotFoundException If the class does not find it in the - * classpath. + * @throws ClassNotFoundException * - * @throws InvocationTargetException Holds an exception thrown by an invoked - * method or constructor. + * @throws InvocationTargetException * - * @throws NoSuchMethodException Occurs when a method is called that exists - * at compile-time, but does not exist at - * runtime. + * @throws NoSuchMethodException */ @Test public void testConfig_Load1() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java index 76237048..4f899353 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java @@ -34,19 +34,15 @@ import jthtest.tools.JTFrame; public class Test_Config_New1 extends Test { - /** + /** * This test is to verify that menu item \"Configure-> New configuration\" in an * existing directory and configuration will reset it to an empty state. * - * @throws ClassNotFoundException If the class does not find it in the - * classpath. + * @throws ClassNotFoundException + * + * @throws InvocationTargetException * - * @throws InvocationTargetException Holds an exception thrown by an invoked - * method or constructor. - * - * @throws NoSuchMethodException Occurs when a method is called that exists - * at compile-time, but does not exist at - * runtime. + * @throws NoSuchMethodException */ public void testImpl() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException { diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java index 52c17d90..724230c5 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java @@ -42,19 +42,16 @@ public class Test_Config_Save2 extends ConfigTools { public static void main(String args[]) { JUnitCore.main("jthtest.gui.Config_SaveEdit.Test_Config_SaveEdit2"); } - /** + /** * Verify that "File->Save" menu item in Configuration Editor will save the * current configuration in a new file if there is no file name. * - * @throws ClassNotFoundException If the class does not find it in the - * classpath. + * @throws ClassNotFoundException + * + * @throws InvocationTargetException * - * @throws InvocationTargetException Holds an exception thrown by an invoked - * method or constructor. + * @throws NoSuchMethodException * - * @throws NoSuchMethodException Occurs when a method is called that exists - * at compile-time, but does not exist at - * runtime. */ @Test public void testConfig_SaveEdit2() From df2094d252a2040367d19893be76be613b31a47b Mon Sep 17 00:00:00 2001 From: "golla.yadav@oracle.com" Date: Thu, 24 Mar 2022 14:17:41 -0700 Subject: [PATCH 5/6] 7903118: Sanity Tests - Corrected the trailing whitespace errors in two files --- .../src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java | 2 +- .../src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java index 4f899353..f342b3be 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_New1.java @@ -39,7 +39,7 @@ public class Test_Config_New1 extends Test { * existing directory and configuration will reset it to an empty state. * * @throws ClassNotFoundException - * + * * @throws InvocationTargetException * * @throws NoSuchMethodException diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java index 724230c5..e073c7b6 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java @@ -47,7 +47,7 @@ public static void main(String args[]) { * current configuration in a new file if there is no file name. * * @throws ClassNotFoundException - * + * * @throws InvocationTargetException * * @throws NoSuchMethodException From bd44690021aa4b4d5a859cae81559bf8efce0d6e Mon Sep 17 00:00:00 2001 From: "golla.yadav@oracle.com" Date: Sat, 26 Mar 2022 12:23:57 -0700 Subject: [PATCH 6/6] 7903118: Sanity Tests - Fixed the compilation errors --- .../src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java | 2 +- .../src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java index bb8eceff..f859bb4b 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Load1.java @@ -35,7 +35,7 @@ import org.junit.runner.JUnitCore; import org.netbeans.jemmy.operators.JFrameOperator; -import jthtest.Config_Load.Config_Load; +import jthtest.ConfigTools; public class Test_Config_Load1 extends ConfigTools { public static void main(String[] args) { diff --git a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java index e073c7b6..4d032f87 100644 --- a/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java +++ b/gui-tests/src/gui/src/jthtest/Sanity_Tests/Test_Config_Save2.java @@ -36,7 +36,7 @@ import org.netbeans.jemmy.operators.JDialogOperator; import org.netbeans.jemmy.operators.JFrameOperator; -import jthtest.Config_SaveEdit.Config_SaveEdit; +import jthtest.ConfigTools; public class Test_Config_Save2 extends ConfigTools { public static void main(String args[]) {