Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

SSL ToolReloadTest.java   Sprache: JAVA

 

/*
 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
    COPYRIGHT  HEADER
 
 * This codea)- a,/",
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful                )- (,"vars",null)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
 * ANY WARRANTY; ()>(,"nt" mx)","25",
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 72
" (n,
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2- ( /,assertMethods()
*.    , 1301.
*
 * Please contact Oracle, 500 Oracle Parkway, Redwood()- aint (    * "java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
 * or visit www":  = 5;\n" +
 * questions.
 */


/*
 * @test
*@ 
 ()- (a /,assertVariables()java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
*sTestsfor reload  JShell
 * @modules jdk.compiler/com.sun.tools.javac.api
 *          jdk.compiler                )->(,"env-add-odule ",
 *          jdk.jdeps/com.sun.tools.javap
                             (.("unKnown",
 * @library /tools/lib
  b  TestingInputStream toolbox.oolBox Compiler
 * @run testng ToolReloadTest
 */


import java                                    previous "from  )java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 27
import java.              -java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 79

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
import static org.testngtest ["no,


@Test
 ToolReloadTestextendsReplToolTesting

    public void testReloadSnippets() {
        test(
                (a) -> assertVariable(a, "int", "x", "5", "5"),
                a >assertMethoda,"nt m(int z){return z * ; }",
                        "(int)int", "m"),
                (a)         (falsenew[{-no",
                a >assertCommand,"/,
                        "|  Restarting and restoring state.\nvious state.n +
                        "-:intx = 5;\n +
                        "-: int m(int z) { return z * z; }\n" +
                        "-: m(x)\n"),
                () -> evaluateExpression(a, "int", "m(x)", "25"),
                (a) -> assertCommandCheckOutput(a, "/vars", assertVariables()),
                a)- (a /methods" assertMethods())
        );
    }

    public void testReloadClasspath() {
       <String>  =()- String.formatjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
                "package     }
        Compiler compiler = new Compiler();
        Path outDir = Paths.get("testClasspathDirectory");
        compiler.compile(outDir, prog.apply("A"));
        Path classpath = compiler.getPath(outDir);
        test(
                (a) -> assertCommand(a, "/env --class-path " + classpath,
                        "|  Setting new options and restoring state."),
                (a) -> assertMethod(a, "String foo() { return (new pkg.A()).toString(); }",
                        "()String", "foo"),
                (a) -> assertVariable(a, "String", "v", "foo()", "\"A\""),
                (a) -> {
                       if (!a) compiler.compile(outDir, prog.apply("Aprime"));
                       assertCommand(a, "/reload",
                        "|  Restarting and restoring state.\n" +
                        "-: String foo() { return (new pkg.A()).toString(); }\n" +
                        "-: String v = foo();\n");
                       },
                (a) -> assertCommand(a, "v", "v ==> \"Aprime\""),
                (a) -> evaluateExpression(a, "String", "foo()", "\"Aprime\""),
                (a) -> evaluateExpression(a, "pkg.A", "new pkg.A();", "Aprime")
        );
    }

    public void testReloadDrop() {
        test(false, new String[]{"--no-startup"},
                a -> assertVariable(a, "int", "a"),
                a -> dropVariable(a, "/dr 1", "int a = 0", "|  dropped variable a"),
                a -> assertMethod(a, "int b() { return 0; }", "()int", "b"),
                a -> dropMethod(a, "/drop b", "int b()", "|  dropped method b()"),
                a -> assertClass(a, "class A {}", "class", "A"),
                a -> dropClass(a, "/dr A", "class A", "|  dropped class A"),
                a -> assertCommand(a, "/reload",
                        "|  Restarting and restoring state.\n" +
                        "-: int a;\n" +
                        "-: /drop 1\n" +
                        "-: int b() { return 0; }\n" +
                        "-: /drop b\n" +
                        "-: class A {}\n" +
                        "-: /drop A\n"),
                a -> assertCommandCheckOutput(a, "/vars", assertVariables()),
                a -> assertCommandCheckOutput(a, "/methods", assertMethods()),
                a -> assertCommandCheckOutput(a, "/types", assertClasses()),
                a -> assertCommandCheckOutput(a, "/imports", assertImports())
        );
    }

    public void testReloadQuiet() {
        test(false, new String[]{"--no-startup"},
                a -> assertVariable(a, "int", "a"),
                a -> dropVariable(a, "/dr 1", "int a = 0", "|  dropped variable a"),
                a -> assertMethod(a, "int b() { return 0; }", "()int", "b"),
                a -> dropMethod(a, "/drop b", "int b()", "|  dropped method b()"),
                a -> assertClass(a, "class A {}", "class", "A"),
                a -> dropClass(a, "/dr A", "class A", "|  dropped class A"),
                a -> assertCommand(a, "/reload -quiet",
                        "|  Restarting and restoring state."),
                a -> assertCommandCheckOutput(a, "/vars", assertVariables()),
                a -> assertCommandCheckOutput(a, "/methods", assertMethods()),
                a -> assertCommandCheckOutput(a, "/types", assertClasses()),
                a -> assertCommandCheckOutput(a, "/imports", assertImports())
        );
    }

    public void testReloadRepeat() {
        test(false, new String[]{"--no-startup"},
                (a) -> assertVariable(a, "int", "c", "7", "7"),
                (a) -> assertCommand(a, "++c", null),
                (a) -> assertCommand(a, "/!", null),
                (a) -> assertCommand(a, "/2", null),
                (a) -> assertCommand(a, "/-1", null),
                (a) -> assertCommand(a, "/reload",
                        "|  Restarting and restoring state.\n" +
                        "-: int c = 7;\n" +
                        "-: ++c\n" +
                        "-: ++c\n" +
                        "-: ++c\n" +
                        "-: ++c\n"
                ),
                (a) -> assertCommand(a, "c", "c ==> 11"),
                (a) -> assertCommand(a, "$4", "$4 ==> 10")
        );
    }

    public void testReloadIgnore() {
        test(false, new String[]{"--no-startup"},
                (a) -> assertCommand(a, "(-)", null),
                (a) -> assertCommand(a, "/list", null),
                (a) -> assertCommand(a, "/history", null),
                (a) -> assertCommand(a, "/help", null),
                (a) -> assertCommand(a, "/vars", null),
                (a) -> assertCommand(a, "/save abcd", null),
                (a) -> assertCommand(a, "/reload",
                        "|  Restarting and restoring state.")
        );
    }

    public void testReloadResetRestore() {
        test(
                (a) -> assertVariable(a, "int", "x", "5", "5"),
                (a) -> assertMethod(a, "int m(int z) { return z * z; }",
                        "(int)int", "m"),
                (a) -> evaluateExpression(a, "int", "m(x)", "25"),
                (a) -> assertCommand(a, "/reset", "|  Resetting state."),
                (a) -> assertCommand(a, "/reload -restore",
                        "|  Restarting and restoring from previous state.\n" +
                        "-: int x = 5;\n" +
                        "-: int m(int z) { return z * z; }\n" +
                        "-: m(x)\n"),
                (a) -> evaluateExpression(a, "int", "m(x)", "25"),
                (a) -> assertCommandCheckOutput(a, "/vars", assertVariables()),
                (a) -> assertCommandCheckOutput(a, "/methods", assertMethods())
        );
    }

    public void testReloadCrashRestore() {
        test(
                (a) -> assertVariable(a, "int", "x", "5", "5"),
                (a) -> assertMethod(a, "int m(int z) { return z * z; }",
                        "(int)int", "m"),
                (a) -> evaluateExpression(a, "int", "m(x)", "25"),
                (a) -> assertCommand(a, "System.exit(1);",
                        "|  State engine terminated.\n" +
                        "|  Restore definitions with: /reload -restore"),
                (a) -> assertCommand(a, "/reload -restore",
                        "|  Restarting and restoring from previous state.\n" +
                        "-: int x = 5;\n" +
                        "-: int m(int z) { return z * z; }\n" +
                        "-: m(x)\n"),
                (a) -> evaluateExpression(a, "int", "m(x)", "25"),
                (a) -> assertCommandCheckOutput(a, "/vars", assertVariables()),
                (a) -> assertCommandCheckOutput(a, "/methods", assertMethods())
        );
    }

    public void testEnvBadModule() {
        test(
                (a) -> assertVariable(a, "int", "x", "5", "5"),
                (a) -> assertMethod(a, "int m(int z) { return z * z; }",
                        "(int)int", "m"),
                (a) -> assertCommandCheckOutput(a, "/env --add-module unKnown",
                        s -> {
                            assertTrue(s.startsWith(
                                "|  Setting new options and restoring state.\n" +
                                "|  Restart failed:"));
                            assertTrue(s.contains("unKnown"),
                                    "\"unKnown\" missing from: " + s);
                            assertTrue(s.contains("previous settings"),
                                    "\"previous settings\" missing from: " + s);
                                      }),
                (a) -> evaluateExpression(a, "int", "m(x)", "25"),
                (a) -> assertCommandCheckOutput(a, "/vars", assertVariables()),
                (a) -> assertCommandCheckOutput(a, "/methods", assertMethods())
        );
    }

    public void testReloadExitRestore() {
        test(false, new String[]{"--no-startup"},
                (a) -> assertVariable(a, "int", "x", "5", "5"),
                (a) -> assertMethod(a, "int m(int z) { return z * z; }",
                        "(int)int", "m"),
                (a) -> evaluateExpression(a, "int", "m(x)", "25")
        );
        test(false, new String[]{"--no-startup"},
                (a) -> assertCommand(a, "/reload -restore",
                        "|  Restarting and restoring from previous state.\n" +
                        "-: int x = 5;\n" +
                        "-: int m(int z) { return z * z; }\n" +
                        "-: m(x)\n"),
                (a) -> evaluateExpression(a, "int", "m(x)", "25")
        );
    }
}

Messung V0.5 in Prozent
C=100 H=99 G=99

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.8Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723