-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support rules of type ExternalResource
add tests for the initial rule support. #433
- Loading branch information
Matthias Merdes
authored and
Matthias Merdes
committed
Sep 28, 2016
1 parent
d9cfac6
commit cc25056
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...java/org/junit/jupiter/engine/vintage/rulesupport/ExternalResourceLegacySupportTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2015-2016 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v1.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.junit.jupiter.engine.vintage.rulesupport; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import org.junit.Rule; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.junit.rules.TemporaryFolder; | ||
|
||
@ExtendWith(ExternalResourceLegacySupport.class) | ||
public class ExternalResourceLegacySupportTests { | ||
|
||
private File file; | ||
|
||
@Rule | ||
public TemporaryFolder folder = new TemporaryFolder(); | ||
|
||
@BeforeEach | ||
void setup() throws IOException { | ||
this.file = folder.newFile("temp.txt"); | ||
} | ||
|
||
@Test | ||
void checkTemporaryFolder() { | ||
System.out.println("file of TemporaryFolder: " + this.file); | ||
assert file.canRead(); | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...ava/org/junit/jupiter/engine/vintage/rulesupport/ExternalResourceWithoutAdapterTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2015-2016 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v1.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.junit.jupiter.engine.vintage.rulesupport; | ||
|
||
import org.junit.Rule; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.rules.TemporaryFolder; | ||
|
||
public class ExternalResourceWithoutAdapterTests { | ||
|
||
@Rule | ||
public TemporaryFolder folder = new TemporaryFolder(); | ||
|
||
@BeforeEach | ||
void setup() { | ||
try { | ||
folder.newFile("temp.txt"); | ||
} | ||
catch (Exception exception) { | ||
System.out.println("exception = " + exception.getMessage()); | ||
assert exception.getMessage().equals("the temporary folder has not yet been created"); | ||
} | ||
} | ||
|
||
@Test | ||
void checkTemporaryFolder() { | ||
// only needed to invoke testing at all | ||
} | ||
|
||
} |