| 1 | /* |
| 2 | * JTiger Unit Testing Framework for J2SE 1.5 |
| 3 | * Copyright (C) 2005 Tony Morris |
| 4 | * |
| 5 | * This software is licenced under the |
| 6 | * Common Public Licence version 1.0 |
| 7 | * http://www.opensource.org/licenses/cpl1.0.php |
| 8 | * |
| 9 | * You received a copy of this licence with this software. |
| 10 | */ |
| 11 | package org.jtiger.report.html; |
| 12 | |
| 13 | final class FixturesFilenamePolicyFactory |
| 14 | { |
| 15 | private FixturesFilenamePolicyFactory() |
| 16 | { |
| 17 | |
| 18 | } |
| 19 | |
| 20 | static FilenamePolicy newFixturesFilenamePolicy() |
| 21 | { |
| 22 | return new FixturesFilenamePolicy(); |
| 23 | } |
| 24 | |
| 25 | private static final class FixturesFilenamePolicy implements FilenamePolicy |
| 26 | { |
| 27 | private int counter; |
| 28 | |
| 29 | FixturesFilenamePolicy() |
| 30 | { |
| 31 | |
| 32 | } |
| 33 | |
| 34 | public String nextFilename() |
| 35 | { |
| 36 | final StringBuilder filename = new StringBuilder(); |
| 37 | filename.append("fixtures/fixture"); |
| 38 | filename.append(counter++); |
| 39 | filename.append(".html"); |
| 40 | return filename.toString(); |
| 41 | } |
| 42 | } |
| 43 | } |