官术网_书友最值得收藏!

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Tests should be readable and expressive; for example, a test that verifies unauthorized access can be written as testUnauthorizedAccess() or rather when_an_unauthorized_user_accesses_the_system_then_raises_secuirty_error()."

A block of code is set as follows:

@Test
  public void currencyRoundsOff() throws Exception {
    assertNotNull(CurrencyFormatter.format(100.999));
    assertTrue(CurrencyFormatter.format(100.999).contains("$"));
    assertEquals("$101.00", CurrencyFormatter.format(100.999));
  }

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

public class LocaleTest {
  private Locale defaultLocale;
  @Before
  public void setUp() {
    defaultLocale = Locale.getDefault();
    Locale.setDefault(Locale.GERMANY);
  }
  @After
  public void restore() {
    Locale.setDefault(defaultLocale);
  }
  @Test
  public void currencyRoundsOff() throws Exception {
    assertEquals("$101.00", CurrencyFormatter.format(100.999));
  }
}

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Go to the Libraries tab in the project's build path."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

主站蜘蛛池模板: 重庆市| 仪征市| 固阳县| 砚山县| 姚安县| 漳州市| 桦南县| 都昌县| 新乡县| 克东县| 普兰店市| 吴堡县| 简阳市| 楚雄市| 宁强县| 淮滨县| 南安市| 准格尔旗| 六盘水市| 望奎县| 武川县| 石嘴山市| 大埔区| 新余市| 沁阳市| 红河县| 房产| 黑山县| 玉林市| 青铜峡市| 贵德县| 丹巴县| 崇义县| 休宁县| 福海县| 阿克| 屯门区| 双柏县| 分宜县| 东乌| 绩溪县|