Examples of format()


Examples of org.jfree.chart.util.RelativeDateFormat.format()

    /**
     * Some checks for the formatting.
     */
    public void testFormat() {
        RelativeDateFormat rdf = new RelativeDateFormat();
        String s = rdf.format(new Date(2 * 60L * 60L * 1000L + 122500L));
        assertEquals("2h2m2.500s", s);
    }

    /**
     * Test that we can configure the RelativeDateFormat to show
View Full Code Here

Examples of org.jitterbit.util.StorageSizeUnit.format()

        return null;
    }

    private String getTextFor(long value) {
        StorageSizeUnit unit = getUnit(value);
        return unit.format(value);
    }

    private StorageSizeUnit getUnit(long value) {
        if (fixedUnit != null) {
            return fixedUnit;
View Full Code Here

Examples of org.jnetpcap.packet.format.JFormatter.format()

    JPacket packet =
        TestUtils.getPcapPacket("tests/test-icmp-recordroute-opt.pcap", 0);

    JFormatter out = new TextFormatter();
    out.format(packet);
   
    assertNotNull(packet);
    assertTrue(packet.hasHeader(ip));
    assertTrue(ip.hasSubHeaders());
    assertFalse(ip.hasSubHeader(lsroute));
View Full Code Here

Examples of org.jnetpcap.packet.format.TextFormatter.format()

    JScanner scanner = new JScanner();
    scanner.scan(packet, Ethernet.ID);

    TextFormatter out = new TextFormatter();
    out.format(packet);
  }

  /**
   * _test scan file bb handler.
   *
 
View Full Code Here

Examples of org.jnetpcap.packet.format.XmlFormatter.format()

  public void testXmlFormatter() throws IOException {
    JFormatter out = new XmlFormatter(OUT);
   
    JPacket packet = TestUtils.getPcapPacket("tests/test-afs.pcap", 0);

    out.format(packet);
  }
 
  /**
   * Test xml ip4 record route opt.
   *
 
View Full Code Here

Examples of org.jnode.fs.fat.FatFileSystemFormatter.format()

            dm.register(dev);

            log.info("Format initrd ramdisk");

            final FatFileSystemFormatter formatter = new FatFileSystemFormatter(FatType.FAT16);
            final FileSystem<?> fs = formatter.format(dev);
            try {
                fs.getRootEntry().getDirectory().addDirectory("tmp");
            } catch (IOException ex) {
                log.error("Cannot create tmp on ramdisk");
            }
View Full Code Here

Examples of org.jnode.fs.fat.GrubFatFormatter.format()

    public static void createFloppy(File f) throws Exception {

        GrubFatFormatter ff = new GrubFatFormatter(0, null, null);
        FileDevice newFd = new FileDevice(f, "rw");
        newFd.setLength(1440 * 1024);
        ff.format(newFd);

        // newFd.start();
        final FileSystemService fSS = InitialNaming.lookup(FileSystemService.NAME);
        FatFileSystemType type = fSS.getFileSystemType(FatFileSystemType.ID);
        FatFileSystem fs = new FatFileSystem(newFd, false, type);
View Full Code Here

Examples of org.jnode.shell.syntax.AlternativesSyntax.format()

        Test test = new Test();
        Syntax syntax1 =
                new AlternativesSyntax(new OptionSyntax("intArg", 'i'), new OptionSyntax("fileArg",
                        'f'), new OptionSyntax("flagArg", "xxx"));
        Assert.assertEquals("( -i <intArg> ) | ( -f <fileArg> ) | --xxx",
                syntax1.format(test.getArgumentBundle()));
    }

    @org.junit.Test
    public void testOne() throws Exception {
        TestShell shell = new TestShell();
View Full Code Here

Examples of org.jnode.shell.syntax.MuAlternation.format()

    }

    @Test
    public void testFormat2() {
        MuSyntax syntax = new MuAlternation("root", new MuBackReference("root"), null);
        Assert.assertEquals("<root> ::= ( <[root]> |  )\n<[root]> ::= <root>", syntax.format());
        syntax.resolveBackReferences();
        Assert.assertEquals("<root> ::= ( <root> |  )", syntax.format());
    }
}
View Full Code Here

Examples of org.jnode.shell.syntax.MuSyntax.format()

    }

    @Test
    public void testFormat2() {
        MuSyntax syntax = new MuAlternation("root", new MuBackReference("root"), null);
        Assert.assertEquals("<root> ::= ( <[root]> |  )\n<[root]> ::= <root>", syntax.format());
        syntax.resolveBackReferences();
        Assert.assertEquals("<root> ::= ( <root> |  )", syntax.format());
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.