Search in sources :

Example 6 with Files

use of com.google.common.io.Files in project mzmine2 by mzmine.

the class KovatsIndexExtractionDialog method initRawDataFileSelection.

/**
 * Init raw data selection to last used raw data file or "kovats" or "dro"
 */
private void initRawDataFileSelection() {
    if (dataFiles != null && dataFiles.length <= 0)
        return;
    RawDataFilesSelection select = parameterSet.getParameter(KovatsIndexExtractionParameters.dataFiles).getValue();
    RawDataFile[] raw = null;
    // set to parameters files - if they exist in this project
    if (select != null && select.getMatchingRawDataFiles().length > 0) {
        RawDataFile[] exists = Arrays.stream(select.getMatchingRawDataFiles()).filter(r -> Arrays.stream(dataFiles).anyMatch(d -> r.getName().equals(d.getName()))).toArray(RawDataFile[]::new);
        if (exists.length > 0)
            raw = exists;
    }
    if (raw == null) {
        // find kovats or dro file
        // first use all kovats named files and then dro (max 2)
        RawDataFile[] kovats = Arrays.stream(dataFiles).filter(d -> d.getName().toLowerCase().contains("kovats")).toArray(RawDataFile[]::new);
        RawDataFile[] dro = Arrays.stream(dataFiles).filter(d -> d.getName().toLowerCase().contains("dro")).toArray(RawDataFile[]::new);
        // maximum of two files are chosen (0,1,2)
        int size = Math.min(2, kovats.length + dro.length);
        raw = new RawDataFile[size];
        for (int i = 0; i < raw.length; i++) {
            if (i < kovats.length)
                raw[i] = kovats[i];
            else
                raw[i] = dro[i - kovats.length];
        }
    }
    if (raw.length > 0) {
        selectedDataFile = raw;
        comboDataFileName.setSelectedItem(selectedDataFile[0]);
        if (raw.length > 1) {
            comboDataFileName2.setSelectedItem(selectedDataFile[1]);
        }
    }
}
Also used : Color(java.awt.Color) StringComponent(net.sf.mzmine.parameters.parametertypes.StringComponent) Arrays(java.util.Arrays) FileAndPathUtil(net.sf.mzmine.util.files.FileAndPathUtil) ChartGestureHandler(net.sf.mzmine.chartbasics.gestures.ChartGestureHandler) ValueMarker(org.jfree.chart.plot.ValueMarker) MultiChoiceComponent(net.sf.mzmine.parameters.parametertypes.MultiChoiceComponent) ParameterSet(net.sf.mzmine.parameters.ParameterSet) Event(net.sf.mzmine.chartbasics.gestures.ChartGesture.Event) JFileChooser(javax.swing.JFileChooser) BorderLayout(java.awt.BorderLayout) JComboBox(javax.swing.JComboBox) Image(java.awt.Image) Key(net.sf.mzmine.chartbasics.gestures.ChartGesture.Key) Font(java.awt.Font) Range(com.google.common.collect.Range) MZRangeComponent(net.sf.mzmine.parameters.parametertypes.ranges.MZRangeComponent) Icon(javax.swing.Icon) Logger(java.util.logging.Logger) StandardCharsets(java.nio.charset.StandardCharsets) Box(javax.swing.Box) ChartGestureDragDiffEvent(net.sf.mzmine.chartbasics.gestures.ChartGestureDragDiffEvent) Dimension(java.awt.Dimension) List(java.util.List) Stream(java.util.stream.Stream) XYDataset(org.jfree.data.xy.XYDataset) Entry(java.util.Map.Entry) JCheckBox(javax.swing.JCheckBox) Entity(net.sf.mzmine.chartbasics.gestures.ChartGesture.Entity) RTRangeComponent(net.sf.mzmine.parameters.parametertypes.ranges.RTRangeComponent) BasicStroke(java.awt.BasicStroke) JPanel(javax.swing.JPanel) MZmineCore(net.sf.mzmine.main.MZmineCore) ColorPalettes(net.sf.mzmine.util.ColorPalettes) JTextField(javax.swing.JTextField) FileNameExtensionFilter(javax.swing.filechooser.FileNameExtensionFilter) MzRangeFormulaCalculatorModule(net.sf.mzmine.modules.tools.mzrangecalculator.MzRangeFormulaCalculatorModule) RawDataFile(net.sf.mzmine.datamodel.RawDataFile) ArrayUtils(org.apache.commons.lang3.ArrayUtils) NumberFormat(java.text.NumberFormat) Button(net.sf.mzmine.chartbasics.gestures.ChartGesture.Button) ArrayList(java.util.ArrayList) Level(java.util.logging.Level) GridLayout(java.awt.GridLayout) IntegerComponent(net.sf.mzmine.parameters.parametertypes.IntegerComponent) FileNameComponent(net.sf.mzmine.parameters.parametertypes.filenames.FileNameComponent) DelayedDocumentListener(net.sf.mzmine.framework.listener.DelayedDocumentListener) Files(com.google.common.io.Files) ChartGesture(net.sf.mzmine.chartbasics.gestures.ChartGesture) TxtWriter(net.sf.mzmine.util.io.TxtWriter) ImageIcon(javax.swing.ImageIcon) TICPlot(net.sf.mzmine.modules.visualization.tic.TICPlot) ParameterSetupDialog(net.sf.mzmine.parameters.dialogs.ParameterSetupDialog) BoxLayout(javax.swing.BoxLayout) Stroke(java.awt.Stroke) FlowLayout(java.awt.FlowLayout) MZTolerance(net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance) JButton(javax.swing.JButton) KovatsIndex(net.sf.mzmine.modules.tools.kovats.KovatsValues.KovatsIndex) TICPlotType(net.sf.mzmine.modules.visualization.tic.TICPlotType) MigLayout(net.miginfocom.swing.MigLayout) Window(java.awt.Window) DecimalFormat(java.text.DecimalFormat) RawDataFilesSelection(net.sf.mzmine.parameters.parametertypes.selectors.RawDataFilesSelection) TICSumDataSet(net.sf.mzmine.modules.visualization.tic.TICSumDataSet) IOException(java.io.IOException) IonizationType(net.sf.mzmine.datamodel.IonizationType) File(java.io.File) Consumer(java.util.function.Consumer) RectangleInsets(org.jfree.chart.ui.RectangleInsets) TreeMap(java.util.TreeMap) ChartGestureDragDiffHandler(net.sf.mzmine.chartbasics.gestures.ChartGestureDragDiffHandler) JLabel(javax.swing.JLabel) RawDataFilesSelectionType(net.sf.mzmine.parameters.parametertypes.selectors.RawDataFilesSelectionType) DialogLoggerUtil(net.sf.mzmine.util.DialogLoggerUtil) DoubleComponent(net.sf.mzmine.parameters.parametertypes.DoubleComponent) RawDataFilesSelection(net.sf.mzmine.parameters.parametertypes.selectors.RawDataFilesSelection) RawDataFile(net.sf.mzmine.datamodel.RawDataFile)

Example 7 with Files

use of com.google.common.io.Files in project sonar-java by SonarSource.

the class XmlFileSensorTest method test_no_issues_but_xml_file_still_published.

@Test
public void test_no_issues_but_xml_file_still_published() throws Exception {
    SensorContextTester context = SensorContextTester.create(new File("src/test/files/maven2/").getAbsoluteFile());
    DefaultFileSystem fs = context.fileSystem();
    final File file = new File("src/test/files/maven2/pom.xml");
    DefaultInputFile inputFile = new TestInputFileBuilder("", "pom.xml").setModuleBaseDir(fs.baseDirPath()).setPublish(false).build();
    fs.add(inputFile);
    SonarComponents sonarComponents = createSonarComponentsMock(fs, file);
    XmlFileSensor sensor = new XmlFileSensor(sonarComponents, fs);
    assertThat(inputFile.isPublished()).isFalse();
    sensor.execute(context);
    assertThat(inputFile.isPublished()).isTrue();
    verify(sonarComponents, never()).reportIssue(Mockito.argThat(argument -> file.getAbsolutePath().equals(argument.getFile().getAbsolutePath())));
}
Also used : TestInputFileBuilder(org.sonar.api.batch.fs.internal.TestInputFileBuilder) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) DefaultFileSystem(org.sonar.api.batch.fs.internal.DefaultFileSystem) DefaultInputFile(org.sonar.api.batch.fs.internal.DefaultInputFile) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SensorContextTester(org.sonar.api.batch.sensor.internal.SensorContextTester) Lists(com.google.common.collect.Lists) Files(com.google.common.io.Files) JavaCheck(org.sonar.plugins.java.api.JavaCheck) SonarComponents(org.sonar.java.SonarComponents) Checks(org.sonar.api.batch.rule.Checks) Nullable(javax.annotation.Nullable) Before(org.junit.Before) IOException(java.io.IOException) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) RuleAnnotationUtils(org.sonar.api.rules.RuleAnnotationUtils) File(java.io.File) StandardCharsets(java.nio.charset.StandardCharsets) TestInputFileBuilder(org.sonar.api.batch.fs.internal.TestInputFileBuilder) SensorDescriptor(org.sonar.api.batch.sensor.SensorDescriptor) Mockito.verify(org.mockito.Mockito.verify) Mockito(org.mockito.Mockito) Mockito.never(org.mockito.Mockito.never) PomElementOrderCheck(org.sonar.java.checks.xml.maven.PomElementOrderCheck) RuleKey(org.sonar.api.rule.RuleKey) Mockito.mock(org.mockito.Mockito.mock) SonarComponents(org.sonar.java.SonarComponents) SensorContextTester(org.sonar.api.batch.sensor.internal.SensorContextTester) DefaultInputFile(org.sonar.api.batch.fs.internal.DefaultInputFile) DefaultInputFile(org.sonar.api.batch.fs.internal.DefaultInputFile) File(java.io.File) DefaultFileSystem(org.sonar.api.batch.fs.internal.DefaultFileSystem) Test(org.junit.Test)

Example 8 with Files

use of com.google.common.io.Files in project closure-compiler by google.

the class RefasterJsTestUtils method assertFileRefactoring.

/**
 * Performs refactoring using a RefasterJs template and asserts that result is as expected.
 *
 * @param refasterJsTemplate path of the file or resource containing the RefasterJs template to
 *     apply
 * @param testDataPathPrefix path prefix of the directory from which input and expected-output
 *     file will be read
 * @param originalFile file name of the JavaScript source file to apply the refaster template to
 * @param additionalSourceFiles list of additional source files to provide to the compiler (e.g.
 *     dependencies)
 * @param expectedFileChoices the expected result options of applying the specified template to
 *     {@code originalFile}
 * @throws IOException
 */
public static void assertFileRefactoring(String refasterJsTemplate, String testDataPathPrefix, String originalFile, List<String> additionalSourceFiles, String... expectedFileChoices) throws IOException {
    RefasterJsScanner scanner = new RefasterJsScanner();
    scanner.loadRefasterJsTemplate(refasterJsTemplate);
    final String originalFilePath = testDataPathPrefix + File.separator + originalFile;
    ImmutableList.Builder<String> expectedCodeBuilder = ImmutableList.builder();
    for (String expectedFile : expectedFileChoices) {
        expectedCodeBuilder.add(slurpFile(testDataPathPrefix + File.separator + expectedFile));
    }
    final ImmutableList<String> expectedCode = expectedCodeBuilder.build();
    RefactoringDriver.Builder driverBuilder = new RefactoringDriver.Builder().addExterns(CommandLineRunner.getBuiltinExterns(CompilerOptions.Environment.BROWSER));
    for (String additionalSource : additionalSourceFiles) {
        driverBuilder.addInputsFromFile(testDataPathPrefix + File.separator + additionalSource);
    }
    RefactoringDriver driver = driverBuilder.addInputsFromFile(originalFilePath).build();
    List<SuggestedFix> fixes = driver.drive(scanner);
    assertThat(driver.getCompiler().getErrors()).isEmpty();
    assertThat(driver.getCompiler().getWarnings()).isEmpty();
    ImmutableList<String> newCode = ApplySuggestedFixes.applyAllSuggestedFixChoicesToCode(fixes, ImmutableMap.of(originalFilePath, slurpFile(originalFilePath))).stream().map(m -> m.get(originalFilePath)).collect(ImmutableList.toImmutableList());
    assertThat(newCode).comparingElementsUsing(new IgnoringWhitespaceCorrespondence()).containsExactlyElementsIn(expectedCode);
}
Also used : ApplySuggestedFixes(com.google.javascript.refactoring.ApplySuggestedFixes) RefasterJsScanner(com.google.javascript.refactoring.RefasterJsScanner) CompilerOptions(com.google.javascript.jscomp.CompilerOptions) ImmutableMap(com.google.common.collect.ImmutableMap) IOException(java.io.IOException) Truth.assertThat(com.google.common.truth.Truth.assertThat) SuggestedFix(com.google.javascript.refactoring.SuggestedFix) File(java.io.File) StandardCharsets(java.nio.charset.StandardCharsets) Correspondence(com.google.common.truth.Correspondence) List(java.util.List) CommandLineRunner(com.google.javascript.jscomp.CommandLineRunner) ImmutableList(com.google.common.collect.ImmutableList) Files(com.google.common.io.Files) RefactoringDriver(com.google.javascript.refactoring.RefactoringDriver) RefactoringDriver(com.google.javascript.refactoring.RefactoringDriver) SuggestedFix(com.google.javascript.refactoring.SuggestedFix) ImmutableList(com.google.common.collect.ImmutableList) RefasterJsScanner(com.google.javascript.refactoring.RefasterJsScanner)

Example 9 with Files

use of com.google.common.io.Files in project alluxio by Alluxio.

the class PinCommandMultipleMediaIntegrationTest method pinToMediumForceEviction.

@Test
public void pinToMediumForceEviction() throws Exception {
    FileSystem fileSystem = sLocalAlluxioClusterResource.get().getClient();
    FileSystemShell fsShell = new FileSystemShell(ServerConfiguration.global());
    AlluxioURI filePathA = new AlluxioURI("/testFileA");
    AlluxioURI dirPath = new AlluxioURI("/testDirA");
    AlluxioURI filePathB = new AlluxioURI(dirPath.getPath() + "/testFileB");
    AlluxioURI filePathC = new AlluxioURI("/testFileC");
    int fileSize = SIZE_BYTES / 2;
    FileSystemTestUtils.createByteFile(fileSystem, filePathA, WritePType.CACHE_THROUGH, fileSize);
    assertTrue(fileExists(fileSystem, filePathA));
    assertEquals(0, fsShell.run("pin", filePathA.toString(), "MEM"));
    URIStatus status = fileSystem.getStatus(filePathA);
    assertTrue(status.isPinned());
    assertTrue(status.getPinnedMediumTypes().contains("MEM"));
    fileSystem.createDirectory(dirPath);
    assertEquals(0, fsShell.run("pin", dirPath.toString(), "MEM"));
    FileSystemTestUtils.createByteFile(fileSystem, filePathB, WritePType.CACHE_THROUGH, fileSize);
    assertTrue(fileExists(fileSystem, filePathB));
    URIStatus statusB = fileSystem.getStatus(filePathB);
    assertTrue(statusB.isPinned());
    assertTrue(statusB.getPinnedMediumTypes().contains("MEM"));
    FileSystemTestUtils.createByteFile(fileSystem, filePathC, WritePType.THROUGH, fileSize);
    assertEquals(100, fileSystem.getStatus(filePathA).getInAlluxioPercentage());
    assertEquals(100, fileSystem.getStatus(filePathB).getInAlluxioPercentage());
    assertEquals(0, fileSystem.getStatus(filePathC).getInAlluxioPercentage());
    assertEquals(0, fsShell.run("pin", filePathC.toString(), "SSD"));
    // Verify files are replicated into the correct tier through job service
    CommonUtils.waitFor("File being loaded", () -> sJobCluster.getMaster().getJobMaster().listDetailed().stream().anyMatch(x -> x.getStatus().equals(Status.COMPLETED) && x.getName().equals("Replicate") && x.getAffectedPaths().contains(filePathC.getPath())), sWaitOptions);
    assertEquals(100, fileSystem.getStatus(filePathC).getInAlluxioPercentage());
    assertEquals(Constants.MEDIUM_MEM, fileSystem.getStatus(filePathA).getFileBlockInfos().get(0).getBlockInfo().getLocations().get(0).getMediumType());
    assertEquals(Constants.MEDIUM_MEM, fileSystem.getStatus(filePathB).getFileBlockInfos().get(0).getBlockInfo().getLocations().get(0).getMediumType());
    assertEquals(Constants.MEDIUM_SSD, fileSystem.getStatus(filePathC).getFileBlockInfos().get(0).getBlockInfo().getLocations().get(0).getMediumType());
    assertEquals(0, fsShell.run("unpin", filePathA.toString()));
    assertEquals(0, fsShell.run("pin", filePathC.toString(), "MEM"));
    status = fileSystem.getStatus(filePathA);
    assertFalse(status.isPinned());
    assertTrue(status.getPinnedMediumTypes().isEmpty());
    // Verify files are migrated from another tier into the correct tier through job service
    // Also verify that eviction works
    CommonUtils.waitFor("File being moved", () -> sJobCluster.getMaster().getJobMaster().listDetailed().stream().anyMatch(x -> x.getStatus().equals(Status.COMPLETED) && x.getName().equals("Move") && x.getAffectedPaths().contains(filePathC.getPath())), sWaitOptions);
    assertEquals(0, fileSystem.getStatus(filePathA).getInAlluxioPercentage());
    assertEquals(Constants.MEDIUM_MEM, fileSystem.getStatus(filePathC).getFileBlockInfos().get(0).getBlockInfo().getLocations().get(0).getMediumType());
}
Also used : BeforeClass(org.junit.BeforeClass) TestRule(org.junit.rules.TestRule) FileSystemTestUtils(alluxio.client.file.FileSystemTestUtils) Status(alluxio.job.wire.Status) PropertyKey(alluxio.conf.PropertyKey) WaitForOptions(alluxio.util.WaitForOptions) FileSystem(alluxio.client.file.FileSystem) Constants(alluxio.Constants) Files(com.google.common.io.Files) AlluxioURI(alluxio.AlluxioURI) ClassRule(org.junit.ClassRule) BaseIntegrationTest(alluxio.testutils.BaseIntegrationTest) Before(org.junit.Before) WritePType(alluxio.grpc.WritePType) FileSystemShell(alluxio.cli.fs.FileSystemShell) ServerConfiguration(alluxio.conf.ServerConfiguration) LocalAlluxioClusterResource(alluxio.testutils.LocalAlluxioClusterResource) LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) Assert.assertTrue(org.junit.Assert.assertTrue) AlluxioException(alluxio.exception.AlluxioException) Test(org.junit.Test) IOException(java.io.IOException) URIStatus(alluxio.client.file.URIStatus) Rule(org.junit.Rule) Assert.assertFalse(org.junit.Assert.assertFalse) Assert.assertEquals(org.junit.Assert.assertEquals) CommonUtils(alluxio.util.CommonUtils) FileSystem(alluxio.client.file.FileSystem) FileSystemShell(alluxio.cli.fs.FileSystemShell) URIStatus(alluxio.client.file.URIStatus) AlluxioURI(alluxio.AlluxioURI) BaseIntegrationTest(alluxio.testutils.BaseIntegrationTest) Test(org.junit.Test)

Example 10 with Files

use of com.google.common.io.Files in project controller by opendaylight.

the class JMXGeneratorTest method generateMBEsTest.

@Test
public void generateMBEsTest() throws Exception {
    // default value for module factory file is true
    map.put(JMXGenerator.MODULE_FACTORY_FILE_BOOLEAN, "randomValue");
    jmxGenerator.setAdditionalConfig(map);
    Collection<File> files = jmxGenerator.generateSources(context, outputBaseDir, Collections.singleton(threadsJavaModule), m -> Optional.empty());
    assertEquals(expectedModuleFileNames, toFileNames(files));
    for (File file : files) {
        final String name = file.getName();
        if (!name.endsWith("java")) {
            continue;
        }
        MbeASTVisitor visitor = new MbeASTVisitor(EXPECTED_PACKAGE_PREFIX + ".threads.java", name);
        verifyFile(file, visitor);
        switch(name) {
            case "AbstractDynamicThreadPoolModule.java":
                assertAbstractDynamicThreadPoolModule(visitor);
                break;
            case "AsyncEventBusModuleMXBean.java":
                assertEquals("Incorrenct number of generated methods", 4, visitor.methods.size());
                break;
            case "AbstractNamingThreadFactoryModuleFactory.java":
                assertAbstractNamingThreadFactoryModuleFactory(visitor);
                break;
            case "AsyncEventBusModule.java":
                assertContains(visitor.extnds, EXPECTED_PACKAGE_PREFIX + ".threads.java.AbstractAsyncEventBusModule");
                visitor.assertFields(0);
                assertEquals("Incorrenct number of generated methods", 2, visitor.methods.size());
                visitor.assertConstructors(2);
                visitor.assertMethodDescriptions(0);
                visitor.assertMethodJavadocs(0);
                break;
            case "EventBusModuleFactory.java":
                assertContains(visitor.extnds, EXPECTED_PACKAGE_PREFIX + ".threads.java.AbstractEventBusModuleFactory");
                visitor.assertFields(0);
                assertEquals("Incorrenct number of generated methods", 0, visitor.methods.size());
                visitor.assertConstructors(0);
                visitor.assertMethodDescriptions(0);
                visitor.assertMethodJavadocs(0);
                break;
        }
    }
    verifyXmlFiles(Collections2.filter(files, input -> input.getName().endsWith("xml")));
    // verify ModuleFactory file
    File moduleFactoryFile = JMXGenerator.concatFolders(generatedResourcesDir, "META-INF", "services", ModuleFactory.class.getName());
    assertTrue(moduleFactoryFile.exists());
    Set<String> lines = ImmutableSet.copyOf(Files.readLines(moduleFactoryFile, StandardCharsets.UTF_8));
    Set<String> expectedLines = ImmutableSet.of(EXPECTED_PACKAGE_PREFIX + ".threads.java.EventBusModuleFactory", EXPECTED_PACKAGE_PREFIX + ".threads.java.AsyncEventBusModuleFactory", EXPECTED_PACKAGE_PREFIX + ".threads.java.DynamicThreadPoolModuleFactory", EXPECTED_PACKAGE_PREFIX + ".threads.java.NamingThreadFactoryModuleFactory", EXPECTED_PACKAGE_PREFIX + ".threads.java.ThreadPoolRegistryImplModuleFactory");
    assertEquals(expectedLines, lines);
}
Also used : ConfigConstants(org.opendaylight.controller.config.yangjmxgenerator.ConfigConstants) DynamicMBeanWithInstance(org.opendaylight.controller.config.api.DynamicMBeanWithInstance) HashMap(java.util.HashMap) ModuleFactory(org.opendaylight.controller.config.spi.ModuleFactory) Collections2(com.google.common.collect.Collections2) AbstractModule(org.opendaylight.controller.config.spi.AbstractModule) DependencyResolverFactory(org.opendaylight.controller.config.api.DependencyResolverFactory) ArrayList(java.util.ArrayList) Assert.assertThat(org.junit.Assert.assertThat) EXPECTED_PACKAGE_PREFIX(org.opendaylight.controller.config.yangjmxgenerator.PackageTranslatorTest.EXPECTED_PACKAGE_PREFIX) ErrorHandler(org.xml.sax.ErrorHandler) ParseException(com.github.javaparser.ParseException) Files(com.google.common.io.Files) MavenProject(org.apache.maven.project.MavenProject) Assert.fail(org.junit.Assert.fail) ServiceInterfaceEntryTest(org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntryTest) CompilationUnit(com.github.javaparser.ast.CompilationUnit) Mockito.doReturn(org.mockito.Mockito.doReturn) Before(org.junit.Before) InputSource(org.xml.sax.InputSource) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) ImmutableSet(com.google.common.collect.ImmutableSet) Module(org.opendaylight.controller.config.spi.Module) Assert.assertNotNull(org.junit.Assert.assertNotNull) Collection(java.util.Collection) Assert.assertTrue(org.junit.Assert.assertTrue) Set(java.util.Set) IOException(java.io.IOException) Test(org.junit.Test) File(java.io.File) StandardCharsets(java.nio.charset.StandardCharsets) BundleContext(org.osgi.framework.BundleContext) List(java.util.List) SAXParseException(org.xml.sax.SAXParseException) DependencyResolver(org.opendaylight.controller.config.api.DependencyResolver) Assert.assertFalse(org.junit.Assert.assertFalse) DocumentBuilder(javax.xml.parsers.DocumentBuilder) SAXException(org.xml.sax.SAXException) Optional(java.util.Optional) DocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) JavaParser(com.github.javaparser.JavaParser) ModuleFactory(org.opendaylight.controller.config.spi.ModuleFactory) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) File(java.io.File) ServiceInterfaceEntryTest(org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntryTest) Test(org.junit.Test)

Aggregations

Files (com.google.common.io.Files)16 File (java.io.File)13 IOException (java.io.IOException)11 List (java.util.List)9 StandardCharsets (java.nio.charset.StandardCharsets)8 ArrayList (java.util.ArrayList)6 Test (org.junit.Test)6 ImmutableList (com.google.common.collect.ImmutableList)5 ImmutableMap (com.google.common.collect.ImmutableMap)5 Stream (java.util.stream.Stream)5 Joiner (com.google.common.base.Joiner)3 ImmutableSet (com.google.common.collect.ImmutableSet)3 Optional (java.util.Optional)3 Before (org.junit.Before)3 Compiler (com.facebook.buck.cxx.Compiler)2 CxxPreprocessorInput (com.facebook.buck.cxx.CxxPreprocessorInput)2 BuildTarget (com.facebook.buck.model.BuildTarget)2 Flavor (com.facebook.buck.model.Flavor)2 InternalFlavor (com.facebook.buck.model.InternalFlavor)2 BuildRule (com.facebook.buck.rules.BuildRule)2