Example usage for java.nio.file Path getClass

List of usage examples for java.nio.file Path getClass

Introduction

In this page you can find the example usage for java.nio.file Path getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.xwiki.vfs.internal.script.PathConverterTest.java

@Test
public void convertWhenOk() throws Exception {
    ResourceReferenceSerializer<VfsResourceReference, URI> serializer = this.mocker
            .getInstance(new DefaultParameterizedType(null, ResourceReferenceSerializer.class,
                    VfsResourceReference.class, URI.class), "truevfs");
    VfsResourceReference reference = new VfsResourceReference(URI.create("attach:Sandbox.WebHome@my.zip"),
            "a/b/c");
    when(serializer.serialize(reference)).thenReturn(URI.create("attach://xwiki:Sandbox.WebHome/my.zip/a/b/c"));

    Path path = this.mocker.getComponentUnderTest().convert(new DefaultParameterizedType(null, Path.class),
            "attach:Sandbox.WebHome@my.zip/a/b/c");
    assertEquals("attach://xwiki:Sandbox.WebHome/my.zip/a/b/c", path.toString());
    assertEquals(TPath.class.getName(), path.getClass().getName());
}