src/test/java/com/cloudbees/jenkins/support/actions/SupportComputerActionTest.java
@Test
    public void generateBundleDefaultsAndCheckContent() throws Exception {
        j.createSlave("slave1", "test", null).getComputer().connect(false).get();

        // Check that the generation does not show any warnings
        Computer computer = j.jenkins.getComputer("slave1");
        ZipFile z = SupportTestUtils.generateBundleWithoutWarnings(
                computer.getUrl(),
                new SupportComputerAction(j.jenkins.getComputer("slave1")),
                SupportPlugin.class,
                j.createWebClient());

        assertNotNull(z.getEntry("manifest.md"));
        assertNotNull(z.getEntry("nodes/slave/slave1/config.xml"));

        if (SystemPlatform.LINUX == SystemPlatform.current()) {
            List<String> files = Arrays.asList(
                    "proc/swaps.txt",
                    "proc/cpuinfo.txt",
                    "proc/mounts.txt",
                    "proc/system-uptime.txt",
                    "proc/net/rpc/nfs.txt",
                    "proc/net/rpc/nfsd.txt",
                    "proc/meminfo.txt",
                    "proc/self/status.txt",
                    "proc/self/cmdline",
                    "proc/self/environ",
                    "proc/self/limits.txt",
                    "proc/self/mountstats.txt",
                    "sysctl.txt",
                    "dmesg.txt",
                    "userid.txt",
                    "dmi.txt");

            for (String file : files) {
                assertNotNull(file + " was not found in the bundle",
                        z.getEntry("nodes/slave/slave1/" + file));
            }
        }
    }
/*
     * Integration test that simulates the user action of clicking the button to generate the bundle.
     */
Integration test that simulates the user action of clicking the button to generate the bundle.
Integration test that simulates the user action of clicking the button to generate the bundle .
@Test
    public void generateBundleDefaultsAndCheckContent() throws Exception {
        j.createSlave("slave1", "test", null).getComputer().connect(false).get();
        Computer computer = j.jenkins.getComputer("slave1");
        ZipFile z = SupportTestUtils.generateBundleWithoutWarnings(
                computer.getUrl(),
                new SupportComputerAction(j.jenkins.getComputer("slave1")),
                SupportPlugin.class,
                j.createWebClient());
        assertNotNull(z.getEntry("manifest.md"));
        assertNotNull(z.getEntry("nodes/slave/slave1/config.xml"));
        if (SystemPlatform.LINUX == SystemPlatform.current()) {
            List<String> files = Arrays.asList(
                    "proc/swaps.txt",
                    "proc/cpuinfo.txt",
                    "proc/mounts.txt",
                    "proc/system-uptime.txt",
                    "proc/net/rpc/nfs.txt",
                    "proc/net/rpc/nfsd.txt",
                    "proc/meminfo.txt",
                    "proc/self/status.txt",
                    "proc/self/cmdline",
                    "proc/self/environ",
                    "proc/self/limits.txt",
                    "proc/self/mountstats.txt",
                    "sysctl.txt",
                    "dmesg.txt",
                    "userid.txt",
                    "dmi.txt");
            for (String file : files) {
                assertNotNull(file + " was not found in the bundle",
                        z.getEntry("nodes/slave/slave1/" + file));
            }
        }
    }
@ Test public void generateBundleDefaultsAndCheckContent ( ) throws Exception { j . createSlave ( "slave1" , "test" , null ) . getComputer ( ) . connect ( false ) . get ( ) ; Computer computer = j . jenkins . getComputer ( "slave1" ) ; ZipFile z = SupportTestUtils . generateBundleWithoutWarnings ( computer . getUrl ( ) , new SupportComputerAction ( j . jenkins . getComputer ( "slave1" ) ) , SupportPlugin . class , j . createWebClient ( ) ) ; assertNotNull ( z . getEntry ( "manifest.md" ) ) ; assertNotNull ( z . getEntry ( "nodes/slave/slave1/config.xml" ) ) ; if ( SystemPlatform . LINUX == SystemPlatform . current ( ) ) { List < String > files = Arrays . asList ( "proc/swaps.txt" , "proc/cpuinfo.txt" , "proc/mounts.txt" , "proc/system-uptime.txt" , "proc/net/rpc/nfs.txt" , "proc/net/rpc/nfsd.txt" , "proc/meminfo.txt" , "proc/self/status.txt" , "proc/self/cmdline" , "proc/self/environ" , "proc/self/limits.txt" , "proc/self/mountstats.txt" , "sysctl.txt" , "dmesg.txt" , "userid.txt" , "dmi.txt" ) ; for ( String file : files ) { assertNotNull ( file + " was not found in the bundle" , z . getEntry ( "nodes/slave/slave1/" + file ) ) ; } } }
Integration test that simulates the user action of clicking the button to generate the bundle.
Integration test that simulates the user action of clicking the button to generate the bundle .
// Check that the generation does not show any warnings