Search in sources :

Example 1 with MemoryMapMapParserDelegate

use of net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate in project memory-map-plugin by Praqma.

the class MemoryMapParserDelegateTest method testFileNotFoundWithNullPattern.

@Test(expected = MemoryMapFileNotFoundError.class)
public void testFileNotFoundWithNullPattern() throws IOException {
    File filePath = new File(file.getAbsolutePath().substring(0, file.getAbsolutePath().lastIndexOf(File.separator)));
    MemoryMapMapParserDelegate delegate = new MemoryMapMapParserDelegate();
    delegate.findFile(filePath, null);
}
Also used : File(java.io.File) MemoryMapMapParserDelegate(net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate) Test(org.junit.Test)

Example 2 with MemoryMapMapParserDelegate

use of net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate in project memory-map-plugin by Praqma.

the class MemoryMapParserDelegateTest method testFileNotFoundWithBlankPattern.

@Test(expected = MemoryMapFileNotFoundError.class)
public void testFileNotFoundWithBlankPattern() throws IOException {
    File filePath = new File(file.getAbsolutePath().substring(0, file.getAbsolutePath().lastIndexOf(File.separator)));
    MemoryMapMapParserDelegate delegate = new MemoryMapMapParserDelegate();
    delegate.findFile(filePath, " ");
}
Also used : File(java.io.File) MemoryMapMapParserDelegate(net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate) Test(org.junit.Test)

Example 3 with MemoryMapMapParserDelegate

use of net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate in project memory-map-plugin by Praqma.

the class MemoryMapParserDelegateTest method testFileFound.

@Test
public void testFileFound() throws IOException {
    File filePath = new File(file.getAbsolutePath().substring(0, file.getAbsolutePath().lastIndexOf(File.separator)));
    MemoryMapMapParserDelegate delegate = new MemoryMapMapParserDelegate();
    delegate.findFile(filePath, file.getName());
}
Also used : File(java.io.File) MemoryMapMapParserDelegate(net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate) Test(org.junit.Test)

Example 4 with MemoryMapMapParserDelegate

use of net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate in project memory-map-plugin by Praqma.

the class MemoryMapParserDelegateTest method findFilePatternWorks_test.

@Test
public void findFilePatternWorks_test() throws IOException {
    MemoryMapMapParserDelegate delegate = new MemoryMapMapParserDelegate();
    MemoryMapGraphConfiguration gc = new MemoryMapGraphConfiguration(null, null);
    gc.setGraphDataList("CODE,DATA,CONST");
    gc.setGraphCaption("Config Memory Graph");
    List<MemoryMapGraphConfiguration> graphConfig = Collections.singletonList(gc);
    AbstractMemoryMapParser parser = new TexasInstrumentsMemoryMapParser("TI", "TexasInstrumentsMapFile.txt", "28069_RAM_lnk.cmd", 16, graphConfig, Boolean.TRUE);
    List<AbstractMemoryMapParser> parsers = Collections.singletonList(parser);
    delegate.setParsers(parsers);
    assertNotNull(delegate.getParsers());
    assertNotNull(parser.getMapFile());
    File test = new File(file.getAbsolutePath().substring(0, file.getAbsolutePath().lastIndexOf(File.separator)));
    assertTrue(test.isDirectory());
    try {
        delegate.findFile(test, "*.map");
    } catch (Exception ex) {
        fail("Parser did not find the file" + ex);
    }
}
Also used : MemoryMapGraphConfiguration(net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration) TexasInstrumentsMemoryMapParser(net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser) AbstractMemoryMapParser(net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser) File(java.io.File) MemoryMapMapParserDelegate(net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate) IOException(java.io.IOException) Test(org.junit.Test)

Aggregations

File (java.io.File)4 MemoryMapMapParserDelegate (net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate)4 Test (org.junit.Test)4 IOException (java.io.IOException)1 MemoryMapGraphConfiguration (net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration)1 AbstractMemoryMapParser (net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser)1 TexasInstrumentsMemoryMapParser (net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser)1