langtools/test/tools/javac/modules/ModuleTestBase.java
changeset 36778 e04318f39f92
parent 36526 3b41f1c69604
child 37758 3ecf9b414e05
equal deleted inserted replaced
36777:28d33fb9097f 36778:e04318f39f92
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    39 import java.util.Arrays;
    39 import java.util.Arrays;
    40 import java.util.List;
    40 import java.util.List;
    41 import java.util.Set;
    41 import java.util.Set;
    42 import java.util.TreeSet;
    42 import java.util.TreeSet;
    43 import java.util.stream.Collectors;
    43 import java.util.stream.Collectors;
       
    44 
       
    45 import toolbox.JavacTask;
       
    46 import toolbox.ToolBox;
    44 
    47 
    45 /**
    48 /**
    46  * Base class for module tests.
    49  * Base class for module tests.
    47  */
    50  */
    48 public class ModuleTestBase {
    51 public class ModuleTestBase {
   173             return moduleSrc;
   176             return moduleSrc;
   174         }
   177         }
   175 
   178 
   176         public void build(Path where) throws IOException {
   179         public void build(Path where) throws IOException {
   177             Path moduleSrc = write(where);
   180             Path moduleSrc = write(where);
   178             tb.new JavacTask()
   181             new JavacTask(tb)
   179                     .outdir(where.resolve(name))
   182                     .outdir(where.resolve(name))
   180                     .options("-mp", modulePath)
   183                     .options("-mp", modulePath)
   181                     .files(findJavaFiles(moduleSrc))
   184                     .files(findJavaFiles(moduleSrc))
   182                     .run()
   185                     .run()
   183                     .writeAll();
   186                     .writeAll();