Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pdt search updates #1473

Merged
merged 10 commits into from
Jun 18, 2019
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ImportProductSetsIT {
private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
private static final String COMPUTE_REGION = "us-west1";
private static final String GCS_URI =
"gs://java-docs-samples-testing/product-search/product_sets.csv";
"gs://cloud-samples-data/vision/product_search/product_sets.csv";
private static final String PRODUCT_SET_ID = "fake_product_set_id_for_testing";
private static final String PRODUCT_ID_1 = "fake_product_id_for_testing_1";
private static final String PRODUCT_ID_2 = "fake_product_id_for_testing_2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,21 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Integration (system) tests for {@link ProductSearch}. */
/**
* Integration (system) tests for {@link ProductSearch}.Tests rely on pre-created product set
* that has been indexed.
**/
@RunWith(JUnit4.class)
@SuppressWarnings("checkstyle:abbreviationaswordinname")
public class ProductSearchIT {
private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
private static final String COMPUTE_REGION = "us-west1";
private static final String GCS_URI =
"gs://java-docs-samples-testing/product-search/indexed_product_sets.csv";
private static final String PRODUCT_SET_ID = "indexed_product_set_id_for_testing";
private static final String PRODUCT_CATEGORY = "apparel";
private static final String PRODUCT_ID_1 = "indexed_product_id_for_testing_1";
private static final String PRODUCT_ID_2 = "indexed_product_id_for_testing_2";
private static final String IMAGE_URI_1 =
"gs://java-docs-samples-testing/product-search/shoes_1.jpg";
"gs://cloud-samples-data/vision/product_search/shoes_1.jpg";
private static final String FILE_PATH_1 = "./resources/shoes_1.jpg";
private static final String FILTER = "style=womens";
private ByteArrayOutputStream bout;
Expand All @@ -51,15 +52,11 @@ public void setUp() throws Exception {
bout = new ByteArrayOutputStream();
out = new PrintStream(bout);
System.setOut(out);
ImportProductSets.importProductSets(PROJECT_ID, COMPUTE_REGION, GCS_URI);
bout.reset();
}

@After
public void tearDown() throws Exception {
ProductManagement.deleteProduct(PROJECT_ID,COMPUTE_REGION,PRODUCT_ID_1);
ProductManagement.deleteProduct(PROJECT_ID,COMPUTE_REGION,PRODUCT_ID_2);
ProductSetManagement.deleteProductSet(PROJECT_ID, COMPUTE_REGION, PRODUCT_SET_ID);
System.setOut(null);
}

Expand Down