chatman commented on code in PR #3747:
URL: https://github.com/apache/solr/pull/3747#discussion_r2417467952


##########
solr/core/src/test/org/apache/solr/schema/DenseVectorFieldTest.java:
##########
@@ -760,4 +771,67 @@ public void 
denseVectorByteEncoding_shouldRaiseExceptionWithFloatValues() throws
       deleteCore();
     }
   }
+
+  private void addDocWithJavaBin(SolrInputDocument doc) throws Exception {
+    UpdateRequest ur = new UpdateRequest();
+    ur.add(doc);
+
+    ByteArrayOutputStream bos = new ByteArrayOutputStream();
+    JavaBinUpdateRequestCodec codec = new JavaBinUpdateRequestCodec();
+    codec.marshal(ur, bos);
+
+    byte[] payload = bos.toByteArray();
+
+    ContentStreamBase.ByteArrayStream cs =
+        new ContentStreamBase.ByteArrayStream(payload, "application/javabin");
+
+    try (SolrQueryRequest sreq = req()) {
+      SolrQueryResponse srsp = new SolrQueryResponse();
+      UpdateRequestProcessorChain chain =
+          h.getCore().getUpdateProcessorChain(new ModifiableSolrParams());
+      try (UpdateRequestProcessor proc = chain.createProcessor(sreq, srsp)) {
+        new JavabinLoader().load(sreq, srsp, cs, proc);
+        proc.finish();
+      }
+      h.getCore().getUpdateHandler().commit(new CommitUpdateCommand(sreq, 
false));
+    }
+  }
+
+  @Test
+  public void 
indexing_floatPrimitiveArray_viaJavaBin_shouldIndexAndReturnStored()

Review Comment:
   Tests in Solr usually don't have the "_shouldIndexAndReturnStored" part in 
the method name. Also, camel casing is preferable for test names. I think for 
sake of consistency, we should name this test 
testIndexingFloatPrimitiveArrayViaJavaBin, or simply "testIndexingViaJavaBin" 
and make sure both float[] and List<float> works (maybe through a 
randomization). Also, can we fold both the double[] and float[] tests into a 
single test?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to