From 8c37cd8b67e574382d919bcd7d9a533f35a2be94 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Thu, 2 May 2024 11:15:13 -0400 Subject: [PATCH] add unit test that reproduces the issue --- .../concourse/ete/bugrepro/GH499.java | 69 +++++++++++++++++++ .../src/test/resources/cover-letter.txt | 3 + 2 files changed, 72 insertions(+) create mode 100644 concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/bugrepro/GH499.java create mode 100644 concourse-ete-tests/src/test/resources/cover-letter.txt diff --git a/concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/bugrepro/GH499.java b/concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/bugrepro/GH499.java new file mode 100644 index 0000000000..a240e75dbf --- /dev/null +++ b/concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/bugrepro/GH499.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2013-2024 Cinchapi Inc. + * + * Licensed 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 com.cinchapi.concourse.ete.bugrepro; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Map; +import java.util.Set; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.common.base.Array; +import com.cinchapi.concourse.test.ClientServerTest; +import com.cinchapi.concourse.util.FileOps; +import com.cinchapi.concourse.util.Resources; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; + +/** + * Unit tests to validate that exported data can be imported as is. + * + * @author Jeff Nelson + */ +public class GH499 extends ClientServerTest { + + @Test + public void reproGH_499() { + String coverLetter = FileOps + .read(Resources.getAbsolutePath("/cover-letter.txt")); + Map data = ImmutableMap.of("name", "Jeff Nelson", + "coverLetter", coverLetter, "age", ImmutableList.of(1, 2)); + long record = client.insert(data); + Map> expected = client.select(record); + Path file = Paths.get(FileOps.tempFile()); + server.executeCli("export", + "--file " + file.toString() + + " --username admin --password admin --port " + + server.getClientPort()); + FileOps.readLines(file.toString()).forEach(System.out::println); + System.out.println(server.executeCli("import", + Array.containing("--data", file.toString(), "-e", "test", + "--username", "admin", "--password", "admin", "--port", + Integer.toString(server.getClientPort())))); + client = server.connect("admin", "admin", "test"); + Map> actual = client + .select(client.inventory().iterator().next()); + Assert.assertEquals(expected, actual); + } + + @Override + protected String getServerVersion() { + return ClientServerTest.LATEST_SNAPSHOT_VERSION; + } + +} diff --git a/concourse-ete-tests/src/test/resources/cover-letter.txt b/concourse-ete-tests/src/test/resources/cover-letter.txt new file mode 100644 index 0000000000..24a2e51542 --- /dev/null +++ b/concourse-ete-tests/src/test/resources/cover-letter.txt @@ -0,0 +1,3 @@ +

Redacted Name

1600 Harden Street

Columbia, SC, 29204

386-627-6912

redacted@gmail.com

lionxmedia.com


Dear Sir/Madam


I am writing to express my profound interest in the Marketing Research internship position at TripleLift. My experience last year with the company was one I will always remember. As a Mass Communications student at Benedict College’s School of Arts & Sciences expecting to graduate in December of 2024, I am eager to join your team and gain hands-on experience, develop skills, and build a network in the corporate industry. After seeing your internship posted on Handshake, I am excited to apply for a chance to share the multimedia and graphic design skills I have gained to benefit your organization.

Through coursework in both digital media and literature and previous experience using Adobe Photoshop, Lightroom, InDesign, and Premiere Pro, I have developed written, oral, and digital communication skills – all I believe may be critical to working in the production industry. Through the courses I have completed at Benedict College in the past two years, including but not limited to; Basic Photography, Oral Communication, Photo for Web & social media, I have strengthened my editorial, presentation, teamwork, production, and photography skills. Additionally, as a Junior Media Specialist for Your Faith Recruitment & Education Consultants, and the Webmaster for the Xi Beta Chapter of Phi Mu Alpha Sinfonia Music Fraternity of America, I am constantly developing production skills and proficiency in dealing with the public and working under pressure. 

          Attached are my resume and personal portfolio link lionxmedia.com where some of my past and recent graphic design and photography projects are displayed. Thank you for this opportunity and for considering me as a candidate for the Production Assistant internship program. I look forward to hearing from you and becoming a valuable part of your team.

Sincerely,

Shape
+
+Description automatically generated with medium confidence

Redacted Name


\ No newline at end of file