-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I can't get this working, and I'm sure I'm doing something wrong.
- Loading branch information
1 parent
75cf924
commit 6321d35
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
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,38 @@ | ||
package ortus.boxlang.runtime.util; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import java.nio.file.Paths; | ||
|
||
@Disabled( "Not a single test is passing - I'm probably doing it wrong!" ) | ||
public class FQNTest { | ||
|
||
@DisplayName( "Can convert an absolute path to a full package/class path" ) | ||
@Test | ||
void testItCanParseAbsolutePathToString() { | ||
FQN fqn = new FQN( Paths.get( "/src/test/java/ortus/boxlang/runtime/util/FQNTest.java" ) ); | ||
assertEquals( "src.test.java.ortus.boxlang.runtime.util.FQNTest", fqn.toString() ); | ||
} | ||
@DisplayName( "Can convert an absolute path to just a package path" ) | ||
@Test | ||
void testItCanParseAbsolutePathToPackage() { | ||
FQN fqn = new FQN( Paths.get( "/src/test/java/ortus/boxlang/runtime/util/FQNTest.java" ) ); | ||
assertEquals( "src.test.java.ortus.boxlang.runtime.util", fqn.getPackageString() ); | ||
} | ||
|
||
@DisplayName( "Can convert a file path with prefix to a relative package name" ) | ||
@Test | ||
void testItCanParseRelativePrefixedPathToString() { | ||
FQN fqn = new FQN( Paths.get( "src/test/java/" ), Paths.get( "ortus/boxlang/runtime/util/FQNTest.java" ) ); | ||
assertEquals( "src.test.java.ortus.boxlang.runtime.util.FQNTest", fqn.toString() ); | ||
} | ||
|
||
@DisplayName( "Can convert a file path with prefix to a relative package name" ) | ||
@Test | ||
void testItCanParseRelativePrefixedPathToPackagePath() { | ||
FQN fqn = new FQN( Paths.get( "src/test/java/" ), Paths.get( "ortus/boxlang/runtime/util/FQNTest.java" ) ); | ||
assertEquals( "src.test.java.ortus.boxlang.runtime.util", fqn.getPackageString() ); | ||
} | ||
} |