diff --git a/docs/rde-import-architecture.md b/docs/rde-import-architecture.md
deleted file mode 100644
index 66aa57828..000000000
--- a/docs/rde-import-architecture.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# Registry Data Import Architecture
-
-*See also the [RDE usage guide](./rde-import-usage.md).*
-
-The Registry Data Import feature was designed to handle escrow files from other
-registries with millions of domains. In the spirit of divide and conquer, the
-mapreduce library is used to break up the work of the import into smaller chunks
-that can be processed in a reasonable period of time. This process is broken
-down into four separate mapreduce jobs that must be run in sequence due to how
-datastore transactions work and due to dependencies between registry objects.
-The steps are broken up as follows:
-
-__Initial Setup__ - This is a set of manual steps that must be completed before
-the process can be run, and is out of the scope of this document. See
-[Usage](./rde-import-usage.md) for more details.
-
-__Contacts Import__ - Reads contact entries from an escrow file and saves them
-as `ContactResource` entities. `HistoryEntry` entities are also created for the
-contact. This process depends on initial setup, but does not depend on any
-previous step being run.
-
-__Hosts Import__ - Reads host entries from an escrow file and saves them as
-`HostResource` entities. `HistoryEntry` entities are also created for the hosts.
-This process depends on initial setup, but does not depend on any previous step
-being run.
-
-__Domains Import__ - Reads domain entries from an escrow file and saves them as
-`DomainResource` entities. For each domain imported, a history entry, autorenew
-billing event and autorenew poll message will also be created. For domains that
-are in pending transfer state, the import process will also create future
-entities for automatic server approval in the same fashion as domain transfer
-request EPP messages. Domains cannot be imported until the contacts and hosts
-required by the domain are imported in previous steps.
-
-__Hosts Link__ - Reads host entries from an escrow file and links in-zone hosts
-to their superordinate domains. This is the last step because both hosts and
-domains have to be imported before the link can be made in both directions.
-
-## Components
-
-Each mapreduce job (with the exception of Hosts Link) is made up of a similar
-set of components. Note that much of the work that is done by each job strongly
-resembles the inversion of the Registry Data Export feature, and reuses the Jaxb
-representations of the xml elements that compose escrow files.
-
-__Parser__ - The parser is the lowest level of the import process. This
-component parses an escrow file (provided as an open stream from Google Cloud
-Storage) into discrete JAXB objects. The parser maintains an internal cursor in
-the xml file that represents the next element to be read, and can advance to and
-skip any number of elements.
-
-__Reader__ - The reader is configured by each mapreduce job to load an escrow
-file from Cloud Storage and use a parser to read a selected subset of the file,
-forwarding the results to a mapper.
-
-__Input__ - An input is responsible for determining how many reader instances to
-create and which section of the escrow file should be consumed by each reader.
-
-__Converter__ - The converter accepts a Jaxb object and returns an equivalent
-resource that can be saved to the datastore.
-
-__Import Utility Logic__ - Common import logic is consolidated into a single
-place, such as creation of index entities and escrow file validation.
-
-__Mapper__ - The mapper accepts a stream of Jaxb objects from the reader and
-uses the converter to map them to resource objects. Then for each resource
-object produced, the mapper will attempt to save the resource and any related
-objects to the datastore in a transaction. This is an idempotent operation; if
-any resource has been previously imported by the process, it will be ignored.
-
-__Action Endpoint__ - The action endpoint is responsible for accepting requests
-to launch each step of the import process, bootstrapping mapreduce jobs, and
-redirecting the client to the status page of the import job. This is the entry
-point of the import process.
diff --git a/docs/rde-import-usage.md b/docs/rde-import-usage.md
deleted file mode 100644
index a953b7d15..000000000
--- a/docs/rde-import-usage.md
+++ /dev/null
@@ -1,122 +0,0 @@
-# Registry Data Import Usage Guide
-
-In order to import an RDE escrow file into Nomulus, four different mapreduce
-processes must be run in sequence. Future iterations of this feature may
-automate the sequence, but for now each step of the process must be run
-manually.
-
-Note that only contacts, hosts and domains are imported by this process. Other
-objects such as registrars and top level domains are not imported automatically,
-and must be configured before running this import process (see below).
-
-## Prerequisites
-
-This document assumes that the import process is being executed against a fully
-functioning instance of Nomulus that is set up with its own unique project
-id. See the other docs (particularly the [install guide](./install.md)) for
-details and helpful links.
-
-Before launching any of the import jobs, the top level domain (TLD) and all
-registrars that are included in the escrow file must be created in the registry;
-these cannot be created automatically. Detailed instructions on how to create
-TLDs, registrars and registrar contacts can be found in
-the [first steps tutorial](./first-steps-tutorial.md).
-
-## How to load an escrow file
-
-First of all, ensure that all of the cloud storage buckets are set up for
-nomulus. See the [Architecture documentation](./architecture.md) for details.
-The escrow file that will be imported should be uploaded to the
-`PROJECT-rde-import` cloud storage bucket. The escrow file should not be
-compressed or encrypted. When launching each mapreduce job, reference the
-absolute path to the file (just the path, not the bucket name) in the `path`
-argument.
-
-__TODO:__ Add `PROJECT-rde-import` bucket requirement to architecture doc.
-
-## Overview of import steps
-
-Due to the huge variety in size of domain registries, the number of objects
-included in escrow files can also vary widely. In order to process these files
-in a way that scales, the import of contacts, hosts and domains has been
-implemented as a series of four mapreduce jobs. The four jobs are summarized as
-follows:
-
-* Contacts Import - Creates contacts in the registry.
-* Hosts Import - Creates host objects in the registry. Note that only host
- objects are supported at this time; escrow files with host attributes are not
- supported and will be rejected by the import process.
-* Domains Import - Creates domain objects in the registry. This step will also
- publish NS records and A records to dns as necessary based on referenced host
- objects.
-* Hosts Link - Links hosts to their superordinate domain objects. This step is
- necessary to establish data integrity for imported objects.
-
-The import steps __must__ be run in this order: Contacts Import, Hosts Import,
-Domains Import, Hosts Link.
-
-## Executing the import process
-
-The import process steps must be executed by a user that is logged in as an
-administrator of the deployed Nomulus instance. Currently, the way to launch the
-process is to manually enter the proper url into the user's web browser, which
-will kick off the mapreduce job and load its status page. The status page will
-serve as a way to monitor the progress of a job until completion. Once each job
-is completed, the user can launch the next step in the same fashion.
-
-Parameters:
-
-* path - This is the path to the escrow file in cloud storage.
-* mapShards - This is the number of shards that will be used to process the
- file. The process has been tested with a mapShards setting of 100, which
- seems to perform well in most cases.
-
-The import process is deployed in the `backend` service, so "backend-dot-" will
-be prepended to the hostname. Replace `PROJECT` below with the unique project
-name under which the Nomulus instance is deployed, and `PATH` with the path to
-the escrow file.
-
-Launch Contacts Import:
-`https://backend-dot-PROJECT.appspot.com/_dr/importRdeContacts?path=PATH&mapShards=100`
-
-Launch Hosts Import:
-`https://backend-dot-PROJECT.appspot.com/_dr/importRdeHosts?path=PATH&mapShards=100`
-
-Launch Domains Import:
-`https://backend-dot-PROJECT.appspot.com/_dr/importRdeDomains?path=PATH&mapShards=100`
-
-Launch Hosts Link:
-`https://backend-dot-PROJECT.appspot.com/_dr/linkRdeHosts?path=PATH&mapShards=100`
-
-For each job, the mapreduce user interface will display the status of the
-running job. The job is finished when all of the boxes on the left turn green
-(at which point the next step of the process can be safely launched). If any of
-the boxes turn red, it means that the job failed and the logs should be
-consulted for errors (see below).
-
-Note that each of these steps is idempotent, and can be run many times with no
-harmful side effects or duplicated data.
-
-## Monitoring and troubleshooting
-
-On the status page, several counters will be shown as the job progresses,
-indicating the number of operations attempted, how many succeeded, how many were
-ignored, and if there were any errors. This is a good tool to understand at a
-high level how the job is progressing. The counters from a completed job can
-also be compared against the known count of resources from an escrow file to
-determine if the import was successful or not.
-
-For a more detailed view, open up the logging for the project in
-the [Google Cloud Console](https://console.cloud.google.com). The application
-logs from the import process will show up under requests with a url that starts
-with `/_dr/mapreduce/workerCallback` - the logs provide a detailed view of which
-resources were read from file, which were imported, which had already existed
-before the import, and which failed to import.
-
-## Known limitations
-
-Currently, the ID of all registrars in the escrow file must match those that are
-already configured in the registry. Future work is planned to map between
-different internal and external registrar IDs by using the IANA IDs, which are
-always consistent between registries.
-
diff --git a/java/google/registry/config/RegistryConfig.java b/java/google/registry/config/RegistryConfig.java
index d91460daa..ae5805994 100644
--- a/java/google/registry/config/RegistryConfig.java
+++ b/java/google/registry/config/RegistryConfig.java
@@ -725,18 +725,6 @@ public final class RegistryConfig {
return projectId + "-rde";
}
- /**
- * Returns the Google Cloud Storage bucket for importing escrow files.
- *
- * @see google.registry.rde.imports.RdeContactImportAction
- * @see google.registry.rde.imports.RdeHostImportAction
- */
- @Provides
- @Config("rdeImportBucket")
- public static String provideRdeImportBucket(@Config("projectId") String projectId) {
- return projectId + "-rde-import";
- }
-
/**
* Amount of time between RDE deposits.
*
diff --git a/java/google/registry/module/backend/BUILD b/java/google/registry/module/backend/BUILD
index 547abad46..d59646b24 100644
--- a/java/google/registry/module/backend/BUILD
+++ b/java/google/registry/module/backend/BUILD
@@ -31,7 +31,6 @@ java_library(
"//java/google/registry/module",
"//java/google/registry/monitoring/whitebox",
"//java/google/registry/rde",
- "//java/google/registry/rde/imports",
"//java/google/registry/reporting",
"//java/google/registry/reporting/billing",
"//java/google/registry/reporting/icann",
diff --git a/java/google/registry/module/backend/BackendRequestComponent.java b/java/google/registry/module/backend/BackendRequestComponent.java
index f54e402a6..898bebb0b 100644
--- a/java/google/registry/module/backend/BackendRequestComponent.java
+++ b/java/google/registry/module/backend/BackendRequestComponent.java
@@ -59,11 +59,6 @@ import google.registry.rde.RdeReportAction;
import google.registry.rde.RdeReporter;
import google.registry.rde.RdeStagingAction;
import google.registry.rde.RdeUploadAction;
-import google.registry.rde.imports.RdeContactImportAction;
-import google.registry.rde.imports.RdeDomainImportAction;
-import google.registry.rde.imports.RdeHostImportAction;
-import google.registry.rde.imports.RdeHostLinkAction;
-import google.registry.rde.imports.RdeImportsModule;
import google.registry.reporting.ReportingModule;
import google.registry.reporting.billing.BillingModule;
import google.registry.reporting.billing.CopyDetailReportsAction;
@@ -104,7 +99,6 @@ import google.registry.tmch.TmchSmdrlAction;
IcannReportingModule.class,
MapreduceModule.class,
RdeModule.class,
- RdeImportsModule.class,
ReportingModule.class,
RequestModule.class,
SheetModule.class,
@@ -139,10 +133,6 @@ interface BackendRequestComponent {
PublishDnsUpdatesAction publishDnsUpdatesAction();
PublishSpec11ReportAction publishSpec11ReportAction();
ReadDnsQueueAction readDnsQueueAction();
- RdeContactImportAction rdeContactImportAction();
- RdeDomainImportAction rdeDomainImportAction();
- RdeHostImportAction rdeHostImportAction();
- RdeHostLinkAction rdeHostLinkAction();
RdeReportAction rdeReportAction();
RdeStagingAction rdeStagingAction();
RdeUploadAction rdeUploadAction();
diff --git a/java/google/registry/rde/imports/BUILD b/java/google/registry/rde/imports/BUILD
deleted file mode 100644
index 52b68cd80..000000000
--- a/java/google/registry/rde/imports/BUILD
+++ /dev/null
@@ -1,39 +0,0 @@
-package(
- default_visibility = ["//visibility:public"],
-)
-
-licenses(["notice"]) # Apache 2.0
-
-java_library(
- name = "imports",
- srcs = glob(["*.java"]),
- deps = [
- "//java/google/registry/config",
- "//java/google/registry/dns",
- "//java/google/registry/flows",
- "//java/google/registry/gcs",
- "//java/google/registry/mapreduce",
- "//java/google/registry/model",
- "//java/google/registry/pricing",
- "//java/google/registry/request",
- "//java/google/registry/request/auth",
- "//java/google/registry/util",
- "//java/google/registry/xjc",
- "//java/google/registry/xml",
- "//third_party/jaxb",
- "//third_party/objectify:objectify-v4_1",
- "@com_google_appengine_api_1_0_sdk",
- "@com_google_appengine_tools_appengine_gcs_client",
- "@com_google_appengine_tools_appengine_mapreduce",
- "@com_google_auto_factory",
- "@com_google_auto_value",
- "@com_google_code_findbugs_jsr305",
- "@com_google_dagger",
- "@com_google_flogger",
- "@com_google_flogger_system_backend",
- "@com_google_guava",
- "@javax_servlet_api",
- "@joda_time",
- "@org_joda_money",
- ],
-)
diff --git a/java/google/registry/rde/imports/RdeContactImportAction.java b/java/google/registry/rde/imports/RdeContactImportAction.java
deleted file mode 100644
index a57bcda17..000000000
--- a/java/google/registry/rde/imports/RdeContactImportAction.java
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static google.registry.mapreduce.MapreduceRunner.PARAM_MAP_SHARDS;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.appengine.tools.mapreduce.Mapper;
-import com.google.common.collect.ImmutableList;
-import com.google.common.flogger.FluentLogger;
-import google.registry.config.RegistryConfig.Config;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.mapreduce.MapreduceRunner;
-import google.registry.model.contact.ContactResource;
-import google.registry.request.Action;
-import google.registry.request.Parameter;
-import google.registry.request.Response;
-import google.registry.request.auth.Auth;
-import google.registry.util.SystemClock;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdecontact.XjcRdeContact;
-import google.registry.xjc.rdecontact.XjcRdeContactElement;
-import java.util.Optional;
-import javax.inject.Inject;
-
-/**
- * A mapreduce that imports contacts from an escrow file.
- *
- *
Specify the escrow file to import with the "path" parameter.
- */
-@Action(
- service = Action.Service.BACKEND,
- path = "/_dr/task/importRdeContacts",
- auth = Auth.AUTH_INTERNAL_ONLY)
-public class RdeContactImportAction implements Runnable {
-
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- protected final MapreduceRunner mrRunner;
- protected final Response response;
- protected final String importBucketName;
- protected final String importFileName;
- protected final Optional mapShards;
-
- @Inject
- public RdeContactImportAction(
- MapreduceRunner mrRunner,
- Response response,
- @Config("rdeImportBucket") String importBucketName,
- @Parameter("path") String importFileName,
- @Parameter(PARAM_MAP_SHARDS) Optional mapShards) {
- this.mrRunner = mrRunner;
- this.response = response;
- this.importBucketName = importBucketName;
- this.importFileName = importFileName;
- this.mapShards = mapShards;
- }
-
- @Override
- public void run() {
- mrRunner
- .setJobName("Import contacts from escrow file")
- .setModuleName("backend")
- .runMapOnly(createMapper(), ImmutableList.of(createInput()))
- .sendLinkToMapreduceConsole(response);
- }
-
- /**
- * Creates a new {@link RdeContactInput}
- */
- private RdeContactInput createInput() {
- return new RdeContactInput(mapShards, importBucketName, importFileName);
- }
-
- /**
- * Creates a new {@link RdeContactImportMapper}
- */
- private RdeContactImportMapper createMapper() {
- return new RdeContactImportMapper(importBucketName);
- }
-
- /** Mapper to import contacts from an escrow file. */
- public static class RdeContactImportMapper
- extends Mapper, Void, Void> {
-
- private static final long serialVersionUID = -7645091075256589374L;
-
- private final String importBucketName;
- private transient RdeImportUtils importUtils;
-
- public RdeContactImportMapper(String importBucketName) {
- this.importBucketName = importBucketName;
- }
-
- private RdeImportUtils getImportUtils() {
- if (importUtils == null) {
- importUtils = createRdeImportUtils();
- }
- return importUtils;
- }
-
- /**
- * Creates a new instance of RdeImportUtils.
- */
- private RdeImportUtils createRdeImportUtils() {
- return new RdeImportUtils(
- ofy(),
- new SystemClock(),
- importBucketName,
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize()));
- }
-
- @Override
- public void map(JaxbFragment fragment) {
- final XjcRdeContact xjcContact = fragment.getInstance().getValue();
- try {
- logger.atInfo().log("Converting xml for contact %s", xjcContact.getId());
- // Record number of attempted map operations
- getContext().incrementCounter("contact imports attempted");
- logger.atInfo().log("Saving contact %s", xjcContact.getId());
- ofy()
- .transact(
- () -> {
- ContactResource contact =
- XjcToContactResourceConverter.convertContact(xjcContact);
- getImportUtils().importEppResource(contact);
- });
- // Record number of contacts imported
- getContext().incrementCounter("contacts saved");
- logger.atInfo().log("Contact %s was imported successfully", xjcContact.getId());
- } catch (ResourceExistsException e) {
- // Record the number of contacts already in the registry
- getContext().incrementCounter("existing contacts skipped");
- logger.atInfo().log("Contact %s already exists", xjcContact.getId());
- } catch (Exception e) {
- // Record the number of contacts with unexpected errors
- getContext().incrementCounter("contact import errors");
- logger.atSevere().withCause(e).log(
- "Error importing contact %s; xml=%s", xjcContact.getId(), xjcContact);
- }
- }
- }
-}
diff --git a/java/google/registry/rde/imports/RdeContactInput.java b/java/google/registry/rde/imports/RdeContactInput.java
deleted file mode 100644
index d51656914..000000000
--- a/java/google/registry/rde/imports/RdeContactInput.java
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.math.IntMath.divide;
-import static java.math.RoundingMode.CEILING;
-import static java.math.RoundingMode.FLOOR;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.appengine.tools.mapreduce.Input;
-import com.google.appengine.tools.mapreduce.InputReader;
-import com.google.common.collect.ImmutableList;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.model.contact.ContactResource;
-import google.registry.rde.imports.RdeParser.RdeHeader;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdecontact.XjcRdeContactElement;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * A MapReduce {@link Input} that imports {@link ContactResource} objects from an escrow file.
- *
- * If a mapShards parameter has been specified, up to that many readers will be created
- * so that each map shard has one reader. If a mapShards parameter has not been specified, a
- * default number of readers will be created.
- */
-public class RdeContactInput extends Input> {
-
- private static final long serialVersionUID = -366966393494008712L;
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- /**
- * Default number of readers if map shards are not specified.
- */
- private static final int DEFAULT_READERS = 50;
-
- /**
- * Minimum number of records per reader.
- */
- private static final int MINIMUM_RECORDS_PER_READER = 100;
-
- /**
- * Optional argument to explicitly specify the number of readers.
- */
- private final int numReaders;
- private final String importBucketName;
- private final String importFileName;
-
- public RdeContactInput(Optional mapShards, String importBucketName,
- String importFileName) {
- this.numReaders = mapShards.orElse(DEFAULT_READERS);
- this.importBucketName = importBucketName;
- this.importFileName = importFileName;
- }
-
- @Override
- public List extends InputReader>> createReaders() {
- int numReaders = this.numReaders;
- RdeHeader header = newParser().getHeader();
- int numberOfContacts = header.getContactCount().intValue();
- if (numberOfContacts / numReaders < MINIMUM_RECORDS_PER_READER) {
- numReaders = divide(numberOfContacts, MINIMUM_RECORDS_PER_READER, FLOOR);
- // use at least one reader
- numReaders = Math.max(numReaders, 1);
- }
- ImmutableList.Builder builder = new ImmutableList.Builder<>();
- int contactsPerReader =
- Math.max(MINIMUM_RECORDS_PER_READER, divide(numberOfContacts, numReaders, CEILING));
- int offset = 0;
- for (int i = 0; i < numReaders; i++) {
- builder = builder.add(newReader(offset, contactsPerReader));
- offset += contactsPerReader;
- }
- return builder.build();
- }
-
- private RdeContactReader newReader(int offset, int maxResults) {
- return new RdeContactReader(importBucketName, importFileName, offset, maxResults);
- }
-
- private RdeParser newParser() {
- GcsUtils utils = new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize());
- GcsFilename filename = new GcsFilename(importBucketName, importFileName);
- try (InputStream xmlInput = utils.openInputStream(filename)) {
- return new RdeParser(xmlInput);
- } catch (Exception e) {
- throw new InitializationException(
- String.format("Error opening rde file %s/%s", importBucketName, importFileName), e);
- }
- }
-
- /**
- * Thrown when the input cannot initialize properly.
- */
- private static class InitializationException extends RuntimeException {
-
- public InitializationException(String message, Throwable cause) {
- super(message, cause);
- }
- }
-}
diff --git a/java/google/registry/rde/imports/RdeContactReader.java b/java/google/registry/rde/imports/RdeContactReader.java
deleted file mode 100644
index bded645da..000000000
--- a/java/google/registry/rde/imports/RdeContactReader.java
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.appengine.tools.mapreduce.InputReader;
-import com.google.common.flogger.FluentLogger;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdecontact.XjcRdeContactElement;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.NoSuchElementException;
-import javax.annotation.concurrent.NotThreadSafe;
-
-/** Mapreduce {@link InputReader} for reading contacts from escrow files */
-@NotThreadSafe
-public class RdeContactReader extends InputReader>
- implements Serializable {
-
- private static final long serialVersionUID = -3688793834175577691L;
-
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- final String importBucketName;
- final String importFileName;
- final int offset;
- final int maxResults;
-
- private int count = 0;
-
- transient RdeParser parser;
-
- /**
- * Creates a new instance of {@link RdeParser}
- */
- private RdeParser newParser() {
- GcsUtils utils = new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize());
- GcsFilename filename = new GcsFilename(importBucketName, importFileName);
- InputStream xmlInput = utils.openInputStream(filename);
- try {
- RdeParser parser = new RdeParser(xmlInput);
- // skip the file offset and count
- // if count is greater than 0, the reader has been rehydrated after doing some work.
- // skip any already processed records.
- parser.skipContacts(offset + count);
- return parser;
- } catch (Exception e) {
- throw new RuntimeException(
- String.format("Error opening rde file %s/%s", importBucketName, importFileName), e);
- }
- }
-
- public RdeContactReader(
- String importBucketName,
- String importFileName,
- int offset,
- int maxResults) {
- this.importBucketName = importBucketName;
- this.importFileName = importFileName;
- this.offset = offset;
- this.maxResults = maxResults;
- }
-
- @Override
- public JaxbFragment next() {
- if (count < maxResults) {
- if (parser == null) {
- parser = newParser();
- if (parser.isAtContact()) {
- return readContact();
- }
- }
- if (parser.nextContact()) {
- return readContact();
- }
- }
- throw new NoSuchElementException();
- }
-
- private JaxbFragment readContact() {
- count++;
- return JaxbFragment.create(new XjcRdeContactElement(parser.getContact()));
- }
-
- @Override
- public void endSlice() throws IOException {
- super.endSlice();
- if (parser != null) {
- parser.close();
- }
- }
-}
diff --git a/java/google/registry/rde/imports/RdeDomainImportAction.java b/java/google/registry/rde/imports/RdeDomainImportAction.java
deleted file mode 100644
index 823d5d754..000000000
--- a/java/google/registry/rde/imports/RdeDomainImportAction.java
+++ /dev/null
@@ -1,292 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static google.registry.flows.domain.DomainTransferUtils.createLosingTransferPollMessage;
-import static google.registry.flows.domain.DomainTransferUtils.createPendingTransferData;
-import static google.registry.flows.domain.DomainTransferUtils.createTransferServerApproveEntities;
-import static google.registry.mapreduce.MapreduceRunner.PARAM_MAP_SHARDS;
-import static google.registry.model.domain.DomainBase.extendRegistrationWithCap;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.pricing.PricingEngineProxy.getDomainRenewCost;
-import static google.registry.rde.imports.RdeImportUtils.createAutoRenewBillingEventForDomainImport;
-import static google.registry.rde.imports.RdeImportUtils.createAutoRenewPollMessageForDomainImport;
-import static google.registry.rde.imports.RdeImportUtils.createHistoryEntryForDomainImport;
-import static google.registry.rde.imports.RdeImportsModule.PATH;
-import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
-
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.appengine.tools.mapreduce.Mapper;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.flogger.FluentLogger;
-import google.registry.config.RegistryConfig.Config;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.dns.DnsQueue;
-import google.registry.gcs.GcsUtils;
-import google.registry.mapreduce.MapreduceRunner;
-import google.registry.model.billing.BillingEvent;
-import google.registry.model.domain.DomainBase;
-import google.registry.model.domain.Period;
-import google.registry.model.domain.Period.Unit;
-import google.registry.model.domain.rgp.GracePeriodStatus;
-import google.registry.model.poll.PollMessage;
-import google.registry.model.reporting.HistoryEntry;
-import google.registry.model.transfer.TransferData;
-import google.registry.model.transfer.TransferData.TransferServerApproveEntity;
-import google.registry.model.transfer.TransferStatus;
-import google.registry.request.Action;
-import google.registry.request.Parameter;
-import google.registry.request.Response;
-import google.registry.request.auth.Auth;
-import google.registry.util.StringGenerator;
-import google.registry.util.SystemClock;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdedomain.XjcRdeDomain;
-import google.registry.xjc.rdedomain.XjcRdeDomainElement;
-import java.util.Optional;
-import javax.inject.Inject;
-import javax.inject.Named;
-import org.joda.money.Money;
-import org.joda.time.DateTime;
-
-/**
- * A mapreduce that imports domains from an escrow file.
- *
- * Specify the escrow file to import with the "path" parameter.
- */
-@Action(
- service = Action.Service.BACKEND,
- path = "/_dr/task/importRdeDomains",
- auth = Auth.AUTH_INTERNAL_ONLY)
-public class RdeDomainImportAction implements Runnable {
-
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- protected final MapreduceRunner mrRunner;
- protected final Response response;
- protected final String importBucketName;
- protected final String importFileName;
- protected final Optional mapShards;
- protected final StringGenerator stringGenerator;
-
- @Inject
- public RdeDomainImportAction(
- MapreduceRunner mrRunner,
- Response response,
- @Config("rdeImportBucket") String importBucketName,
- @Parameter(PATH) String importFileName,
- @Parameter(PARAM_MAP_SHARDS) Optional mapShards,
- @Named("base64StringGenerator") StringGenerator stringGenerator) {
- this.mrRunner = mrRunner;
- this.response = response;
- this.importBucketName = importBucketName;
- this.importFileName = importFileName;
- this.mapShards = mapShards;
- this.stringGenerator = stringGenerator;
- }
-
- @Override
- public void run() {
- logger.atInfo().log(
- "Launching domains import mapreduce: bucket=%s, filename=%s",
- this.importBucketName, this.importFileName);
- mrRunner
- .setJobName("Import domains from escrow file")
- .setModuleName("backend")
- .runMapOnly(createMapper(), ImmutableList.of(createInput()))
- .sendLinkToMapreduceConsole(response);
- }
-
- /**
- * Creates a new {@link RdeDomainInput}
- */
- private RdeDomainInput createInput() {
- return new RdeDomainInput(mapShards, importBucketName, importFileName);
- }
-
- /**
- * Creates a new {@link RdeDomainImportMapper}
- */
- private RdeDomainImportMapper createMapper() {
- return new RdeDomainImportMapper(importBucketName, stringGenerator);
- }
-
- /** Mapper to import domains from an escrow file. */
- public static class RdeDomainImportMapper
- extends Mapper, Void, Void> {
-
- private static final long serialVersionUID = -7645091075256589374L;
-
- private final String importBucketName;
- private final StringGenerator stringGenerator;
- private transient RdeImportUtils importUtils;
- private transient DnsQueue dnsQueue;
-
- public RdeDomainImportMapper(String importBucketName, StringGenerator stringGenerator) {
- this.importBucketName = importBucketName;
- this.stringGenerator = stringGenerator;
- }
-
- private RdeImportUtils getImportUtils() {
- if (importUtils == null) {
- importUtils = createRdeImportUtils();
- }
- return importUtils;
- }
-
- private DnsQueue getDnsQueue() {
- if (dnsQueue == null) {
- dnsQueue = DnsQueue.create();
- }
- return dnsQueue;
- }
-
- /**
- * Creates a new instance of RdeImportUtils.
- */
- private RdeImportUtils createRdeImportUtils() {
- return new RdeImportUtils(
- ofy(),
- new SystemClock(),
- importBucketName,
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize()));
- }
-
- @Override
- public void map(JaxbFragment fragment) {
- final XjcRdeDomain xjcDomain = fragment.getInstance().getValue();
- try {
- // Record number of attempted map operations
- getContext().incrementCounter("domain imports attempted");
- logger.atInfo().log("Saving domain %s", xjcDomain.getName());
-
- ofy().transact(() -> saveDomain(xjcDomain));
-
- // Record the number of domains imported
- getContext().incrementCounter("domains saved");
- logger.atInfo().log("Domain %s was imported successfully", xjcDomain.getName());
- } catch (ResourceExistsException e) {
- // Record the number of domains already in the registry
- getContext().incrementCounter("existing domains skipped");
- logger.atInfo().log("Domain %s already exists", xjcDomain.getName());
- } catch (Exception e) {
- getContext().incrementCounter("domain import errors");
- logger.atSevere().withCause(e).log(
- "Error processing domain %s; xml=%s", xjcDomain.getName(), xjcDomain);
- }
- }
-
- private void saveDomain(XjcRdeDomain xjcDomain) {
- HistoryEntry historyEntry = createHistoryEntryForDomainImport(xjcDomain);
- BillingEvent.Recurring autorenewBillingEvent =
- createAutoRenewBillingEventForDomainImport(xjcDomain, historyEntry);
- PollMessage.Autorenew autorenewPollMessage =
- createAutoRenewPollMessageForDomainImport(xjcDomain, historyEntry);
- DomainBase domain =
- XjcToDomainBaseConverter.convertDomain(
- xjcDomain, autorenewBillingEvent, autorenewPollMessage, stringGenerator);
- getDnsQueue().addDomainRefreshTask(domain.getFullyQualifiedDomainName());
- // Keep a list of "extra objects" that need to be saved along with the domain
- // and add to it if necessary.
- ImmutableSet extraEntitiesToSave =
- getImportUtils().createIndexesForEppResource(domain);
- // Create speculative server approval entities for pending transfers
- if (domain.getTransferData().getTransferStatus() == TransferStatus.PENDING) {
- TransferData transferData = domain.getTransferData();
- checkArgumentNotNull(
- transferData,
- "Domain %s is in pending transfer but has no transfer data",
- domain.getFullyQualifiedDomainName());
- Money transferCost =
- getDomainRenewCost(
- domain.getFullyQualifiedDomainName(),
- transferData.getPendingTransferExpirationTime(),
- 1);
- DateTime automaticTransferTime = transferData.getPendingTransferExpirationTime();
- // If the transfer will occur within the autorenew grace period, it should
- // subsume the autorenew, so we don't add the normal extra year. See the
- // original logic in DomainTransferRequestFlow (which is very similar) for
- // more information. That said, note that here we stop 1 millisecond before
- // the actual transfer time to avoid hitting the transfer-handling part of
- // cloneProjectedAtTime(), since unlike in the DomainTransferRequestFlow case,
- // this domain already has a pending transfer.
- DomainBase domainAtTransferTime =
- domain.cloneProjectedAtTime(automaticTransferTime.minusMillis(1));
- boolean inAutorenewGraceAtTransfer =
- !domainAtTransferTime.getGracePeriodsOfType(GracePeriodStatus.AUTO_RENEW).isEmpty();
- int extraYears = inAutorenewGraceAtTransfer ? 0 : 1;
- // Construct the capped new expiration time.
- DateTime serverApproveNewExpirationTime =
- extendRegistrationWithCap(
- automaticTransferTime,
- domainAtTransferTime.getRegistrationExpirationTime(),
- extraYears);
- // Create speculative entities in anticipation of an automatic server
- // approval.
- ImmutableSet serverApproveEntities =
- createTransferServerApproveEntities(
- automaticTransferTime,
- serverApproveNewExpirationTime,
- historyEntry,
- domain,
- historyEntry.getTrid(),
- transferData.getGainingClientId(),
- Optional.of(transferCost),
- transferData.getTransferRequestTime());
- transferData =
- createPendingTransferData(
- transferData.asBuilder(), serverApproveEntities, Period.create(1, Unit.YEARS));
- // Create a poll message to notify the losing registrar that a transfer was
- // requested.
- PollMessage requestPollMessage =
- createLosingTransferPollMessage(
- domain.getRepoId(), transferData, serverApproveNewExpirationTime, historyEntry)
- .asBuilder()
- .setEventTime(transferData.getTransferRequestTime())
- .build();
- domain = domain.asBuilder().setTransferData(transferData).build();
- autorenewBillingEvent =
- autorenewBillingEvent
- .asBuilder()
- .setRecurrenceEndTime(transferData.getPendingTransferExpirationTime())
- .build();
- autorenewPollMessage =
- autorenewPollMessage
- .asBuilder()
- .setAutorenewEndTime(transferData.getPendingTransferExpirationTime())
- .build();
- extraEntitiesToSave =
- new ImmutableSet.Builder<>()
- .add(requestPollMessage)
- .addAll(extraEntitiesToSave)
- .addAll(serverApproveEntities)
- .build();
- } // End pending transfer check
- ofy()
- .save()
- .entities(
- new ImmutableSet.Builder<>()
- .add(domain, historyEntry, autorenewBillingEvent, autorenewPollMessage)
- .addAll(extraEntitiesToSave)
- .build())
- .now();
- }
- }
-}
diff --git a/java/google/registry/rde/imports/RdeDomainInput.java b/java/google/registry/rde/imports/RdeDomainInput.java
deleted file mode 100644
index 5964a486b..000000000
--- a/java/google/registry/rde/imports/RdeDomainInput.java
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.math.IntMath.divide;
-import static java.math.RoundingMode.CEILING;
-import static java.math.RoundingMode.FLOOR;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.appengine.tools.mapreduce.Input;
-import com.google.appengine.tools.mapreduce.InputReader;
-import com.google.common.collect.ImmutableList;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.model.domain.DomainBase;
-import google.registry.rde.imports.RdeParser.RdeHeader;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdedomain.XjcRdeDomainElement;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * A MapReduce {@link Input} that imports {@link DomainBase} objects from an escrow file.
- *
- * If a mapShards parameter has been specified, up to that many readers will be created
- * so that each map shard has one reader. If a mapShards parameter has not been specified, a
- * default number of readers will be created.
- */
-public class RdeDomainInput extends Input> {
-
- private static final long serialVersionUID = -366966393494008712L;
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- /**
- * Default number of readers if map shards are not specified.
- */
- private static final int DEFAULT_READERS = 50;
-
- /**
- * Minimum number of records per reader.
- */
- private static final int MINIMUM_RECORDS_PER_READER = 100;
-
- /**
- * Optional argument to explicitly specify the number of readers.
- */
- private final int numReaders;
- private final String importBucketName;
- private final String importFileName;
-
- public RdeDomainInput(
- Optional mapShards, String importBucketName, String importFileName) {
- this.numReaders = mapShards.orElse(DEFAULT_READERS);
- this.importBucketName = importBucketName;
- this.importFileName = importFileName;
- }
-
- @Override
- public List extends InputReader>> createReaders() {
- int numReaders = this.numReaders;
- RdeHeader header = newParser().getHeader();
- int numberOfDomains = header.getDomainCount().intValue();
- if (numberOfDomains / numReaders < MINIMUM_RECORDS_PER_READER) {
- numReaders = divide(numberOfDomains, MINIMUM_RECORDS_PER_READER, FLOOR);
- // use at least one reader
- numReaders = Math.max(numReaders, 1);
- }
- ImmutableList.Builder builder = new ImmutableList.Builder<>();
- int domainsPerReader =
- Math.max(MINIMUM_RECORDS_PER_READER, divide(numberOfDomains, numReaders, CEILING));
- int offset = 0;
- for (int i = 0; i < numReaders; i++) {
- builder = builder.add(newReader(offset, domainsPerReader));
- offset += domainsPerReader;
- }
- return builder.build();
- }
-
- private RdeDomainReader newReader(int offset, int maxResults) {
- return new RdeDomainReader(importBucketName, importFileName, offset, maxResults);
- }
-
- private RdeParser newParser() {
- GcsUtils utils = new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize());
- GcsFilename filename = new GcsFilename(importBucketName, importFileName);
- try (InputStream xmlInput = utils.openInputStream(filename)) {
- return new RdeParser(xmlInput);
- } catch (Exception e) {
- throw new InitializationException(
- String.format("Error opening rde file %s/%s", importBucketName, importFileName), e);
- }
- }
-
- /**
- * Thrown when the input cannot initialize properly.
- */
- private static class InitializationException extends RuntimeException {
-
- public InitializationException(String message, Throwable cause) {
- super(message, cause);
- }
- }
-}
diff --git a/java/google/registry/rde/imports/RdeDomainReader.java b/java/google/registry/rde/imports/RdeDomainReader.java
deleted file mode 100644
index 4d6f5e9a4..000000000
--- a/java/google/registry/rde/imports/RdeDomainReader.java
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.appengine.tools.mapreduce.InputReader;
-import com.google.common.flogger.FluentLogger;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdedomain.XjcRdeDomainElement;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.NoSuchElementException;
-
-/** Mapreduce {@link InputReader} for reading domains from escrow files */
-public class RdeDomainReader extends InputReader>
- implements Serializable {
-
- private static final long serialVersionUID = -2175777052970160122L;
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- final String importBucketName;
- final String importFileName;
- final int offset;
- final int maxResults;
-
- private int count = 0;
-
- transient RdeParser parser;
-
- /**
- * Creates a new instance of {@link RdeParser}
- */
- private RdeParser newParser() {
- GcsUtils utils = new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize());
- GcsFilename filename = new GcsFilename(importBucketName, importFileName);
- InputStream xmlInput = utils.openInputStream(filename);
- try {
- RdeParser parser = new RdeParser(xmlInput);
- // skip the file offset and count
- // if count is greater than 0, the reader has been rehydrated after doing some work.
- // skip any already processed records.
- parser.skipDomains(offset + count);
- return parser;
- } catch (Exception e) {
- throw new RuntimeException(
- String.format("Error opening rde file %s/%s", importBucketName, importFileName), e);
- }
- }
-
- public RdeDomainReader(
- String importBucketName,
- String importFileName,
- int offset,
- int maxResults) {
- this.importBucketName = importBucketName;
- this.importFileName = importFileName;
- this.offset = offset;
- this.maxResults = maxResults;
- }
-
- @Override
- public JaxbFragment next() {
- if (count < maxResults) {
- if (parser == null) {
- parser = newParser();
- if (parser.isAtDomain()) {
- return readDomain();
- }
- }
- if (parser.nextDomain()) {
- return readDomain();
- }
- }
- throw new NoSuchElementException();
- }
-
- private JaxbFragment readDomain() {
- count++;
- return JaxbFragment.create(new XjcRdeDomainElement(parser.getDomain()));
- }
-
- @Override
- public void endSlice() throws IOException {
- super.endSlice();
- if (parser != null) {
- parser.close();
- }
- }
-}
diff --git a/java/google/registry/rde/imports/RdeHostImportAction.java b/java/google/registry/rde/imports/RdeHostImportAction.java
deleted file mode 100644
index 3882f5359..000000000
--- a/java/google/registry/rde/imports/RdeHostImportAction.java
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static google.registry.mapreduce.MapreduceRunner.PARAM_MAP_SHARDS;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.appengine.tools.mapreduce.Mapper;
-import com.google.common.collect.ImmutableList;
-import com.google.common.flogger.FluentLogger;
-import google.registry.config.RegistryConfig.Config;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.mapreduce.MapreduceRunner;
-import google.registry.model.host.HostResource;
-import google.registry.request.Action;
-import google.registry.request.Parameter;
-import google.registry.request.Response;
-import google.registry.request.auth.Auth;
-import google.registry.util.SystemClock;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdehost.XjcRdeHost;
-import google.registry.xjc.rdehost.XjcRdeHostElement;
-import java.util.Optional;
-import javax.inject.Inject;
-
-/**
- * A mapreduce that imports hosts from an escrow file.
- *
- * Specify the escrow file to import with the "path" parameter.
- */
-@Action(
- service = Action.Service.BACKEND,
- path = "/_dr/task/importRdeHosts",
- auth = Auth.AUTH_INTERNAL_ONLY)
-public class RdeHostImportAction implements Runnable {
-
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- private final MapreduceRunner mrRunner;
- private final Response response;
- private final String importBucketName;
- private final String importFileName;
- private final Optional mapShards;
-
- @Inject
- public RdeHostImportAction(
- MapreduceRunner mrRunner,
- Response response,
- @Config("rdeImportBucket") String importBucketName,
- @Parameter("path") String importFileName,
- @Parameter(PARAM_MAP_SHARDS) Optional mapShards) {
- this.mrRunner = mrRunner;
- this.response = response;
- this.importBucketName = importBucketName;
- this.importFileName = importFileName;
- this.mapShards = mapShards;
- }
-
- @Override
- public void run() {
- mrRunner
- .setJobName("Import hosts from escrow file")
- .setModuleName("backend")
- .runMapOnly(
- new RdeHostImportMapper(importBucketName),
- ImmutableList.of(new RdeHostInput(mapShards, importBucketName, importFileName)))
- .sendLinkToMapreduceConsole(response);
- }
-
- /** Mapper to import hosts from an escrow file. */
- public static class RdeHostImportMapper
- extends Mapper, Void, Void> {
-
- private static final long serialVersionUID = -2898753709127134419L;
-
- private final String importBucketName;
- private transient RdeImportUtils importUtils;
-
- public RdeHostImportMapper(String importBucketName) {
- this.importBucketName = importBucketName;
- }
-
- private RdeImportUtils getImportUtils() {
- if (importUtils == null) {
- importUtils = createRdeImportUtils();
- }
- return importUtils;
- }
-
- /**
- * Creates a new instance of RdeImportUtils.
- */
- private RdeImportUtils createRdeImportUtils() {
- return new RdeImportUtils(
- ofy(),
- new SystemClock(),
- importBucketName,
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize()));
- }
-
- @Override
- public void map(JaxbFragment fragment) {
- final XjcRdeHost xjcHost = fragment.getInstance().getValue();
- try {
- // Record number of attempted map operations
- getContext().incrementCounter("host imports attempted");
- logger.atInfo().log("Saving host %s", xjcHost.getName());
- ofy()
- .transact(
- () -> {
- HostResource host = XjcToHostResourceConverter.convert(xjcHost);
- getImportUtils().importEppResource(host);
- });
- // Record number of hosts imported
- getContext().incrementCounter("hosts saved");
- logger.atInfo().log("Host %s was imported successfully", xjcHost.getName());
- } catch (ResourceExistsException e) {
- // Record the number of hosts already in the registry
- getContext().incrementCounter("existing hosts skipped");
- logger.atInfo().log("Host %s already exists", xjcHost.getName());
- } catch (Exception e) {
- // Record the number of hosts with unexpected errors
- getContext().incrementCounter("host import errors");
- logger.atSevere().withCause(e).log(
- "Error processing host %s; xml=%s", xjcHost.getName(), xjcHost);
- }
- }
- }
-}
diff --git a/java/google/registry/rde/imports/RdeHostInput.java b/java/google/registry/rde/imports/RdeHostInput.java
deleted file mode 100644
index 2175e2ad8..000000000
--- a/java/google/registry/rde/imports/RdeHostInput.java
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.appengine.tools.mapreduce.Input;
-import com.google.appengine.tools.mapreduce.InputReader;
-import com.google.common.collect.ImmutableList;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.model.host.HostResource;
-import google.registry.rde.imports.RdeParser.RdeHeader;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdehost.XjcRdeHostElement;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * A MapReduce {@link Input} that imports {@link HostResource} objects from an escrow file.
- *
- * If a mapShards parameter has been specified, up to that many readers will be created
- * so that each map shard has one reader. If a mapShards parameter has not been specified, a
- * default number of readers will be created.
- */
-public class RdeHostInput extends Input> {
-
- private static final long serialVersionUID = 9218225041307602452L;
-
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- /**
- * Default number of readers if map shards are not specified.
- */
- private static final int DEFAULT_READERS = 50;
-
- /**
- * Minimum number of records per reader.
- */
- private static final int MINIMUM_RECORDS_PER_READER = 100;
-
- /**
- * Optional argument to explicitly specify the number of readers.
- */
- private final int numReaders;
- private final String importBucketName;
- private final String importFileName;
-
- public RdeHostInput(Optional mapShards, String importBucketName,
- String importFileName) {
- this.numReaders = mapShards.orElse(DEFAULT_READERS);
- checkArgument(numReaders > 0, "Number of shards must be greater than zero");
- this.importBucketName = importBucketName;
- this.importFileName = importFileName;
- }
-
- @Override
- public List extends InputReader>> createReaders() {
- int numReaders = this.numReaders;
- RdeHeader header = createParser().getHeader();
- int numberOfHosts = header.getHostCount().intValue();
- if (numberOfHosts / numReaders < MINIMUM_RECORDS_PER_READER) {
- numReaders = numberOfHosts / MINIMUM_RECORDS_PER_READER;
- // use at least one reader
- numReaders = Math.max(numReaders, 1);
- }
- ImmutableList.Builder builder = new ImmutableList.Builder<>();
- int hostsPerReader =
- Math.max(MINIMUM_RECORDS_PER_READER, (int) Math.ceil((double) numberOfHosts / numReaders));
- int offset = 0;
- for (int i = 0; i < numReaders; i++) {
- builder = builder.add(createReader(offset, hostsPerReader));
- offset += hostsPerReader;
- }
- return builder.build();
- }
-
- private RdeHostReader createReader(int offset, int maxResults) {
- return new RdeHostReader(importBucketName, importFileName, offset, maxResults);
- }
-
- private RdeParser createParser() {
- GcsUtils utils = new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize());
- GcsFilename filename = new GcsFilename(importBucketName, importFileName);
- InputStream xmlInput = utils.openInputStream(filename);
- try {
- return new RdeParser(xmlInput);
- } catch (Exception e) {
- throw new InitializationException(
- String.format("Error opening rde file %s/%s", importBucketName, importFileName), e);
- }
- }
-
- /**
- * Thrown when the input cannot initialize properly.
- */
- private static class InitializationException extends RuntimeException {
- public InitializationException(String message, Throwable cause) {
- super(message, cause);
- }
- }
-}
diff --git a/java/google/registry/rde/imports/RdeHostLinkAction.java b/java/google/registry/rde/imports/RdeHostLinkAction.java
deleted file mode 100644
index 0e349f816..000000000
--- a/java/google/registry/rde/imports/RdeHostLinkAction.java
+++ /dev/null
@@ -1,215 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.base.Preconditions.checkState;
-import static google.registry.mapreduce.MapreduceRunner.PARAM_MAP_SHARDS;
-import static google.registry.model.EppResourceUtils.loadByForeignKey;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.model.registry.Registries.findTldForName;
-import static java.util.stream.Collectors.joining;
-
-import com.google.appengine.tools.mapreduce.Mapper;
-import com.google.common.collect.ImmutableList;
-import com.google.common.flogger.FluentLogger;
-import com.google.common.net.InternetDomainName;
-import com.googlecode.objectify.Key;
-import google.registry.config.RegistryConfig.Config;
-import google.registry.flows.host.HostFlowUtils;
-import google.registry.mapreduce.MapreduceRunner;
-import google.registry.model.EppResource;
-import google.registry.model.domain.DomainBase;
-import google.registry.model.eppcommon.StatusValue;
-import google.registry.model.host.HostResource;
-import google.registry.request.Action;
-import google.registry.request.Parameter;
-import google.registry.request.Response;
-import google.registry.request.auth.Auth;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdehost.XjcRdeHost;
-import google.registry.xjc.rdehost.XjcRdeHostElement;
-import java.util.Optional;
-import javax.inject.Inject;
-import org.joda.time.DateTime;
-
-/**
- * A mapreduce that links hosts from an escrow file to their superordinate domains.
- *
- * This mapreduce is run as the last step of the process of importing escrow files. For each host
- * in the escrow file, the corresponding {@link HostResource} record in Datastore is linked to its
- * superordinate {@link DomainBase} only if it is an in-zone host. This is necessary because all
- * hosts must exist before domains can be imported, due to references in host objects, and domains
- * must exist before hosts can be linked to their superordinate domains.
- *
- *
Specify the escrow file to import with the "path" parameter.
- */
-@Action(
- service = Action.Service.BACKEND,
- path = "/_dr/task/linkRdeHosts",
- auth = Auth.AUTH_INTERNAL_ONLY)
-public class RdeHostLinkAction implements Runnable {
-
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
-
- private final MapreduceRunner mrRunner;
- private final Response response;
- private final String importBucketName;
- private final String importFileName;
- private final Optional mapShards;
-
- @Inject
- public RdeHostLinkAction(
- MapreduceRunner mrRunner,
- Response response,
- @Config("rdeImportBucket") String importBucketName,
- @Parameter("path") String importFileName,
- @Parameter(PARAM_MAP_SHARDS) Optional mapShards) {
- this.mrRunner = mrRunner;
- this.response = response;
- this.importBucketName = importBucketName;
- this.importFileName = importFileName;
- this.mapShards = mapShards;
- }
-
- @Override
- public void run() {
- mrRunner
- .setJobName("Link hosts from escrow file")
- .setModuleName("backend")
- .runMapOnly(
- new RdeHostPostImportMapper(),
- ImmutableList.of(new RdeHostInput(mapShards, importBucketName, importFileName)))
- .sendLinkToMapreduceConsole(response);
- }
-
- /** Mapper to link hosts from an escrow file to their superordinate domains. */
- public static class RdeHostPostImportMapper
- extends Mapper, Void, Void> {
-
- private static final long serialVersionUID = -2898753709127134419L;
-
- @Override
- public void map(JaxbFragment fragment) {
- // Record number of attempted map operations
- getContext().incrementCounter("post-import hosts read");
- final XjcRdeHost xjcHost = fragment.getInstance().getValue();
- logger.atInfo().log("Attempting to link superordinate domain for host %s", xjcHost.getName());
- try {
- final InternetDomainName hostName = InternetDomainName.from(xjcHost.getName());
-
- HostLinkResult hostLinkResult = ofy().transact(() -> {
- Optional superordinateDomain =
- lookupSuperordinateDomain(hostName, ofy().getTransactionTime());
- // if suporordinateDomain is absent, this is an out of zone host and can't be linked.
- // absent is only returned for out of zone hosts, and an exception is thrown for in
- // zone hosts with no superordinate domain.
- if (!superordinateDomain.isPresent()) {
- return HostLinkResult.HOST_OUT_OF_ZONE;
- }
- if (superordinateDomain.get().getStatusValues().contains(StatusValue.PENDING_DELETE)) {
- return HostLinkResult.SUPERORDINATE_DOMAIN_IN_PENDING_DELETE;
- }
- Key superordinateDomainKey = Key.create(superordinateDomain.get());
- // link host to superordinate domain and set time of last superordinate change to
- // the time of the import
- HostResource host =
- ofy().load().now(Key.create(HostResource.class, xjcHost.getRoid()));
- if (host == null) {
- return HostLinkResult.HOST_NOT_FOUND;
- }
- // link domain to subordinate host
- ofy().save().entities(
- host.asBuilder().setSuperordinateDomain(superordinateDomainKey)
- .setLastSuperordinateChange(ofy().getTransactionTime())
- .build(),
- superordinateDomain.get().asBuilder()
- .addSubordinateHost(host.getFullyQualifiedHostName()).build());
- return HostLinkResult.HOST_LINKED;
- });
- // increment counter and log appropriately based on result of transaction
- switch (hostLinkResult) {
- case HOST_LINKED:
- getContext().incrementCounter("post-import hosts linked");
- logger.atInfo().log(
- "Successfully linked host %s to superordinate domain", xjcHost.getName());
- // Record number of hosts successfully linked
- break;
- case HOST_NOT_FOUND:
- getContext().incrementCounter("hosts not found");
- logger.atSevere().log(
- "Host with name %s and repoid %s not found", xjcHost.getName(), xjcHost.getRoid());
- break;
- case SUPERORDINATE_DOMAIN_IN_PENDING_DELETE:
- getContext()
- .incrementCounter(
- "post-import hosts with superordinate domains in pending delete");
- logger.atInfo().log(
- "Host %s has a superordinate domain in pending delete", xjcHost.getName());
- break;
- case HOST_OUT_OF_ZONE:
- getContext().incrementCounter("post-import hosts out of zone");
- logger.atInfo().log("Host %s is out of zone", xjcHost.getName());
- break;
- }
- } catch (RuntimeException e) {
- // Record the number of hosts with unexpected errors
- getContext().incrementCounter("post-import host errors");
- logger.atSevere().withCause(e).log(
- "Error linking host %s; xml=%s", xjcHost.getName(), xjcHost);
- }
- }
-
- /**
- * Return the {@link DomainBase} this host is subordinate to, or absent for out of zone
- * hosts.
- *
- * We use this instead of {@link HostFlowUtils#lookupSuperordinateDomain} because we don't
- * want to use the EPP exception classes for the case when the superordinate domain doesn't
- * exist or isn't active.
- *
- * @throws IllegalStateException for hosts without superordinate domains
- */
- private static Optional lookupSuperordinateDomain(
- InternetDomainName hostName, DateTime now) {
- Optional tld = findTldForName(hostName);
- // out of zone hosts cannot be linked
- if (!tld.isPresent()) {
- return Optional.empty();
- }
- // This is a subordinate host
- String domainName =
- hostName
- .parts()
- .stream()
- .skip(hostName.parts().size() - (tld.get().parts().size() + 1))
- .collect(joining("."));
- Optional superordinateDomain =
- loadByForeignKey(DomainBase.class, domainName, now);
- // Hosts can't be linked if domains import hasn't been run
- checkState(
- superordinateDomain.isPresent(),
- "Superordinate domain does not exist or is deleted: %s",
- domainName);
- return superordinateDomain;
- }
- }
-
- private enum HostLinkResult {
- HOST_NOT_FOUND,
- HOST_OUT_OF_ZONE,
- SUPERORDINATE_DOMAIN_IN_PENDING_DELETE,
- HOST_LINKED;
- }
-}
diff --git a/java/google/registry/rde/imports/RdeHostReader.java b/java/google/registry/rde/imports/RdeHostReader.java
deleted file mode 100644
index 7c4b0c2a3..000000000
--- a/java/google/registry/rde/imports/RdeHostReader.java
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.appengine.tools.mapreduce.InputReader;
-import com.google.common.flogger.FluentLogger;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdehost.XjcRdeHostElement;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.NoSuchElementException;
-import javax.annotation.concurrent.NotThreadSafe;
-
-/** Mapreduce {@link InputReader} for reading hosts from escrow files */
-@NotThreadSafe
-public class RdeHostReader extends InputReader>
- implements Serializable {
-
- private static final long serialVersionUID = 3037264959150412846L;
-
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- final String importBucketName;
- final String importFileName;
- final int offset;
- final int maxResults;
-
- private int count = 0;
-
- transient RdeParser parser;
-
- /**
- * Creates a new instance of {@link RdeParser}
- */
- private RdeParser newParser() {
- GcsUtils utils = new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize());
- GcsFilename filename = new GcsFilename(importBucketName, importFileName);
- InputStream xmlInput = utils.openInputStream(filename);
- try {
- RdeParser parser = new RdeParser(xmlInput);
- // skip the file offset and count
- // if count is greater than 0, the reader has been rehydrated after doing some work.
- // skip any already processed records.
- parser.skipHosts(offset + count);
- return parser;
- } catch (Exception e) {
- throw new RuntimeException(
- String.format("Error opening RDE file %s/%s", importBucketName, importFileName), e);
- }
- }
-
- public RdeHostReader(
- String importBucketName,
- String importFileName,
- int offset,
- int maxResults) {
- this.importBucketName = importBucketName;
- this.importFileName = importFileName;
- this.offset = offset;
- this.maxResults = maxResults;
- }
-
- @Override
- public JaxbFragment next() {
- if (count < maxResults) {
- if (parser == null) {
- parser = newParser();
- if (parser.isAtHost()) {
- return readHost();
- }
- }
- if (parser.nextHost()) {
- return readHost();
- }
- }
- throw new NoSuchElementException();
- }
-
- private JaxbFragment readHost() {
- count++;
- return JaxbFragment.create(new XjcRdeHostElement(parser.getHost()));
- }
-
- @Override
- public void endSlice() throws IOException {
- super.endSlice();
- if (parser != null) {
- parser.close();
- }
- }
-}
diff --git a/java/google/registry/rde/imports/RdeImportUtils.java b/java/google/registry/rde/imports/RdeImportUtils.java
deleted file mode 100644
index a33046de2..000000000
--- a/java/google/registry/rde/imports/RdeImportUtils.java
+++ /dev/null
@@ -1,239 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.model.registry.Registry.TldState.PREDELEGATION;
-import static google.registry.util.DateTimeUtils.END_OF_TIME;
-import static google.registry.util.DateTimeUtils.START_OF_TIME;
-import static google.registry.util.PreconditionsUtils.checkArgumentPresent;
-import static java.nio.charset.StandardCharsets.US_ASCII;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.flogger.FluentLogger;
-import com.google.common.io.BaseEncoding;
-import com.googlecode.objectify.Key;
-import google.registry.config.RegistryConfig.Config;
-import google.registry.flows.ServerTridProvider;
-import google.registry.flows.ServerTridProviderImpl;
-import google.registry.gcs.GcsUtils;
-import google.registry.model.EppResource;
-import google.registry.model.EppResource.ForeignKeyedEppResource;
-import google.registry.model.billing.BillingEvent;
-import google.registry.model.billing.BillingEvent.Flag;
-import google.registry.model.billing.BillingEvent.Reason;
-import google.registry.model.domain.DomainBase;
-import google.registry.model.eppcommon.Trid;
-import google.registry.model.index.EppResourceIndex;
-import google.registry.model.index.ForeignKeyIndex;
-import google.registry.model.ofy.Ofy;
-import google.registry.model.poll.PollMessage;
-import google.registry.model.registrar.Registrar;
-import google.registry.model.registry.Registry;
-import google.registry.model.registry.Registry.RegistryNotFoundException;
-import google.registry.model.registry.Registry.TldState;
-import google.registry.model.reporting.HistoryEntry;
-import google.registry.util.Clock;
-import google.registry.xjc.XjcXmlTransformer;
-import google.registry.xjc.rdedomain.XjcRdeDomain;
-import google.registry.xjc.rdedomain.XjcRdeDomainElement;
-import google.registry.xjc.rderegistrar.XjcRdeRegistrar;
-import google.registry.xml.XmlException;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.UUID;
-import javax.inject.Inject;
-import javax.xml.bind.JAXBException;
-import javax.xml.stream.XMLStreamException;
-
-/**
- * Utility functions for escrow file import.
- */
-public class RdeImportUtils {
-
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
-
- private final Ofy ofy;
- private final Clock clock;
- private final String escrowBucketName;
- private final GcsUtils gcsUtils;
-
- private static final ServerTridProvider serverTridProvider = new ServerTridProviderImpl();
-
- @Inject
- public RdeImportUtils(
- Ofy ofy, Clock clock, @Config("rdeImportBucket") String escrowBucketName, GcsUtils gcsUtils) {
- this.ofy = ofy;
- this.clock = clock;
- this.gcsUtils = gcsUtils;
- this.escrowBucketName = escrowBucketName;
- }
-
- public ImmutableSet
- createIndexesForEppResource(T resource) {
- @SuppressWarnings("unchecked")
- ForeignKeyIndex existingForeignKeyIndex =
- ForeignKeyIndex.load(
- (Class) resource.getClass(), resource.getForeignKey(), START_OF_TIME);
- // ForeignKeyIndex should never have existed, since existing resource was not found.
- checkState(
- existingForeignKeyIndex == null,
- "New %s resource has existing foreign key index; foreignKey=%s, repoId=%s",
- resource.getClass().getCanonicalName(),
- resource.getForeignKey(),
- resource.getRepoId());
- return ImmutableSet.of(ForeignKeyIndex.create(resource, resource.getDeletionTime()),
- EppResourceIndex.create(Key.create(resource)));
- }
-
- /**
- * Imports a resource from an escrow file.
- *
- * The resource will only be imported if it has not been previously imported.
- *
- *
If the resource is imported, {@link ForeignKeyIndex} and {@link EppResourceIndex} are also
- * created.
- */
- public void importEppResource(
- final T resource) {
- Object existing = ofy.load().key(Key.create(resource)).now();
- if (existing != null) {
- // This will roll back the transaction and prevent duplicate history entries from being saved.
- throw new ResourceExistsException();
- }
- ofy.save().entities(new ImmutableSet.Builder<>()
- .add(resource)
- .addAll(createIndexesForEppResource(resource))
- .build());
- logger.atInfo().log(
- "Imported %s resource - ROID=%s, id=%s",
- resource.getClass().getSimpleName(), resource.getRepoId(), resource.getForeignKey());
- }
-
- /**
- * Validates an escrow file for import.
- *
- * Before an escrow file is imported into the registry, the following conditions must be met:
- *
- *
- * The TLD must already exist in the registry
- * The TLD must be in the PREDELEGATION state
- * Each registrar must already exist in the registry
- * Each IDN table referenced must already exist in the registry
- *
- *
- * If any of the above conditions is not true, an {@link IllegalStateException} will be thrown.
- *
- * @param escrowFilePath Path to the escrow file to validate
- * @throws IOException If the escrow file cannot be read
- * @throws IllegalArgumentException if the escrow file cannot be imported
- */
- public void validateEscrowFileForImport(String escrowFilePath) throws IOException {
- // TODO (wolfgang@donuts.co): Add validation method for IDN tables
- try (InputStream input =
- gcsUtils.openInputStream(new GcsFilename(escrowBucketName, escrowFilePath))) {
- try (RdeParser parser = new RdeParser(input)) {
- // validate that tld exists and is in PREDELEGATION state
- String tld = parser.getHeader().getTld();
- try {
- Registry registry = Registry.get(tld);
- TldState currentState = registry.getTldState(clock.nowUtc());
- checkArgument(
- currentState == PREDELEGATION,
- "TLD '%s' is in state %s and cannot be imported",
- tld,
- currentState);
- } catch (RegistryNotFoundException e) {
- throw new IllegalArgumentException(
- String.format("TLD '%s' not found in the registry", tld));
- }
- // validate that all registrars exist
- while (parser.nextRegistrar()) {
- XjcRdeRegistrar registrar = parser.getRegistrar();
- checkArgumentPresent(
- Registrar.loadByClientIdCached(registrar.getId()),
- "Registrar '%s' not found in the registry",
- registrar.getId());
- }
- } catch (XMLStreamException | JAXBException e) {
- throw new IllegalArgumentException(
- String.format("Invalid XML file: '%s'", escrowFilePath), e);
- }
- }
- }
-
- /** Generates a random {@link Trid} for rde import. */
- public static Trid generateTridForImport() {
- // Client trids must be a token between 3 and 64 characters long
- // Base64 encoded UUID string meets this requirement
- return Trid.create(
- "Import_" + BaseEncoding.base64().encode(UUID.randomUUID().toString().getBytes(US_ASCII)),
- serverTridProvider.createServerTrid());
- }
-
- public static BillingEvent.Recurring createAutoRenewBillingEventForDomainImport(
- XjcRdeDomain domain, HistoryEntry historyEntry) {
- return new BillingEvent.Recurring.Builder()
- .setReason(Reason.RENEW)
- .setFlags(ImmutableSet.of(Flag.AUTO_RENEW))
- .setTargetId(domain.getRoid())
- .setClientId(domain.getClID())
- .setEventTime(domain.getExDate())
- .setRecurrenceEndTime(END_OF_TIME)
- .setParent(historyEntry)
- .build();
- }
-
- public static PollMessage.Autorenew createAutoRenewPollMessageForDomainImport(
- XjcRdeDomain domain, HistoryEntry historyEntry) {
- return new PollMessage.Autorenew.Builder()
- .setTargetId(domain.getRoid())
- .setClientId(domain.getClID())
- .setEventTime(domain.getExDate())
- .setMsg("Domain was auto-renewed.")
- .setParent(historyEntry)
- .build();
- }
-
- public static HistoryEntry createHistoryEntryForDomainImport(XjcRdeDomain domain) {
- XjcRdeDomainElement element = new XjcRdeDomainElement(domain);
- return new HistoryEntry.Builder()
- .setType(HistoryEntry.Type.RDE_IMPORT)
- .setClientId(domain.getClID())
- .setTrid(generateTridForImport())
- .setModificationTime(ofy().getTransactionTime())
- .setXmlBytes(getObjectXml(element))
- .setBySuperuser(true)
- .setReason("RDE Import")
- .setRequestedByRegistrar(false)
- .setParent(Key.create(null, DomainBase.class, domain.getRoid()))
- .build();
- }
-
- public static byte[] getObjectXml(Object jaxbElement) {
- try {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- XjcXmlTransformer.marshalLenient(jaxbElement, bout, UTF_8);
- return bout.toByteArray();
- } catch (XmlException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/java/google/registry/rde/imports/RdeImportsModule.java b/java/google/registry/rde/imports/RdeImportsModule.java
deleted file mode 100644
index 6241a0a5b..000000000
--- a/java/google/registry/rde/imports/RdeImportsModule.java
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import dagger.Module;
-import dagger.Provides;
-import google.registry.request.Parameter;
-import google.registry.request.RequestParameters;
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * Dagger module for RDE imports package.
- *
- * @see "google.registry.module.backend.BackendRequestComponent"
- */
-@Module
-public final class RdeImportsModule {
-
- static final String PATH = "path";
-
- @Provides
- @Parameter(PATH)
- static String providePath(HttpServletRequest req) {
- return RequestParameters.extractRequiredParameter(req, PATH);
- }
-}
diff --git a/java/google/registry/rde/imports/RdeParser.java b/java/google/registry/rde/imports/RdeParser.java
deleted file mode 100644
index b3ed2da42..000000000
--- a/java/google/registry/rde/imports/RdeParser.java
+++ /dev/null
@@ -1,591 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
-
-import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableMap;
-import google.registry.xjc.rdecontact.XjcRdeContact;
-import google.registry.xjc.rdecontact.XjcRdeContactElement;
-import google.registry.xjc.rdedomain.XjcRdeDomain;
-import google.registry.xjc.rdedomain.XjcRdeDomainElement;
-import google.registry.xjc.rdeeppparams.XjcRdeEppParams;
-import google.registry.xjc.rdeeppparams.XjcRdeEppParamsElement;
-import google.registry.xjc.rdeheader.XjcRdeHeader;
-import google.registry.xjc.rdeheader.XjcRdeHeaderCount;
-import google.registry.xjc.rdeheader.XjcRdeHeaderElement;
-import google.registry.xjc.rdehost.XjcRdeHost;
-import google.registry.xjc.rdehost.XjcRdeHostElement;
-import google.registry.xjc.rdeidn.XjcRdeIdn;
-import google.registry.xjc.rdeidn.XjcRdeIdnElement;
-import google.registry.xjc.rdenndn.XjcRdeNndn;
-import google.registry.xjc.rdenndn.XjcRdeNndnElement;
-import google.registry.xjc.rderegistrar.XjcRdeRegistrar;
-import google.registry.xjc.rderegistrar.XjcRdeRegistrarElement;
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.Optional;
-import javax.annotation.concurrent.NotThreadSafe;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-/**
- * RDE escrow deposit file parser
- *
- *
{@link RdeParser} parses escrow deposit files as a sequence of elements. The parser will first
- * parse and cache the RDE header before any other elements, so all calls to {@link #getHeader} will
- * return the header even if the parser has advanced beyond it.
- *
- *
{@link RdeParser} currently supports parsing the following rde elements as jaxb objects:
- *
- * Contact
- * Host
- * Domain
- * Registrar
- * Tld
- * IDN table reference
- * EPP Params
- * NNDN
- *
- *
- * Any calls to {@link #nextDomain}, {@link #nextHost}, etc. will advance the parser to the next
- * element in the file, if any additional elements of that type exist. Since the order of these
- * elements is not known at the time the file is read, client code should only try to parse one type
- * of element at a time. Parsing of additional element types should be performed by creating a new
- * parser.
- */
-@NotThreadSafe
-public class RdeParser implements Closeable {
-
- private static final String RDE_DOMAIN_URI = "urn:ietf:params:xml:ns:rdeDomain-1.0";
- private static final String RDE_HOST_URI = "urn:ietf:params:xml:ns:rdeHost-1.0";
- private static final String RDE_CONTACT_URI = "urn:ietf:params:xml:ns:rdeContact-1.0";
- private static final String RDE_REGISTRAR_URI = "urn:ietf:params:xml:ns:rdeRegistrar-1.0";
- private static final String RDE_IDN_URI = "urn:ietf:params:xml:ns:rdeIDN-1.0";
- private static final String RDE_NNDN_URI = "urn:ietf:params:xml:ns:rdeNNDN-1.0";
- private static final String RDE_EPP_PARAMS_URI = "urn:ietf:params:xml:ns:rdeEppParams-1.0";
- private static final String RDE_HEADER_URI = "urn:ietf:params:xml:ns:rdeHeader-1.0";
-
- /** List of packages to initialize JAXBContext. **/
- private static final String JAXB_CONTEXT_PACKAGES = Joiner.on(":")
- .join(Arrays.asList(
- "google.registry.xjc.contact",
- "google.registry.xjc.domain",
- "google.registry.xjc.host",
- "google.registry.xjc.mark",
- "google.registry.xjc.rde",
- "google.registry.xjc.rdecontact",
- "google.registry.xjc.rdedomain",
- "google.registry.xjc.rdeeppparams",
- "google.registry.xjc.rdeheader",
- "google.registry.xjc.rdeidn",
- "google.registry.xjc.rdenndn",
- "google.registry.xjc.rderegistrar",
- "google.registry.xjc.smd"));
-
- /**
- * Convenient immutable java representation of an RDE header
- */
- public static class RdeHeader {
-
- private final ImmutableMap counts;
- private final String tld;
-
- public String getTld() {
- return tld;
- }
-
- public Long getDomainCount() {
- return Optional.ofNullable(counts.get(RDE_DOMAIN_URI)).orElse(0L);
- }
-
- public Long getHostCount() {
- return Optional.ofNullable(counts.get(RDE_HOST_URI)).orElse(0L);
- }
-
- public Long getContactCount() {
- return Optional.ofNullable(counts.get(RDE_CONTACT_URI)).orElse(0L);
- }
-
- public Long getRegistrarCount() {
- return Optional.ofNullable(counts.get(RDE_REGISTRAR_URI)).orElse(0L);
- }
-
- public Long getIdnCount() {
- return Optional.ofNullable(counts.get(RDE_IDN_URI)).orElse(0L);
- }
-
- public Long getNndnCount() {
- return Optional.ofNullable(counts.get(RDE_NNDN_URI)).orElse(0L);
- }
-
- public Long getEppParamsCount() {
- return Optional.ofNullable(counts.get(RDE_EPP_PARAMS_URI)).orElse(0L);
- }
-
- private RdeHeader(XjcRdeHeader header) {
- this.tld = header.getTld();
- ImmutableMap.Builder builder = new ImmutableMap.Builder<>();
- for (XjcRdeHeaderCount count : header.getCounts()) {
- builder = builder.put(count.getUri(), count.getValue());
- }
- counts = builder.build();
- }
- }
-
- private final InputStream xmlInput;
- private final XMLStreamReader reader;
- private final Unmarshaller unmarshaller;
-
- private RdeHeader header;
-
- /**
- * Creates a new instance of {@link RdeParser}
- *
- * @param xmlInput Contents of the escrow deposit file
- * @throws JAXBException
- */
- public RdeParser(InputStream xmlInput) throws XMLStreamException, JAXBException {
- this.xmlInput = xmlInput;
- this.unmarshaller = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES).createUnmarshaller();
- this.reader = XMLInputFactory.newInstance().createXMLStreamReader(xmlInput);
- this.header = new RdeHeader(readHeader());
- }
-
- /**
- * Attempts to read the RDE header as a jaxb object.
- *
- * @throws IllegalStateException if no RDE header is found in the file
- */
- private XjcRdeHeader readHeader() {
- if (!nextElement(RDE_HEADER_URI, "header")) {
- throw new IllegalStateException("No RDE Header found");
- }
- XjcRdeHeaderElement element = (XjcRdeHeaderElement) unmarshalElement(RDE_HEADER_URI, "header");
- return element.getValue();
- }
-
- /**
- * Unmarshals the current element into a Jaxb element.
- *
- * @param uri Element URI
- * @param name Element Name
- * @return Jaxb Element
- * @throws IllegalStateException if the parser is not at the specified element
- */
- private Object unmarshalElement(String uri, String name) {
- checkArgumentNotNull(name, "name cannot be null");
- checkArgumentNotNull(uri, "uri cannot be null");
- try {
- if (isAtElement(uri, name)) {
- return unmarshaller.unmarshal(reader);
- } else {
- throw new IllegalStateException(String.format("Not at element %s:%s", uri, name));
- }
- } catch (IllegalStateException e) {
- throw e;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Checks if the parser is at an instance of the specified element.
- *
- * @param uri Element URI
- * @param name Element Name
- * @return true if the parser is at an instance of the element, false otherwise
- */
- private boolean isAtElement(String uri, String name) {
- return reader.getEventType() == XMLStreamReader.START_ELEMENT
- && uri.equals(reader.getNamespaceURI()) && name.equals(reader.getName().getLocalPart());
- }
-
- /**
- * Attempts to advance to the next instance of the specified element.
- *
- * The parser may skip over other types of elements while advancing to the next instance of the
- * specified element.
- *
- * @param uri Element URI
- * @param name Element Name
- * @return true if the parser advanced to the element, false otherwise.
- */
- private boolean nextElement(String uri, String name) {
- try {
- while (reader.hasNext()) {
- reader.next();
- if (isAtElement(uri, name)) {
- return true;
- }
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- return false;
- }
-
- public RdeHeader getHeader() {
- return header;
- }
-
- /**
- * Attempts to skip over a number of specified elements.
- *
- *
If the parser is not currently at one of the specified elements, it will advance to the next
- * instance before skipping any.
- *
- *
In the process of skipping over a specific type of element, other elements may be skipped as
- * well. Elements of types other than that specified by the uri and name will not be counted.
- *
- * @param numberOfElements Number of elements to skip
- * @param uri Element URI
- * @param name Element Name
- * @return Number of elements that were skipped
- */
- private int skipElements(int numberOfElements, String uri, String name) {
- checkArgument(
- numberOfElements >= 0, "number of elements must be greater than or equal to zero");
- // don't do any skipping if numberOfElements is 0
- if (numberOfElements == 0) {
- return 0;
- }
- // unless the parser is at one of the specified elements,
- // the first call to nextElement() will advance to the first
- // element to be skipped
- int skipped = 0;
- if (isAtElement(uri, name)) {
- skipped = 1;
- }
- while (nextElement(uri, name) && skipped < numberOfElements) {
- skipped++;
- }
- return skipped;
- }
-
- /**
- * Advances parser to the next contact element.
- *
- *
The parser may skip over other types of elements while advancing to the next contact
- * element.
- *
- * @return true if the parser advanced to a contact element, false otherwise
- */
- public boolean nextContact() {
- return nextElement(RDE_CONTACT_URI, "contact");
- }
-
- /**
- * Checks if the parser is at a contact element.
- *
- * @return true if the parser is at a contact element, false otherwise
- */
- public boolean isAtContact() {
- return isAtElement(RDE_CONTACT_URI, "contact");
- }
-
- /**
- * Attempts to skip over a number of contacts.
- *
- *
If the parser is not currently at a contact element, it will advance to the next instance
- * before skipping any.
- *
- *
In the process of skipping over a contact element, other elements may be skipped as well.
- * Elements of types other than contact elements will not be counted.
- *
- * @return Number of contact elements that were skipped
- */
- public int skipContacts(int numberOfContacts) {
- return skipElements(numberOfContacts, RDE_CONTACT_URI, "contact");
- }
-
- /**
- * Gets the current contact.
- *
- *
The parser must be at a contact element before this method is called, or an
- * {@link IllegalStateException} will be thrown. Check the return value of {@link #isAtContact} or
- * {@link #nextContact} to determine if the parser is at a contact element.
- *
- * @return Jaxb Contact
- * @throws IllegalStateException if the parser is not at a contact element
- */
- public XjcRdeContact getContact() {
- XjcRdeContactElement element =
- (XjcRdeContactElement) unmarshalElement(RDE_CONTACT_URI, "contact");
- return element.getValue();
- }
-
- /**
- * Advances parser to the next domain element.
- *
- *
The parser may skip over other types of elements while advancing to the next domain element.
- *
- * @return true if the parser advanced to a domain element, false otherwise
- */
- public boolean nextDomain() {
- return nextElement(RDE_DOMAIN_URI, "domain");
- }
-
- /**
- * Checks if the parser is at a domain element.
- *
- * @return true if the parser is at a domain element, false otherwise
- */
- public boolean isAtDomain() {
- return isAtElement(RDE_DOMAIN_URI, "domain");
- }
-
- /**
- * Attempts to skip over a number of domains.
- *
- *
If the parser is not currently at a domain element, it will advance to the next instance
- * before skipping any.
- *
- *
In the process of skipping over a domain element, other elements may be skipped as well.
- * Elements of types other than domain elements will not be counted.
- *
- * @return Number of domain elements that were skipped
- */
- public int skipDomains(int numberOfDomains) {
- return skipElements(numberOfDomains, RDE_DOMAIN_URI, "domain");
- }
-
- /**
- * Gets the current domain.
- *
- *
The parser must be at a domain element before this method is called, or an
- * {@link IllegalStateException} will be thrown. Check the return value of {@link #isAtDomain} or
- * {@link #nextDomain} to determine if the parser is at a domain element.
- *
- * @return Jaxb Domain
- * @throws IllegalStateException if the parser is not at a domain element
- */
- public XjcRdeDomain getDomain() {
- XjcRdeDomainElement element = (XjcRdeDomainElement) unmarshalElement(RDE_DOMAIN_URI, "domain");
- return element.getValue();
- }
-
- /**
- * Advances parser to the next host element.
- *
- *
The parser may skip over other types of elements while advancing to the next host element.
- *
- * @return true if the parser advanced to a host element, false otherwise
- */
- public boolean nextHost() {
- return nextElement(RDE_HOST_URI, "host");
- }
-
- /**
- * Checks if the parser is at a host element.
- *
- * @return true if the parser is at a host element, false otherwise
- */
- public boolean isAtHost() {
- return isAtElement(RDE_HOST_URI, "host");
- }
-
- /**
- * Attempts to skip over a number of hosts.
- *
- *
If the parser is not currently at a host element, it will advance to the next instance
- * before skipping any.
- *
- *
In the process of skipping over a host element, other elements may be skipped as well.
- * Elements of types other than host elements will not be counted.
- *
- * @return Number of host elements that were skipped
- */
- public int skipHosts(int numberOfHosts) {
- return skipElements(numberOfHosts, RDE_HOST_URI, "host");
- }
-
- /**
- * Gets the current host.
- *
- *
The parser must be at a host element before this method is called, or an
- * {@link IllegalStateException} will be thrown. Check the return value of {@link #isAtHost} or
- * {@link #nextHost} to determine if the parser is at a host element.
- *
- * @return Jaxb Host
- * @throws IllegalStateException if the parser is not at a host element
- */
- public XjcRdeHost getHost() {
- XjcRdeHostElement element = (XjcRdeHostElement) unmarshalElement(RDE_HOST_URI, "host");
- return element.getValue();
- }
-
- /**
- * Advances parser to the next registrar element.
- *
- *
The parser may skip over other types of elements while advancing to the next registrar
- * element.
- *
- * @return true if the parser advanced to a registrar element, false otherwise
- */
- public boolean nextRegistrar() {
- return nextElement(RDE_REGISTRAR_URI, "registrar");
- }
-
- /**
- * Checks if the parser is at a registrar element.
- *
- * @return true if the parser is at a registrar element, false otherwise
- */
- public boolean isAtRegistrar() {
- return isAtElement(RDE_REGISTRAR_URI, "registrar");
- }
-
- /**
- * Gets the current registrar.
- *
- *
The parser must be at a registrar element before this method is called, or an
- * {@link IllegalStateException} will be thrown. Check the return value of {@link #isAtRegistrar}
- * or {@link #nextRegistrar} to determine if the parser is at a registrar element.
- *
- * @return Jaxb Registrar
- * @throws IllegalStateException if the parser is not at a registrar element
- */
- public XjcRdeRegistrar getRegistrar() {
- XjcRdeRegistrarElement element =
- (XjcRdeRegistrarElement) unmarshalElement(RDE_REGISTRAR_URI, "registrar");
- return element.getValue();
- }
-
- /**
- * Advances parser to the next IDN element.
- *
- *
The parser may skip over other types of elements while advancing to the next IDN element.
- *
- * @return true if the parser advanced to a IDN element, false otherwise
- */
- public boolean nextIdn() {
- return nextElement(RDE_IDN_URI, "idnTableRef");
- }
-
- /**
- * Checks if the parser is at a IDN element.
- *
- * @return true if the parser is at a IDN element, false otherwise
- */
- public boolean isAtIdn() {
- return isAtElement(RDE_IDN_URI, "idnTableRef");
- }
-
- /**
- * Gets the current IDN.
- *
- *
The parser must be at a IDN element before this method is called, or an
- * {@link IllegalStateException} will be thrown. Check the return value of {@link #isAtIdn} or
- * {@link #nextIdn} to determine if the parser is at a IDN element.
- *
- * @return Jaxb IDN
- * @throws IllegalStateException if the parser is not at a IDN element
- */
- public XjcRdeIdn getIdn() {
- XjcRdeIdnElement element = (XjcRdeIdnElement) unmarshalElement(RDE_IDN_URI, "idnTableRef");
- return element.getValue();
- }
-
- /**
- * Advances parser to the next NNDN element.
- *
- *
The parser may skip over other types of elements while advancing to the next NNDN element.
- *
- * @return true if the parser advanced to a NNDN element, false otherwise
- */
- public boolean nextNndn() {
- return nextElement(RDE_NNDN_URI, "NNDN");
- }
-
- /**
- * Checks if the parser is at a NNDN element.
- *
- * @return true if the parser is at a NNDN element, false otherwise
- */
- public boolean isAtNndn() {
- return isAtElement(RDE_NNDN_URI, "NNDN");
- }
-
- /**
- * Gets the current NNDN.
- *
- *
The parser must be at a NNDN element before this method is called, or an
- * {@link IllegalStateException} will be thrown. Check the return value of {@link #isAtNndn} or
- * {@link #nextNndn} to determine if the parser is at a NNDN element.
- *
- * @return Jaxb NNDN
- * @throws IllegalStateException if the parser is not at a NNDN element
- */
- public XjcRdeNndn getNndn() {
- XjcRdeNndnElement element = (XjcRdeNndnElement) unmarshalElement(RDE_NNDN_URI, "NNDN");
- return element.getValue();
- }
-
- /**
- * Advances parser to the next eppParams element.
- *
- *
The parser may skip over other types of elements while advancing to the next eppParams
- * element.
- *
- * @return true if the parser advanced to a eppParams element, false otherwise
- */
- public boolean nextEppParams() {
- return nextElement(RDE_EPP_PARAMS_URI, "eppParams");
- }
-
- /**
- * Checks if the parser is at a eppParams element.
- *
- * @return true if the parser is at a eppParams element, false otherwise
- */
- public boolean isAtEppParams() {
- return isAtElement(RDE_EPP_PARAMS_URI, "eppParams");
- }
-
- /**
- * Gets the current eppParams.
- *
- *
The parser must be at a eppParams element before this method is called, or an
- * {@link IllegalStateException} will be thrown. Check the return value of {@link #isAtEppParams}
- * or {@link #nextEppParams} to determine if the parser is at a eppParams element.
- *
- * @return Jaxb EppParams
- * @throws IllegalStateException if the parser is not at a eppParams element
- */
- public XjcRdeEppParams getEppParams() {
- XjcRdeEppParamsElement element =
- (XjcRdeEppParamsElement) unmarshalElement(RDE_EPP_PARAMS_URI, "eppParams");
- return element.getValue();
- }
-
- /**
- * Closes the underlying InputStream
- *
- * @throws IOException if the underlying stream throws {@link IOException} on close.
- */
- @Override
- public void close() throws IOException {
- xmlInput.close();
- }
-}
diff --git a/java/google/registry/rde/imports/ResourceExistsException.java b/java/google/registry/rde/imports/ResourceExistsException.java
deleted file mode 100644
index 8a2e701b5..000000000
--- a/java/google/registry/rde/imports/ResourceExistsException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-/**
- * Indicates that a resource already exists and was not imported.
- */
-public class ResourceExistsException extends RuntimeException {
-
- private static final long serialVersionUID = -9180381693364904061L;
-}
diff --git a/java/google/registry/rde/imports/XjcToContactResourceConverter.java b/java/google/registry/rde/imports/XjcToContactResourceConverter.java
deleted file mode 100644
index f37ce80df..000000000
--- a/java/google/registry/rde/imports/XjcToContactResourceConverter.java
+++ /dev/null
@@ -1,200 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.base.Predicates.equalTo;
-import static com.google.common.base.Predicates.not;
-import static com.google.common.collect.ImmutableList.toImmutableList;
-import static com.google.common.collect.ImmutableSet.toImmutableSet;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.rde.imports.RdeImportUtils.generateTridForImport;
-
-import com.google.common.collect.ImmutableList;
-import com.googlecode.objectify.Key;
-import google.registry.model.contact.ContactAddress;
-import google.registry.model.contact.ContactPhoneNumber;
-import google.registry.model.contact.ContactResource;
-import google.registry.model.contact.Disclose;
-import google.registry.model.contact.Disclose.PostalInfoChoice;
-import google.registry.model.contact.PostalInfo;
-import google.registry.model.eppcommon.StatusValue;
-import google.registry.model.reporting.HistoryEntry;
-import google.registry.model.transfer.TransferData;
-import google.registry.model.transfer.TransferStatus;
-import google.registry.util.XmlToEnumMapper;
-import google.registry.xjc.contact.XjcContactAddrType;
-import google.registry.xjc.contact.XjcContactDiscloseType;
-import google.registry.xjc.contact.XjcContactE164Type;
-import google.registry.xjc.contact.XjcContactIntLocType;
-import google.registry.xjc.contact.XjcContactPostalInfoEnumType;
-import google.registry.xjc.contact.XjcContactPostalInfoType;
-import google.registry.xjc.contact.XjcContactStatusType;
-import google.registry.xjc.rdecontact.XjcRdeContact;
-import google.registry.xjc.rdecontact.XjcRdeContactElement;
-import google.registry.xjc.rdecontact.XjcRdeContactTransferDataType;
-import javax.annotation.Nullable;
-
-/** Utility class that converts an {@link XjcRdeContact} into a {@link ContactResource}. */
-final class XjcToContactResourceConverter extends XjcToEppResourceConverter {
-
- private static final XmlToEnumMapper POSTAL_INFO_TYPE_MAPPER =
- XmlToEnumMapper.create(PostalInfo.Type.values());
- private static final XmlToEnumMapper TRANSFER_STATUS_MAPPER =
- XmlToEnumMapper.create(TransferStatus.values());
- /** Converts {@link XjcRdeContact} to {@link ContactResource}. */
- static ContactResource convertContact(XjcRdeContact contact) {
- ofy().save().entity(
- new HistoryEntry.Builder()
- .setType(HistoryEntry.Type.RDE_IMPORT)
- .setClientId(contact.getClID())
- .setTrid(generateTridForImport())
- .setModificationTime(ofy().getTransactionTime())
- .setXmlBytes(getObjectXml(new XjcRdeContactElement(contact)))
- .setBySuperuser(true)
- .setReason("RDE Import")
- .setRequestedByRegistrar(false)
- .setParent(Key.create(null, ContactResource.class, contact.getRoid()))
- .build());
- return new ContactResource.Builder()
- .setRepoId(contact.getRoid())
- .setStatusValues(
- contact
- .getStatuses()
- .stream()
- .map(XjcToContactResourceConverter::convertStatusValue)
- .filter(not(equalTo(StatusValue.LINKED)))
- .collect(toImmutableSet()))
- .setLocalizedPostalInfo(
- getPostalInfoOfType(contact.getPostalInfos(), XjcContactPostalInfoEnumType.LOC))
- .setInternationalizedPostalInfo(
- getPostalInfoOfType(contact.getPostalInfos(), XjcContactPostalInfoEnumType.INT))
- .setContactId(contact.getId())
- .setPersistedCurrentSponsorClientId(contact.getClID())
- .setCreationClientId(contact.getCrRr() == null ? null : contact.getCrRr().getValue())
- .setLastEppUpdateClientId(contact.getUpRr() == null ? null : contact.getUpRr().getValue())
- .setCreationTime(contact.getCrDate())
- .setLastEppUpdateTime(contact.getUpDate())
- .setLastTransferTime(contact.getTrDate())
- .setVoiceNumber(convertPhoneNumber(contact.getVoice()))
- .setFaxNumber(convertPhoneNumber(contact.getFax()))
- .setEmailAddress(contact.getEmail())
- .setDisclose(convertDisclose(contact.getDisclose()))
- .setTransferData(convertTransferData(contact.getTrnData()))
- .build();
- }
-
- /**
- * Extracts a {@link PostalInfo} from an {@link Iterable} of {@link XjcContactPostalInfoEnumType}.
- */
- @Nullable
- private static PostalInfo getPostalInfoOfType(
- Iterable postalInfos, XjcContactPostalInfoEnumType type) {
- for (XjcContactPostalInfoType postalInfo : postalInfos) {
- if (postalInfo.getType() == type) {
- return convertPostalInfo(postalInfo);
- }
- }
- return null;
- }
-
- /** Converts {@link XjcRdeContactTransferDataType} to {@link TransferData}. */
- private static TransferData convertTransferData(
- @Nullable XjcRdeContactTransferDataType transferData) {
- if (transferData == null) {
- return TransferData.EMPTY;
- }
- return new TransferData.Builder()
- .setTransferStatus(TRANSFER_STATUS_MAPPER.xmlToEnum(transferData.getTrStatus().value()))
- .setGainingClientId(transferData.getReRr().getValue())
- .setLosingClientId(transferData.getAcRr().getValue())
- .setTransferRequestTime(transferData.getReDate())
- .setPendingTransferExpirationTime(transferData.getAcDate())
- .build();
- }
-
- /** Converts {@link XjcContactAddrType} to {@link ContactAddress}. */
- private static ContactAddress convertAddress(XjcContactAddrType address) {
- return new ContactAddress.Builder()
- .setStreet(ImmutableList.copyOf(address.getStreets()))
- .setCity(address.getCity())
- .setState(address.getSp())
- .setZip(address.getPc())
- .setCountryCode(address.getCc())
- .build();
- }
-
- /** Converts {@link XjcContactDiscloseType} to {@link Disclose}. */
- @Nullable
- private static Disclose convertDisclose(@Nullable XjcContactDiscloseType disclose) {
- if (disclose == null) {
- return null;
- }
- return new Disclose.Builder()
- .setFlag(disclose.isFlag())
- .setNames(
- disclose
- .getNames()
- .stream()
- .map(XjcToContactResourceConverter::convertPostalInfoChoice)
- .collect(toImmutableList()))
- .setOrgs(
- disclose
- .getOrgs()
- .stream()
- .map(XjcToContactResourceConverter::convertPostalInfoChoice)
- .collect(toImmutableList()))
- .setAddrs(
- disclose
- .getAddrs()
- .stream()
- .map(XjcToContactResourceConverter::convertPostalInfoChoice)
- .collect(toImmutableList()))
- .build();
- }
-
- /** Converts {@link XjcContactE164Type} to {@link ContactPhoneNumber}. */
- @Nullable
- private static ContactPhoneNumber convertPhoneNumber(@Nullable XjcContactE164Type phoneNumber) {
- if (phoneNumber == null) {
- return null;
- }
- return new ContactPhoneNumber.Builder()
- .setPhoneNumber(phoneNumber.getValue())
- .setExtension(phoneNumber.getX())
- .build();
- }
-
- /** Converts {@link PostalInfoChoice} to {@link XjcContactIntLocType}. */
- private static PostalInfoChoice convertPostalInfoChoice(XjcContactIntLocType choice) {
- return PostalInfoChoice.create(POSTAL_INFO_TYPE_MAPPER.xmlToEnum(choice.getType().value()));
- }
-
- /** Converts {@link XjcContactPostalInfoType} to {@link PostalInfo}. */
- private static PostalInfo convertPostalInfo(XjcContactPostalInfoType postalInfo) {
- return new PostalInfo.Builder()
- .setName(postalInfo.getName())
- .setOrg(postalInfo.getOrg())
- .setAddress(convertAddress(postalInfo.getAddr()))
- .setType(POSTAL_INFO_TYPE_MAPPER.xmlToEnum(postalInfo.getType().value()))
- .build();
- }
-
- /** Converts {@link XjcContactStatusType} to {@link StatusValue}. */
- private static StatusValue convertStatusValue(XjcContactStatusType statusType) {
- return StatusValue.fromXmlName(statusType.getS().value());
- }
-
- private XjcToContactResourceConverter() {}
-}
diff --git a/java/google/registry/rde/imports/XjcToDomainBaseConverter.java b/java/google/registry/rde/imports/XjcToDomainBaseConverter.java
deleted file mode 100644
index 6ab586a1b..000000000
--- a/java/google/registry/rde/imports/XjcToDomainBaseConverter.java
+++ /dev/null
@@ -1,255 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.collect.ImmutableSet.toImmutableSet;
-import static google.registry.util.DomainNameUtils.canonicalizeDomainName;
-import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
-import static org.joda.time.DateTimeZone.UTC;
-
-import com.google.common.base.Ascii;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.net.InternetDomainName;
-import com.googlecode.objectify.Key;
-import google.registry.model.billing.BillingEvent;
-import google.registry.model.contact.ContactResource;
-import google.registry.model.domain.DesignatedContact;
-import google.registry.model.domain.DomainAuthInfo;
-import google.registry.model.domain.DomainBase;
-import google.registry.model.domain.GracePeriod;
-import google.registry.model.domain.rgp.GracePeriodStatus;
-import google.registry.model.domain.secdns.DelegationSignerData;
-import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
-import google.registry.model.eppcommon.StatusValue;
-import google.registry.model.host.HostResource;
-import google.registry.model.index.ForeignKeyIndex;
-import google.registry.model.poll.PollMessage;
-import google.registry.model.registry.Registries;
-import google.registry.model.registry.Registry;
-import google.registry.model.transfer.TransferData;
-import google.registry.model.transfer.TransferStatus;
-import google.registry.util.StringGenerator;
-import google.registry.util.XmlToEnumMapper;
-import google.registry.xjc.domain.XjcDomainContactType;
-import google.registry.xjc.domain.XjcDomainNsType;
-import google.registry.xjc.domain.XjcDomainStatusType;
-import google.registry.xjc.rdedomain.XjcRdeDomain;
-import google.registry.xjc.rdedomain.XjcRdeDomainElement;
-import google.registry.xjc.rdedomain.XjcRdeDomainTransferDataType;
-import google.registry.xjc.rgp.XjcRgpStatusType;
-import google.registry.xjc.secdns.XjcSecdnsDsDataType;
-import java.util.function.Function;
-import org.joda.time.DateTime;
-
-/** Utility class that converts an {@link XjcRdeDomainElement} into a {@link DomainBase}. */
-final class XjcToDomainBaseConverter extends XjcToEppResourceConverter {
-
- private static final XmlToEnumMapper TRANSFER_STATUS_MAPPER =
- XmlToEnumMapper.create(TransferStatus.values());
-
- private static final Function> HOST_OBJ_CONVERTER =
- fullyQualifiedHostName -> {
- // host names are always lower case
- fullyQualifiedHostName = canonicalizeDomainName(fullyQualifiedHostName);
- Key key =
- ForeignKeyIndex.loadAndGetKey(
- HostResource.class, fullyQualifiedHostName, DateTime.now(UTC));
- checkState(
- key != null,
- String.format("HostResource not found with name '%s'", fullyQualifiedHostName));
- return key;
- };
-
- /** Converts {@link XjcRgpStatusType} to {@link GracePeriod} */
- private static class GracePeriodConverter implements Function {
-
- private final XjcRdeDomain domain;
- private final Key autoRenewBillingEvent;
- private final Registry tld;
-
- GracePeriodConverter(XjcRdeDomain domain, Key autoRenewBillingEvent) {
- this.domain = domain;
- this.autoRenewBillingEvent = autoRenewBillingEvent;
- this.tld =
- Registry.get(
- Registries.findTldForNameOrThrow(InternetDomainName.from(domain.getName()))
- .toString());
- }
-
- @Override
- public GracePeriod apply(XjcRgpStatusType gracePeriodStatus) {
- switch (gracePeriodStatus.getS()) {
- case ADD_PERIOD:
- return GracePeriod.createWithoutBillingEvent(
- GracePeriodStatus.ADD,
- domain.getCrDate().plus(this.tld.getAddGracePeriodLength()),
- domain.getCrRr().getValue());
- case AUTO_RENEW_PERIOD:
- return GracePeriod.createForRecurring(
- GracePeriodStatus.AUTO_RENEW,
- domain.getUpDate().plus(this.tld.getAutoRenewGracePeriodLength()),
- domain.getClID(),
- autoRenewBillingEvent);
- case PENDING_DELETE:
- return GracePeriod.createWithoutBillingEvent(
- GracePeriodStatus.PENDING_DELETE,
- domain.getUpDate().plus(this.tld.getPendingDeleteLength()),
- domain.getClID());
- case REDEMPTION_PERIOD:
- return GracePeriod.createWithoutBillingEvent(
- GracePeriodStatus.REDEMPTION,
- domain.getUpDate().plus(this.tld.getRedemptionGracePeriodLength()),
- domain.getClID());
- case RENEW_PERIOD:
- return GracePeriod.createWithoutBillingEvent(
- GracePeriodStatus.RENEW,
- domain.getUpDate().plus(this.tld.getRenewGracePeriodLength()),
- domain.getClID());
- case TRANSFER_PERIOD:
- return GracePeriod.createWithoutBillingEvent(
- GracePeriodStatus.TRANSFER,
- domain.getUpDate().plus(this.tld.getTransferGracePeriodLength()),
- domain.getTrnData().getReRr().getValue());
- default:
- throw new IllegalArgumentException(
- "Unsupported grace period status: " + gracePeriodStatus.getS());
- }
- }
- }
-
- /** Converts {@link XjcRdeDomain} to {@link DomainBase}. */
- static DomainBase convertDomain(
- XjcRdeDomain domain,
- BillingEvent.Recurring autoRenewBillingEvent,
- PollMessage.Autorenew autoRenewPollMessage,
- StringGenerator stringGenerator) {
- GracePeriodConverter gracePeriodConverter =
- new GracePeriodConverter(domain, Key.create(autoRenewBillingEvent));
- DomainBase.Builder builder =
- new DomainBase.Builder()
- .setFullyQualifiedDomainName(canonicalizeDomainName(domain.getName()))
- .setRepoId(domain.getRoid())
- .setIdnTableName(domain.getIdnTableId())
- .setPersistedCurrentSponsorClientId(domain.getClID())
- .setCreationClientId(domain.getCrRr().getValue())
- .setCreationTime(domain.getCrDate())
- .setAutorenewPollMessage(Key.create(autoRenewPollMessage))
- .setAutorenewBillingEvent(Key.create(autoRenewBillingEvent))
- .setRegistrationExpirationTime(domain.getExDate())
- .setLastEppUpdateTime(domain.getUpDate())
- .setLastEppUpdateClientId(domain.getUpRr() == null ? null : domain.getUpRr().getValue())
- .setLastTransferTime(domain.getTrDate())
- .setStatusValues(
- domain
- .getStatuses()
- .stream()
- .map(XjcToDomainBaseConverter::convertStatusType)
- .collect(toImmutableSet()))
- .setNameservers(convertNameservers(domain.getNs()))
- .setGracePeriods(
- domain
- .getRgpStatuses()
- .stream()
- .map(gracePeriodConverter)
- .collect(toImmutableSet()))
- .setContacts(
- domain
- .getContacts()
- .stream()
- .map(XjcToDomainBaseConverter::convertContactType)
- .collect(toImmutableSet()))
- .setDsData(
- domain.getSecDNS() == null
- ? ImmutableSet.of()
- : domain
- .getSecDNS()
- .getDsDatas()
- .stream()
- .map(XjcToDomainBaseConverter::convertSecdnsDsDataType)
- .collect(toImmutableSet()))
- .setTransferData(convertDomainTransferData(domain.getTrnData()))
- // authInfo pw must be a token between 6 and 16 characters in length
- // generate a token of 16 characters as the default authInfo pw
- .setAuthInfo(
- DomainAuthInfo.create(
- PasswordAuth.create(stringGenerator.createString(16), domain.getRoid())));
- checkArgumentNotNull(
- domain.getRegistrant(), "Registrant is missing for domain '%s'", domain.getName());
- builder = builder.setRegistrant(convertRegistrant(domain.getRegistrant()));
- return builder.build();
- }
-
- /** Returns {@link Key} for registrant from foreign key */
- private static Key convertRegistrant(String contactId) {
- Key key =
- ForeignKeyIndex.loadAndGetKey(ContactResource.class, contactId, DateTime.now(UTC));
- checkState(key != null, "Registrant not found: '%s'", contactId);
- return key;
- }
-
- /** Converts {@link XjcDomainNsType} to ImmutableSet>
. */
- private static ImmutableSet> convertNameservers(XjcDomainNsType ns) {
- // If no hosts are specified, return an empty set
- if (ns == null || (ns.getHostAttrs() == null && ns.getHostObjs() == null)) {
- return ImmutableSet.of();
- }
- // Domain linked hosts must be specified by host object, not host attributes.
- checkArgument(
- ns.getHostAttrs() == null || ns.getHostAttrs().isEmpty(),
- "Host attributes are not yet supported");
- return ns.getHostObjs().stream().map(HOST_OBJ_CONVERTER).collect(toImmutableSet());
- }
-
- /** Converts {@link XjcRdeDomainTransferDataType} to {@link TransferData}. */
- private static TransferData convertDomainTransferData(XjcRdeDomainTransferDataType data) {
- if (data == null) {
- return TransferData.EMPTY;
- }
- return new TransferData.Builder()
- .setTransferStatus(TRANSFER_STATUS_MAPPER.xmlToEnum(data.getTrStatus().value()))
- .setGainingClientId(data.getReRr().getValue())
- .setLosingClientId(data.getAcRr().getValue())
- .setTransferRequestTime(data.getReDate())
- .setPendingTransferExpirationTime(data.getAcDate())
- .setTransferredRegistrationExpirationTime(data.getExDate())
- .build();
- }
-
- /** Converts {@link XjcDomainStatusType} to {@link StatusValue}. */
- private static StatusValue convertStatusType(XjcDomainStatusType type) {
- return StatusValue.fromXmlName(type.getS().value());
- }
-
- /** Converts {@link XjcSecdnsDsDataType} to {@link DelegationSignerData}. */
- private static DelegationSignerData convertSecdnsDsDataType(XjcSecdnsDsDataType secdns) {
- return DelegationSignerData.create(
- secdns.getKeyTag(), secdns.getAlg(), secdns.getDigestType(), secdns.getDigest());
- }
-
- /** Converts {@link XjcDomainContactType} to {@link DesignatedContact}. */
- private static DesignatedContact convertContactType(XjcDomainContactType contact) {
- String contactId = contact.getValue();
- Key key =
- ForeignKeyIndex.loadAndGetKey(ContactResource.class, contactId, DateTime.now(UTC));
- checkState(key != null, "Contact not found: '%s'", contactId);
- DesignatedContact.Type type =
- DesignatedContact.Type.valueOf(Ascii.toUpperCase(contact.getType().toString()));
- return DesignatedContact.create(type, key);
- }
-
- private XjcToDomainBaseConverter() {}
-}
diff --git a/java/google/registry/rde/imports/XjcToEppResourceConverter.java b/java/google/registry/rde/imports/XjcToEppResourceConverter.java
deleted file mode 100644
index 329f9a94f..000000000
--- a/java/google/registry/rde/imports/XjcToEppResourceConverter.java
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import google.registry.model.EppResource;
-import google.registry.xjc.XjcXmlTransformer;
-import google.registry.xml.XmlException;
-import java.io.ByteArrayOutputStream;
-
-/**
- * Base class for Jaxb object to {@link EppResource} converters
- */
-public abstract class XjcToEppResourceConverter {
-
- protected static byte[] getObjectXml(Object jaxbElement) {
- try {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- XjcXmlTransformer.marshalLenient(jaxbElement, bout, UTF_8);
- return bout.toByteArray();
- } catch (XmlException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/java/google/registry/rde/imports/XjcToHostResourceConverter.java b/java/google/registry/rde/imports/XjcToHostResourceConverter.java
deleted file mode 100644
index 26eefeda8..000000000
--- a/java/google/registry/rde/imports/XjcToHostResourceConverter.java
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.base.Predicates.in;
-import static com.google.common.base.Predicates.not;
-import static com.google.common.collect.ImmutableSet.toImmutableSet;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.rde.imports.RdeImportUtils.generateTridForImport;
-import static google.registry.util.DomainNameUtils.canonicalizeDomainName;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.net.InetAddresses;
-import com.googlecode.objectify.Key;
-import google.registry.model.eppcommon.StatusValue;
-import google.registry.model.host.HostResource;
-import google.registry.model.reporting.HistoryEntry;
-import google.registry.xjc.host.XjcHostAddrType;
-import google.registry.xjc.host.XjcHostStatusType;
-import google.registry.xjc.rdehost.XjcRdeHost;
-import google.registry.xjc.rdehost.XjcRdeHostElement;
-import java.net.InetAddress;
-
-/** Utility class that converts an {@link XjcRdeHost} into a {@link HostResource}. */
-public class XjcToHostResourceConverter extends XjcToEppResourceConverter {
- static HostResource convert(XjcRdeHost host) {
- // TODO(b/35384052): Handle subordinate hosts correctly by setting superordinateDomaina and
- // lastSuperordinateChange fields.
-
- // First create and save history entry
- ofy().save().entity(
- new HistoryEntry.Builder()
- .setType(HistoryEntry.Type.RDE_IMPORT)
- .setClientId(host.getClID())
- .setTrid(generateTridForImport())
- .setModificationTime(ofy().getTransactionTime())
- .setXmlBytes(getObjectXml(new XjcRdeHostElement(host)))
- .setBySuperuser(true)
- .setReason("RDE Import")
- .setRequestedByRegistrar(false)
- .setParent(Key.create(null, HostResource.class, host.getRoid()))
- .build());
- return new HostResource.Builder()
- .setFullyQualifiedHostName(canonicalizeDomainName(host.getName()))
- .setRepoId(host.getRoid())
- .setPersistedCurrentSponsorClientId(host.getClID())
- .setLastTransferTime(host.getTrDate())
- .setCreationTime(host.getCrDate())
- .setLastEppUpdateTime(host.getUpDate())
- .setCreationClientId(host.getCrRr().getValue())
- .setLastEppUpdateClientId(host.getUpRr() == null ? null : host.getUpRr().getValue())
- .setStatusValues(
- host.getStatuses()
- .stream()
- .map(XjcToHostResourceConverter::convertStatusType)
- .filter(not(in(ImmutableSet.of(StatusValue.LINKED, StatusValue.PENDING_TRANSFER))))
- .collect(toImmutableSet()))
- .setInetAddresses(
- host.getAddrs()
- .stream()
- .map(XjcToHostResourceConverter::convertAddrType)
- .collect(toImmutableSet()))
- .build();
- }
-
- /** Converts {@link XjcHostStatusType} to {@link StatusValue}. */
- private static StatusValue convertStatusType(XjcHostStatusType status) {
- return StatusValue.fromXmlName(status.getS().value());
- }
-
- /** Converts {@link XjcHostAddrType} to {@link InetAddress}. */
- private static InetAddress convertAddrType(XjcHostAddrType addr) {
- return InetAddresses.forString(addr.getValue());
- }
-
- private XjcToHostResourceConverter() {}
-}
diff --git a/javatests/google/registry/module/backend/testdata/backend_routing.txt b/javatests/google/registry/module/backend/testdata/backend_routing.txt
index c27f0b630..56592cd2b 100644
--- a/javatests/google/registry/module/backend/testdata/backend_routing.txt
+++ b/javatests/google/registry/module/backend/testdata/backend_routing.txt
@@ -21,10 +21,6 @@ PATH CLASS METHOD
/_dr/task/generateSpec11 GenerateSpec11ReportAction POST n INTERNAL APP IGNORED
/_dr/task/icannReportingStaging IcannReportingStagingAction POST n INTERNAL APP IGNORED
/_dr/task/icannReportingUpload IcannReportingUploadAction POST n INTERNAL,API APP ADMIN
-/_dr/task/importRdeContacts RdeContactImportAction GET n INTERNAL APP IGNORED
-/_dr/task/importRdeDomains RdeDomainImportAction GET n INTERNAL APP IGNORED
-/_dr/task/importRdeHosts RdeHostImportAction GET n INTERNAL APP IGNORED
-/_dr/task/linkRdeHosts RdeHostLinkAction GET n INTERNAL APP IGNORED
/_dr/task/nordnUpload NordnUploadAction POST y INTERNAL APP IGNORED
/_dr/task/nordnVerify NordnVerifyAction POST y INTERNAL APP IGNORED
/_dr/task/pollBigqueryJob BigqueryPollJobAction GET,POST y INTERNAL APP IGNORED
diff --git a/javatests/google/registry/rde/imports/BUILD b/javatests/google/registry/rde/imports/BUILD
deleted file mode 100644
index 50e8c8696..000000000
--- a/javatests/google/registry/rde/imports/BUILD
+++ /dev/null
@@ -1,47 +0,0 @@
-package(
- default_testonly = 1,
- default_visibility = ["//java/google/registry:registry_project"],
-)
-
-licenses(["notice"]) # Apache 2.0
-
-load("//java/com/google/testing/builddefs:GenTestRules.bzl", "GenTestRules")
-
-java_library(
- name = "imports",
- srcs = glob(["*.java"]),
- resources = glob(["testdata/*"]),
- deps = [
- "//java/google/registry/config",
- "//java/google/registry/gcs",
- "//java/google/registry/mapreduce",
- "//java/google/registry/model",
- "//java/google/registry/rde/imports",
- "//java/google/registry/request",
- "//java/google/registry/util",
- "//java/google/registry/xjc",
- "//javatests/google/registry/testing",
- "//javatests/google/registry/testing/mapreduce",
- "//third_party/jaxb",
- "//third_party/objectify:objectify-v4_1",
- "@com_google_appengine_api_1_0_sdk",
- "@com_google_appengine_tools_appengine_gcs_client",
- "@com_google_code_findbugs_jsr305",
- "@com_google_dagger",
- "@com_google_guava",
- "@com_google_truth",
- "@com_google_truth_extensions_truth_java8_extension",
- "@joda_time",
- "@junit",
- "@org_joda_money",
- "@org_mockito_all",
- ],
-)
-
-GenTestRules(
- name = "GeneratedTestRules",
- default_test_size = "medium",
- shard_count = 4,
- test_files = glob(["*Test.java"]),
- deps = [":imports"],
-)
diff --git a/javatests/google/registry/rde/imports/RdeContactImportActionTest.java b/javatests/google/registry/rde/imports/RdeContactImportActionTest.java
deleted file mode 100644
index e13644545..000000000
--- a/javatests/google/registry/rde/imports/RdeContactImportActionTest.java
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.testing.DatastoreHelper.getHistoryEntries;
-import static google.registry.testing.DatastoreHelper.newContactResource;
-import static google.registry.testing.DatastoreHelper.persistResource;
-import static google.registry.testing.DatastoreHelper.persistSimpleResource;
-import static org.joda.time.DateTimeZone.UTC;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.common.io.ByteSource;
-import com.google.common.io.ByteStreams;
-import com.googlecode.objectify.Key;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.mapreduce.MapreduceRunner;
-import google.registry.model.contact.ContactResource;
-import google.registry.model.eppcommon.Trid;
-import google.registry.model.reporting.HistoryEntry;
-import google.registry.request.Response;
-import google.registry.testing.FakeResponse;
-import google.registry.testing.mapreduce.MapreduceTestCase;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Optional;
-import org.joda.time.DateTime;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeContactImportAction}. */
-@RunWith(JUnit4.class)
-public class RdeContactImportActionTest extends MapreduceTestCase {
-
- private static final ByteSource DEPOSIT_1_CONTACT =
- RdeImportsTestData.loadBytes("deposit_1_contact.xml");
- private static final String IMPORT_BUCKET_NAME = "import-bucket";
- private static final String IMPORT_FILE_NAME = "escrow-file.xml";
-
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- private MapreduceRunner mrRunner;
-
- private Response response;
-
- @Before
- public void before() {
- response = new FakeResponse();
- mrRunner = makeDefaultRunner();
- action = new RdeContactImportAction(
- mrRunner,
- response,
- IMPORT_BUCKET_NAME,
- IMPORT_FILE_NAME,
- Optional.of(3));
- }
-
- @Test
- public void test_mapreduceSuccessfullyImportsContact() throws Exception {
- pushToGcs(DEPOSIT_1_CONTACT);
- runMapreduce();
- List contacts = ofy().load().type(ContactResource.class).list();
- assertThat(contacts).hasSize(1);
- checkContact(contacts.get(0));
- }
-
- @Test
- public void test_mapreduceSuccessfullyCreatesHistoryEntry() throws Exception {
- pushToGcs(DEPOSIT_1_CONTACT);
- runMapreduce();
- List contacts = ofy().load().type(ContactResource.class).list();
- ContactResource contact = contacts.get(0);
- // verify history entry
- List historyEntries = getHistoryEntries(contact);
- assertThat(historyEntries).hasSize(1);
- checkHistoryEntry(historyEntries.get(0), contact);
- }
-
- /** Ensures that a second pass on a contact does not import a new contact. */
- @Test
- public void test_mapreduceTwiceDoesNotDuplicateResources() throws Exception {
- pushToGcs(DEPOSIT_1_CONTACT);
- // Create contact and history entry first
- ContactResource existingContact = persistResource(
- newContactResource("contact1")
- .asBuilder()
- .setRepoId("contact1-TEST")
- .build());
- persistSimpleResource(createHistoryEntry(
- existingContact.getRepoId(),
- existingContact.getCurrentSponsorClientId(),
- loadContactXml(DEPOSIT_1_CONTACT)));
- // Simulate running a second import and verify that the resources
- // aren't imported twice (only one host, and one history entry)
- runMapreduce();
- List contacts = ofy().load().type(ContactResource.class).list();
- assertThat(contacts).hasSize(1);
- ContactResource contact = contacts.get(0);
- // verify history entry
- List historyEntries = getHistoryEntries(contact);
- assertThat(historyEntries).hasSize(1);
- checkHistoryEntry(historyEntries.get(0), contact);
- }
-
- private static HistoryEntry createHistoryEntry(String roid, String clid, byte[] objectXml) {
- return new HistoryEntry.Builder()
- .setType(HistoryEntry.Type.RDE_IMPORT)
- .setClientId(clid)
- .setTrid(Trid.create("client-trid", "server-trid"))
- .setModificationTime(DateTime.now(UTC))
- .setXmlBytes(objectXml)
- .setBySuperuser(true)
- .setReason("RDE Import")
- .setRequestedByRegistrar(false)
- .setParent(Key.create(null, ContactResource.class, roid))
- .build();
- }
-
- /** Verify history entry fields are correct */
- private void checkHistoryEntry(HistoryEntry entry, ContactResource parent) {
- assertThat(entry.getType()).isEqualTo(HistoryEntry.Type.RDE_IMPORT);
- assertThat(entry.getClientId()).isEqualTo(parent.getCurrentSponsorClientId());
- assertThat(entry.getXmlBytes().length).isGreaterThan(0);
- assertThat(entry.getBySuperuser()).isTrue();
- assertThat(entry.getReason()).isEqualTo("RDE Import");
- assertThat(entry.getRequestedByRegistrar()).isEqualTo(false);
- assertThat(entry.getParent()).isEqualTo(Key.create(parent));
- }
-
- /** Verifies that contact id and ROID match expected values */
- private void checkContact(ContactResource contact) {
- assertThat(contact.getContactId()).isEqualTo("contact1");
- assertThat(contact.getRepoId()).isEqualTo("contact1-TEST");
- }
-
- private void runMapreduce() throws Exception {
- action.run();
- executeTasksUntilEmpty("mapreduce");
- }
-
- private void pushToGcs(ByteSource source) throws IOException {
- try (OutputStream outStream =
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize())
- .openOutputStream(new GcsFilename(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME));
- InputStream inStream = source.openStream()) {
- ByteStreams.copy(inStream, outStream);
- }
- }
-
- private static byte[] loadContactXml(ByteSource source) throws IOException {
- byte[] result = new byte[((int) source.size())];
- try (InputStream inStream = source.openStream()) {
- ByteStreams.readFully(inStream, result);
- }
- return result;
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeContactInputTest.java b/javatests/google/registry/rde/imports/RdeContactInputTest.java
deleted file mode 100644
index fb6ea0e9c..000000000
--- a/javatests/google/registry/rde/imports/RdeContactInputTest.java
+++ /dev/null
@@ -1,262 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.common.io.ByteSource;
-import com.google.common.io.ByteStreams;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.testing.AppEngineRule;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Optional;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeContactInput} */
-@RunWith(JUnit4.class)
-public class RdeContactInputTest {
-
- private static final ByteSource DEPOSIT_0_CONTACT =
- RdeImportsTestData.loadBytes("deposit_0_contact_header.xml");
- private static final ByteSource DEPOSIT_1_CONTACT =
- RdeImportsTestData.loadBytes("deposit_1_contact.xml");
- private static final ByteSource DEPOSIT_199_CONTACT =
- RdeImportsTestData.loadBytes("deposit_199_contact_header.xml");
- private static final ByteSource DEPOSIT_200_CONTACT =
- RdeImportsTestData.loadBytes("deposit_200_contact_header.xml");
- private static final ByteSource DEPOSIT_1000_CONTACT =
- RdeImportsTestData.loadBytes("deposit_1000_contact_header.xml");
- private static final ByteSource DEPOSIT_10000_CONTACT =
- RdeImportsTestData.loadBytes("deposit_10000_contact_header.xml");
- private static final String IMPORT_BUCKET_NAME = "import-bucket";
- private static final String IMPORT_FILE_NAME = "escrow-file.xml";
-
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- @Rule
- public final AppEngineRule appEngine = AppEngineRule.builder()
- .withDatastore()
- .build();
-
- /** Escrow file with zero contacts results in one reader */
- @Test
- public void testZeroContactsDefaultShards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_0_CONTACT);
- assertNumberOfReaders(Optional.empty(), 1);
- }
-
- /** Escrow file with zero contacts results in expected reader configuration */
- @Test
- public void testZeroContactsDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_0_CONTACT);
- assertReaderConfigurations(Optional.empty(), 0, 0, 100);
- }
-
- /** Escrow file with zero contacts and 75 shards results in one reader */
- @Test
- public void testZeroContacts75Shards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_0_CONTACT);
- assertNumberOfReaders(Optional.of(75), 1);
- }
-
- /** Escrow file with one contact results in one reader */
- @Test
- public void testOneContactDefaultShards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_1_CONTACT);
- assertNumberOfReaders(Optional.empty(), 1);
- }
-
- /** Escrow file with one contact results in expected reader configuration */
- @Test
- public void testOneContactDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_1_CONTACT);
- assertReaderConfigurations(Optional.empty(), 0, 0, 100);
- }
-
- /** Escrow file with one contact and 75 shards results in one reader */
- @Test
- public void testOneContact75Shards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_1_CONTACT);
- assertNumberOfReaders(Optional.of(75), 1);
- }
-
- /** Escrow file with 199 contacts results in one reader */
- @Test
- public void test199ContactsDefaultShards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_199_CONTACT);
- assertNumberOfReaders(Optional.empty(), 1);
- }
-
- /** Escrow file with 199 contacts results in expected reader configuration */
- @Test
- public void test199ContactsDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_199_CONTACT);
- assertReaderConfigurations(Optional.empty(), 0, 0, 199);
- }
-
- /** Escrow file with 199 contacts and 75 shards results in one reader */
- @Test
- public void test199Contacts75Shards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_199_CONTACT);
- assertNumberOfReaders(Optional.of(75), 1);
- }
-
- /** Escrow file with 200 contacts results in two readers */
- @Test
- public void test200ContactsDefaultShards_returnsTwoReaders() throws Exception {
- pushToGcs(DEPOSIT_200_CONTACT);
- assertNumberOfReaders(Optional.empty(), 2);
- }
-
- /** Escrow file with 200 contacts results in expected reader configurations */
- @Test
- public void test200ContactsDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_200_CONTACT);
- assertReaderConfigurations(Optional.empty(), 0, 0, 100);
- assertReaderConfigurations(Optional.empty(), 1, 100, 100);
- }
-
- /** Escrow file with 200 contacts and 75 shards results in two readers */
- @Test
- public void test200Contacts75Shards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_200_CONTACT);
- assertNumberOfReaders(Optional.of(75), 2);
- }
-
- /** Escrow file with 1000 contacts results in ten readers */
- @Test
- public void test1000ContactsDefaultShards_returns10Readers() throws Exception {
- pushToGcs(DEPOSIT_1000_CONTACT);
- assertNumberOfReaders(Optional.empty(), 10);
- }
-
- /** Escrow file with 1000 contacts results in expected reader configurations */
- @Test
- public void test1000ContactsDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_1000_CONTACT);
- for (int i = 0; i < 10; i++) {
- assertReaderConfigurations(Optional.empty(), i, i * 100, 100);
- }
- }
-
- /** Escrow file with 1000 contacts and 75 shards results in ten readers */
- @Test
- public void test1000Contacts75Shards_returns10Readers() throws Exception {
- pushToGcs(DEPOSIT_1000_CONTACT);
- assertNumberOfReaders(Optional.of(75), 10);
- }
-
- /** Escrow file with 10000 contacts results in 50 readers */
- @Test
- public void test10000ContactsDefaultShards_returns50Readers() throws Exception {
- pushToGcs(DEPOSIT_10000_CONTACT);
- assertNumberOfReaders(Optional.empty(), 50);
- }
-
- /** Escrow file with 10000 contacts results in expected reader configurations */
- @Test
- public void test10000ContactsDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_10000_CONTACT);
- for (int i = 0; i < 50; i++) {
- assertReaderConfigurations(Optional.empty(), i, i * 200, 200);
- }
- }
-
- /** Escrow file with 10000 contacts and 75 shards results in 75 readers */
- @Test
- public void test10000Contacts75Shards_returns75Readers() throws Exception {
- pushToGcs(DEPOSIT_10000_CONTACT);
- assertNumberOfReaders(Optional.of(75), 75);
- }
-
- /** Escrow file with 10000 contacts and 150 shards results in 100 readers */
- @Test
- public void test10000Contacts150Shards_returns100Readers() throws Exception {
- pushToGcs(DEPOSIT_10000_CONTACT);
- assertNumberOfReaders(Optional.of(150), 100);
- }
-
- /**
- * Verify bucket, filename, offset and max results for a specific reader
- *
- * @param numberOfShards Number of desired shards ({@code Optional.empty()} uses default of 50)
- * @param whichReader Index of the reader in the list that is produced by the
- * {@link RdeContactInput}
- * @param expectedOffset Expected offset of the reader
- * @param expectedMaxResults Expected maxResults of the reader
- */
- private void assertReaderConfigurations(
- Optional numberOfShards,
- int whichReader,
- int expectedOffset,
- int expectedMaxResults) {
- RdeContactInput input = getInput(numberOfShards);
- List> readers = input.createReaders();
- RdeContactReader reader = (RdeContactReader) readers.get(whichReader);
- assertImportBucketAndFilename(reader);
- assertThat(reader.offset).isEqualTo(expectedOffset);
- assertThat(reader.maxResults).isEqualTo(expectedMaxResults);
- }
-
- private void pushToGcs(ByteSource source) throws IOException {
- try (OutputStream outStream =
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize())
- .openOutputStream(new GcsFilename(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME));
- InputStream inStream = source.openStream()) {
- ByteStreams.copy(inStream, outStream);
- }
- }
-
- /**
- * Verify the number of readers produced by the {@link RdeContactInput}
- *
- * @param numberOfShards Number of desired shards ({@code Optional.empty()} uses default of 50)
- * @param expectedNumberOfReaders Expected size of the list returned
- */
- private void assertNumberOfReaders(Optional numberOfShards,
- int expectedNumberOfReaders) {
- RdeContactInput input = getInput(numberOfShards);
- List> readers = input.createReaders();
- assertThat(readers).hasSize(expectedNumberOfReaders);
- }
-
- /**
- * Creates a new testable instance of {@link RdeContactInput}
- * @param mapShards Number of desired shards ({@code Optional.empty()} uses default of 50)
- */
- private RdeContactInput getInput(Optional mapShards) {
- return new RdeContactInput(mapShards, IMPORT_BUCKET_NAME, IMPORT_FILE_NAME);
- }
-
- /**
- * Verifies the configured import bucket and file names.
- */
- private void assertImportBucketAndFilename(RdeContactReader reader) {
- assertThat(reader.importBucketName).isEqualTo("import-bucket");
- assertThat(reader.importFileName).isEqualTo("escrow-file.xml");
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeContactReaderTest.java b/javatests/google/registry/rde/imports/RdeContactReaderTest.java
deleted file mode 100644
index 700a19053..000000000
--- a/javatests/google/registry/rde/imports/RdeContactReaderTest.java
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.testing.JUnitBackports.assertThrows;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.common.io.ByteSource;
-import com.google.common.io.ByteStreams;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.testing.AppEngineRule;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdecontact.XjcRdeContact;
-import google.registry.xjc.rdecontact.XjcRdeContactElement;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.util.NoSuchElementException;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeContactReader} */
-@RunWith(JUnit4.class)
-public class RdeContactReaderTest {
-
- private static final ByteSource DEPOSIT_1_CONTACT =
- RdeImportsTestData.loadBytes("deposit_1_contact.xml");
- private static final ByteSource DEPOSIT_3_CONTACT =
- RdeImportsTestData.loadBytes("deposit_3_contact.xml");
- private static final ByteSource DEPOSIT_4_CONTACT =
- RdeImportsTestData.loadBytes("deposit_4_contact.xml");
- private static final ByteSource DEPOSIT_10_CONTACT =
- RdeImportsTestData.loadBytes("deposit_10_contact.xml");
- private static final String IMPORT_BUCKET_NAME = "rde-import";
- private static final String IMPORT_FILE_NAME = "escrow-file.xml";
-
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- @Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
- /** Reads at least one result at 0 offset 1 maxResults */
- @Test
- public void testZeroOffsetOneResult_readsOne() throws Exception {
- pushToGcs(DEPOSIT_1_CONTACT);
- RdeContactReader reader = getReader(0, 1);
- checkContact(reader.next(), "contact1", "contact1-TEST");
- }
-
- /** Reads at most one at 0 offset 1 maxResults */
- @Test
- public void testZeroOffsetOneResult_stopsAfterOne() throws Exception {
- pushToGcs(DEPOSIT_3_CONTACT);
- RdeContactReader reader = getReader(0, 1);
- reader.next();
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Skips already-processed records after rehydration */
- @Test
- public void testZeroOffsetOneResult_skipsOneAfterRehydration() throws Exception {
- pushToGcs(DEPOSIT_3_CONTACT);
- RdeContactReader reader = getReader(0, 1);
- reader.next();
- reader.endSlice();
-
- reader = cloneReader(reader);
- reader.beginSlice();
- // reader will not advance any further
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Reads three contacts */
- @Test
- public void testZeroOffsetThreeResult_readsThree() throws Exception {
- pushToGcs(DEPOSIT_3_CONTACT);
- RdeContactReader reader = getReader(0, 3);
- checkContact(reader.next(), "contact1", "contact1-TEST");
- checkContact(reader.next(), "contact2", "contact2-TEST");
- checkContact(reader.next(), "contact3", "contact3-TEST");
- }
-
- /** Stops reading at 3 maxResults */
- @Test
- public void testZeroOffsetThreeResult_stopsAtThree() throws Exception {
- pushToGcs(DEPOSIT_4_CONTACT);
- RdeContactReader reader = getReader(0, 3);
- for (int i = 0; i < 3; i++) {
- reader.next();
- }
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Reads one contact from file then stops at end of file */
- @Test
- public void testZeroOffsetThreeResult_endOfFile() throws Exception {
- pushToGcs(DEPOSIT_1_CONTACT);
- RdeContactReader reader = getReader(0, 3);
- reader.next();
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Skips three contacts with offset of three */
- @Test
- public void testThreeOffsetOneResult_skipsThree() throws Exception {
- pushToGcs(DEPOSIT_4_CONTACT);
- RdeContactReader reader = getReader(3, 1);
- checkContact(reader.next(), "contact4", "contact4-TEST");
- }
-
- /** Skips four contacts after advancing once at three offset, then rehydrating */
- @Test
- public void testThreeOffsetTwoResult_skipsFourAfterRehydration() throws Exception {
- pushToGcs(DEPOSIT_10_CONTACT);
- RdeContactReader reader = getReader(3, 2);
- reader.next();
- reader.endSlice();
- reader = cloneReader(reader);
- reader.beginSlice();
- checkContact(reader.next(), "contact5", "contact5-TEST");
- }
-
- /** Reads three at zero offset three results with rehydration in the middle */
- @Test
- public void testZeroOffsetThreeResult_readsThreeWithRehydration() throws Exception {
- pushToGcs(DEPOSIT_4_CONTACT);
- RdeContactReader reader = getReader(0, 3);
- checkContact(reader.next(), "contact1", "contact1-TEST");
- reader.endSlice();
- reader = cloneReader(reader);
- reader.beginSlice();
- checkContact(reader.next(), "contact2", "contact2-TEST");
- checkContact(reader.next(), "contact3", "contact3-TEST");
- }
-
- /** Stops reading at three with zero offset three results with rehydration in the middle */
- @Test
- public void testZeroOffsetThreeResult_stopsAtThreeWithRehydration() throws Exception {
- pushToGcs(DEPOSIT_4_CONTACT);
- RdeContactReader reader = getReader(0, 3);
- reader.next();
- reader.endSlice();
- reader = cloneReader(reader);
- reader.beginSlice();
- reader.next();
- reader.next();
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- private void pushToGcs(ByteSource source) throws IOException {
- try (OutputStream outStream =
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize())
- .openOutputStream(new GcsFilename(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME));
- InputStream inStream = source.openStream()) {
- ByteStreams.copy(inStream, outStream);
- }
- }
-
- /** Creates a deep copy of the {@link RdeContactReader} */
- private RdeContactReader cloneReader(
- RdeContactReader reader) throws Exception {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- ObjectOutputStream oout = new ObjectOutputStream(bout);
- oout.writeObject(reader);
- ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
- ObjectInputStream oin = new ObjectInputStream(bin);
- return (RdeContactReader) oin.readObject();
- }
-
- /** Verifies that contact id and ROID match expected values */
- private void checkContact(
- JaxbFragment fragment, String contactId, String repoId) {
- assertThat(fragment).isNotNull();
- XjcRdeContact contact = fragment.getInstance().getValue();
- assertThat(contact.getId()).isEqualTo(contactId);
- assertThat(contact.getRoid()).isEqualTo(repoId);
- }
-
- /** Gets a new {@link RdeContactReader} with specified offset and maxResults */
- private RdeContactReader getReader(int offset, int maxResults) throws Exception {
- RdeContactReader reader =
- new RdeContactReader(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME, offset, maxResults);
- reader.beginSlice();
- return reader;
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java b/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java
deleted file mode 100644
index 4ad9d8a56..000000000
--- a/javatests/google/registry/rde/imports/RdeDomainImportActionTest.java
+++ /dev/null
@@ -1,417 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.testing.DatastoreHelper.createTld;
-import static google.registry.testing.DatastoreHelper.getHistoryEntries;
-import static google.registry.testing.DatastoreHelper.getPollMessages;
-import static google.registry.testing.DatastoreHelper.newDomainBase;
-import static google.registry.testing.DatastoreHelper.persistActiveContact;
-import static google.registry.testing.DatastoreHelper.persistResource;
-import static google.registry.testing.DatastoreHelper.persistSimpleResource;
-import static google.registry.testing.TaskQueueHelper.assertDnsTasksEnqueued;
-import static google.registry.util.DateTimeUtils.END_OF_TIME;
-import static org.joda.money.CurrencyUnit.USD;
-import static org.joda.time.DateTimeZone.UTC;
-import static org.junit.Assert.fail;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.common.io.ByteSource;
-import com.google.common.io.ByteStreams;
-import com.googlecode.objectify.Key;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.mapreduce.MapreduceRunner;
-import google.registry.model.billing.BillingEvent;
-import google.registry.model.domain.DomainBase;
-import google.registry.model.domain.rgp.GracePeriodStatus;
-import google.registry.model.eppcommon.Trid;
-import google.registry.model.poll.PollMessage;
-import google.registry.model.reporting.HistoryEntry;
-import google.registry.model.transfer.TransferResponse.DomainTransferResponse;
-import google.registry.model.transfer.TransferStatus;
-import google.registry.request.Response;
-import google.registry.testing.FakeResponse;
-import google.registry.testing.mapreduce.MapreduceTestCase;
-import google.registry.util.RandomStringGenerator;
-import google.registry.util.StringGenerator;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.security.SecureRandom;
-import java.util.List;
-import java.util.Optional;
-import javax.annotation.Nullable;
-import org.joda.money.Money;
-import org.joda.time.DateTime;
-import org.joda.time.Seconds;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeDomainImportAction}. */
-@RunWith(JUnit4.class)
-public class RdeDomainImportActionTest extends MapreduceTestCase {
-
- private static final ByteSource DEPOSIT_1_DOMAIN =
- RdeImportsTestData.loadBytes("deposit_1_domain.xml");
- private static final ByteSource DEPOSIT_1_DOMAIN_PENDING_TRANSFER =
- RdeImportsTestData.loadBytes("deposit_1_domain_pending_transfer.xml");
- private static final ByteSource DEPOSIT_1_DOMAIN_PENDING_TRANSFER_REG_CAP =
- RdeImportsTestData.loadBytes("deposit_1_domain_pending_transfer_registration_cap.xml");
- private static final String IMPORT_BUCKET_NAME = "import-bucket";
- private static final String IMPORT_FILE_NAME = "escrow-file.xml";
-
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- private MapreduceRunner mrRunner;
-
- private Response response;
-
- @Before
- public void before() {
- createTld("test");
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- response = new FakeResponse();
- mrRunner = makeDefaultRunner();
- action =
- new RdeDomainImportAction(
- mrRunner,
- response,
- IMPORT_BUCKET_NAME,
- IMPORT_FILE_NAME,
- Optional.of(3),
- new RandomStringGenerator(StringGenerator.Alphabets.BASE_64, new SecureRandom()));
- }
-
- @Test
- public void testMapreduceSuccessfullyImportsDomain() throws Exception {
- pushToGcs(DEPOSIT_1_DOMAIN);
- runMapreduce();
- List domains = ofy().load().type(DomainBase.class).list();
- assertThat(domains).hasSize(1);
- checkDomain(domains.get(0));
- }
-
- @Test
- public void testMapreduceSuccessfullyCreatesHistoryEntry() throws Exception {
- pushToGcs(DEPOSIT_1_DOMAIN);
- runMapreduce();
- List domains = ofy().load().type(DomainBase.class).list();
- DomainBase domain = domains.get(0);
- // verify history entry
- List historyEntries = getHistoryEntries(domain);
- assertThat(historyEntries).hasSize(1);
- checkHistoryEntry(historyEntries.get(0), domain);
- }
-
- /** Ensures that a second pass on a domain does not import a new domain. */
- @Test
- public void testMapreduceTwiceDoesNotDuplicateResources() throws Exception {
- pushToGcs(DEPOSIT_1_DOMAIN);
- // Create domain and history entry first
- DomainBase existingDomain =
- persistResource(
- newDomainBase("example1.test").asBuilder().setRepoId("Dexample1-TEST").build());
- persistSimpleResource(createHistoryEntry(
- existingDomain.getRepoId(),
- existingDomain.getCurrentSponsorClientId(),
- loadDomainXml(DEPOSIT_1_DOMAIN)));
- // Simulate running a second import and verify that the resources
- // aren't imported twice (only one domain, and one history entry)
- pushToGcs(DEPOSIT_1_DOMAIN);
- runMapreduce();
- List domains = ofy().load().type(DomainBase.class).list();
- assertThat(domains.size()).isEqualTo(1);
- DomainBase domain = domains.get(0);
- // verify history entry
- List historyEntries = getHistoryEntries(domain);
- assertThat(historyEntries).hasSize(1);
- checkHistoryEntry(historyEntries.get(0), domain);
- }
-
- /** Ensures that DNS publishing is kicked off on domain import */
- @Test
- public void test_mapreducePublishesToDns() throws Exception {
- pushToGcs(DEPOSIT_1_DOMAIN);
- runMapreduce();
- assertDnsTasksEnqueued("example1.test");
- }
-
- /**
- * Verifies the state of an imported pending transfer before and after implicit server approval
- */
- @Test
- public void testMapreducePendingTransferServerApproval() throws Exception {
- pushToGcs(DEPOSIT_1_DOMAIN_PENDING_TRANSFER);
- runMapreduce();
- List domains = ofy().load().type(DomainBase.class).list();
- assertThat(domains).hasSize(1);
- checkDomain(domains.get(0));
- // implicit server approval happens at 2015-01-08T22:00:00.0Z
- DateTime serverApprovalTime = DateTime.parse("2015-01-08T22:00:00.0Z");
- // Domain should be assigned to RegistrarX before server approval
- DomainBase beforeApproval =
- domains.get(0).cloneProjectedAtTime(serverApprovalTime.minus(Seconds.ONE));
- assertThat(beforeApproval.getCurrentSponsorClientId()).isEqualTo("RegistrarX");
- assertThat(loadAutorenewBillingEventForDomain(beforeApproval).getClientId())
- .isEqualTo("RegistrarX");
- assertThat(loadAutorenewPollMessageForDomain(beforeApproval).getClientId())
- .isEqualTo("RegistrarX");
- // Current expiration is 2015-04-03T22:00:00.0Z
- assertThat(beforeApproval.getRegistrationExpirationTime())
- .isEqualTo(DateTime.parse("2015-04-03T22:00:00.0Z"));
- // Domain is not yet in transfer grace period
- assertThat(beforeApproval.getGracePeriodStatuses()).doesNotContain(GracePeriodStatus.TRANSFER);
- // Check autorenew events - recurrence end is set to transfer approval time,
- // and client id is set to losing registrar. This is important in case the
- // transfer is cancelled or rejected.
- // Event time is set to domain expiration date.
- checkAutorenewBillingEvent(
- beforeApproval,
- "RegistrarX",
- DateTime.parse("2015-04-03T22:00:00.0Z"),
- DateTime.parse("2015-01-08T22:00:00.0Z"));
- checkAutorenewPollMessage(
- beforeApproval,
- "RegistrarX",
- DateTime.parse("2015-04-03T22:00:00.0Z"),
- DateTime.parse("2015-01-08T22:00:00.0Z"));
-
- // Domain should be assigned to RegistrarY after server approval
- DomainBase afterApproval =
- domains.get(0).cloneProjectedAtTime(serverApprovalTime);
- assertThat(afterApproval.getCurrentSponsorClientId()).isEqualTo("RegistrarY");
- assertThat(loadAutorenewBillingEventForDomain(afterApproval).getClientId())
- .isEqualTo("RegistrarY");
- assertThat(loadAutorenewPollMessageForDomain(afterApproval).getClientId())
- .isEqualTo("RegistrarY");
- // New expiration should be incremented by 1 year
- assertThat(afterApproval.getRegistrationExpirationTime())
- .isEqualTo(DateTime.parse("2016-04-03T22:00:00.0Z"));
- // Domain should now be in transfer grace period
- assertThat(afterApproval.getGracePeriodStatuses()).contains(GracePeriodStatus.TRANSFER);
- // Check autorenew events - recurrence end is set to END_OF_TIME,
- // and client id is set to gaining registrar. This represents the new state of the domain,
- // unless the transfer is cancelled during the grace period, at which time it will
- // revert to the previous state.
- // Event time is set to domain expiration date.
- checkAutorenewBillingEvent(
- afterApproval, "RegistrarY", DateTime.parse("2016-04-03T22:00:00.0Z"), END_OF_TIME);
- checkAutorenewPollMessage(
- afterApproval, "RegistrarY", DateTime.parse("2016-04-03T22:00:00.0Z"), END_OF_TIME);
- }
-
- @Test
- public void testMapreducePendingTransferRegistrationCap() throws Exception {
- DateTime serverApprovalTime = DateTime.parse("2015-02-03T22:00:00.0Z");
- pushToGcs(DEPOSIT_1_DOMAIN_PENDING_TRANSFER_REG_CAP);
- runMapreduce();
- List domains = ofy().load().type(DomainBase.class).list();
- assertThat(domains).hasSize(1);
- checkDomain(domains.get(0));
-
- // Domain should be assigned to RegistrarX before server approval
- DomainBase beforeApproval =
- domains.get(0).cloneProjectedAtTime(serverApprovalTime.minus(Seconds.ONE));
- assertThat(beforeApproval.getCurrentSponsorClientId()).isEqualTo("RegistrarX");
- assertThat(loadAutorenewBillingEventForDomain(beforeApproval).getClientId())
- .isEqualTo("RegistrarX");
- assertThat(loadAutorenewPollMessageForDomain(beforeApproval).getClientId())
- .isEqualTo("RegistrarX");
- // Current expiration is 2024-04-03T22:00:00.0Z
- assertThat(beforeApproval.getRegistrationExpirationTime())
- .isEqualTo(DateTime.parse("2024-04-03T22:00:00.0Z"));
-
- // Domain should be assigned to RegistrarY after server approval
- DomainBase afterApproval =
- domains.get(0).cloneProjectedAtTime(serverApprovalTime);
- assertThat(afterApproval.getCurrentSponsorClientId()).isEqualTo("RegistrarY");
- // New expiration should be capped at 10 years from server approval time, which is 2025-02-03,
- // instead of 2025-04-03 which would be the current expiration plus a full year.
- assertThat(afterApproval.getRegistrationExpirationTime())
- .isEqualTo(DateTime.parse("2025-02-03T22:00:00.0Z"));
-
- // Same checks for the autorenew billing event and poll message.
- checkAutorenewBillingEvent(
- afterApproval, "RegistrarY", DateTime.parse("2025-02-03T22:00:00.0Z"), END_OF_TIME);
- checkAutorenewPollMessage(
- afterApproval, "RegistrarY", DateTime.parse("2025-02-03T22:00:00.0Z"), END_OF_TIME);
-
- // Check expiration time in losing registrar's poll message responseData.
- checkTransferRequestPollMessage(domains.get(0), "RegistrarX",
- DateTime.parse("2015-01-29T22:00:00.0Z"),
- DateTime.parse("2025-02-03T22:00:00.0Z"));
- }
-
- @Test
- public void testMapreducePendingTransferEvents() throws Exception {
- pushToGcs(DEPOSIT_1_DOMAIN_PENDING_TRANSFER);
- runMapreduce();
- List domains = ofy().load().type(DomainBase.class).list();
- assertThat(domains).hasSize(1);
- checkDomain(domains.get(0));
- checkTransferRequestPollMessage(
- domains.get(0),
- "RegistrarX",
- DateTime.parse("2015-01-03T22:00:00.0Z"),
- DateTime.parse("2016-04-03T22:00:00.0Z"));
- checkTransferServerApprovalPollMessage(
- domains.get(0),
- "RegistrarX",
- DateTime.parse("2015-01-08T22:00:00.0Z"));
- checkTransferServerApprovalPollMessage(
- domains.get(0),
- "RegistrarY",
- DateTime.parse("2015-01-08T22:00:00.0Z"));
- // Billing event is set to the end of the transfer grace period, 5 days after server approval
- checkTransferBillingEvent(domains.get(0), DateTime.parse("2015-01-13T22:00:00.0Z"));
- }
-
- private static void checkTransferBillingEvent(
- DomainBase domain, DateTime automaticTransferTime) {
- for (BillingEvent.OneTime event :
- ofy().load().type(BillingEvent.OneTime.class).ancestor(domain).list()) {
- if (event.getReason() == BillingEvent.Reason.TRANSFER) {
- assertThat(event.getCost()).isEqualTo(Money.of(USD, 11));
- assertThat(event.getClientId()).isEqualTo("RegistrarY");
- assertThat(event.getBillingTime()).isEqualTo(automaticTransferTime);
- }
- }
- }
-
- /** Verifies the existence of a transfer request poll message */
- private static void checkTransferRequestPollMessage(
- DomainBase domain, String clientId, DateTime expectedAt, DateTime expectedExpiration) {
- for (PollMessage message : getPollMessages(domain)) {
- if (TransferStatus.PENDING.getMessage().equals(message.getMsg())
- && clientId.equals(message.getClientId())
- && expectedAt.equals(message.getEventTime())) {
- assertThat(message.getResponseData()).hasSize(1);
- DomainTransferResponse responseData =
- (DomainTransferResponse) message.getResponseData().get(0);
- // make sure expiration is set correctly
- assertThat(responseData.getExtendedRegistrationExpirationTime())
- .isEqualTo(expectedExpiration);
- return;
- }
- }
- fail("Expected transfer request poll message");
- }
-
- /** Verifies the existence of a transfer server approved poll message */
- private static void checkTransferServerApprovalPollMessage(
- DomainBase domain, String clientId, DateTime expectedAt) {
- for (PollMessage message : getPollMessages(domain)) {
- if (TransferStatus.SERVER_APPROVED.getMessage().equals(message.getMsg())
- && clientId.equals(message.getClientId())
- && expectedAt.equals(message.getEventTime())) {
- return;
- }
- }
- fail("Expected transfer server approved poll message");
- }
-
- /** Verifies autorenew {@link PollMessage} is correct */
- private static void checkAutorenewPollMessage(
- DomainBase domain, String clientId, DateTime expectedAt, DateTime recurrenceEndTime) {
- PollMessage.Autorenew autorenewPollMessage = loadAutorenewPollMessageForDomain(domain);
- assertThat(autorenewPollMessage).isNotNull();
- assertThat(autorenewPollMessage.getClientId()).isEqualTo(clientId);
- assertThat(autorenewPollMessage.getEventTime()).isEqualTo(expectedAt);
- assertThat(autorenewPollMessage.getAutorenewEndTime()).isEqualTo(recurrenceEndTime);
- }
-
- /** Verifies autorenew {@link BillingEvent} is correct */
- private static void checkAutorenewBillingEvent(
- DomainBase domain, String clientId, DateTime expectedAt, DateTime recurrenceEndTime) {
- BillingEvent.Recurring autorenewBillingEvent = loadAutorenewBillingEventForDomain(domain);
- assertThat(autorenewBillingEvent).isNotNull();
- assertThat(autorenewBillingEvent.getClientId()).isEqualTo(clientId);
- assertThat(autorenewBillingEvent.getEventTime()).isEqualTo(expectedAt);
- assertThat(autorenewBillingEvent.getRecurrenceEndTime()).isEqualTo(recurrenceEndTime);
- }
-
- /** Verify history entry fields are correct */
- private static void checkHistoryEntry(HistoryEntry entry, DomainBase parent) {
- assertThat(entry.getType()).isEqualTo(HistoryEntry.Type.RDE_IMPORT);
- assertThat(entry.getClientId()).isEqualTo(parent.getCurrentSponsorClientId());
- assertThat(entry.getXmlBytes().length).isGreaterThan(0);
- assertThat(entry.getBySuperuser()).isTrue();
- assertThat(entry.getReason()).isEqualTo("RDE Import");
- assertThat(entry.getRequestedByRegistrar()).isEqualTo(false);
- assertThat(entry.getParent()).isEqualTo(Key.create(parent));
- }
-
- /** Verifies that domain fields match expected values */
- private static void checkDomain(DomainBase domain) {
- assertThat(domain.getFullyQualifiedDomainName()).isEqualTo("example1.test");
- assertThat(domain.getRepoId()).isEqualTo("Dexample1-TEST");
- }
-
- private void runMapreduce() throws Exception {
- action.run();
- executeTasksUntilEmpty("mapreduce");
- }
-
- private void pushToGcs(ByteSource source) throws IOException {
- try (OutputStream outStream =
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize())
- .openOutputStream(new GcsFilename(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME));
- InputStream inStream = source.openStream()) {
- ByteStreams.copy(inStream, outStream);
- }
- }
-
- private static byte[] loadDomainXml(ByteSource source) throws IOException {
- byte[] result = new byte[((int) source.size())];
- try (InputStream inStream = source.openStream()) {
- ByteStreams.readFully(inStream, result);
- }
- return result;
- }
-
- @Nullable
- private static BillingEvent.Recurring loadAutorenewBillingEventForDomain(DomainBase domain) {
- return ofy().load().key(domain.getAutorenewBillingEvent()).now();
- }
-
- @Nullable
- private static PollMessage.Autorenew loadAutorenewPollMessageForDomain(DomainBase domain) {
- return ofy().load().key(domain.getAutorenewPollMessage()).now();
- }
-
- private static HistoryEntry createHistoryEntry(String roid, String clid, byte[] objectXml) {
- return new HistoryEntry.Builder()
- .setType(HistoryEntry.Type.RDE_IMPORT)
- .setClientId(clid)
- .setTrid(Trid.create("client-trid", "server-trid"))
- .setModificationTime(DateTime.now(UTC))
- .setXmlBytes(objectXml)
- .setBySuperuser(true)
- .setReason("RDE Import")
- .setRequestedByRegistrar(false)
- .setParent(Key.create(null, DomainBase.class, roid))
- .build();
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeDomainReaderTest.java b/javatests/google/registry/rde/imports/RdeDomainReaderTest.java
deleted file mode 100644
index 0ecff50bc..000000000
--- a/javatests/google/registry/rde/imports/RdeDomainReaderTest.java
+++ /dev/null
@@ -1,221 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.rde.imports.RdeImportsTestData.loadBytes;
-import static google.registry.testing.DatastoreHelper.createTld;
-import static google.registry.testing.DatastoreHelper.persistActiveContact;
-import static google.registry.testing.JUnitBackports.assertThrows;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.common.io.ByteSource;
-import com.google.common.io.ByteStreams;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.testing.AppEngineRule;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdedomain.XjcRdeDomain;
-import google.registry.xjc.rdedomain.XjcRdeDomainElement;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.util.NoSuchElementException;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeDomainReader} */
-@RunWith(JUnit4.class)
-public class RdeDomainReaderTest {
-
- private static final ByteSource DEPOSIT_1_DOMAIN = loadBytes("deposit_1_domain.xml");
- private static final ByteSource DEPOSIT_3_DOMAIN = loadBytes("deposit_3_domain.xml");
- private static final ByteSource DEPOSIT_4_DOMAIN = loadBytes("deposit_4_domain.xml");
- private static final ByteSource DEPOSIT_10_DOMAIN = loadBytes("deposit_10_domain.xml");
- private static final String IMPORT_BUCKET_NAME = "rde-import";
- private static final String IMPORT_FILE_NAME = "escrow-file.xml";
-
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- @Rule
- public final AppEngineRule appEngine = AppEngineRule.builder()
- .withDatastore()
- .build();
-
- @Before
- public void before() {
- createTld("test");
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- }
-
- /** Reads at least one result at 0 offset 1 maxResults */
- @Test
- public void testZeroOffsetOneResult_readsOne() throws Exception {
- pushToGcs(DEPOSIT_1_DOMAIN);
- RdeDomainReader reader = getReader(0, 1);
- checkDomain(reader.next(), "example1.test", "Dexample1-TEST");
- }
-
- /** Reads at most one at 0 offset 1 maxResults */
- @Test
- public void testZeroOffsetOneResult_stopsAfterOne() throws Exception {
- pushToGcs(DEPOSIT_3_DOMAIN);
- RdeDomainReader reader = getReader(0, 1);
- reader.next();
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Skips already-processed records after rehydration */
- @Test
- public void testZeroOffsetOneResult_skipsOneAfterRehydration() throws Exception {
- pushToGcs(DEPOSIT_3_DOMAIN);
- RdeDomainReader reader = getReader(0, 1);
- reader.next();
- reader.endSlice();
-
- reader = cloneObject(reader);
- reader.beginSlice();
- // reader will not advance any further
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Reads three domains */
- @Test
- public void testZeroOffsetThreeResult_readsThree() throws Exception {
- pushToGcs(DEPOSIT_3_DOMAIN);
- RdeDomainReader reader = getReader(0, 3);
- checkDomain(reader.next(), "example1.test", "Dexample1-TEST");
- checkDomain(reader.next(), "example2.test", "Dexample2-TEST");
- checkDomain(reader.next(), "example3.test", "Dexample3-TEST");
- }
-
- /** Stops reading at 3 maxResults */
- @Test
- public void testZeroOffsetThreeResult_stopsAtThree() throws Exception {
- pushToGcs(DEPOSIT_4_DOMAIN);
- RdeDomainReader reader = getReader(0, 3);
- for (int i = 0; i < 3; i++) {
- reader.next();
- }
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Reads one domain from file then stops at end of file */
- @Test
- public void testZeroOffsetThreeResult_endOfFile() throws Exception {
- pushToGcs(DEPOSIT_1_DOMAIN);
- RdeDomainReader reader = getReader(0, 3);
- reader.next();
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Skips three domains with offset of three */
- @Test
- public void testThreeOffsetOneResult_skipsThree() throws Exception {
- pushToGcs(DEPOSIT_4_DOMAIN);
- RdeDomainReader reader = getReader(3, 1);
- checkDomain(reader.next(), "example4.test", "Dexample4-TEST");
- }
-
- /** Skips four domains after advancing once at three offset, then rehydrating */
- @Test
- public void testThreeOffsetTwoResult_skipsFourAfterRehydration() throws Exception {
- pushToGcs(DEPOSIT_10_DOMAIN);
- RdeDomainReader reader = getReader(3, 2);
- reader.next();
- reader.endSlice();
- reader = cloneObject(reader);
- reader.beginSlice();
- checkDomain(reader.next(), "example5.test", "Dexample5-TEST");
- }
-
- /** Reads three at zero offset three results with rehydration in the middle */
- @Test
- public void testZeroOffsetThreeResult_readsThreeWithRehydration() throws Exception {
- pushToGcs(DEPOSIT_4_DOMAIN);
- RdeDomainReader reader = getReader(0, 3);
- checkDomain(reader.next(), "example1.test", "Dexample1-TEST");
- reader.endSlice();
- reader = cloneObject(reader);
- reader.beginSlice();
- checkDomain(reader.next(), "example2.test", "Dexample2-TEST");
- checkDomain(reader.next(), "example3.test", "Dexample3-TEST");
- }
-
- /** Stops reading at three with zero offset three results with rehydration in the middle */
- @Test
- public void testZeroOffsetThreeResult_stopsAtThreeWithRehydration() throws Exception {
- pushToGcs(DEPOSIT_4_DOMAIN);
- RdeDomainReader reader = getReader(0, 3);
- reader.next();
- reader.endSlice();
- reader = cloneObject(reader);
- reader.beginSlice();
- reader.next();
- reader.next();
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- private void pushToGcs(ByteSource source) throws IOException {
- try (OutputStream outStream =
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize())
- .openOutputStream(new GcsFilename(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME));
- InputStream inStream = source.openStream()) {
- ByteStreams.copy(inStream, outStream);
- }
- }
-
- /** Creates a deep copy of the {@code T} */
- public T cloneObject(
- T object) throws Exception {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- ObjectOutputStream oout = new ObjectOutputStream(bout);
- oout.writeObject(object);
- ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
- ObjectInputStream oin = new ObjectInputStream(bin);
- @SuppressWarnings("unchecked")
- T result = (T) oin.readObject();
- return result;
- }
-
- /** Verifies that domain name and ROID match expected values */
- private void checkDomain(
- JaxbFragment fragment, String domainName, String repoId) {
- assertThat(fragment).isNotNull();
- XjcRdeDomain domain = fragment.getInstance().getValue();
- assertThat(domain.getName()).isEqualTo(domainName);
- assertThat(domain.getRoid()).isEqualTo(repoId);
- }
-
- /** Gets a new {@link RdeDomainReader} with specified offset and maxResults */
- private RdeDomainReader getReader(int offset, int maxResults) throws Exception {
- RdeDomainReader reader =
- new RdeDomainReader(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME, offset, maxResults);
- reader.beginSlice();
- return reader;
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeHostImportActionTest.java b/javatests/google/registry/rde/imports/RdeHostImportActionTest.java
deleted file mode 100644
index fd092d730..000000000
--- a/javatests/google/registry/rde/imports/RdeHostImportActionTest.java
+++ /dev/null
@@ -1,180 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.rde.imports.RdeImportsTestData.loadBytes;
-import static google.registry.testing.DatastoreHelper.getHistoryEntries;
-import static google.registry.testing.DatastoreHelper.newHostResource;
-import static google.registry.testing.DatastoreHelper.persistResource;
-import static google.registry.testing.DatastoreHelper.persistSimpleResource;
-import static org.joda.time.DateTimeZone.UTC;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.common.io.ByteSource;
-import com.google.common.io.ByteStreams;
-import com.googlecode.objectify.Key;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.mapreduce.MapreduceRunner;
-import google.registry.model.eppcommon.Trid;
-import google.registry.model.host.HostResource;
-import google.registry.model.reporting.HistoryEntry;
-import google.registry.request.Response;
-import google.registry.testing.FakeResponse;
-import google.registry.testing.mapreduce.MapreduceTestCase;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Optional;
-import org.joda.time.DateTime;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeHostImportAction}. */
-@RunWith(JUnit4.class)
-public class RdeHostImportActionTest extends MapreduceTestCase {
-
- private static final ByteSource DEPOSIT_1_HOST = loadBytes("deposit_1_host.xml");
- private static final String IMPORT_BUCKET_NAME = "import-bucket";
- private static final String IMPORT_FILE_NAME = "escrow-file.xml";
-
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- private MapreduceRunner mrRunner;
- private Response response;
-
- private final Optional mapShards = Optional.empty();
-
- @Before
- public void before() {
- response = new FakeResponse();
- mrRunner = makeDefaultRunner();
- action = new RdeHostImportAction(
- mrRunner,
- response,
- IMPORT_BUCKET_NAME,
- IMPORT_FILE_NAME,
- mapShards);
- }
-
- @Test
- public void test_mapreduceSuccessfullyImportsHost() throws Exception {
- pushToGcs(DEPOSIT_1_HOST);
- runMapreduce();
- List hosts = ofy().load().type(HostResource.class).list();
- assertThat(hosts).hasSize(1);
- checkHost(hosts.get(0));
- }
-
- @Test
- public void test_mapreduceSuccessfullyCreatesHistoryEntry() throws Exception {
- pushToGcs(DEPOSIT_1_HOST);
- runMapreduce();
- List hosts = ofy().load().type(HostResource.class).list();
- HostResource host = hosts.get(0);
- // verify history entry
- List historyEntries = getHistoryEntries(host);
- assertThat(historyEntries).hasSize(1);
- checkHistoryEntry(historyEntries.get(0), host);
- }
-
- /** Ensures that a second pass on a host does not import a new host. */
- @Test
- public void test_mapreduceTwiceDoesNotDuplicateResources() throws Exception {
- pushToGcs(DEPOSIT_1_HOST);
- // Create host and history entry first
- HostResource existingHost = persistResource(
- newHostResource("ns1.example1.test")
- .asBuilder()
- .setRepoId("Hns1_example1_test-TEST")
- .build());
- persistSimpleResource(createHistoryEntry(
- existingHost.getRepoId(),
- existingHost.getPersistedCurrentSponsorClientId(),
- loadHostXml(DEPOSIT_1_HOST)));
- // Simulate running a second import and verify that the resources
- // aren't imported twice (only one host, and one history entry)
- runMapreduce();
- List hosts = ofy().load().type(HostResource.class).list();
- assertThat(hosts).hasSize(1);
- HostResource host = hosts.get(0);
- // verify history entry
- List historyEntries = getHistoryEntries(host);
- assertThat(historyEntries).hasSize(1);
- checkHistoryEntry(historyEntries.get(0), host);
- }
-
- /** Verify history entry fields are correct */
- private void checkHistoryEntry(HistoryEntry entry, HostResource parent) {
- assertThat(entry.getType()).isEqualTo(HistoryEntry.Type.RDE_IMPORT);
- assertThat(entry.getClientId()).isEqualTo(parent.getPersistedCurrentSponsorClientId());
- assertThat(entry.getXmlBytes().length).isGreaterThan(0);
- assertThat(entry.getBySuperuser()).isTrue();
- assertThat(entry.getReason()).isEqualTo("RDE Import");
- assertThat(entry.getRequestedByRegistrar()).isEqualTo(false);
- assertThat(entry.getParent()).isEqualTo(Key.create(parent));
- }
-
- /** Verifies that host id and ROID match expected values */
- private void checkHost(HostResource host) {
- assertThat(host.getFullyQualifiedHostName()).isEqualTo("ns1.example1.test");
- assertThat(host.getRepoId()).isEqualTo("Hns1_example1_test-TEST");
- }
-
- private void runMapreduce() throws Exception {
- action.run();
- executeTasksUntilEmpty("mapreduce");
- }
-
- private void pushToGcs(ByteSource source) throws IOException {
- try (OutputStream outStream =
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize())
- .openOutputStream(new GcsFilename(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME));
- InputStream inStream = source.openStream()) {
- ByteStreams.copy(inStream, outStream);
- }
- }
-
- private static HistoryEntry createHistoryEntry(String roid, String clid, byte[] objectXml) {
- return new HistoryEntry.Builder()
- .setType(HistoryEntry.Type.RDE_IMPORT)
- .setClientId(clid)
- .setTrid(Trid.create("client-trid", "server-trid"))
- .setModificationTime(DateTime.now(UTC))
- .setXmlBytes(objectXml)
- .setBySuperuser(true)
- .setReason("RDE Import")
- .setRequestedByRegistrar(false)
- .setParent(Key.create(null, HostResource.class, roid))
- .build();
- }
-
- private static byte[] loadHostXml(ByteSource source) throws IOException {
- byte[] result = new byte[((int) source.size())];
- try (InputStream inStream = source.openStream()) {
- ByteStreams.readFully(inStream, result);
- }
- return result;
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeHostInputTest.java b/javatests/google/registry/rde/imports/RdeHostInputTest.java
deleted file mode 100644
index 2dcfbf0d3..000000000
--- a/javatests/google/registry/rde/imports/RdeHostInputTest.java
+++ /dev/null
@@ -1,272 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.rde.imports.RdeImportsTestData.loadBytes;
-import static google.registry.testing.JUnitBackports.assertThrows;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.common.io.ByteSource;
-import com.google.common.io.ByteStreams;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.testing.AppEngineRule;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Optional;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeHostInput} */
-@RunWith(JUnit4.class)
-public class RdeHostInputTest {
-
- private static final ByteSource DEPOSIT_0_HOST = loadBytes("deposit_0_host_header.xml");
- private static final ByteSource DEPOSIT_1_HOST = loadBytes("deposit_1_host.xml");
- private static final ByteSource DEPOSIT_199_HOST = loadBytes("deposit_199_host_header.xml");
- private static final ByteSource DEPOSIT_200_HOST = loadBytes("deposit_200_host_header.xml");
- private static final ByteSource DEPOSIT_1000_HOST = loadBytes("deposit_1000_host_header.xml");
- private static final ByteSource DEPOSIT_10000_HOST = loadBytes("deposit_10000_host_header.xml");
- private static final String IMPORT_BUCKET_NAME = "import-bucket";
- private static final String IMPORT_FILE_NAME = "escrow-file.xml";
-
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- @Rule
- public final AppEngineRule appEngine = AppEngineRule.builder()
- .withDatastore()
- .build();
- /** Number of shards cannot be negative */
- @Test
- public void testNegativeShards_throwsIllegalArgumentException() {
- IllegalArgumentException thrown =
- assertThrows(IllegalArgumentException.class, () -> getInput(Optional.of(-1)));
- assertThat(thrown).hasMessageThat().contains("Number of shards must be greater than zero");
- }
-
- /** Number of shards cannot be zero */
- @Test
- public void testZeroShards_throwsIllegalArgumentException() {
- IllegalArgumentException thrown =
- assertThrows(IllegalArgumentException.class, () -> getInput(Optional.of(0)));
- assertThat(thrown).hasMessageThat().contains("Number of shards must be greater than zero");
- }
-
- /** Escrow file with zero hosts results in one reader */
- @Test
- public void testZeroHostsDefaultShards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_0_HOST);
- assertNumberOfReaders(Optional.empty(), 1);
- }
-
- /** Escrow file with zero hosts results in expected reader configuration */
- @Test
- public void testZeroHostsDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_0_HOST);
- assertReaderConfigurations(Optional.empty(), 0, 0, 100);
- }
-
- /** Escrow file with zero hosts and 75 shards results in one reader */
- @Test
- public void testZeroHosts75Shards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_0_HOST);
- assertNumberOfReaders(Optional.of(75), 1);
- }
-
- /** Escrow file with one host results in one reader */
- @Test
- public void testOneHostDefaultShards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_1_HOST);
- assertNumberOfReaders(Optional.empty(), 1);
- }
-
- /** Escrow file with one host results in expected reader configuration */
- @Test
- public void testOneHostDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_1_HOST);
- assertReaderConfigurations(Optional.empty(), 0, 0, 100);
- }
-
- /** Escrow file with one host and 75 shards results in one reader */
- @Test
- public void testOneHost75Shards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_1_HOST);
- assertNumberOfReaders(Optional.of(75), 1);
- }
-
- /** Escrow file with 199 hosts results in one reader */
- @Test
- public void test199HostsDefaultShards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_199_HOST);
- assertNumberOfReaders(Optional.empty(), 1);
- }
-
- /** Escrow file with 199 hosts results in expected reader configuration */
- @Test
- public void test199HostsDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_199_HOST);
- assertReaderConfigurations(Optional.empty(), 0, 0, 199);
- }
-
- /** Escrow file with 199 hosts and 75 shards results in one reader */
- @Test
- public void test199Hosts75Shards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_199_HOST);
- assertNumberOfReaders(Optional.of(75), 1);
- }
-
- /** Escrow file with 200 hosts results in two readers */
- @Test
- public void test200HostsDefaultShards_returnsTwoReaders() throws Exception {
- pushToGcs(DEPOSIT_200_HOST);
- assertNumberOfReaders(Optional.empty(), 2);
- }
-
- /** Escrow file with 200 hosts results in expected reader configurations */
- @Test
- public void test200HostsDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_200_HOST);
- assertReaderConfigurations(Optional.empty(), 0, 0, 100);
- assertReaderConfigurations(Optional.empty(), 1, 100, 100);
- }
-
- /** Escrow file with 200 hosts and 75 shards results in two readers */
- @Test
- public void test200Hosts75Shards_returnsOneReader() throws Exception {
- pushToGcs(DEPOSIT_200_HOST);
- assertNumberOfReaders(Optional.of(75), 2);
- }
-
- /** Escrow file with 1000 hosts results in ten readers */
- @Test
- public void test1000HostsDefaultShards_returns10Readers() throws Exception {
- pushToGcs(DEPOSIT_1000_HOST);
- assertNumberOfReaders(Optional.empty(), 10);
- }
-
- /** Escrow file with 1000 hosts results in expected reader configurations */
- @Test
- public void test1000HostsDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_1000_HOST);
- for (int i = 0; i < 10; i++) {
- assertReaderConfigurations(Optional.empty(), i, i * 100, 100);
- }
- }
-
- /** Escrow file with 1000 hosts and 75 shards results in ten readers */
- @Test
- public void test1000Hosts75Shards_returns10Readers() throws Exception {
- pushToGcs(DEPOSIT_1000_HOST);
- assertNumberOfReaders(Optional.of(75), 10);
- }
-
- /** Escrow file with 10000 hosts results in 50 readers */
- @Test
- public void test10000HostsDefaultShards_returns50Readers() throws Exception {
- pushToGcs(DEPOSIT_10000_HOST);
- assertNumberOfReaders(Optional.empty(), 50);
- }
-
- /** Escrow file with 10000 hosts results in expected reader configurations */
- @Test
- public void test10000HostsDefaultShardsReaderConfigurations() throws Exception {
- pushToGcs(DEPOSIT_10000_HOST);
- for (int i = 0; i < 50; i++) {
- assertReaderConfigurations(Optional.empty(), i, i * 200, 200);
- }
- }
-
- /** Escrow file with 10000 hosts and 75 shards results in 75 readers */
- @Test
- public void test10000Hosts75Shards_returns75Readers() throws Exception {
- pushToGcs(DEPOSIT_10000_HOST);
- assertNumberOfReaders(Optional.of(75), 75);
- }
-
- /** Escrow file with 10000 hosts and 150 shards results in 100 readers */
- @Test
- public void test10000Hosts150Shards_returns100Readers() throws Exception {
- pushToGcs(DEPOSIT_10000_HOST);
- assertNumberOfReaders(Optional.of(150), 100);
- }
-
- /**
- * Verify bucket, filename, offset and max results for a specific reader
- *
- * @param numberOfShards Number of desired shards ({@link Optional#empty} uses default of 50)
- * @param whichReader Index of the reader in the list that is produced by the {@link RdeHostInput}
- * @param expectedOffset Expected offset of the reader
- * @param expectedMaxResults Expected maxResults of the reader
- */
- private void assertReaderConfigurations(
- Optional numberOfShards,
- int whichReader,
- int expectedOffset,
- int expectedMaxResults) {
- RdeHostInput input = getInput(numberOfShards);
- List> readers = input.createReaders();
- RdeHostReader reader = (RdeHostReader) readers.get(whichReader);
- assertImportBucketAndFilename(reader);
- assertThat(reader.offset).isEqualTo(expectedOffset);
- assertThat(reader.maxResults).isEqualTo(expectedMaxResults);
- }
-
- private void pushToGcs(ByteSource source) throws IOException {
- try (OutputStream outStream =
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize())
- .openOutputStream(new GcsFilename(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME));
- InputStream inStream = source.openStream()) {
- ByteStreams.copy(inStream, outStream);
- }
- }
-
- /**
- * Verify the number of readers produced by the {@link RdeHostInput}
- *
- * @param numberOfShards Number of desired shards ({@link Optional#empty} uses default of 50)
- * @param expectedNumberOfReaders Expected size of the list returned
- */
- private void assertNumberOfReaders(
- Optional numberOfShards, int expectedNumberOfReaders) {
- RdeHostInput input = getInput(numberOfShards);
- List> readers = input.createReaders();
- assertThat(readers).hasSize(expectedNumberOfReaders);
- }
-
- /**
- * Creates a new testable instance of {@link RdeHostInput}
- * @param mapShards Number of desired shards ({@link Optional#empty} uses default of 50)
- */
- private RdeHostInput getInput(Optional mapShards) {
- return new RdeHostInput(mapShards, IMPORT_BUCKET_NAME, IMPORT_FILE_NAME);
- }
-
- /**
- * Verifies the configured import bucket and file names.
- */
- private void assertImportBucketAndFilename(RdeHostReader reader) {
- assertThat(reader.importBucketName).isEqualTo("import-bucket");
- assertThat(reader.importFileName).isEqualTo("escrow-file.xml");
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java b/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java
deleted file mode 100644
index 4f0a3d9da..000000000
--- a/javatests/google/registry/rde/imports/RdeHostLinkActionTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.model.eppcommon.StatusValue.PENDING_DELETE;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.rde.imports.RdeImportsTestData.loadBytes;
-import static google.registry.testing.DatastoreHelper.createTld;
-import static google.registry.testing.DatastoreHelper.newDomainBase;
-import static google.registry.testing.DatastoreHelper.newHostResource;
-import static google.registry.testing.DatastoreHelper.persistActiveDomain;
-import static google.registry.testing.DatastoreHelper.persistResource;
-import static google.registry.util.DateTimeUtils.END_OF_TIME;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.io.ByteSource;
-import com.google.common.io.ByteStreams;
-import com.googlecode.objectify.Key;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.mapreduce.MapreduceRunner;
-import google.registry.model.domain.DomainBase;
-import google.registry.model.host.HostResource;
-import google.registry.model.index.ForeignKeyIndex.ForeignKeyDomainIndex;
-import google.registry.model.ofy.Ofy;
-import google.registry.request.Response;
-import google.registry.testing.FakeClock;
-import google.registry.testing.FakeResponse;
-import google.registry.testing.InjectRule;
-import google.registry.testing.mapreduce.MapreduceTestCase;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Optional;
-import org.joda.time.DateTime;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeHostLinkAction}. */
-@RunWith(JUnit4.class)
-public class RdeHostLinkActionTest extends MapreduceTestCase {
-
- private static final ByteSource DEPOSIT_1_HOST = loadBytes("deposit_1_host.xml");
- private static final String IMPORT_BUCKET_NAME = "import-bucket";
- private static final String IMPORT_FILE_NAME = "escrow-file.xml";
-
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- @Rule
- public final InjectRule inject = new InjectRule();
-
- private MapreduceRunner mrRunner;
-
- private Response response;
-
- private final Optional mapShards = Optional.empty();
-
- private final FakeClock clock = new FakeClock();
-
- @Before
- public void before() {
- clock.setTo(DateTime.parse("2016-05-07T14:55:38Z"));
- inject.setStaticField(Ofy.class, "clock", clock);
- createTld("test");
- response = new FakeResponse();
- mrRunner = makeDefaultRunner();
- action =
- new RdeHostLinkAction(mrRunner, response, IMPORT_BUCKET_NAME, IMPORT_FILE_NAME, mapShards);
- }
-
- @Test
- public void test_mapreduceSuccessfullyLinksHost() throws Exception {
- // Create host and domain first
- persistResource(
- newHostResource("ns1.example1.test")
- .asBuilder()
- .setRepoId("Hns1_example1_test-TEST")
- .build());
- DomainBase superordinateDomain = persistActiveDomain("example1.test");
- Key superOrdinateDomainKey = Key.create(superordinateDomain);
- pushToGcs(DEPOSIT_1_HOST);
- // set transaction time to slightly after resource save
- clock.advanceOneMilli();
- runMapreduce();
- // verify that host is linked to domain
- List hosts = ofy().load().type(HostResource.class).list();
- assertThat(hosts).hasSize(1);
- assertThat(hosts.get(0).getSuperordinateDomain()).isEqualTo(superOrdinateDomainKey);
- assertThat(hosts.get(0).getLastSuperordinateChange())
- .isEqualTo(DateTime.parse("2016-05-07T14:55:38.001Z"));
- // verify that domain is linked to host
- List domains = ofy().load().type(DomainBase.class).list();
- assertThat(domains).hasSize(1);
- assertThat(domains.get(0).getSubordinateHosts()).containsExactly("ns1.example1.test");
- }
-
- @Test
- public void test_mapreduceIgnoresHostWithWrongRepoid() throws Exception {
- // in-zone host with different repoid is ignored, since it would already be linked
- // from a separate epp create or import.
- // Create host and domain first
- HostResource newHost = persistResource(
- newHostResource("ns1.example1.test")
- .asBuilder()
- .setRepoId("wrong-repoid")
- .build());
- DomainBase superordinateDomain = persistActiveDomain("example1.test");
- ForeignKeyDomainIndex.create(superordinateDomain, END_OF_TIME);
- pushToGcs(DEPOSIT_1_HOST);
- // set transaction time to slightly after resource save
- clock.advanceOneMilli();
- runMapreduce();
- // verify that host has not been updated
- List hosts = ofy().load().type(HostResource.class).list();
- assertThat(hosts).hasSize(1);
- assertThat(hosts.get(0).getUpdateAutoTimestamp()).isEqualTo(newHost.getUpdateAutoTimestamp());
- }
-
- @Test
- public void test_mapreduceIgnoresHostWithSuperordinateDomainPendingDeletion() throws Exception {
- HostResource newHost = persistResource(
- newHostResource("ns1.example1.test")
- .asBuilder()
- .setRepoId("Hns1_example1_test-TEST")
- .build());
- persistResource(
- newDomainBase("example1.test")
- .asBuilder()
- .setStatusValues(ImmutableSet.of(PENDING_DELETE))
- .build());
- pushToGcs(DEPOSIT_1_HOST);
- // set transaction time to slightly after resource save
- clock.advanceOneMilli();
- runMapreduce();
- // verify that host has not been updated
- List hosts = ofy().load().type(HostResource.class).list();
- assertThat(hosts).hasSize(1);
- assertThat(hosts.get(0).getUpdateAutoTimestamp()).isEqualTo(newHost.getUpdateAutoTimestamp());
- }
-
- private void runMapreduce() throws Exception {
- action.run();
- executeTasksUntilEmpty("mapreduce");
- }
-
- private static void pushToGcs(ByteSource source) throws IOException {
- try (OutputStream outStream =
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize())
- .openOutputStream(new GcsFilename(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME));
- InputStream inStream = source.openStream()) {
- ByteStreams.copy(inStream, outStream);
- }
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeHostReaderTest.java b/javatests/google/registry/rde/imports/RdeHostReaderTest.java
deleted file mode 100644
index 08e6c5546..000000000
--- a/javatests/google/registry/rde/imports/RdeHostReaderTest.java
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.rde.imports.RdeImportsTestData.loadBytes;
-import static google.registry.testing.JUnitBackports.assertThrows;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.appengine.tools.cloudstorage.GcsService;
-import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
-import com.google.appengine.tools.cloudstorage.RetryParams;
-import com.google.common.io.ByteSource;
-import com.google.common.io.ByteStreams;
-import google.registry.config.RegistryConfig.ConfigModule;
-import google.registry.gcs.GcsUtils;
-import google.registry.testing.AppEngineRule;
-import google.registry.xjc.JaxbFragment;
-import google.registry.xjc.rdehost.XjcRdeHost;
-import google.registry.xjc.rdehost.XjcRdeHostElement;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.util.NoSuchElementException;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeHostReader} */
-@RunWith(JUnit4.class)
-public class RdeHostReaderTest {
-
- private static final ByteSource DEPOSIT_1_HOST = loadBytes("deposit_1_host.xml");
- private static final ByteSource DEPOSIT_3_HOST = loadBytes("deposit_3_host.xml");
- private static final ByteSource DEPOSIT_4_HOST = loadBytes("deposit_4_host.xml");
- private static final ByteSource DEPOSIT_10_HOST = loadBytes("deposit_10_host.xml");
- private static final String IMPORT_BUCKET_NAME = "rde-import";
- private static final String IMPORT_FILE_NAME = "escrow-file.xml";
-
- private static final GcsService GCS_SERVICE =
- GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
-
- @Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
- /** Reads at least one result at 0 offset 1 maxResults */
- @Test
- public void testZeroOffsetOneResult_readsOne() throws Exception {
- pushToGcs(DEPOSIT_1_HOST);
- RdeHostReader reader = getReader(0, 1);
- checkHost(reader.next(), "ns1.example1.test", "Hns1_example1_test-TEST");
- }
-
- /** Reads at most one at 0 offset 1 maxResults */
- @Test
- public void testZeroOffsetOneResult_stopsAfterOne() throws Exception {
- pushToGcs(DEPOSIT_3_HOST);
- RdeHostReader reader = getReader(0, 1);
- reader.next();
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Skips already-processed records after rehydration */
- @Test
- public void testZeroOffsetOneResult_skipsOneAfterRehydration() throws Exception {
- pushToGcs(DEPOSIT_3_HOST);
- RdeHostReader reader = getReader(0, 1);
- reader.next();
- reader.endSlice();
-
- reader = cloneReader(reader);
- reader.beginSlice();
- // reader will not advance any further
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Reads three hosts */
- @Test
- public void testZeroOffsetThreeResult_readsThree() throws Exception {
- pushToGcs(DEPOSIT_3_HOST);
- RdeHostReader reader = getReader(0, 3);
- checkHost(reader.next(), "ns1.example1.test", "Hns1_example1_test-TEST");
- checkHost(reader.next(), "ns1.example2.test", "Hns1_example2_test-TEST");
- checkHost(reader.next(), "ns1.example3.test", "Hns1_example3_test-TEST");
- }
-
- /** Stops reading at 3 maxResults */
- @Test
- public void testZeroOffsetThreeResult_stopsAtThree() throws Exception {
- pushToGcs(DEPOSIT_4_HOST);
- RdeHostReader reader = getReader(0, 3);
- for (int i = 0; i < 3; i++) {
- reader.next();
- }
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Reads one host from file then stops at end of file */
- @Test
- public void testZeroOffsetThreeResult_endOfFile() throws Exception {
- pushToGcs(DEPOSIT_1_HOST);
- RdeHostReader reader = getReader(0, 3);
- reader.next();
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- /** Skips three hosts with offset of three */
- @Test
- public void testThreeOffsetOneResult_skipsThree() throws Exception {
- pushToGcs(DEPOSIT_4_HOST);
- RdeHostReader reader = getReader(3, 1);
- checkHost(reader.next(), "ns1.example4.test", "Hns1_example4_test-TEST");
- }
-
- /** Skips four hosts after advancing once at three offset, then rehydrating */
- @Test
- public void testThreeOffsetTwoResult_skipsFourAfterRehydration() throws Exception {
- pushToGcs(DEPOSIT_10_HOST);
- RdeHostReader reader = getReader(3, 2);
- reader.next();
- reader.endSlice();
- reader = cloneReader(reader);
- reader.beginSlice();
- checkHost(reader.next(), "ns1.example5.test", "Hns1_example5_test-TEST");
- }
-
- /** Reads three at zero offset three results with rehydration in the middle */
- @Test
- public void testZeroOffsetThreeResult_readsThreeWithRehydration() throws Exception {
- pushToGcs(DEPOSIT_4_HOST);
- RdeHostReader reader = getReader(0, 3);
- checkHost(reader.next(), "ns1.example1.test", "Hns1_example1_test-TEST");
- reader.endSlice();
- reader = cloneReader(reader);
- reader.beginSlice();
- checkHost(reader.next(), "ns1.example2.test", "Hns1_example2_test-TEST");
- checkHost(reader.next(), "ns1.example3.test", "Hns1_example3_test-TEST");
- }
-
- /** Stops reading at three with zero offset three results with rehydration in the middle */
- @Test
- public void testZeroOffsetThreeResult_stopsAtThreeWithRehydration() throws Exception {
- pushToGcs(DEPOSIT_4_HOST);
- RdeHostReader reader = getReader(0, 3);
- reader.next();
- reader.endSlice();
- reader = cloneReader(reader);
- reader.beginSlice();
- reader.next();
- reader.next();
- assertThrows(NoSuchElementException.class, reader::next);
- }
-
- private void pushToGcs(ByteSource source) throws IOException {
- try (OutputStream outStream =
- new GcsUtils(GCS_SERVICE, ConfigModule.provideGcsBufferSize())
- .openOutputStream(new GcsFilename(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME));
- InputStream inStream = source.openStream()) {
- ByteStreams.copy(inStream, outStream);
- }
- }
-
- /** Creates a deep copy of the {@link RdeHostReader} */
- private RdeHostReader cloneReader(
- RdeHostReader reader) throws Exception {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- ObjectOutputStream oout = new ObjectOutputStream(bout);
- oout.writeObject(reader);
- ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
- ObjectInputStream oin = new ObjectInputStream(bin);
- return (RdeHostReader) oin.readObject();
- }
-
- /** Verifies that domain name and ROID match expected values */
- private void checkHost(
- JaxbFragment fragment, String domainName, String repoId) {
- assertThat(fragment).isNotNull();
- XjcRdeHost host = fragment.getInstance().getValue();
- assertThat(host.getName()).isEqualTo(domainName);
- assertThat(host.getRoid()).isEqualTo(repoId);
- }
- /** Gets a new {@link RdeHostReader} with specified offset and maxResults */
- private RdeHostReader getReader(int offset, int maxResults) throws Exception {
- RdeHostReader reader =
- new RdeHostReader(IMPORT_BUCKET_NAME, IMPORT_FILE_NAME, offset, maxResults);
- reader.beginSlice();
- return reader;
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeImportTestUtils.java b/javatests/google/registry/rde/imports/RdeImportTestUtils.java
deleted file mode 100644
index c3316f9be..000000000
--- a/javatests/google/registry/rde/imports/RdeImportTestUtils.java
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static com.google.common.truth.Truth8.assertThat;
-
-import google.registry.model.eppcommon.Trid;
-
-/**
- * Collection of test utility logic for RDE import.
- */
-public class RdeImportTestUtils {
-
- /**
- * Verifies that the {@link Trid} clientTransactionId
meets system requirements.
- *
- *
- * clientTransactionId
cannot be null
- * clientTransactionId
must be a token between 3 and 64 characters long
- * clientTransactionId
must be prefixed with Import__
- *
- */
- public static void checkTrid(Trid trid) {
- assertThat(trid).isNotNull();
- assertThat(trid.getClientTransactionId()).isPresent();
- String clTrid = trid.getClientTransactionId().get();
- assertThat(clTrid.length()).isAtLeast(3);
- assertThat(clTrid.length()).isAtMost(64);
- assertThat(clTrid).startsWith("Import_");
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeImportUtilsTest.java b/javatests/google/registry/rde/imports/RdeImportUtilsTest.java
deleted file mode 100644
index fef256106..000000000
--- a/javatests/google/registry/rde/imports/RdeImportUtilsTest.java
+++ /dev/null
@@ -1,355 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.collect.ImmutableList.toImmutableList;
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.model.registry.Registry.TldState.PREDELEGATION;
-import static google.registry.testing.DatastoreHelper.createTld;
-import static google.registry.testing.DatastoreHelper.persistActiveContact;
-import static google.registry.testing.DatastoreHelper.persistNewRegistrar;
-import static google.registry.testing.DatastoreHelper.persistResource;
-import static google.registry.testing.JUnitBackports.assertThrows;
-import static org.joda.time.DateTimeZone.UTC;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import com.google.appengine.tools.cloudstorage.GcsFilename;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Streams;
-import com.google.common.io.ByteSource;
-import com.googlecode.objectify.Key;
-import google.registry.gcs.GcsUtils;
-import google.registry.model.EppResource;
-import google.registry.model.EppResource.ForeignKeyedEppResource;
-import google.registry.model.contact.ContactResource;
-import google.registry.model.domain.DesignatedContact;
-import google.registry.model.domain.DesignatedContact.Type;
-import google.registry.model.domain.DomainBase;
-import google.registry.model.eppcommon.StatusValue;
-import google.registry.model.host.HostResource;
-import google.registry.model.index.EppResourceIndex;
-import google.registry.model.index.EppResourceIndexBucket;
-import google.registry.model.index.ForeignKeyIndex;
-import google.registry.model.registrar.Registrar;
-import google.registry.testing.AppEngineRule;
-import google.registry.testing.FakeClock;
-import google.registry.testing.ShardableTestCase;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import org.joda.time.DateTime;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeImportUtils} */
-@RunWith(JUnit4.class)
-public class RdeImportUtilsTest extends ShardableTestCase {
-
- private static final ByteSource DEPOSIT_XML = RdeImportsTestData.loadBytes("deposit_full.xml");
- private static final ByteSource DEPOSIT_BADTLD_XML =
- RdeImportsTestData.loadBytes("deposit_full_badtld.xml");
- private static final ByteSource DEPOSIT_GETLD_XML =
- RdeImportsTestData.loadBytes("deposit_full_getld.xml");
- private static final ByteSource DEPOSIT_BADREGISTRAR_XML =
- RdeImportsTestData.loadBytes("deposit_full_badregistrar.xml");
-
- private InputStream xmlInput;
-
- @Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
-
- private final GcsUtils gcsUtils = mock(GcsUtils.class);
-
- private RdeImportUtils rdeImportUtils;
- private FakeClock clock;
-
- @Before
- public void before() {
- clock = new FakeClock();
- clock.setTo(DateTime.now(UTC));
- rdeImportUtils = new RdeImportUtils(ofy(), clock, "import-bucket", gcsUtils);
- createTld("test", PREDELEGATION);
- createTld("getld");
- persistNewRegistrar("RegistrarX", "RegistrarX", Registrar.Type.REAL, 1L);
- }
-
- @After
- public void after() throws IOException {
- if (xmlInput != null) {
- xmlInput.close();
- }
- }
-
- /** Verifies import of a contact that has not been previously imported. */
- @Test
- public void testImportNewContact() {
- final ContactResource newContact = buildNewContact();
- importResourceInTransaction(newContact);
- assertEppResourceIndexEntityFor(newContact);
- assertForeignKeyIndexFor(newContact);
-
- // Verify that the new contact was saved.
- ContactResource saved = getContact("TEST-123");
- assertThat(saved).isNotNull();
- assertThat(saved.getContactId()).isEqualTo(newContact.getContactId());
- assertThat(saved.getEmailAddress()).isEqualTo(newContact.getEmailAddress());
- assertThat(saved.getLastEppUpdateTime()).isEqualTo(newContact.getLastEppUpdateTime());
- }
-
- /** Verifies that a contact will not be imported more than once. */
- @Test
- public void testImportExistingContact() {
- ContactResource newContact = buildNewContact();
- persistResource(newContact);
- final ContactResource updatedContact =
- newContact
- .asBuilder()
- .setLastEppUpdateTime(newContact.getLastEppUpdateTime().plusSeconds(1))
- .build();
- assertThrows(ResourceExistsException.class, () -> importResourceInTransaction(updatedContact));
- // Verify that the updated contact was not saved.
- ContactResource saved = getContact("TEST-123");
- assertThat(saved).isNotNull();
- assertThat(saved.getContactId()).isEqualTo(newContact.getContactId());
- assertThat(saved.getEmailAddress()).isEqualTo(newContact.getEmailAddress());
- assertThat(saved.getLastEppUpdateTime()).isEqualTo(newContact.getLastEppUpdateTime());
- }
-
- /** Verifies import of a host that has not been previously imported. */
- @Test
- public void testImportNewHost() throws UnknownHostException {
- final HostResource newHost = buildNewHost();
- importResourceInTransaction(newHost);
-
- assertEppResourceIndexEntityFor(newHost);
- assertForeignKeyIndexFor(newHost);
-
- // Verify that the new contact was saved.
- HostResource saved = getHost("FOO_ROID");
- assertThat(saved).isNotNull();
- assertThat(saved.getFullyQualifiedHostName()).isEqualTo(newHost.getFullyQualifiedHostName());
- assertThat(saved.getInetAddresses()).isEqualTo(newHost.getInetAddresses());
- assertThat(saved.getLastEppUpdateTime()).isEqualTo(newHost.getLastEppUpdateTime());
- }
-
- /** Verifies that a host will not be imported more than once. */
- @Test
- public void testImportExistingHost() throws UnknownHostException {
- HostResource newHost = buildNewHost();
- persistResource(newHost);
- final HostResource updatedHost =
- newHost
- .asBuilder()
- .setLastEppUpdateTime(newHost.getLastEppUpdateTime().plusSeconds(1))
- .build();
- assertThrows(ResourceExistsException.class, () -> importResourceInTransaction(updatedHost));
- // Verify that the contact was not updated.
- HostResource saved = getHost("FOO_ROID");
- assertThat(saved).isNotNull();
- assertThat(saved.getFullyQualifiedHostName()).isEqualTo(newHost.getFullyQualifiedHostName());
- assertThat(saved.getInetAddresses()).isEqualTo(newHost.getInetAddresses());
- assertThat(saved.getLastEppUpdateTime()).isEqualTo(newHost.getLastEppUpdateTime());
- }
-
- @Test
- public void testImportNewDomain() {
- final DomainBase newDomain = buildNewDomain();
- importResourceInTransaction(newDomain);
-
- DomainBase saved = getDomain("Dexample1-TEST");
- assertThat(saved.getFullyQualifiedDomainName())
- .isEqualTo(newDomain.getFullyQualifiedDomainName());
- assertThat(saved.getStatusValues()).isEqualTo(newDomain.getStatusValues());
- assertThat(saved.getRegistrant()).isEqualTo(newDomain.getRegistrant());
- assertThat(saved.getContacts()).isEqualTo(newDomain.getContacts());
- assertThat(saved.getCurrentSponsorClientId()).isEqualTo(newDomain.getCurrentSponsorClientId());
- assertThat(saved.getCreationClientId()).isEqualTo(newDomain.getCreationClientId());
- assertThat(saved.getCreationTime()).isEqualTo(newDomain.getCreationTime());
- assertThat(saved.getRegistrationExpirationTime())
- .isEqualTo(newDomain.getRegistrationExpirationTime());
- }
-
- @Test
- public void testImportExistingDomain() {
- DomainBase newDomain = buildNewDomain();
- persistResource(newDomain);
- final DomainBase updatedDomain =
- newDomain
- .asBuilder()
- .setFullyQualifiedDomainName("1" + newDomain.getFullyQualifiedDomainName())
- .build();
- assertThrows(ResourceExistsException.class, () -> importResourceInTransaction(updatedDomain));
- DomainBase saved = getDomain("Dexample1-TEST");
- assertThat(saved.getFullyQualifiedDomainName())
- .isEqualTo(newDomain.getFullyQualifiedDomainName());
- assertThat(saved.getStatusValues()).isEqualTo(newDomain.getStatusValues());
- assertThat(saved.getRegistrant()).isEqualTo(newDomain.getRegistrant());
- assertThat(saved.getContacts()).isEqualTo(newDomain.getContacts());
- assertThat(saved.getCurrentSponsorClientId()).isEqualTo(newDomain.getCurrentSponsorClientId());
- assertThat(saved.getCreationClientId()).isEqualTo(newDomain.getCreationClientId());
- assertThat(saved.getCreationTime()).isEqualTo(newDomain.getCreationTime());
- assertThat(saved.getRegistrationExpirationTime())
- .isEqualTo(newDomain.getRegistrationExpirationTime());
- }
-
- private static ContactResource buildNewContact() {
- return new ContactResource.Builder()
- .setContactId("sh8013")
- .setEmailAddress("jdoe@example.com")
- .setLastEppUpdateTime(DateTime.parse("2010-10-10T00:00:00.000Z"))
- .setRepoId("TEST-123")
- .build();
- }
-
- private static HostResource buildNewHost() throws UnknownHostException {
- return new HostResource.Builder()
- .setFullyQualifiedHostName("foo.bar.example")
- .setInetAddresses(
- ImmutableSet.of(
- InetAddress.getByName("192.0.2.2"),
- InetAddress.getByName("192.0.2.29"),
- InetAddress.getByName("1080:0:0:0:8:800:200C:417A")))
- .setLastEppUpdateTime(DateTime.parse("2010-10-10T00:00:00.000Z"))
- .setRepoId("FOO_ROID")
- .build();
- }
-
- private DomainBase buildNewDomain() {
- ContactResource registrant = persistActiveContact("jd1234");
- ContactResource admin = persistActiveContact("sh8013");
- return new DomainBase.Builder()
- .setFullyQualifiedDomainName("example1.example")
- .setRepoId("Dexample1-TEST")
- .setStatusValues(ImmutableSet.of(StatusValue.OK))
- .setRegistrant(Key.create(registrant))
- .setContacts(
- ImmutableSet.of(
- DesignatedContact.create(Type.ADMIN, Key.create(admin)),
- DesignatedContact.create(Type.TECH, Key.create(admin))))
- .setPersistedCurrentSponsorClientId("registrarx")
- .setCreationClientId("registrarx")
- .setCreationTime(DateTime.parse("1999-04-03T22:00:00.0Z"))
- .setRegistrationExpirationTime(DateTime.parse("2015-04-03T22:00:00.0Z"))
- .build();
- }
-
- /** Verifies that no errors are thrown when a valid escrow file is validated */
- @Test
- public void testValidateEscrowFile_valid() throws Exception {
- xmlInput = DEPOSIT_XML.openBufferedStream();
- when(gcsUtils.openInputStream(any(GcsFilename.class))).thenReturn(xmlInput);
- rdeImportUtils.validateEscrowFileForImport("valid-deposit-file.xml");
- // stored to avoid an error in FOSS build, marked "CheckReturnValue"
- InputStream unusedResult =
- verify(gcsUtils)
- .openInputStream(new GcsFilename("import-bucket", "valid-deposit-file.xml"));
- }
-
- /** Verifies thrown error when tld in escrow file is not in the registry */
- @Test
- public void testValidateEscrowFile_tldNotFound() throws Exception {
- xmlInput = DEPOSIT_BADTLD_XML.openBufferedStream();
- when(gcsUtils.openInputStream(any(GcsFilename.class))).thenReturn(xmlInput);
- Exception e =
- assertThrows(
- IllegalArgumentException.class,
- () -> rdeImportUtils.validateEscrowFileForImport("invalid-deposit-badtld.xml"));
- assertThat(e).hasMessageThat().isEqualTo("TLD 'badtld' not found in the registry");
- }
-
- /** Verifies thrown errer when tld in escrow file is not in PREDELEGATION state */
- @Test
- public void testValidateEscrowFile_tldWrongState() throws Exception {
- xmlInput = DEPOSIT_GETLD_XML.openBufferedStream();
- when(gcsUtils.openInputStream(any(GcsFilename.class))).thenReturn(xmlInput);
- Exception e =
- assertThrows(
- IllegalArgumentException.class,
- () -> rdeImportUtils.validateEscrowFileForImport("invalid-deposit-getld.xml"));
- assertThat(e)
- .hasMessageThat()
- .isEqualTo("TLD 'getld' is in state GENERAL_AVAILABILITY and cannot be imported");
- }
-
- /** Verifies thrown error when registrar in escrow file is not in the registry */
- @Test
- public void testValidateEscrowFile_badRegistrar() throws Exception {
- xmlInput = DEPOSIT_BADREGISTRAR_XML.openBufferedStream();
- when(gcsUtils.openInputStream(any(GcsFilename.class))).thenReturn(xmlInput);
- Exception e =
- assertThrows(
- IllegalArgumentException.class,
- () -> rdeImportUtils.validateEscrowFileForImport("invalid-deposit-badregistrar.xml"));
- assertThat(e).hasMessageThat().isEqualTo("Registrar 'RegistrarY' not found in the registry");
- }
-
- /** Gets the contact with the specified ROID */
- private static ContactResource getContact(String repoId) {
- final Key key = Key.create(ContactResource.class, repoId);
- return ofy().transact(() -> ofy().load().key(key).now());
- }
-
- /** Gets the host with the specified ROID */
- private static HostResource getHost(String repoId) {
- final Key key = Key.create(HostResource.class, repoId);
- return ofy().transact(() -> ofy().load().key(key).now());
- }
-
- /** Gets the domain with the specified ROID */
- private static DomainBase getDomain(String repoId) {
- final Key key = Key.create(DomainBase.class, repoId);
- return ofy().transact(() -> ofy().load().key(key).now());
- }
-
- /** Confirms that a ForeignKeyIndex exists in Datastore for a given resource. */
- private void assertForeignKeyIndexFor(final T resource) {
- assertThat(ForeignKeyIndex.load(resource.getClass(), resource.getForeignKey(), clock.nowUtc()))
- .isNotNull();
- }
-
- /** Confirms that an EppResourceIndex entity exists in Datastore for a given resource. */
- private static void assertEppResourceIndexEntityFor(final T resource) {
- ImmutableList indices =
- Streams.stream(
- ofy()
- .load()
- .type(EppResourceIndex.class)
- .filter("kind", Key.getKind(resource.getClass())))
- .filter(index -> ofy().load().key(index.getKey()).now().equals(resource))
- .collect(toImmutableList());
- assertThat(indices).hasSize(1);
- assertThat(indices.get(0).getBucket())
- .isEqualTo(EppResourceIndexBucket.getBucketKey(Key.create(resource)));
- }
-
- private void importResourceInTransaction(
- T resource) {
- ofy()
- .transact(
- () -> {
- rdeImportUtils.importEppResource(resource);
- return null;
- });
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeImportsTestData.java b/javatests/google/registry/rde/imports/RdeImportsTestData.java
deleted file mode 100644
index 65b6ca410..000000000
--- a/javatests/google/registry/rde/imports/RdeImportsTestData.java
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import com.google.common.io.ByteSource;
-import google.registry.testing.TestDataHelper;
-
-/** Utility class providing easy access to contents of the {@code testdata/} directory. */
-public final class RdeImportsTestData {
-
- /** Returns {@link ByteSource} for file in {@code rde/imports/testdata/} directory. */
- public static ByteSource loadBytes(String filename) {
- return TestDataHelper.loadBytes(RdeImportsTestData.class, filename);
- }
-
- /**
- * Loads data from file in {@code rde/imports/testdata/} as a String (assuming file is UTF-8).
- */
- public static String loadFile(String filename) {
- return TestDataHelper.loadFile(RdeImportsTestData.class, filename);
- }
-}
diff --git a/javatests/google/registry/rde/imports/RdeParserTest.java b/javatests/google/registry/rde/imports/RdeParserTest.java
deleted file mode 100644
index bac4aea6f..000000000
--- a/javatests/google/registry/rde/imports/RdeParserTest.java
+++ /dev/null
@@ -1,531 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.rde.imports.RdeImportsTestData.loadBytes;
-import static google.registry.testing.JUnitBackports.assertThrows;
-
-import com.google.common.io.ByteSource;
-import google.registry.rde.imports.RdeParser.RdeHeader;
-import google.registry.xjc.rdecontact.XjcRdeContact;
-import google.registry.xjc.rdedomain.XjcRdeDomain;
-import google.registry.xjc.rdeeppparams.XjcRdeEppParams;
-import google.registry.xjc.rdehost.XjcRdeHost;
-import google.registry.xjc.rdeidn.XjcRdeIdn;
-import google.registry.xjc.rdenndn.XjcRdeNndn;
-import google.registry.xjc.rderegistrar.XjcRdeRegistrar;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link RdeParser}. */
-@RunWith(JUnit4.class)
-public class RdeParserTest {
-
- private static final ByteSource DEPOSIT_XML = loadBytes("deposit_full_parser.xml");
-
- private InputStream xml;
- private void checkHeader(RdeHeader header) {
- assertThat(header.getTld()).isEqualTo("test");
- assertThat(header.getContactCount()).isEqualTo(1L);
- assertThat(header.getDomainCount()).isEqualTo(2L);
- assertThat(header.getEppParamsCount()).isEqualTo(1L);
- assertThat(header.getHostCount()).isEqualTo(1L);
- assertThat(header.getIdnCount()).isEqualTo(1L);
- assertThat(header.getNndnCount()).isEqualTo(1L);
- assertThat(header.getRegistrarCount()).isEqualTo(1L);
- }
-
- @Before
- public void before() throws IOException {
- xml = new ByteArrayInputStream(DEPOSIT_XML.read());
- }
-
- @After
- public void after() throws IOException {
- xml.close();
- }
-
- @Test
- public void testGetHeader_returnsHeader() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- checkHeader(parser.getHeader());
- }
- }
-
- @Test
- public void testGetContactNotAtElement_throwsIllegalStateException() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- IllegalStateException thrown = assertThrows(IllegalStateException.class, parser::getContact);
- assertThat(thrown)
- .hasMessageThat()
- .contains("Not at element urn:ietf:params:xml:ns:rdeContact-1.0:contact");
- }
- }
-
- @Test
- public void testGetContactAtElement_returnsContact() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextContact();
- XjcRdeContact contact = parser.getContact();
- assertThat(contact.getId()).isEqualTo("sh8013");
- assertThat(contact.getClID()).isEqualTo("RegistrarX");
- }
- }
-
- @Test
- public void testNextContact_advancesParser() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.isAtContact()).isFalse();
- // there is only one contact in the escrow file
- assertThat(parser.nextContact()).isTrue();
- assertThat(parser.isAtContact()).isTrue();
- assertThat(parser.nextContact()).isFalse();
- assertThat(parser.isAtContact()).isFalse();
- }
- }
-
- @Test
- public void testSkipZeroContacts_skipsZero() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipContacts(0)).isEqualTo(0);
- assertThat(parser.nextContact()).isTrue();
- }
- }
-
- @Test
- public void testSkipOneContactFromBeginning_skipsOne() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipContacts(1)).isEqualTo(1);
- assertThat(parser.isAtContact()).isFalse();
- }
- }
-
- @Test
- public void testSkipOneContactFromFirstContact_skipsOne() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextContact();
- assertThat(parser.skipContacts(1)).isEqualTo(1);
- assertThat(parser.isAtContact()).isFalse();
- }
- }
-
- @Test
- public void testSkip9999Contacts_skipsOne() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipContacts(9999)).isEqualTo(1);
- assertThat(parser.isAtContact()).isFalse();
- }
- }
-
- @Test
- public void testSkipContactsFromEnd_skipsZero() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextContact();
- parser.nextContact();
- assertThat(parser.skipContacts(1)).isEqualTo(0);
- assertThat(parser.isAtContact()).isFalse();
- }
- }
-
- @Test
- public void testGetHeaderAfterNextContact_returnsHeader() throws Exception {
- // verify that the header is still available after advancing to next contact
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextContact();
- checkHeader(parser.getHeader());
- }
- }
-
- @Test
- public void testGetDomainNotAtElement_throwsIllegalStateException() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- IllegalStateException thrown = assertThrows(IllegalStateException.class, parser::getDomain);
- assertThat(thrown)
- .hasMessageThat()
- .contains("Not at element urn:ietf:params:xml:ns:rdeDomain-1.0:domain");
- }
- }
-
- @Test
- public void testGetDomainAtElement_returnsDomain() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextDomain();
- XjcRdeDomain domain = parser.getDomain();
- assertThat(domain.getName()).isEqualTo("example1.test");
- }
- }
-
- @Test
- public void testNextDomain_advancesParser() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- // there are 2 domains in the escrow file
- assertThat(parser.isAtDomain()).isFalse();
- assertThat(parser.nextDomain()).isTrue();
- assertThat(parser.isAtDomain()).isTrue();
- assertThat(parser.nextDomain()).isTrue();
- assertThat(parser.isAtDomain()).isTrue();
- assertThat(parser.nextDomain()).isFalse();
- assertThat(parser.isAtDomain()).isFalse();
- }
- }
-
- @Test
- public void testSkipZeroDomains_skipsZero() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipDomains(0)).isEqualTo(0);
- assertThat(parser.nextDomain()).isTrue();
- }
- }
-
- @Test
- public void testSkipOneDomainFromBeginning_skipsOne() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipDomains(1)).isEqualTo(1);
- // there are two domains
- assertThat(parser.isAtDomain()).isTrue();
- // prove that the parser advanced to the second domain
- assertThat(parser.nextDomain()).isFalse();
- assertThat(parser.isAtDomain()).isFalse();
- }
- }
-
- @Test
- public void testSkipTwoDomainsFromBeginning_skipsTwo() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipDomains(2)).isEqualTo(2);
- // there are two domains
- assertThat(parser.isAtDomain()).isFalse();
- }
- }
-
- @Test
- public void testSkipOneDomainFromFirstDomain_skipsOne() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextDomain();
- assertThat(parser.skipDomains(1)).isEqualTo(1);
- // there are two domains
- assertThat(parser.isAtDomain()).isTrue();
- // prove that the parser advanced to the second domain
- assertThat(parser.nextDomain()).isFalse();
- assertThat(parser.isAtDomain()).isFalse();
- }
- }
-
- @Test
- public void testSkipTwoDomainsFromFirstDomain_skipsTwo() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextDomain();
- assertThat(parser.skipDomains(2)).isEqualTo(2);
- // there are two domains
- assertThat(parser.isAtDomain()).isFalse();
- }
- }
-
- @Test
- public void testSkip9999Domains_skipsTwo() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipDomains(9999)).isEqualTo(2);
- assertThat(parser.isAtDomain()).isFalse();
- }
- }
-
- @Test
- public void testSkipDomainsFromEnd_skipsZero() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextDomain();
- parser.nextDomain();
- parser.nextDomain();
- assertThat(parser.skipDomains(1)).isEqualTo(0);
- }
- }
-
- @Test
- public void testGetHeaderAfterNextDomain_returnsHeader() throws Exception {
- // verify that the header is still available after advancing to next domain
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextDomain();
- checkHeader(parser.getHeader());
- }
- }
-
- @Test
- public void testGetHostNotAtElement_throwsIllegalStateException() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- IllegalStateException thrown = assertThrows(IllegalStateException.class, parser::getHost);
- assertThat(thrown)
- .hasMessageThat()
- .contains("Not at element urn:ietf:params:xml:ns:rdeHost-1.0:host");
- }
- }
-
- @Test
- public void testGetHostAtElement_returnsHost() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextHost();
- XjcRdeHost host = parser.getHost();
- assertThat(host.getName()).isEqualTo("ns1.example.com");
- }
- }
-
- @Test
- public void testNextHost_advancesParser() throws Exception {
- // the header lies, there are 2 hosts in the file
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.isAtHost()).isFalse();
- assertThat(parser.nextHost()).isTrue();
- assertThat(parser.isAtHost()).isTrue();
- assertThat(parser.nextHost()).isTrue();
- assertThat(parser.isAtHost()).isTrue();
- assertThat(parser.nextHost()).isFalse();
- assertThat(parser.isAtHost()).isFalse();
- }
- }
-
- @Test
- public void testSkipZeroHosts_skipsZero() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipHosts(0)).isEqualTo(0);
- assertThat(parser.nextHost()).isTrue();
- }
- }
-
- @Test
- public void testSkipOneHostFromBeginning_skipsOne() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipHosts(1)).isEqualTo(1);
- // there are two hosts
- assertThat(parser.isAtHost()).isTrue();
- // prove that the parser advanced to the second host
- assertThat(parser.nextHost()).isFalse();
- assertThat(parser.isAtHost()).isFalse();
- }
- }
-
- @Test
- public void testSkipTwoHostsFromBeginning_skipsTwo() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipHosts(2)).isEqualTo(2);
- // there are two hosts
- assertThat(parser.isAtHost()).isFalse();
- }
- }
-
- @Test
- public void testSkipOneHostFromFirstHost_skipsOne() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextHost();
- assertThat(parser.skipHosts(1)).isEqualTo(1);
- // there are two hosts
- assertThat(parser.isAtHost()).isTrue();
- // prove that the parser advanced to the second host
- assertThat(parser.nextHost()).isFalse();
- assertThat(parser.isAtHost()).isFalse();
- }
- }
-
- @Test
- public void testSkipTwoHostsFromFirstHost_skipsTwo() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextHost();
- assertThat(parser.skipHosts(2)).isEqualTo(2);
- // there are two hosts
- assertThat(parser.isAtHost()).isFalse();
- }
- }
-
- @Test
- public void testSkip9999Hosts_skipsTwo() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.skipHosts(9999)).isEqualTo(2);
- // there are two hosts
- assertThat(parser.isAtHost()).isFalse();
- }
- }
-
- @Test
- public void testSkipHostFromEnd_skipsZero() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextHost();
- parser.nextHost();
- parser.nextHost();
- assertThat(parser.skipHosts(1)).isEqualTo(0);
- }
- }
-
- @Test
- public void testGetHeaderAfterNextHost_returnsHeader() throws Exception {
- // verify that the header is still available after advancing to next host
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextHost();
- checkHeader(parser.getHeader());
- }
- }
-
- @Test
- public void testGetRegistrarNotAtElement_throwsIllegalStateException() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- IllegalStateException thrown =
- assertThrows(IllegalStateException.class, parser::getRegistrar);
- assertThat(thrown)
- .hasMessageThat()
- .contains("Not at element urn:ietf:params:xml:ns:rdeRegistrar-1.0:registrar");
- }
- }
-
- @Test
- public void testGetRegistrarAtElement_returnsRegistrar() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextRegistrar();
- XjcRdeRegistrar registrar = parser.getRegistrar();
- assertThat(registrar.getId()).isEqualTo("RegistrarX");
- assertThat(registrar.getName()).isEqualTo("Registrar X");
- }
- }
-
- @Test
- public void testNextRegistrar_advancesParser() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.isAtRegistrar()).isFalse();
- assertThat(parser.nextRegistrar()).isTrue();
- assertThat(parser.isAtRegistrar()).isTrue();
- assertThat(parser.nextRegistrar()).isFalse();
- assertThat(parser.isAtRegistrar()).isFalse();
- }
- }
-
- @Test
- public void testGetHeaderAfterNextRegistrar_returnsHeader() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextRegistrar();
- checkHeader(parser.getHeader());
- }
- }
-
- @Test
- public void testGetNndnNotAtElement_throwsIllegalStateException() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- IllegalStateException thrown = assertThrows(IllegalStateException.class, parser::getNndn);
- assertThat(thrown)
- .hasMessageThat()
- .contains("Not at element urn:ietf:params:xml:ns:rdeNNDN-1.0:NNDN");
- }
- }
-
- @Test
- public void testGetNndnAtElement_returnsNndn() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextNndn();
- XjcRdeNndn nndn = parser.getNndn();
- assertThat(nndn.getAName()).isEqualTo("xn--exampl-gva.test");
- }
- }
-
- @Test
- public void testNextNndn_advancesParser() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.isAtNndn()).isFalse();
- assertThat(parser.nextNndn()).isTrue();
- assertThat(parser.isAtNndn()).isTrue();
- assertThat(parser.nextNndn()).isFalse();
- assertThat(parser.isAtNndn()).isFalse();
- }
- }
-
- @Test
- public void testGetHeaderAfterNextNndn_returnsHeader() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextNndn();
- checkHeader(parser.getHeader());
- }
- }
-
- @Test
- public void testGetIdnNotAtElement_throwsIllegalStateException() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- IllegalStateException thrown = assertThrows(IllegalStateException.class, parser::getIdn);
- assertThat(thrown)
- .hasMessageThat()
- .contains("Not at element urn:ietf:params:xml:ns:rdeIDN-1.0:idnTableRef");
- }
- }
-
- @Test
- public void testGetIdnAtElement_returnsIdn() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextIdn();
- XjcRdeIdn idn = parser.getIdn();
- // url contains whitespace
- assertThat(idn.getUrl().trim())
- .isEqualTo("http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html");
- }
- }
-
- @Test
- public void testNextIdn_advancesParser() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.isAtIdn()).isFalse();
- assertThat(parser.nextIdn()).isTrue();
- assertThat(parser.isAtIdn()).isTrue();
- assertThat(parser.nextIdn()).isFalse();
- assertThat(parser.isAtIdn()).isFalse();
- }
- }
-
- @Test
- public void testGetHeaderAfterNextIdn_returnsHeader() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextIdn();
- checkHeader(parser.getHeader());
- }
- }
-
- @Test
- public void testGetEppParamsNotAtElement_throwsIllegalStateException() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- IllegalStateException thrown =
- assertThrows(IllegalStateException.class, parser::getEppParams);
- assertThat(thrown)
- .hasMessageThat()
- .contains("Not at element urn:ietf:params:xml:ns:rdeEppParams-1.0:eppParams");
- }
- }
-
- @Test
- public void testGetEppParamsAtElement_returnsEppParams() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- parser.nextEppParams();
- XjcRdeEppParams eppParams = parser.getEppParams();
- assertThat(eppParams.getVersions()).containsExactly("1.0");
- }
- }
-
- @Test
- public void testNextEppParamsAdvancesParser() throws Exception {
- try (RdeParser parser = new RdeParser(xml)) {
- assertThat(parser.isAtEppParams()).isFalse();
- assertThat(parser.nextEppParams()).isTrue();
- assertThat(parser.isAtEppParams()).isTrue();
- assertThat(parser.nextEppParams()).isFalse();
- assertThat(parser.isAtEppParams()).isFalse();
- }
- }
-}
diff --git a/javatests/google/registry/rde/imports/XjcToContactResourceConverterTest.java b/javatests/google/registry/rde/imports/XjcToContactResourceConverterTest.java
deleted file mode 100644
index 4323d9e8a..000000000
--- a/javatests/google/registry/rde/imports/XjcToContactResourceConverterTest.java
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.rde.imports.RdeImportTestUtils.checkTrid;
-import static google.registry.rde.imports.RdeImportsTestData.loadBytes;
-import static google.registry.testing.DatastoreHelper.createTld;
-import static google.registry.testing.DatastoreHelper.getHistoryEntries;
-import static java.util.Arrays.asList;
-
-import com.google.common.base.Joiner;
-import com.google.common.io.ByteSource;
-import google.registry.model.contact.ContactResource;
-import google.registry.model.contact.PostalInfo;
-import google.registry.model.eppcommon.StatusValue;
-import google.registry.model.reporting.HistoryEntry;
-import google.registry.model.transfer.TransferData;
-import google.registry.model.transfer.TransferStatus;
-import google.registry.testing.AppEngineRule;
-import google.registry.xjc.rdecontact.XjcRdeContact;
-import google.registry.xjc.rdecontact.XjcRdeContactElement;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.List;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
-import org.joda.time.DateTime;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-@RunWith(JUnit4.class)
-public class XjcToContactResourceConverterTest {
-
- //List of packages to initialize JAXBContext
- private static final String JAXB_CONTEXT_PACKAGES = Joiner.on(":").join(asList(
- "google.registry.xjc.contact",
- "google.registry.xjc.domain",
- "google.registry.xjc.host",
- "google.registry.xjc.mark",
- "google.registry.xjc.rde",
- "google.registry.xjc.rdecontact",
- "google.registry.xjc.rdedomain",
- "google.registry.xjc.rdeeppparams",
- "google.registry.xjc.rdeheader",
- "google.registry.xjc.rdeidn",
- "google.registry.xjc.rdenndn",
- "google.registry.xjc.rderegistrar",
- "google.registry.xjc.smd"));
-
- private static final ByteSource CONTACT_XML = loadBytes("contact_fragment.xml");
-
- @Rule
- public final AppEngineRule appEngine = AppEngineRule.builder()
- .withDatastore()
- .build();
-
- private Unmarshaller unmarshaller;
-
- @Before
- public void before() throws Exception {
- createTld("xn--q9jyb4c");
- unmarshaller = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES).createUnmarshaller();
- }
-
- @Test
- public void testConvertContact() throws Exception {
- XjcRdeContact contact = loadContactFromRdeXml();
- ContactResource resource = convertContactInTransaction(contact);
- assertThat(resource.getContactId()).isEqualTo("love-id");
- assertThat(resource.getRepoId()).isEqualTo("2-ROID");
- // The imported XML also had LINKED status, but that should have been dropped on import.
- assertThat(resource.getStatusValues())
- .containsExactly(
- StatusValue.CLIENT_DELETE_PROHIBITED, StatusValue.SERVER_UPDATE_PROHIBITED);
-
- assertThat(resource.getInternationalizedPostalInfo()).isNotNull();
- PostalInfo postalInfo = resource.getInternationalizedPostalInfo();
- assertThat(postalInfo.getName()).isEqualTo("Dipsy Doodle");
- assertThat(postalInfo.getOrg()).isEqualTo("Charleston Road Registry Incorporated");
- assertThat(postalInfo.getAddress().getStreet()).hasSize(2);
- assertThat(postalInfo.getAddress().getStreet().get(0)).isEqualTo("123 Charleston Road");
- assertThat(postalInfo.getAddress().getStreet().get(1)).isEqualTo("Suite 123");
- assertThat(postalInfo.getAddress().getState()).isEqualTo("CA");
- assertThat(postalInfo.getAddress().getZip()).isEqualTo("31337");
- assertThat(postalInfo.getAddress().getCountryCode()).isEqualTo("US");
-
- assertThat(resource.getLocalizedPostalInfo()).isNull();
-
- assertThat(resource.getVoiceNumber()).isNotNull();
- assertThat(resource.getVoiceNumber().getPhoneNumber()).isEqualTo("+1.2126660000");
- assertThat(resource.getVoiceNumber().getExtension()).isEqualTo("123");
-
- assertThat(resource.getFaxNumber()).isNotNull();
- assertThat(resource.getFaxNumber().getPhoneNumber()).isEqualTo("+1.2126660001");
- assertThat(resource.getFaxNumber().getExtension()).isNull();
-
- assertThat(resource.getEmailAddress()).isEqualTo("justine@crr.com");
- assertThat(resource.getCurrentSponsorClientId()).isEqualTo("TheRegistrar");
- assertThat(resource.getCreationClientId()).isEqualTo("NewRegistrar");
- assertThat(resource.getCreationTime()).isEqualTo(DateTime.parse("1900-01-01TZ"));
- assertThat(resource.getLastEppUpdateClientId()).isEqualTo("TheRegistrar");
- assertThat(resource.getLastEppUpdateTime()).isEqualTo(DateTime.parse("1930-04-20TZ"));
- assertThat(resource.getLastTransferTime()).isEqualTo(DateTime.parse("1925-04-20TZ"));
-
- assertThat(resource.getTransferData()).isNotNull();
- assertThat(resource.getTransferData().getTransferStatus())
- .isEqualTo(TransferStatus.SERVER_APPROVED);
- assertThat(resource.getTransferData().getGainingClientId()).isEqualTo("TheRegistrar");
- assertThat(resource.getTransferData().getTransferRequestTime())
- .isEqualTo(DateTime.parse("1925-04-19TZ"));
- assertThat(resource.getTransferData().getLosingClientId()).isEqualTo("NewRegistrar");
- assertThat(resource.getTransferData().getPendingTransferExpirationTime())
- .isEqualTo(DateTime.parse("1925-04-21TZ"));
-
- assertThat(resource.getDisclose()).isNotNull();
- assertThat(resource.getDisclose().getFlag()).isTrue();
- assertThat(resource.getDisclose().getAddrs()).hasSize(1);
- assertThat(resource.getDisclose().getAddrs().get(0).getType())
- .isEqualTo(PostalInfo.Type.INTERNATIONALIZED);
- assertThat(resource.getDisclose().getNames()).hasSize(1);
- assertThat(resource.getDisclose().getNames().get(0).getType())
- .isEqualTo(PostalInfo.Type.INTERNATIONALIZED);
- assertThat(resource.getDisclose().getOrgs()).isEmpty();
- }
-
- @Test
- public void testConvertContact_absentVoiceAndFaxNumbers() throws Exception {
- XjcRdeContact contact = loadContactFromRdeXml();
- contact.setVoice(null);
- contact.setFax(null);
- ContactResource resource = convertContactInTransaction(contact);
- assertThat(resource.getVoiceNumber()).isNull();
- assertThat(resource.getFaxNumber()).isNull();
- }
-
- @Test
- public void testConvertContact_absentDisclose() throws Exception {
- XjcRdeContact contact = loadContactFromRdeXml();
- contact.setDisclose(null);
- ContactResource resource = convertContactInTransaction(contact);
- assertThat(resource.getDisclose()).isNull();
- }
-
- @Test
- public void testConvertContact_absentTransferData() throws Exception {
- XjcRdeContact contact = loadContactFromRdeXml();
- contact.setTrDate(null);
- contact.setTrnData(null);
- ContactResource resource = convertContactInTransaction(contact);
- assertThat(resource.getLastTransferTime()).isNull();
- assertThat(resource.getTransferData()).isSameAs(TransferData.EMPTY);
- }
-
- @Test
- public void testConvertContactResourceHistoryEntry() throws Exception {
- XjcRdeContact contact = loadContactFromRdeXml();
- ContactResource resource = convertContactInTransaction(contact);
- List historyEntries = getHistoryEntries(resource);
- assertThat(historyEntries).hasSize(1);
- HistoryEntry entry = historyEntries.get(0);
- assertThat(entry.getType()).isEqualTo(HistoryEntry.Type.RDE_IMPORT);
- assertThat(entry.getClientId()).isEqualTo("TheRegistrar");
- assertThat(entry.getBySuperuser()).isTrue();
- assertThat(entry.getReason()).isEqualTo("RDE Import");
- assertThat(entry.getRequestedByRegistrar()).isFalse();
- checkTrid(entry.getTrid());
- // check xml against original domain xml
- try (InputStream ins = new ByteArrayInputStream(entry.getXmlBytes())) {
- XjcRdeContact unmarshalledXml =
- ((XjcRdeContactElement) unmarshaller.unmarshal(ins)).getValue();
- assertThat(unmarshalledXml.getId()).isEqualTo("love-id");
- assertThat(unmarshalledXml.getRoid()).isEqualTo("2-ROID");
- }
- }
-
- private static ContactResource convertContactInTransaction(final XjcRdeContact xjcContact) {
- return ofy().transact(() -> XjcToContactResourceConverter.convertContact(xjcContact));
- }
-
- private XjcRdeContact loadContactFromRdeXml() throws Exception {
- try (InputStream ins = CONTACT_XML.openStream()) {
- return ((XjcRdeContactElement) unmarshaller.unmarshal(ins)).getValue();
- }
- }
-}
diff --git a/javatests/google/registry/rde/imports/XjcToDomainBaseConverterTest.java b/javatests/google/registry/rde/imports/XjcToDomainBaseConverterTest.java
deleted file mode 100644
index d1fad9dff..000000000
--- a/javatests/google/registry/rde/imports/XjcToDomainBaseConverterTest.java
+++ /dev/null
@@ -1,442 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.io.BaseEncoding.base16;
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.rde.imports.RdeImportTestUtils.checkTrid;
-import static google.registry.rde.imports.RdeImportUtils.createAutoRenewBillingEventForDomainImport;
-import static google.registry.rde.imports.RdeImportUtils.createAutoRenewPollMessageForDomainImport;
-import static google.registry.rde.imports.RdeImportUtils.createHistoryEntryForDomainImport;
-import static google.registry.testing.DatastoreHelper.createTld;
-import static google.registry.testing.DatastoreHelper.getHistoryEntries;
-import static google.registry.testing.DatastoreHelper.persistActiveContact;
-import static google.registry.testing.DatastoreHelper.persistActiveHost;
-import static google.registry.testing.DatastoreHelper.persistResource;
-import static google.registry.testing.JUnitBackports.assertThrows;
-import static google.registry.util.DateTimeUtils.END_OF_TIME;
-import static java.util.Arrays.asList;
-
-import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.io.ByteSource;
-import com.googlecode.objectify.Key;
-import google.registry.model.billing.BillingEvent;
-import google.registry.model.billing.BillingEvent.Flag;
-import google.registry.model.billing.BillingEvent.Reason;
-import google.registry.model.contact.ContactResource;
-import google.registry.model.domain.DesignatedContact;
-import google.registry.model.domain.DomainBase;
-import google.registry.model.domain.GracePeriod;
-import google.registry.model.domain.rgp.GracePeriodStatus;
-import google.registry.model.domain.secdns.DelegationSignerData;
-import google.registry.model.eppcommon.StatusValue;
-import google.registry.model.host.HostResource;
-import google.registry.model.poll.PollMessage;
-import google.registry.model.poll.PollMessage.Autorenew;
-import google.registry.model.reporting.HistoryEntry;
-import google.registry.model.transfer.TransferData;
-import google.registry.model.transfer.TransferStatus;
-import google.registry.testing.AppEngineRule;
-import google.registry.testing.DeterministicStringGenerator;
-import google.registry.util.StringGenerator;
-import google.registry.xjc.rdedomain.XjcRdeDomain;
-import google.registry.xjc.rdedomain.XjcRdeDomainElement;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import org.joda.time.DateTime;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Tests for {@link XjcToDomainBaseConverter} */
-@RunWith(JUnit4.class)
-public class XjcToDomainBaseConverterTest {
-
- //List of packages to initialize JAXBContext
- private static final String JAXB_CONTEXT_PACKAGES = Joiner.on(":").join(asList(
- "google.registry.xjc.contact",
- "google.registry.xjc.domain",
- "google.registry.xjc.host",
- "google.registry.xjc.mark",
- "google.registry.xjc.rde",
- "google.registry.xjc.rdecontact",
- "google.registry.xjc.rdedomain",
- "google.registry.xjc.rdeeppparams",
- "google.registry.xjc.rdeheader",
- "google.registry.xjc.rdeidn",
- "google.registry.xjc.rdenndn",
- "google.registry.xjc.rderegistrar",
- "google.registry.xjc.smd"));
-
- @Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
-
- private Unmarshaller unmarshaller;
-
- private final DeterministicStringGenerator stringGenerator =
- new DeterministicStringGenerator(StringGenerator.Alphabets.BASE_64);
-
- @Before
- public void before() throws Exception {
- createTld("example");
- unmarshaller = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES).createUnmarshaller();
- }
-
- @Test
- public void testConvertDomainBase() {
- final ContactResource jd1234 = persistActiveContact("jd1234");
- final ContactResource sh8013 = persistActiveContact("sh8013");
- ImmutableSet expectedContacts =
- ImmutableSet.of(
- DesignatedContact.create(DesignatedContact.Type.ADMIN, Key.create(sh8013)),
- DesignatedContact.create(DesignatedContact.Type.TECH, Key.create(sh8013)));
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- assertThat(domain.getFullyQualifiedDomainName()).isEqualTo("example1.example");
- assertThat(domain.getRepoId()).isEqualTo("Dexample1-TEST");
- // A DomainBase has status INACTIVE if there are no nameservers.
- assertThat(domain.getStatusValues()).isEqualTo(ImmutableSet.of(StatusValue.INACTIVE));
- assertThat(domain.getRegistrant().getName()).isEqualTo(jd1234.getRepoId());
- assertThat(domain.getContacts()).isEqualTo(expectedContacts);
- assertThat(domain.getCurrentSponsorClientId()).isEqualTo("RegistrarX");
- assertThat(domain.getCreationClientId()).isEqualTo("RegistrarX");
- assertThat(domain.getCreationTime()).isEqualTo(DateTime.parse("1999-04-03T22:00:00.0Z"));
- assertThat(domain.getRegistrationExpirationTime())
- .isEqualTo(DateTime.parse("2015-04-03T22:00:00.0Z"));
- assertThat(domain.getGracePeriods()).isEmpty();
- assertThat(domain.getLastEppUpdateClientId()).isNull();
- assertThat(domain.getLastEppUpdateTime()).isNull();
- assertThat(domain.getAutorenewBillingEvent()).isNotNull();
- assertThat(domain.getAutorenewPollMessage()).isNotNull();
- assertThat(domain.getAuthInfo()).isNotNull();
- assertThat(domain.getAuthInfo().getPw().getValue()).isEqualTo("0123456789abcdef");
- }
-
- /** Verifies that uppercase domain names are converted to lowercase */
- @Test
- public void testConvertDomainBaseUpperCase() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_ucase.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- assertThat(domain.getFullyQualifiedDomainName()).isEqualTo("example1.example");
- }
-
- @Test
- public void testConvertDomainBaseAddPeriod() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_addPeriod.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- assertThat(domain.getGracePeriods()).hasSize(1);
- GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
- assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.ADD);
- assertThat(gracePeriod.getClientId()).isEqualTo("RegistrarX");
- assertThat(gracePeriod.getExpirationTime()).isEqualTo(xjcDomain.getCrDate().plusDays(5));
- }
-
- @Test
- public void testConvertDomainBaseAutoRenewPeriod() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_autoRenewPeriod.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- assertThat(domain.getGracePeriods()).hasSize(1);
- GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
- assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.AUTO_RENEW);
- assertThat(gracePeriod.getClientId()).isEqualTo("RegistrarX");
- assertThat(gracePeriod.getExpirationTime()).isEqualTo(xjcDomain.getUpDate().plusDays(45));
- }
-
- @Test
- public void testConvertDomainBaseRedemptionPeriod() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_redemptionPeriod.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- assertThat(domain.getGracePeriods()).hasSize(1);
- GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
- assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.REDEMPTION);
- assertThat(gracePeriod.getClientId()).isEqualTo("RegistrarX");
- assertThat(gracePeriod.getExpirationTime()).isEqualTo(xjcDomain.getUpDate().plusDays(30));
- }
-
- @Test
- public void testConvertDomainBaseRenewPeriod() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_renewPeriod.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- assertThat(domain.getGracePeriods()).hasSize(1);
- GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
- assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.RENEW);
- assertThat(gracePeriod.getClientId()).isEqualTo("RegistrarX");
- assertThat(gracePeriod.getExpirationTime()).isEqualTo(xjcDomain.getUpDate().plusDays(5));
- }
-
- @Test
- public void testConvertDomainBasePendingDeletePeriod() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_pendingDeletePeriod.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- assertThat(domain.getGracePeriods()).hasSize(1);
- GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
- assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.PENDING_DELETE);
- assertThat(gracePeriod.getClientId()).isEqualTo("RegistrarX");
- assertThat(gracePeriod.getExpirationTime()).isEqualTo(xjcDomain.getUpDate().plusDays(5));
- }
-
- @Test
- public void testConvertDomainBasePendingRestorePeriodUnsupported() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_pendingRestorePeriod.xml");
- IllegalArgumentException thrown =
- assertThrows(IllegalArgumentException.class, () -> convertDomainInTransaction(xjcDomain));
- assertThat(thrown)
- .hasMessageThat()
- .contains("Unsupported grace period status: PENDING_RESTORE");
- }
-
- @Test
- public void testConvertDomainBaseTransferPeriod() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_transferPeriod.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- assertThat(domain.getGracePeriods()).hasSize(1);
- GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
- assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.TRANSFER);
- assertThat(gracePeriod.getClientId()).isEqualTo("RegistrarX");
- assertThat(gracePeriod.getExpirationTime()).isEqualTo(xjcDomain.getUpDate().plusDays(5));
- TransferData transferData = domain.getTransferData();
- assertThat(transferData).isNotEqualTo(TransferData.EMPTY);
- assertThat(transferData.getTransferStatus()).isEqualTo(TransferStatus.CLIENT_APPROVED);
- assertThat(transferData.getLosingClientId()).isEqualTo("RegistrarY");
- assertThat(transferData.getTransferRequestTime())
- .isEqualTo(DateTime.parse("2014-10-08T16:23:21.897803Z"));
- assertThat(transferData.getGainingClientId()).isEqualTo("RegistrarX");
- assertThat(transferData.getPendingTransferExpirationTime())
- .isEqualTo(DateTime.parse("2014-10-09T08:25:43.305554Z"));
- }
-
- @Test
- public void testConvertDomainBaseEppUpdateRegistrar() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_up_rr.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- assertThat(domain.getLastEppUpdateClientId()).isEqualTo("RegistrarX");
- }
-
- @Test
- public void testConvertDomainBaseWithHostObjs() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- HostResource host1 = persistActiveHost("ns1.example.net");
- HostResource host2 = persistActiveHost("ns2.example.net");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_host_objs.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- assertThat(domain.getNameservers()).containsExactly(Key.create(host1), Key.create(host2));
- }
-
- @Test
- public void testConvertDomainBaseWithHostAttrs() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- persistActiveHost("ns1.example.net");
- persistActiveHost("ns2.example.net");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_host_attrs.xml");
- IllegalArgumentException thrown =
- assertThrows(IllegalArgumentException.class, () -> convertDomainInTransaction(xjcDomain));
- assertThat(thrown).hasMessageThat().contains("Host attributes are not yet supported");
- }
-
- @Test
- public void testConvertDomainBaseHostNotFound() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- persistActiveHost("ns1.example.net");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_host_objs.xml");
- IllegalStateException thrown =
- assertThrows(IllegalStateException.class, () -> convertDomainInTransaction(xjcDomain));
- assertThat(thrown)
- .hasMessageThat()
- .contains("HostResource not found with name 'ns2.example.net'");
- }
-
- @Test
- public void testConvertDomainBaseRegistrantNotFound() {
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
- IllegalStateException thrown =
- assertThrows(IllegalStateException.class, () -> convertDomainInTransaction(xjcDomain));
- assertThat(thrown).hasMessageThat().contains("Registrant not found: 'jd1234'");
- }
-
- @Test
- public void testConvertDomainBaseRegistrantMissing() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_registrant_missing.xml");
- IllegalArgumentException thrown =
- assertThrows(IllegalArgumentException.class, () -> convertDomainInTransaction(xjcDomain));
- assertThat(thrown)
- .hasMessageThat()
- .contains("Registrant is missing for domain 'example1.example'");
- }
-
- @Test
- public void testConvertDomainBaseAdminNotFound() {
- persistActiveContact("jd1234");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
- IllegalStateException thrown =
- assertThrows(IllegalStateException.class, () -> convertDomainInTransaction(xjcDomain));
- assertThat(thrown).hasMessageThat().contains("Contact not found: 'sh8013'");
- }
-
- @Test
- public void testConvertDomainBaseSecDnsData() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_secdns.xml");
- DomainBase domain = convertDomainInTransaction(xjcDomain);
- byte[] digest =
- base16().decode("5FA1FA1C2F70AA483FE178B765D82B272072B4E4167902C5B7F97D46C8899F44");
- assertThat(domain.getDsData()).containsExactly(DelegationSignerData.create(4609, 8, 2, digest));
- }
-
- @Test
- public void testConvertDomainBaseHistoryEntry() throws Exception {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
- // First import in a transaction, then verify in another transaction.
- // Ancestor queries don't work within the same transaction.
- DomainBase domain = persistResource(convertDomainInTransaction(xjcDomain));
- List historyEntries = getHistoryEntries(domain);
- assertThat(historyEntries).hasSize(1);
- HistoryEntry entry = historyEntries.get(0);
- assertThat(entry.getType()).isEqualTo(HistoryEntry.Type.RDE_IMPORT);
- assertThat(entry.getClientId()).isEqualTo("RegistrarX");
- assertThat(entry.getBySuperuser()).isTrue();
- assertThat(entry.getReason()).isEqualTo("RDE Import");
- assertThat(entry.getRequestedByRegistrar()).isFalse();
- checkTrid(entry.getTrid());
- // check xml against original domain xml
- try (InputStream ins = new ByteArrayInputStream(entry.getXmlBytes())) {
- XjcRdeDomain unmarshalledXml = ((XjcRdeDomainElement) unmarshaller.unmarshal(ins)).getValue();
- assertThat(unmarshalledXml.getName()).isEqualTo(xjcDomain.getName());
- assertThat(unmarshalledXml.getRoid()).isEqualTo(xjcDomain.getRoid());
- }
- }
-
- @Test
- public void testConvertDomainBaseAutoRenewBillingEvent() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
- // First import in a transaction, then verify in another transaction.
- // Ancestor queries don't work within the same transaction.
- DomainBase domain = persistResource(convertDomainInTransaction(xjcDomain));
- BillingEvent.Recurring autoRenewEvent =
- ofy().load().key(domain.getAutorenewBillingEvent()).now();
- assertThat(autoRenewEvent.getReason()).isEqualTo(Reason.RENEW);
- assertThat(autoRenewEvent.getFlags()).isEqualTo(ImmutableSet.of(Flag.AUTO_RENEW));
- assertThat(autoRenewEvent.getTargetId()).isEqualTo(xjcDomain.getRoid());
- assertThat(autoRenewEvent.getClientId()).isEqualTo("RegistrarX");
- assertThat(autoRenewEvent.getEventTime()).isEqualTo(xjcDomain.getExDate());
- assertThat(autoRenewEvent.getRecurrenceEndTime()).isEqualTo(END_OF_TIME);
- }
-
- @Test
- public void testConvertDomainBaseAutoRenewPollMessage() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
- // First import in a transaction, then verify in another transaction.
- // Ancestor queries don't work within the same transaction.
- DomainBase domain = persistResource(convertDomainInTransaction(xjcDomain));
- Autorenew pollMessage = ofy().load().key(domain.getAutorenewPollMessage()).now();
- assertThat(pollMessage).isInstanceOf(PollMessage.Autorenew.class);
- assertThat(pollMessage.getTargetId()).isEqualTo(xjcDomain.getRoid());
- assertThat(pollMessage.getClientId()).isEqualTo("RegistrarX");
- assertThat(pollMessage.getEventTime()).isEqualTo(xjcDomain.getExDate());
- assertThat(pollMessage.getMsg()).isEqualTo("Domain was auto-renewed.");
- }
-
- @Test
- public void testConvertDomainBasePendingTransfer() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_pending_transfer.xml");
- DomainBase domain = persistResource(convertDomainInTransaction(xjcDomain));
- assertThat(domain.getTransferData()).isNotNull();
- assertThat(domain.getTransferData().getTransferStatus()).isEqualTo(TransferStatus.PENDING);
- assertThat(domain.getTransferData().getGainingClientId()).isEqualTo("RegistrarY");
- assertThat(domain.getTransferData().getTransferRequestTime())
- .isEqualTo(DateTime.parse("2015-01-03T22:00:00.0Z"));
- assertThat(domain.getTransferData().getLosingClientId()).isEqualTo("RegistrarX");
- assertThat(domain.getTransferData().getPendingTransferExpirationTime())
- .isEqualTo(DateTime.parse("2015-01-08T22:00:00.0Z"));
- }
-
- @Test
- public void testConvertDomainBasePendingTransferRegistrationCap() {
- persistActiveContact("jd1234");
- persistActiveContact("sh8013");
- final XjcRdeDomain xjcDomain =
- loadDomainFromRdeXml("domain_fragment_pending_transfer_registration_cap.xml");
- DomainBase domain = persistResource(convertDomainInTransaction(xjcDomain));
- assertThat(domain.getTransferData()).isNotNull();
- // This test will be imcomplete until b/36405140 is fixed to store exDate on TransferData, since
- // without that there's no way to actually test the capping of the projected registration here.
- }
-
- private DomainBase convertDomainInTransaction(final XjcRdeDomain xjcDomain) {
- return ofy()
- .transact(
- () -> {
- HistoryEntry historyEntry = createHistoryEntryForDomainImport(xjcDomain);
- BillingEvent.Recurring autorenewBillingEvent =
- createAutoRenewBillingEventForDomainImport(xjcDomain, historyEntry);
- PollMessage.Autorenew autorenewPollMessage =
- createAutoRenewPollMessageForDomainImport(xjcDomain, historyEntry);
- ofy().save().entities(historyEntry, autorenewBillingEvent, autorenewPollMessage);
- return XjcToDomainBaseConverter.convertDomain(
- xjcDomain, autorenewBillingEvent, autorenewPollMessage, stringGenerator);
- });
- }
-
- private XjcRdeDomain loadDomainFromRdeXml(String filename) {
- try {
- ByteSource source = RdeImportsTestData.loadBytes(filename);
- try (InputStream ins = source.openStream()) {
- return ((XjcRdeDomainElement) unmarshaller.unmarshal(ins)).getValue();
- }
- } catch (JAXBException | IOException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/javatests/google/registry/rde/imports/XjcToHostResourceConverterTest.java b/javatests/google/registry/rde/imports/XjcToHostResourceConverterTest.java
deleted file mode 100644
index b99a0adc2..000000000
--- a/javatests/google/registry/rde/imports/XjcToHostResourceConverterTest.java
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2017 The Nomulus Authors. All Rights Reserved.
-//
-// 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 google.registry.rde.imports;
-
-import static com.google.common.truth.Truth.assertThat;
-import static google.registry.model.ofy.ObjectifyService.ofy;
-import static google.registry.rde.imports.RdeImportTestUtils.checkTrid;
-import static google.registry.testing.DatastoreHelper.createTld;
-import static google.registry.testing.DatastoreHelper.getHistoryEntries;
-
-import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableList;
-import com.google.common.io.ByteSource;
-import com.google.common.net.InetAddresses;
-import google.registry.model.eppcommon.StatusValue;
-import google.registry.model.host.HostResource;
-import google.registry.model.reporting.HistoryEntry;
-import google.registry.testing.AppEngineRule;
-import google.registry.testing.ShardableTestCase;
-import google.registry.xjc.rdehost.XjcRdeHost;
-import google.registry.xjc.rdehost.XjcRdeHostElement;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.List;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
-import org.joda.time.DateTime;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/**
- * Unit tests for {@link XjcToHostResourceConverter}
- */
-@RunWith(JUnit4.class)
-public class XjcToHostResourceConverterTest extends ShardableTestCase {
-
- private static final ByteSource HOST_XML = RdeImportsTestData.loadBytes("host_fragment.xml");
- private static final ByteSource HOST_XML_UCASE =
- RdeImportsTestData.loadBytes("host_fragment_ucase.xml");
-
- // List of packages to initialize JAXBContext
- private static final String JAXB_CONTEXT_PACKAGES = Joiner.on(":")
- .join(ImmutableList.of(
- "google.registry.xjc.contact",
- "google.registry.xjc.domain",
- "google.registry.xjc.host",
- "google.registry.xjc.mark",
- "google.registry.xjc.rde",
- "google.registry.xjc.rdecontact",
- "google.registry.xjc.rdedomain",
- "google.registry.xjc.rdeeppparams",
- "google.registry.xjc.rdeheader",
- "google.registry.xjc.rdeidn",
- "google.registry.xjc.rdenndn",
- "google.registry.xjc.rderegistrar",
- "google.registry.xjc.smd"));
-
- @Rule
- public final AppEngineRule appEngine = AppEngineRule.builder()
- .withDatastore()
- .build();
-
- private Unmarshaller unmarshaller;
-
- @Before
- public void before() throws Exception {
- createTld("example");
- unmarshaller = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES).createUnmarshaller();
- }
-
- @Test
- public void testConvertHostResource() throws Exception {
- XjcRdeHost xjcHost = loadHostFromRdeXml();
- HostResource host = convertHostInTransaction(xjcHost);
- assertThat(host.getFullyQualifiedHostName()).isEqualTo("ns1.example1.test");
- assertThat(host.getRepoId()).isEqualTo("Hns1_example1_test-TEST");
- // The imported XML also had LINKED status, but that should have been dropped on import.
- assertThat(host.getStatusValues()).containsExactly(StatusValue.OK);
- assertThat(host.getInetAddresses())
- .containsExactly(
- InetAddresses.forString("192.0.2.2"),
- InetAddresses.forString("192.0.2.29"),
- InetAddresses.forString("1080:0:0:0:8:800:200C:417A"));
- assertThat(host.getPersistedCurrentSponsorClientId()).isEqualTo("RegistrarX");
- assertThat(host.getCreationClientId()).isEqualTo("RegistrarX");
- assertThat(host.getCreationTime()).isEqualTo(DateTime.parse("1999-05-08T12:10:00.0Z"));
- assertThat(host.getLastEppUpdateClientId()).isEqualTo("RegistrarX");
- assertThat(host.getLastEppUpdateTime()).isEqualTo(DateTime.parse("2009-10-03T09:34:00.0Z"));
- assertThat(host.getLastTransferTime()).isEqualTo(DateTime.parse("2008-10-03T09:34:00.0Z"));
- }
-
- /** Verifies that uppercase host names are converted to lowercase */
- @Test
- public void testConvertHostResourceUpperCase() throws Exception {
- XjcRdeHost xjcHost = loadHostFromRdeXml(HOST_XML_UCASE);
- HostResource host = convertHostInTransaction(xjcHost);
- assertThat(host.getFullyQualifiedHostName()).isEqualTo("ns1.example1.test");
- }
-
- @Test
- public void testConvertHostResourceHistoryEntry() throws Exception {
- XjcRdeHost xjcHost = loadHostFromRdeXml();
- HostResource host = convertHostInTransaction(xjcHost);
- List historyEntries = getHistoryEntries(host);
- assertThat(historyEntries).hasSize(1);
- HistoryEntry entry = historyEntries.get(0);
- assertThat(entry.getType()).isEqualTo(HistoryEntry.Type.RDE_IMPORT);
- assertThat(entry.getClientId()).isEqualTo("RegistrarX");
- assertThat(entry.getBySuperuser()).isTrue();
- assertThat(entry.getReason()).isEqualTo("RDE Import");
- assertThat(entry.getRequestedByRegistrar()).isFalse();
- checkTrid(entry.getTrid());
- // check xml against original domain xml
- try (InputStream ins = new ByteArrayInputStream(entry.getXmlBytes())) {
- XjcRdeHost unmarshalledXml = ((XjcRdeHostElement) unmarshaller.unmarshal(ins)).getValue();
- assertThat(unmarshalledXml.getName()).isEqualTo(xjcHost.getName());
- assertThat(unmarshalledXml.getRoid()).isEqualTo(xjcHost.getRoid());
- }
- }
-
- private static HostResource convertHostInTransaction(final XjcRdeHost xjcHost) {
- return ofy().transact(() -> XjcToHostResourceConverter.convert(xjcHost));
- }
-
- private XjcRdeHost loadHostFromRdeXml() throws Exception {
- return loadHostFromRdeXml(HOST_XML);
- }
-
- private XjcRdeHost loadHostFromRdeXml(ByteSource source) throws Exception {
- try (InputStream ins = source.openStream()) {
- return ((XjcRdeHostElement) unmarshaller.unmarshal(ins)).getValue();
- }
- }
-}
diff --git a/javatests/google/registry/rde/imports/testdata/contact_fragment.xml b/javatests/google/registry/rde/imports/testdata/contact_fragment.xml
deleted file mode 100644
index 3f9549506..000000000
--- a/javatests/google/registry/rde/imports/testdata/contact_fragment.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
- love-id
- 2-ROID
-
-
-
-
- Dipsy Doodle
- Charleston Road Registry Incorporated
-
- 123 Charleston Road
- Suite 123
- Mountain View
- CA
- 31337
- US
-
-
- +1.2126660000
- +1.2126660001
- justine@crr.com
- TheRegistrar
- NewRegistrar
- 1900-01-01T00:00:00Z
- TheRegistrar
- 1930-04-20T00:00:00Z
- 1925-04-20T00:00:00Z
-
- serverApproved
- TheRegistrar
- 1925-04-19T00:00:00Z
- NewRegistrar
- 1925-04-21T00:00:00Z
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_0_contact_header.xml b/javatests/google/registry/rde/imports/testdata/deposit_0_contact_header.xml
deleted file mode 100644
index 7951dee38..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_0_contact_header.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 0
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_0_host_header.xml b/javatests/google/registry/rde/imports/testdata/deposit_0_host_header.xml
deleted file mode 100644
index adb8768c1..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_0_host_header.xml
+++ /dev/null
@@ -1,242 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 0
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
- http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_10000_contact_header.xml b/javatests/google/registry/rde/imports/testdata/deposit_10000_contact_header.xml
deleted file mode 100644
index bfa76283c..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_10000_contact_header.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 10000
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_10000_host_header.xml b/javatests/google/registry/rde/imports/testdata/deposit_10000_host_header.xml
deleted file mode 100644
index 4e39e5b95..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_10000_host_header.xml
+++ /dev/null
@@ -1,242 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 10000
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
- http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_1000_contact_header.xml b/javatests/google/registry/rde/imports/testdata/deposit_1000_contact_header.xml
deleted file mode 100644
index f8dd81604..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_1000_contact_header.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1000
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_1000_host_header.xml b/javatests/google/registry/rde/imports/testdata/deposit_1000_host_header.xml
deleted file mode 100644
index d499788b5..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_1000_host_header.xml
+++ /dev/null
@@ -1,242 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1000
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
- http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_10_contact.xml b/javatests/google/registry/rde/imports/testdata/deposit_10_contact.xml
deleted file mode 100644
index 3f16cdcb1..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_10_contact.xml
+++ /dev/null
@@ -1,592 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact2
- contact2-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact3
- contact3-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact4
- contact4-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact5
- contact5-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact6
- contact6-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact7
- contact7-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact8
- contact8-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact9
- contact9-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact10
- contact10-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_10_domain.xml b/javatests/google/registry/rde/imports/testdata/deposit_10_domain.xml
deleted file mode 100644
index 9c1173efd..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_10_domain.xml
+++ /dev/null
@@ -1,369 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example3.test
- Dexample3-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example4.test
- Dexample4-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example5.test
- Dexample5-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example6.test
- Dexample6-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example7.test
- Dexample7-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example8.test
- Dexample8-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example9.test
- Dexample9-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example10.test
- Dexample10-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_10_host.xml b/javatests/google/registry/rde/imports/testdata/deposit_10_host.xml
deleted file mode 100644
index e42b72404..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_10_host.xml
+++ /dev/null
@@ -1,395 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 3
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example2.test
- Hns1_example2_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example3.test
- Hns1_example3_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example4.test
- Hns1_example4_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example5.test
- Hns1_example5_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example6.test
- Hns1_example6_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example7.test
- Hns1_example7_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example8.test
- Hns1_example8_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example9.test
- Hns1_example9_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example10.test
- Hns1_example10_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
- http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_199_contact_header.xml b/javatests/google/registry/rde/imports/testdata/deposit_199_contact_header.xml
deleted file mode 100644
index 266450a5c..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_199_contact_header.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 199
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_199_host_header.xml b/javatests/google/registry/rde/imports/testdata/deposit_199_host_header.xml
deleted file mode 100644
index eb9d2156b..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_199_host_header.xml
+++ /dev/null
@@ -1,242 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 199
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
- http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_1_contact.xml b/javatests/google/registry/rde/imports/testdata/deposit_1_contact.xml
deleted file mode 100644
index 412004326..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_1_contact.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_1_domain.xml b/javatests/google/registry/rde/imports/testdata/deposit_1_domain.xml
deleted file mode 100644
index 4a3ccaa34..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_1_domain.xml
+++ /dev/null
@@ -1,240 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_1_domain_pending_transfer.xml b/javatests/google/registry/rde/imports/testdata/deposit_1_domain_pending_transfer.xml
deleted file mode 100644
index 66a898013..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_1_domain_pending_transfer.xml
+++ /dev/null
@@ -1,249 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
- RegistrarY
- 2015-01-03T22:00:00.0Z
-
- pending
- RegistrarY
- 2015-01-03T22:00:00.0Z
- RegistrarX
- 2015-01-08T22:00:00.0Z
-
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_1_domain_pending_transfer_registration_cap.xml b/javatests/google/registry/rde/imports/testdata/deposit_1_domain_pending_transfer_registration_cap.xml
deleted file mode 100644
index 6034483e0..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_1_domain_pending_transfer_registration_cap.xml
+++ /dev/null
@@ -1,250 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2024-04-03T22:00:00.0Z
- RegistrarY
- 2015-01-29T22:00:00.0Z
-
- pending
- RegistrarY
- 2015-01-29T22:00:00.0Z
- RegistrarX
- 2015-02-03T22:00:00.0Z
- 2025-02-03T22:00:00.0Z
-
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_1_host.xml b/javatests/google/registry/rde/imports/testdata/deposit_1_host.xml
deleted file mode 100644
index dba51527a..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_1_host.xml
+++ /dev/null
@@ -1,242 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
- http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_200_contact_header.xml b/javatests/google/registry/rde/imports/testdata/deposit_200_contact_header.xml
deleted file mode 100644
index 253498e6c..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_200_contact_header.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 200
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_200_host_header.xml b/javatests/google/registry/rde/imports/testdata/deposit_200_host_header.xml
deleted file mode 100644
index 289662150..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_200_host_header.xml
+++ /dev/null
@@ -1,242 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 200
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
- http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_3_contact.xml b/javatests/google/registry/rde/imports/testdata/deposit_3_contact.xml
deleted file mode 100644
index be311d374..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_3_contact.xml
+++ /dev/null
@@ -1,333 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact2
- contact2-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact3
- contact3-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_3_domain.xml b/javatests/google/registry/rde/imports/testdata/deposit_3_domain.xml
deleted file mode 100644
index dd75e9793..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_3_domain.xml
+++ /dev/null
@@ -1,270 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example3.test
- Dexample3-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_3_host.xml b/javatests/google/registry/rde/imports/testdata/deposit_3_host.xml
deleted file mode 100644
index 4cf7159e4..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_3_host.xml
+++ /dev/null
@@ -1,276 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 3
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example2.test
- Hns1_example2_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example3.test
- Hns1_example3_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
- http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_4_contact.xml b/javatests/google/registry/rde/imports/testdata/deposit_4_contact.xml
deleted file mode 100644
index ddac4dca7..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_4_contact.xml
+++ /dev/null
@@ -1,370 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact2
- contact2-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact3
- contact3-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
- contact4
- contact4-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_4_domain.xml b/javatests/google/registry/rde/imports/testdata/deposit_4_domain.xml
deleted file mode 100644
index 1b0924154..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_4_domain.xml
+++ /dev/null
@@ -1,285 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example3.test
- Dexample3-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example4.test
- Dexample4-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_4_host.xml b/javatests/google/registry/rde/imports/testdata/deposit_4_host.xml
deleted file mode 100644
index 4b49d10b7..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_4_host.xml
+++ /dev/null
@@ -1,293 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 3
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example2.test
- Hns1_example2_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example3.test
- Hns1_example3_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example4.test
- Hns1_example4_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- contact1
- contact1-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
- http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_full.xml b/javatests/google/registry/rde/imports/testdata/deposit_full.xml
deleted file mode 100644
index 70f607571..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_full.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_full_badregistrar.xml b/javatests/google/registry/rde/imports/testdata/deposit_full_badregistrar.xml
deleted file mode 100644
index 17d6f183d..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_full_badregistrar.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarY
- Registrar Y
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_full_badtld.xml b/javatests/google/registry/rde/imports/testdata/deposit_full_badtld.xml
deleted file mode 100644
index e2eab56ae..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_full_badtld.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- badtld
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_full_getld.xml b/javatests/google/registry/rde/imports/testdata/deposit_full_getld.xml
deleted file mode 100644
index 7f7f5138b..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_full_getld.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- getld
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/deposit_full_parser.xml b/javatests/google/registry/rde/imports/testdata/deposit_full_parser.xml
deleted file mode 100644
index 70f607571..000000000
--- a/javatests/google/registry/rde/imports/testdata/deposit_full_parser.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
- 2010-10-17T00:00:00Z
-
- 1.0
- urn:ietf:params:xml:ns:rdeHeader-1.0
- urn:ietf:params:xml:ns:rdeContact-1.0
- urn:ietf:params:xml:ns:rdeHost-1.0
- urn:ietf:params:xml:ns:rdeDomain-1.0
- urn:ietf:params:xml:ns:rdeRegistrar-1.0
- urn:ietf:params:xml:ns:rdeIDN-1.0
- urn:ietf:params:xml:ns:rdeNNDN-1.0
- urn:ietf:params:xml:ns:rdeEppParams-1.0
-
-
-
-
-
-
- test
- 2
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
- 1
-
-
-
-
-
- example1.test
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.com
- ns1.example1.test
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- example2.test
- Dexample2-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
-
-
- ns1.example.com
- Hns1_example_com-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
-
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
-
-
-
-
- sh8013
- Csh8013-TEST
-
-
-
- John Doe
- Example Inc.
-
- 123 Example Dr.
- Suite 100
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- RegistrarX
- RegistrarX
-
- 2009-09-13T08:01:00.0Z
- RegistrarX
-
- 2009-11-26T09:10:00.0Z
- 2009-12-03T09:05:00.0Z
-
-
-
-
-
-
-
-
- RegistrarX
- Registrar X
- 123
- ok
-
-
- 123 Example Dr.
-
- Suite 100
-
- Dulles
- VA
- 20166-6503
- US
-
-
- +1.7035555555
-
- +1.7035555556
-
- jdoe@example.test
-
- http://www.example.test
-
-
- whois.example.test
-
- http://whois.example.test
-
-
- 2005-04-23T11:49:00.0Z
- 2009-02-17T17:51:00.0Z
-
-
-
-
-
-http://www.iana.org/domains/idn-tables/tables/br_pt-br_1.0.html
-
-
- http://registro.br/dominio/regras.html
-
-
-
-
-
- xn--exampl-gva.test
- pt-BR
- example1.test
- withheld
- 2005-04-23T11:49:00.0Z
-
-
-
-
- 1.0
- en
-
- urn:ietf:params:xml:ns:domain-1.0
-
-
- urn:ietf:params:xml:ns:contact-1.0
-
-
- urn:ietf:params:xml:ns:host-1.0
-
-
- urn:ietf:params:xml:ns:rgp-1.0
-
- urn:ietf:params:xml:ns:secDNS-1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment.xml
deleted file mode 100644
index 39940b8a3..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_addPeriod.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_addPeriod.xml
deleted file mode 100644
index f920a832e..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_addPeriod.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_autoRenewPeriod.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_autoRenewPeriod.xml
deleted file mode 100644
index ee7244db1..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_autoRenewPeriod.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
- 2014-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_host_attrs.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_host_attrs.xml
deleted file mode 100644
index 7c6005ccd..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_host_attrs.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
-
- ns1.example.net
- 192.0.2.2
- 1080:0:0:0:8:800:200C:417A
-
-
- ns2.example.net
-
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_host_objs.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_host_objs.xml
deleted file mode 100644
index 74ad00dea..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_host_objs.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
-
- ns1.example.net
- NS2.EXAMPLE.NET
-
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_pendingDeletePeriod.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_pendingDeletePeriod.xml
deleted file mode 100644
index cbd4cf742..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_pendingDeletePeriod.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
- 2014-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_pendingRestorePeriod.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_pendingRestorePeriod.xml
deleted file mode 100644
index 1834ff004..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_pendingRestorePeriod.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
- 2014-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_pending_transfer.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_pending_transfer.xml
deleted file mode 100644
index c19c3ac94..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_pending_transfer.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
- RegistrarY
- 2015-01-03T22:00:00.0Z
-
- pending
- RegistrarY
- 2015-01-03T22:00:00.0Z
- RegistrarX
- 2015-01-08T22:00:00.0Z
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_pending_transfer_registration_cap.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_pending_transfer_registration_cap.xml
deleted file mode 100644
index 071bd41fe..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_pending_transfer_registration_cap.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
- RegistrarY
- 2015-01-03T22:00:00.0Z
-
- pending
- RegistrarY
- 2015-01-03T22:00:00.0Z
- RegistrarX
- 2015-01-08T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_redemptionPeriod.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_redemptionPeriod.xml
deleted file mode 100644
index 11c34817f..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_redemptionPeriod.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
- 2014-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_registrant_missing.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_registrant_missing.xml
deleted file mode 100644
index b3c778dd3..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_registrant_missing.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_renewPeriod.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_renewPeriod.xml
deleted file mode 100644
index 2ca5714e3..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_renewPeriod.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
- 2014-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_secdns.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_secdns.xml
deleted file mode 100644
index db7200412..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_secdns.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
-
- 4609
- 8
- 2
- 5FA1FA1C2F70AA483FE178B765D82B272072B4E4167902C5B7F97D46C8899F44
-
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_transferPeriod.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_transferPeriod.xml
deleted file mode 100644
index 314878db3..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_transferPeriod.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
- 2014-04-03T22:00:00.0Z
-
- clientApproved
- RegistrarX
- 2014-10-08T16:23:21.897803Z
- RegistrarY
- 2014-10-09T08:25:43.305554Z
- 2015-04-03T22:00:00.0Z
-
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_ucase.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_ucase.xml
deleted file mode 100644
index 1cb1f979c..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_ucase.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
- EXAMPLE1.EXAMPLE
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/domain_fragment_up_rr.xml b/javatests/google/registry/rde/imports/testdata/domain_fragment_up_rr.xml
deleted file mode 100644
index dac24751c..000000000
--- a/javatests/google/registry/rde/imports/testdata/domain_fragment_up_rr.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
- example1.example
- Dexample1-TEST
-
- jd1234
- sh8013
- sh8013
- RegistrarX
- RegistrarX
- RegistrarX
- 1999-04-03T22:00:00.0Z
- 2015-04-03T22:00:00.0Z
- 2014-04-03T22:00:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/host_fragment.xml b/javatests/google/registry/rde/imports/testdata/host_fragment.xml
deleted file mode 100644
index 0a9856a7d..000000000
--- a/javatests/google/registry/rde/imports/testdata/host_fragment.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
- ns1.example1.test
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
- 2008-10-03T09:34:00.0Z
-
diff --git a/javatests/google/registry/rde/imports/testdata/host_fragment_ucase.xml b/javatests/google/registry/rde/imports/testdata/host_fragment_ucase.xml
deleted file mode 100644
index 6d09021a9..000000000
--- a/javatests/google/registry/rde/imports/testdata/host_fragment_ucase.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
- NS1.EXAMPLE1.TEST
- Hns1_example1_test-TEST
-
-
- 192.0.2.2
- 192.0.2.29
- 1080:0:0:0:8:800:200C:417A
- RegistrarX
- RegistrarX
- 1999-05-08T12:10:00.0Z
- RegistrarX
- 2009-10-03T09:34:00.0Z
- 2008-10-03T09:34:00.0Z
-