本文整理匯總了Java中org.kurento.commons.ClassPath類的典型用法代碼示例。如果您正苦於以下問題:Java ClassPath類的具體用法?Java ClassPath怎麽用?Java ClassPath使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ClassPath類屬於org.kurento.commons包,在下文中一共展示了ClassPath類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: copyClassesToRemote
import org.kurento.commons.ClassPath; //導入依賴的package包/類
private void copyClassesToRemote(final Class<?>[] classesName) throws IOException {
String targetFolder = remoteKms.getTmpFolder();
for (Class<?> className : classesName) {
String classFile = "/" + className.getName().replace(".", "/") + ".class";
Path sourceClass = ClassPath.get(classFile);
Path classFileInDisk = Files.createTempFile("", ".class");
Files.copy(sourceClass, classFileInDisk, StandardCopyOption.REPLACE_EXISTING);
remoteKms.mkdirs(Paths.get(targetFolder + classFile).getParent().toString());
remoteKms.scp(classFileInDisk.toString(), targetFolder + classFile);
Files.delete(classFileInDisk);
}
}
示例2: testInvalidFile
import org.kurento.commons.ClassPath; //導入依賴的package包/類
@Test
public void testInvalidFile() throws IOException {
String expectedKmsUri = KmsUrlLoader.DEFAULT_KMS_URL;
String kmsUri = new KmsUrlLoader(ClassPath.get("/invalid.properties")).getKmsUrl("id");
assertEquals("Invalid kmsUri read from file", expectedKmsUri, kmsUri);
}
示例3: from
import org.kurento.commons.ClassPath; //導入依賴的package包/類
public static Collection<Object[]> from(String defaultBrowserConfigFile) {
try {
// Load executions from config file or system properties
String executionsData =
getProperty(getProperty(TEST_CONFIG_EXECUTIONS_PROPERTY, TEST_CONFIG_EXECUTIONS_DEFAULT));
BrowserConfig browserConfig = null;
Gson gson = new Gson();
if (executionsData != null) {
browserConfig =
gson.fromJson("{\"executions\":" + executionsData + "}", BrowserConfig.class);
} else {
// If there is no browserConfig in config file, load default
// from defaultBrowserConfigFile
try (BufferedReader br = Files.newBufferedReader(
ClassPath.get("/" + defaultBrowserConfigFile), StandardCharsets.UTF_8)) {
browserConfig = gson.fromJson(br, BrowserConfig.class);
}
}
return browserConfig.getTestScenario();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例4: testKmsUri
import org.kurento.commons.ClassPath; //導入依賴的package包/類
@Test
public void testKmsUri() throws IOException {
String expectedKmsUri = "ws://test.url";
String kmsUri = new KmsUrlLoader(ClassPath.get("/config-test.properties")).getKmsUrl("id");
assertEquals("Invalid kmsUri read from file", expectedKmsUri, kmsUri);
}
示例5: testDefaultKmsUri
import org.kurento.commons.ClassPath; //導入依賴的package包/類
@Test
public void testDefaultKmsUri() throws IOException {
String expectedKmsUri = KmsUrlLoader.DEFAULT_KMS_URL;
String kmsUri = new KmsUrlLoader(ClassPath.get("/non-existing.properties")).getKmsUrl("id");
assertEquals("Invalid kmsUri read from file", expectedKmsUri, kmsUri);
}
示例6: testKmsUriProviderWithLoad
import org.kurento.commons.ClassPath; //導入依賴的package包/類
@Test
public void testKmsUriProviderWithLoad() throws IOException {
String expectedKmsUri = "ws://vnfmUri?load=50";
KmsUrlLoader kmsUriLoader = new KmsUrlLoader(ClassPath.get("/provider-config.properties"));
String kmsUri = kmsUriLoader.getKmsUrlLoad("id", 50);
assertEquals("Invalid kmsUri read from file", expectedKmsUri, kmsUri);
}
示例7: testKmsUriProvider
import org.kurento.commons.ClassPath; //導入依賴的package包/類
@Test
public void testKmsUriProvider() throws IOException {
String expectedKmsUri = "ws://vnfmUri";
KmsUrlLoader kmsUriLoader = new KmsUrlLoader(ClassPath.get("/provider-config.properties"));
String kmsUri = kmsUriLoader.getKmsUrl("id");
assertEquals("Invalid kmsUri read from file", expectedKmsUri, kmsUri);
}