jdk/test/tools/jlink/IntegrationTest.java
author sundar
Fri, 08 Jul 2016 17:11:51 +0530
changeset 39505 be0bbd76ae51
parent 39321 c60f34e8c057
child 39834 53a6fb443c20
permissions -rw-r--r--
8161055: Remove plugin ordering by isAfter, isBefore. Reviewed-by: mchung, jlaskey
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * accompanied this code).
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * questions.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    23
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    24
import java.io.File;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    25
import java.io.IOException;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    26
import java.io.UncheckedIOException;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    27
import java.nio.file.Files;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    28
import java.nio.file.Path;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    29
import java.nio.file.Paths;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    30
import java.util.ArrayList;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    31
import java.util.Collections;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    32
import java.util.HashMap;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    33
import java.util.HashSet;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    34
import java.util.List;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    35
import java.util.Map;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    36
import java.util.Set;
39321
c60f34e8c057 8160641: PostProcessingPlugin and ExecutableImage should not be part of plugin API
sundar
parents: 39129
diff changeset
    37
import java.util.function.Function;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    38
import jdk.tools.jlink.Jlink;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    39
import jdk.tools.jlink.Jlink.JlinkConfiguration;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    40
import jdk.tools.jlink.Jlink.PluginsConfiguration;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    41
import jdk.tools.jlink.builder.DefaultImageBuilder;
38320
e24c7029e8ba 8156914: jlink API minor cleanups
sundar
parents: 37779
diff changeset
    42
import jdk.tools.jlink.plugin.ModulePool;
39321
c60f34e8c057 8160641: PostProcessingPlugin and ExecutableImage should not be part of plugin API
sundar
parents: 39129
diff changeset
    43
import jdk.tools.jlink.plugin.Plugin;
c60f34e8c057 8160641: PostProcessingPlugin and ExecutableImage should not be part of plugin API
sundar
parents: 39129
diff changeset
    44
import jdk.tools.jlink.internal.ExecutableImage;
c60f34e8c057 8160641: PostProcessingPlugin and ExecutableImage should not be part of plugin API
sundar
parents: 39129
diff changeset
    45
import jdk.tools.jlink.internal.PostProcessor;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    46
import jdk.tools.jlink.internal.plugins.DefaultCompressPlugin;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    47
import jdk.tools.jlink.internal.plugins.StripDebugPlugin;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    48
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    49
import tests.Helper;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    50
import tests.JImageGenerator;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    51
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    52
/*
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    53
 * @test
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    54
 * @summary Test integration API
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    55
 * @author Jean-Francois Denise
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    56
 * @library ../lib
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    57
 * @modules java.base/jdk.internal.jimage
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    58
 *          jdk.jdeps/com.sun.tools.classfile
38320
e24c7029e8ba 8156914: jlink API minor cleanups
sundar
parents: 37779
diff changeset
    59
 *          jdk.jlink/jdk.tools.jlink
e24c7029e8ba 8156914: jlink API minor cleanups
sundar
parents: 37779
diff changeset
    60
 *          jdk.jlink/jdk.tools.jlink.builder
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    61
 *          jdk.jlink/jdk.tools.jlink.internal
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    62
 *          jdk.jlink/jdk.tools.jlink.internal.plugins
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    63
 *          jdk.jlink/jdk.tools.jmod
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    64
 *          jdk.jlink/jdk.tools.jimage
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    65
 *          jdk.compiler
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    66
 * @build tests.*
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    67
 * @run main IntegrationTest
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    68
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    69
public class IntegrationTest {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    70
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    71
    private static final List<Integer> ordered = new ArrayList<>();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    72
39321
c60f34e8c057 8160641: PostProcessingPlugin and ExecutableImage should not be part of plugin API
sundar
parents: 39129
diff changeset
    73
    public static class MyPostProcessor implements PostProcessor, Plugin {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    74
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    75
        public static final String NAME = "mypostprocessor";
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    76
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    77
        @Override
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    78
        public List<String> process(ExecutableImage image) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    79
            try {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    80
                Files.createFile(image.getHome().resolve("toto.txt"));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    81
                return null;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    82
            } catch (IOException ex) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    83
                throw new UncheckedIOException(ex);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    84
            }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    85
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    86
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    87
        @Override
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    88
        public String getName() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    89
            return NAME;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    90
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    91
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    92
        @Override
39129
4b2086305b68 8159593: Plugin Set<Category> getType() should return a Category
sundar
parents: 38320
diff changeset
    93
        public Category getType() {
4b2086305b68 8159593: Plugin Set<Category> getType() should return a Category
sundar
parents: 38320
diff changeset
    94
            return Category.PROCESSOR;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    95
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    96
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    97
        @Override
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    98
        public void configure(Map<String, String> config) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    99
            throw new UnsupportedOperationException("Shouldn't be called");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   100
        }
39321
c60f34e8c057 8160641: PostProcessingPlugin and ExecutableImage should not be part of plugin API
sundar
parents: 39129
diff changeset
   101
c60f34e8c057 8160641: PostProcessingPlugin and ExecutableImage should not be part of plugin API
sundar
parents: 39129
diff changeset
   102
        @Override
c60f34e8c057 8160641: PostProcessingPlugin and ExecutableImage should not be part of plugin API
sundar
parents: 39129
diff changeset
   103
        public void visit(ModulePool in, ModulePool out) {
c60f34e8c057 8160641: PostProcessingPlugin and ExecutableImage should not be part of plugin API
sundar
parents: 39129
diff changeset
   104
            in.transformAndCopy(Function.identity(), out);
c60f34e8c057 8160641: PostProcessingPlugin and ExecutableImage should not be part of plugin API
sundar
parents: 39129
diff changeset
   105
        }
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   106
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   107
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   108
    public static void main(String[] args) throws Exception {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   109
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   110
        Helper helper = Helper.newHelper();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   111
        if (helper == null) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   112
            System.err.println("Test not run");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   113
            return;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   114
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   115
        apitest();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   116
        test();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   117
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   118
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   119
    private static void apitest() throws Exception {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   120
        boolean failed = false;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   121
        Jlink jl = new Jlink();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   122
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   123
        try {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   124
            jl.build(null);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   125
            failed = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   126
        } catch (Exception ex) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   127
            // XXX OK
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   128
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   129
        if (failed) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   130
            throw new Exception("Should have failed");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   131
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   132
        System.out.println(jl);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   133
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   134
        JlinkConfiguration config
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   135
                = new JlinkConfiguration(null, null, null, null);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   136
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   137
        System.out.println(config);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   138
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   139
        Plugin p = Jlink.newPlugin("toto", Collections.emptyMap(), null);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   140
        if (p != null) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   141
            throw new Exception("Plugin should be null");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   142
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   143
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   144
        Plugin p2 = Jlink.newPlugin("compress", Collections.emptyMap(), null);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   145
        if (p2 == null) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   146
            throw new Exception("Plugin should not be null");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   147
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   148
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   149
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   150
    private static void test() throws Exception {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   151
        Jlink jlink = new Jlink();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   152
        Path output = Paths.get("integrationout");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   153
        List<Path> modulePaths = new ArrayList<>();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   154
        File jmods
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   155
                = JImageGenerator.getJModsDir(new File(System.getProperty("test.jdk")));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   156
        modulePaths.add(jmods.toPath());
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   157
        Set<String> mods = new HashSet<>();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   158
        mods.add("java.management");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   159
        Set<String> limits = new HashSet<>();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   160
        limits.add("java.management");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   161
        JlinkConfiguration config = new Jlink.JlinkConfiguration(output,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   162
                modulePaths, mods, limits, null);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   163
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   164
        List<Plugin> lst = new ArrayList<>();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   165
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   166
        //Strip debug
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   167
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   168
            Map<String, String> config1 = new HashMap<>();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   169
            config1.put(StripDebugPlugin.NAME, "");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   170
            Plugin strip = Jlink.newPlugin("strip-debug", config1, null);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   171
            lst.add(strip);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   172
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   173
        // compress
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   174
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   175
            Map<String, String> config1 = new HashMap<>();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   176
            config1.put(DefaultCompressPlugin.NAME, "2");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   177
            Plugin compress
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   178
                    = Jlink.newPlugin("compress", config1, null);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   179
            lst.add(compress);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   180
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   181
        // Post processor
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   182
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   183
            lst.add(new MyPostProcessor());
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   184
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   185
        // Image builder
37779
7c84df693837 8154956: Module system implementation refresh (4/2016)
alanb
parents: 36511
diff changeset
   186
        DefaultImageBuilder builder = new DefaultImageBuilder(output);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   187
        PluginsConfiguration plugins
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   188
                = new Jlink.PluginsConfiguration(lst, builder, null);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   189
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   190
        jlink.build(config, plugins);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   191
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   192
        if (!Files.exists(output)) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   193
            throw new AssertionError("Directory not created");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   194
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   195
        File jimage = new File(output.toString(), "lib" + File.separator + "modules");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   196
        if (!jimage.exists()) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   197
            throw new AssertionError("jimage not generated");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   198
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   199
        File release = new File(output.toString(), "release");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   200
        if (!release.exists()) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   201
            throw new AssertionError("release not generated");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   202
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   203
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   204
        if (!Files.exists(output.resolve("toto.txt"))) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   205
            throw new AssertionError("Post processing not called");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   206
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   207
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   208
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   209
}