andxu / andy_doc-back

doc for sessions
0 stars 2 forks source link

test plan #3

Open andxu opened 6 years ago

andxu commented 6 years ago

HelloWorld

  1. Open test project all-in-one
  2. Set BP on the first statement of HelloWorld#main
  3. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  4. Press F5 to start debug and wait for BP to be hit
  5. Verify variable args shows like String[0] (id=%d)
  6. Step over and verify the debug cursor moves to the next statement, verfiy the hello in debug console.
  7. Continue the program and verify the hello world in debug console.
  8. Modify the launch.json to seta b for args field, F5 again to verify the args in the HelloWorld.java has two string value of a and b
  9. Modify the launch.json to "vmArgs": "-Xms128m -Xmx512m", F5 again to wait for breakpoint to be hit
  10. Attach to the container and execute ps -ef | grep Xms to verify the-Xms128m -Xmx512m is included in the program args.
andxu commented 6 years ago

Variables

  1. Open test project all-in-one

  2. Set BP on the last statement of VariableTest#test

  3. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files

  4. Change mainClass to VariableTest, press F5 to start debug and wait for BP to be hit

  5. Verify :

    1. i should be 111
    2. nullstr should be null
    3. str should be full displayed with 1000 a
    4. object should be Object (id=^d) and not expandable
    5. test should be VariableTest (id=^d) and expandable with x (VariableTest): 100, i:19099 and x (Foo): 0
    6. a is not expandable
    7. b is displayed as Class (A) (id=^d) and expand b->classLoader, there should be no errors on logs
    8. intarray should have 3 integers 1, 2, 3
    9. strList should have children size: 2 and expandable elementData, expand elementData, a long string string test aaaaaaa... should be displayed
    10. map should have size: 1 and expandable table with a HashMap$Node child.
    11. t should have one element hello
    12. genericArray should be displayed String[10][] (id=^d) with first non-empty element
    13. multi should be displayed String[5][][] (id=^d) and two levels expandable tree nodes.
    14. d should not be expandable
    15. dd should be displayed as GenericsFoo (id=^d) and should have one child x: Foo (id=^d) with only one child x: 0
    16. list should have only one element of int[1] (id=^d) at index 0
    17. this variable should be displayed
  6. Set value on test->x (VariableTest), input value 1, verify this->x (VariableTest) has also been changed to 1

andxu commented 6 years ago

Big stack frame

  1. Open test project all-in-one
  2. Open RecursiveTest.java, and set BP on line 8: return 1
  3. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  4. Change mainClass to RecursiveTest, press F5 to start debug and wait for BP to be hit
  5. Click on the Load More Stack Frames button, verify you can click on it continually. (The total stack frame count is 1000, and vscode will load 20 of them in one page, so you can click Load More Stack Frames button about 50 times), verify there is no PERFORMANCE issue (no delay more than 1 second during the test steps).
  6. Press F5, verify program terminates.
andxu commented 6 years ago

Breakpoint and innner class

  1. Open test project all-in-one
  2. Open BreakPointTest.java and Set BP on each println statement
  3. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  4. Change mainClass to BreakPointTest and Press F5 to start debug, verify the line System.out.println("middle"); is hit
  5. Press F5 again, verify the line System.out.println("inner"); is hit
  6. press F5 again and verify the line System.out.println("anonymous"); is hit
  7. press F5 again and verify the line System.out.println(j); is hit
  8. Press F5, verify the program stops, verify no error in logs.
  9. verify the following messages in debug console
    middle
    inner
    anonymous
    99
andxu commented 6 years ago

No Debug Information Test

  1. Open test project all-in-one
  2. Open NoSourceTest.java, and set BP on line 4: System.out.println(i+10);
  3. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  4. Change mainClass to NoSourceTest and press F5 to start debug, verify the BP is hit
  5. Verify the following stack frames:
    NoSourceTest.lambda$0(Integer) (NoSourceTest.java:4)
    ^d.accept(Object) (Unknown Source:-1)
    Foo.bar(int,int,Consumer) (Unknown Source:-1)
    NoSourceTest.main(String[]) (NoSourceTest.java:3)
    
  6. Select stack frame Foo.bar(int,int,Consumer) (Unknown Source:-1), verify variables:
    1. arg0: 1
    2. arg1: 2
    3. arg2: value like 717356484 (id=395)
    4. this: value like Foo (id=356)
  7. Press F5, verify program terminates.
andxu commented 6 years ago

Variable Performance Test

  1. Open test project all-in-one
  2. Open TooManyVariables.java, and set BP on System.out.println("variable perf test.")
  3. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  4. Change mainClass to VariablePerfTest and press F5 to start debug, verify the BP is hit
  5. Open debug view and expand the ‘this’ variable in variable view.
  6. Verify the time for expanding are less than 5 seconds
  7. Press F5, verify program terminates.
andxu commented 6 years ago

PetClinic

  1. Clone code from https://github.com/spring-projects/spring-petclinic.git
  2. Open the folder in vscode, open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  3. Set BP on WelcomeController.java on line return "welcome"; and main on PetClinicApplication.java
  4. Press F5 to start debug, verify the BP on main is hit.
  5. Press F5 and verify the BP on main is hit again.
  6. Wait for output 2017-11-23 20:23:25.230 INFO 9448 --- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
  7. Open IE and navigate to http://localhost:xxxx (random port in tasks.json), verify the welcome method is hit
  8. Press F5 and verify page like spring-petclinic/target/classes/templates/welcome.html is displayed on IE .
  9. Stop debug and do the test again from step 4
andxu commented 6 years ago

Odd names

  1. Open test project all-in-one
  2. Set BP on the first statement of Hello$orld#main
  3. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  4. Change "mainClass" to "ab$c.Hello$orld" and press F5 to start debug, verify the BP is hit
andxu commented 6 years ago

Java 10

//TODO

andxu commented 6 years ago

Multiple Models - jar with dependency

  1. Clone project from https://github.com/andxu/samples
  2. Open the folder multi-module-test in command line, and run azds prep --public
  3. Run azds up in command line and verify the url provided is accessible with StringUtils.isBlank works!
  4. Open the folder in vscode, open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  5. F5 and verify azds starts up and visit the localhost url provided to verify the BP at HelloPrinter.java line 5 is hit. (A known bug which will cause the BP hit two times.)
andxu commented 6 years ago

Multiple Models - Spring boot

  1. Clone project from https://github.com/andxu/samples
  2. Open the folder spring-boot-test in command line, and run azds prep --public
  3. Run azds up in command line and verify the url provided is accessible with Hello World
  4. Open the folder in vscode, open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  5. F5 and verify azds starts up and visit the localhost url provided to verify the BP at MyService.java line 18 is hit.
andxu commented 6 years ago

Multiple Models - onejar

  1. Clone project from https://github.com/andxu/samples
  2. Open the folder exec-multi-module-test in vscode
  3. Modify the exec-multi-module-test\exec-module2\pom.xml, make sure using the plugin onejar-maven-plugin
  4. Run commandline mvn clean package on root folder.
  5. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  6. Set BP on MyPrinter.java#6
  7. F5 and verify debug session starts up and stops on the BP
  8. F5 to continue and verify StringUtils.isBlank works! appears on debug console.
andxu commented 6 years ago

Multiple Models - mvn jar

  1. Clone project from https://github.com/andxu/samples
  2. Open the folder exec-multi-module-test in vscode
  3. Modify the exec-multi-module-test\exec-module2\pom.xml, make sure using the plugin maven-jar-plugin
  4. Run commandline mvn clean package on root folder.
  5. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  6. Set BP on MyPrinter.java#6
  7. F5 and verify debug session starts up and stops on the BP
  8. F5 to continue and verify StringUtils.isBlank works! appears on debug console.
andxu commented 6 years ago

Multiple Models - mvn exec

  1. Clone project from https://github.com/andxu/samples
  2. Open the folder exec-multi-module-test in vscode
  3. Modify the exec-multi-module-test\exec-module2\pom.xml, make sure using the plugin exec-maven-plugin
  4. Run commandline mvn clean package on root folder.
  5. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  6. Set BP on MyPrinter.java#6
  7. F5 and verify debug session starts up and stops on the BP
  8. F5 to continue and verify StringUtils.isBlank works! appears on debug console.
andxu commented 6 years ago

Multiple Models - Spring boot multiple module

  1. Clone project from https://github.com/andxu/springboot-multiple-module-sample
  2. Open the root folder, open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  3. F5 and verify azds starts up and visit the localhost url provided to verify the BP at UserServiceImpl.java line 18 is hit.
andxu commented 6 years ago

Tutorial Sample

  1. Clone project from https://github.com/Azure/dev-spaces/tree/master/samples/java/getting-started/webfrontend
  2. Open the root folder, open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  3. F5 and verify azds starts up and visit the localhost url provided to verify the BP at Application.java line 16 is hit.
andxu commented 6 years ago

Test classpath and runtime scope dependency

  1. Clone project from https://github.com/andxu/samples
  2. Modify the exec-multi-module-test\exec-module2\pom.xml , and change to the following xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    
    <parent>
        <artifactId>exec-multi-module-test</artifactId>
        <groupId>com.ms.samples</groupId>
        <version>1.0</version>
    </parent>
    
    <artifactId>exec-multi-module-module2</artifactId>
    
    <dependencies>
        <dependency>
            <groupId>com.ms.samples</groupId>
            <artifactId>exec-multi-module-module1</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
            <scope>runtime</scope>
        </dependency>       
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin> 
        </plugins>
    </build>    
    </project>
  3. Open the Command Palette and select "AZDS: Prepare xxxx" then select "OpenJDK" or "Zulu" to generate required files
  4. Set BP on MyPrinter.java#5
  5. F5 and then verify debug session starts up and stops on the BP
  6. Open Process Explorer or 'ps -ef | grep java' to verify the command line args contains dependency/*
  7. Step in, verify there is no error reporting: "StringUtils cannot be resolved"