summaryrefslogtreecommitdiffstats
path: root/vespaclient-java/src/test/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'vespaclient-java/src/test/java/com')
-rw-r--r--vespaclient-java/src/test/java/com/yahoo/vespaget/CommandLineOptionsTest.java19
-rw-r--r--vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java6
-rw-r--r--vespaclient-java/src/test/java/com/yahoo/vespavisit/VdsVisitTestCase.java7
3 files changed, 21 insertions, 11 deletions
diff --git a/vespaclient-java/src/test/java/com/yahoo/vespaget/CommandLineOptionsTest.java b/vespaclient-java/src/test/java/com/yahoo/vespaget/CommandLineOptionsTest.java
index f52be3d47dd..20d12d3f55f 100644
--- a/vespaclient-java/src/test/java/com/yahoo/vespaget/CommandLineOptionsTest.java
+++ b/vespaclient-java/src/test/java/com/yahoo/vespaget/CommandLineOptionsTest.java
@@ -1,15 +1,24 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespaget;
+import com.yahoo.document.fieldset.AllFields;
+import com.yahoo.document.fieldset.DocIdOnly;
import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
import java.util.Iterator;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
/**
* Test class for {@link CommandLineOptions}
@@ -45,7 +54,7 @@ public class CommandLineOptionsTest {
assertFalse(params.help);
assertFalse(params.documentIds.hasNext());
assertFalse(params.printIdsOnly);
- assertEquals("[all]", params.fieldSet);
+ assertEquals(AllFields.NAME, params.fieldSet);
assertEquals("default-get", params.route);
assertTrue(params.cluster.isEmpty());
assertEquals("client", params.configId);
@@ -92,7 +101,7 @@ public class CommandLineOptionsTest {
public void testInvalidCombination3() {
exception.expect(IllegalArgumentException.class);
exception.expectMessage("Field set option can not be used in combination with print ids option.");
- getParsedOptions("--printids", "--fieldset", "[all]");
+ getParsedOptions("--printids", "--fieldset", AllFields.NAME);
}
@Test
@@ -138,7 +147,7 @@ public class CommandLineOptionsTest {
@Test
public void testPrintids() {
ClientParameters params = getParsedOptions("--printids");
- assertEquals("[id]", params.fieldSet);
+ assertEquals(DocIdOnly.NAME, params.fieldSet);
}
@Test
diff --git a/vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java b/vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java
index c662e2fed62..d8b5c267bf2 100644
--- a/vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java
+++ b/vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java
@@ -1,11 +1,11 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespaget;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yahoo.document.DataType;
import com.yahoo.document.Document;
import com.yahoo.document.DocumentId;
+import com.yahoo.document.fieldset.AllFields;
import com.yahoo.documentapi.messagebus.MessageBusDocumentAccess;
import com.yahoo.documentapi.messagebus.MessageBusSyncSession;
import com.yahoo.documentapi.messagebus.loadtypes.LoadType;
@@ -96,7 +96,7 @@ public class DocumentRetrieverTest {
.setCluster("")
.setRoute("default")
.setConfigId("client")
- .setFieldSet("[all]")
+ .setFieldSet(AllFields.NAME)
.setPrintIdsOnly(false)
.setHelp(false)
.setShowDocSize(false)
@@ -180,7 +180,7 @@ public class DocumentRetrieverTest {
}
@Test
- public void testJsonOutput() throws DocumentRetrieverException, JsonParseException, IOException {
+ public void testJsonOutput() throws DocumentRetrieverException, IOException {
ClientParameters params = createParameters()
.setDocumentIds(asIterator(DOC_ID_1, DOC_ID_2, DOC_ID_3))
.setJsonOutput(true)
diff --git a/vespaclient-java/src/test/java/com/yahoo/vespavisit/VdsVisitTestCase.java b/vespaclient-java/src/test/java/com/yahoo/vespavisit/VdsVisitTestCase.java
index d9efe2c5129..4c8fbb1beee 100644
--- a/vespaclient-java/src/test/java/com/yahoo/vespavisit/VdsVisitTestCase.java
+++ b/vespaclient-java/src/test/java/com/yahoo/vespavisit/VdsVisitTestCase.java
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespavisit;
+import com.yahoo.document.fieldset.DocIdOnly;
import com.yahoo.document.select.parser.ParseException;
import com.yahoo.documentapi.*;
import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol;
@@ -83,7 +84,7 @@ public class VdsVisitTestCase {
assertNotNull(params);
assertEquals(654321, allParams.getFullTimeout());
assertEquals(654321, params.getTimeoutMs());
- assertEquals("[id]", params.getFieldSet());
+ assertEquals(DocIdOnly.NAME, params.getFieldSet());
}
@Test
@@ -98,7 +99,7 @@ public class VdsVisitTestCase {
VisitorParameters params = allParams.getVisitorParameters();
assertNotNull(params);
- assertEquals("[id]", params.getFieldSet());
+ assertEquals(DocIdOnly.NAME, params.getFieldSet());
assertTrue(allParams.isPrintIdsOnly());
}
@@ -295,7 +296,7 @@ public class VdsVisitTestCase {
VisitorParameters params = allParams.getVisitorParameters();
assertNotNull(params);
assertEquals("foo", allParams.getStatisticsParts());
- assertEquals("[id]", params.getFieldSet());
+ assertEquals(DocIdOnly.NAME, params.getFieldSet());
assertEquals("CountVisitor", params.getVisitorLibrary());
}