Package org.junit.rules

Examples of org.junit.rules.TemporaryFolder


        singleFile = File.createTempFile(uid(), ".txt");
    }

    @Before
    public void createDirectory() throws IOException {
        final TemporaryFolder tempDir = createDir();
        final String[] dummyFiles = array("kafuka", "kaere", "kiri");
        for (final String name : dummyFiles) {
            tempDir.newFile(name);
        }
        dir = tempDir.getRoot();
        assertThat(dir.listFiles().length, is(dummyFiles.length));
    }
View Full Code Here


            }
        }
    }

    private TemporaryFolder createDir() throws IOException {
        final TemporaryFolder dir = new TemporaryFolder();
        dir.create();
        return dir;
    }
View Full Code Here

            }
        }
    }

    private static TemporaryFolder createDir() {
        final TemporaryFolder dir = new TemporaryFolder();
        try {
            dir.create();
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }
        return dir;
    }
View Full Code Here

      "org.pentaho.platform.web.http.api.resources" ).contextPath( "api" ).addFilter(
      PentahoRequestContextFilter.class, "pentahoRequestContextFilter" ).build();
  private MicroPlatform mp = new MicroPlatform( "test-src/solution" );

  public CommandLineProcessorTest() throws IOException {
    final TemporaryFolder tmpFolder = new TemporaryFolder();
    tmpFolder.create();
    tmpZipFileName = tmpFolder.getRoot().getAbsolutePath() + File.separator + "test.zip";

    NameBaseMimeResolver mimeResolver = mock( NameBaseMimeResolver.class );
    IRepositoryContentConverterHandler converterHandler = mock( IRepositoryContentConverterHandler.class );

    mp.setFullyQualifiedServerUrl( getBaseURI() + webAppDescriptor.getContextPath() + "/" );
View Full Code Here

  public static DesiredCapabilities capabilities = DesiredCapabilities.opera();
  public static File profileDirectory;

  @BeforeClass
  public static void setupDriver() throws IOException {
    profileDirectory = new TemporaryFolder().newFolder();
    capabilities.setCapability(PROFILE.getCapability(), profileDirectory.getPath());
    driver = new TestOperaDesktopDriver(capabilities);
  }
View Full Code Here

    assertTrue(runner.getSettings().arguments() instanceof OperaDesktopArguments);
  }

  @Test
  public void constructionWithProfile() throws IOException {
    TemporaryFolder temporaryProfile = new TemporaryFolder();
    temporaryProfile.create();

    // Make a new copy in a temporary file system so we don't overwrite our fixture
    String profilePath;

    try {
      Files.copy(resources.locate("profile/opera.ini"), temporaryProfile.newFile("operaprefs.ini"));
    } catch (IOException e) {
      fail("Unable to copy preference fixture: " + e.getMessage());
    }

    profilePath = temporaryProfile.getRoot().getAbsolutePath();

    settings.setProfile(profilePath);
    runner = new TestOperaRunner(settings);
    assertEquals(profilePath,
                 runner.getSettings().arguments().getArguments().get(0).getValue())// 1
View Full Code Here

  public File profileDirectory;

  @Before
  public void setup() throws IOException {
    OperaIntervals.HANDSHAKE_TIMEOUT.setValue(new Duration(2, TimeUnit.SECONDS));
    profileDirectory = new TemporaryFolder().newFolder();
    capabilities.setCapability(PROFILE.getCapability(), profileDirectory.getPath());
  }
View Full Code Here

  @Rule
  public TemporaryFolder temporaryProfile;

  @Before
  public void beforeEach() {
    temporaryProfile = new TemporaryFolder();
  }
View Full Code Here

  @Rule
  public TemporaryFolder tmp;

  @Before
  public void beforeEach() {
    tmp = new TemporaryFolder();
  }
View Full Code Here

  @Rule
  public TemporaryFolder tmp;

  @Before
  public void beforeEach() {
    tmp = new TemporaryFolder();
    settings = new OperaSettings();
  }
View Full Code Here

TOP

Related Classes of org.junit.rules.TemporaryFolder

Copyright © 2018 www.massapicom. 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.