gaul commented on code in PR #155:
URL: https://github.com/apache/jclouds/pull/155#discussion_r994623846


##########
providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobStoreTest.java:
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.azureblob.blobstore;
+
+import static org.testng.Assert.assertTrue;
+
+import org.testng.annotations.Test;
+
+/**
+ * Tests behavior of {@code AzureBlobStore}
+ */
+// NOTE:without testName, this will not call @Before* and fail w/NPE during 
surefire
+@Test(groups = "unit", testName = "AzureBlobStore")
+public class AzureBlobStoreTest {
+    
+    static String VALIDATION_REGEX = "[a-zA-Z0-9\\-_=]*";
+
+    public void testMakeBlockId() {
+       // how can i achieve something like a junit5 parametrized test in 
testng?
+       checkBlockIdForPartNumber(0);
+       checkBlockIdForPartNumber(1);
+       checkBlockIdForPartNumber(248);
+       checkBlockIdForPartNumber(504);
+       checkBlockIdForPartNumber(760);
+       checkBlockIdForPartNumber(1016);
+       checkBlockIdForPartNumber(1272);
+       checkBlockIdForPartNumber(4600);
+       checkBlockIdForPartNumber(6654);
+       checkBlockIdForPartNumber(867840);
+       checkBlockIdForPartNumber(868091);
+       checkBlockIdForPartNumber(868096);
+       checkBlockIdForPartNumber(-1);
+       checkBlockIdForPartNumber(-1023);
+   }
+   
+   private void checkBlockIdForPartNumber(int partNumber) {
+       String blockId = AzureBlobStore.makeBlockId(partNumber);
+       // if (!blockId.matches(VALIDATION_REGEX)){
+       //    System.out.println("--------------------------------------------- 
" + partNumber + " -> '" + blockId + "' -> " + 
blockId.matches(VALIDATION_REGEX));
+       //}

Review Comment:
   Please remove this commented code.



##########
providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobStoreTest.java:
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.azureblob.blobstore;
+
+import static org.testng.Assert.assertTrue;
+
+import org.testng.annotations.Test;
+
+/**
+ * Tests behavior of {@code AzureBlobStore}
+ */
+// NOTE:without testName, this will not call @Before* and fail w/NPE during 
surefire
+@Test(groups = "unit", testName = "AzureBlobStore")
+public class AzureBlobStoreTest {
+    
+    static String VALIDATION_REGEX = "[a-zA-Z0-9\\-_=]*";

Review Comment:
   Can you make this `private` and `final` and use `Pattern.compile?`?



-- 
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: notifications-unsubscr...@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to