Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@

package fiftyone.devicedetection.examples.console;

import fiftyone.devicedetection.examples.shared.DataFileHelper;
import fiftyone.devicedetection.examples.shared.EvidenceHelper;
import fiftyone.devicedetection.shared.testhelpers.TestFileUtils;
import org.junit.Test;

public class GettingStartedOnPremTest {

@Test
public void gettingStartedOnPremTest() throws Exception {
GettingStartedOnPrem.run(TestFileUtils.getHashFileName() == null
? TestFileUtils.LITE_HASH_DATA_FILE_PATH
: TestFileUtils.getHashFileName(),
GettingStartedOnPrem.run(DataFileHelper.getDataFileLocation(null),
EvidenceHelper.setUpEvidence(), System.out);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

package fiftyone.devicedetection.examples.console;

import fiftyone.devicedetection.shared.testhelpers.TestFileUtils;
import fiftyone.devicedetection.examples.shared.DataFileHelper;
import org.junit.Test;

import java.io.ByteArrayOutputStream;
Expand All @@ -42,10 +42,8 @@ public class ManualDataUpdateTest {
@Test
public void manualDataUpdate_ReloadsTheDataFile() throws Exception {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ManualDataUpdate.run(TestFileUtils.getHashFileName() == null
? TestFileUtils.LITE_HASH_DATA_FILE_PATH
: TestFileUtils.getHashFileName(),
buffer);
ManualDataUpdate.run(
DataFileHelper.getDataFileLocation(null), buffer);
String output = buffer.toString("UTF-8");
System.out.println(output);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@

package fiftyone.devicedetection.examples.console;

import fiftyone.devicedetection.shared.testhelpers.TestFileUtils;
import fiftyone.devicedetection.examples.shared.DataFileHelper;
import org.junit.Test;

public class MetadataOnPremTest {
@Test
public void gettingMetaDataOnPremTest() throws Exception {
MetadataOnPrem.run(TestFileUtils.getHashFileName() == null
? TestFileUtils.LITE_HASH_DATA_FILE_PATH
: TestFileUtils.getHashFileName(), System.out);
MetadataOnPrem.run(
DataFileHelper.getDataFileLocation(null), System.out);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,16 @@

package fiftyone.devicedetection.examples.console;

import fiftyone.devicedetection.shared.testhelpers.TestFileUtils;
import fiftyone.devicedetection.examples.shared.DataFileHelper;
import org.junit.Test;

import java.io.FileInputStream;
import java.util.Objects;

public class OfflineProcessingTest {
@Test
public void offlineProcessingTest() throws Exception {
OfflineProcessing.run(TestFileUtils.getHashFileName() == null
? TestFileUtils.LITE_HASH_DATA_FILE_PATH
: TestFileUtils.getHashFileName(),
new FileInputStream(Objects.requireNonNull(TestFileUtils.getEvidenceFile())),
OfflineProcessing.run(DataFileHelper.getDataFileLocation(null),
new FileInputStream(DataFileHelper.getEvidenceFile(null)),
System.out);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

package fiftyone.devicedetection.examples.console;

import fiftyone.devicedetection.shared.testhelpers.TestKeyUtils;
import fiftyone.devicedetection.examples.shared.KeyHelper;
import org.junit.Test;

import static fiftyone.devicedetection.examples.console.UpdateDataFile.run;
Expand All @@ -33,9 +33,9 @@
public class UpdateDataFileTest {
@Test
public void updateExampleTest () throws Exception {
String licenseKey = TestKeyUtils.getNamedKey(UpdateDataFile.UPDATE_EXAMPLE_LICENSE_KEY_NAME);
String licenseKey = KeyHelper.getNamedKey(UpdateDataFile.UPDATE_EXAMPLE_LICENSE_KEY_NAME);
assumeFalse("Skipping test, no license key found",
TestKeyUtils.isInvalidKey(licenseKey));
KeyHelper.isInvalidKey(licenseKey));
try {
run(null, licenseKey, false);
} catch (IllegalStateException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import fiftyone.devicedetection.examples.shared.DataFileHelper;
import fiftyone.devicedetection.examples.shared.FindOutMore;
import fiftyone.devicedetection.shared.testhelpers.TestFileUtils;
import org.eclipse.jetty.server.Server;
import org.junit.AfterClass;
import org.junit.BeforeClass;
Expand All @@ -47,10 +46,8 @@ public class GettingStartedWebOnPremTest {
public static void startJetty() throws Exception {
// With no Enterprise file, the free Lite file is found, or
// downloaded, as the example finds it, so a fresh clone runs this.
System.setProperty("TestDataFile", TestFileUtils.getHashFile() == null
? DataFileHelper.findDataFile(
TestFileUtils.LITE_HASH_DATA_FILE_PATH).getAbsolutePath()
: TestFileUtils.getHashFile().getAbsolutePath());
System.setProperty(
"TestDataFile", DataFileHelper.getDataFileLocation(null));
SERVER = EmbedJetty.startWebApp(getFilePath(resourceBase).getAbsolutePath(), 8081);
}

Expand Down
Loading