mv com/google/domain/registry google/registry

This change renames directories in preparation for the great package
rename. The repository is now in a broken state because the code
itself hasn't been updated. However this should ensure that git
correctly preserves history for each file.
This commit is contained in:
Justine Tunney 2016-05-13 18:55:08 -04:00
parent a41677aea1
commit 5012893c1d
2396 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,185 @@
// Copyright 2016 The Domain Registry 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 com.google.domain.registry.model.domain;
import static com.google.common.truth.Truth.assertThat;
import static com.google.domain.registry.model.EppResourceUtils.loadByUniqueId;
import static com.google.domain.registry.testing.DatastoreHelper.cloneAndSetAutoTimestamps;
import static com.google.domain.registry.testing.DatastoreHelper.createTld;
import static com.google.domain.registry.testing.DatastoreHelper.newDomainApplication;
import static com.google.domain.registry.testing.DatastoreHelper.persistActiveContact;
import static com.google.domain.registry.testing.DatastoreHelper.persistActiveHost;
import static com.google.domain.registry.testing.DatastoreHelper.persistResource;
import static com.google.domain.registry.util.DateTimeUtils.START_OF_TIME;
import static org.joda.money.CurrencyUnit.USD;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.domain.registry.model.EntityTestCase;
import com.google.domain.registry.model.billing.BillingEvent;
import com.google.domain.registry.model.domain.launch.ApplicationStatus;
import com.google.domain.registry.model.domain.launch.LaunchNotice;
import com.google.domain.registry.model.domain.launch.LaunchPhase;
import com.google.domain.registry.model.domain.secdns.DelegationSignerData;
import com.google.domain.registry.model.eppcommon.AuthInfo.PasswordAuth;
import com.google.domain.registry.model.eppcommon.StatusValue;
import com.google.domain.registry.model.eppcommon.Trid;
import com.google.domain.registry.model.host.HostResource;
import com.google.domain.registry.model.smd.EncodedSignedMark;
import com.google.domain.registry.model.transfer.TransferData;
import com.google.domain.registry.model.transfer.TransferData.TransferServerApproveEntity;
import com.google.domain.registry.model.transfer.TransferStatus;
import com.google.domain.registry.testing.ExceptionRule;
import com.googlecode.objectify.Key;
import org.joda.money.Money;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
/** Unit tests for {@link DomainApplication}. */
public class DomainApplicationTest extends EntityTestCase {
@Rule
public final ExceptionRule thrown = new ExceptionRule();
DomainApplication domainApplication;
@Before
public void setUp() throws Exception {
createTld("com");
// Set up a new persisted domain entity.
domainApplication = cloneAndSetAutoTimestamps(
new DomainApplication.Builder()
.setFullyQualifiedDomainName("example.com")
.setRepoId("1-COM")
.setCreationClientId("a registrar")
.setLastEppUpdateTime(clock.nowUtc())
.setLastEppUpdateClientId("another registrar")
.setLastTransferTime(clock.nowUtc())
.setStatusValues(ImmutableSet.of(
StatusValue.CLIENT_DELETE_PROHIBITED,
StatusValue.SERVER_DELETE_PROHIBITED,
StatusValue.SERVER_TRANSFER_PROHIBITED,
StatusValue.SERVER_UPDATE_PROHIBITED,
StatusValue.SERVER_RENEW_PROHIBITED,
StatusValue.SERVER_HOLD))
.setRegistrant(ReferenceUnion.create(persistActiveContact("contact_id1")))
.setContacts(ImmutableSet.of(DesignatedContact.create(
DesignatedContact.Type.ADMIN,
ReferenceUnion.create(persistActiveContact("contact_id2")))))
.setNameservers(
ImmutableSet.of(ReferenceUnion.create(persistActiveHost("ns1.example.com"))))
.setCurrentSponsorClientId("a third registrar")
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password")))
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
.setLaunchNotice(
LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME))
.setTransferData(
new TransferData.Builder()
.setExtendedRegistrationYears(0)
.setGainingClientId("gaining")
.setLosingClientId("losing")
.setPendingTransferExpirationTime(clock.nowUtc())
.setServerApproveEntities(
ImmutableSet.<Key<? extends TransferServerApproveEntity>>of(
Key.create(BillingEvent.OneTime.class, 1)))
.setTransferRequestTime(clock.nowUtc())
.setTransferStatus(TransferStatus.SERVER_APPROVED)
.setTransferRequestTrid(Trid.create("client trid"))
.build())
.setCreationTrid(Trid.create("client creation trid"))
.setPhase(LaunchPhase.LANDRUSH)
.setEncodedSignedMarks(ImmutableList.of(EncodedSignedMark.create("base64", "abcdefg=")))
.setApplicationStatus(ApplicationStatus.ALLOCATED)
.setAuctionPrice(Money.of(USD, 11))
.build());
persistResource(domainApplication);
}
@Test
public void testPersistence() throws Exception {
assertThat(
loadByUniqueId(
DomainApplication.class, domainApplication.getForeignKey(), clock.nowUtc()))
.isEqualTo(domainApplication);
}
@Test
public void testIndexing() throws Exception {
verifyIndexing(
domainApplication,
"allContacts.contactId.linked",
"fullyQualifiedDomainName",
"nameservers.linked",
"deletionTime",
"currentSponsorClientId",
"tld");
}
private DomainApplication.Builder emptyBuilder() {
return newDomainApplication("example.com").asBuilder();
}
@Test
public void testEmptyStringsBecomeNull() {
assertThat(emptyBuilder().setCurrentSponsorClientId(null).build()
.getCurrentSponsorClientId()).isNull();
assertThat(emptyBuilder().setCurrentSponsorClientId("").build()
.getCurrentSponsorClientId()).isNull();
assertThat(emptyBuilder().setCurrentSponsorClientId(" ").build()
.getCurrentSponsorClientId()).isNotNull();
}
@Test
public void testEmptySetsAndArraysBecomeNull() {
assertThat(emptyBuilder().setNameservers(null).build().nameservers).isNull();
assertThat(emptyBuilder()
.setNameservers(ImmutableSet.<ReferenceUnion<HostResource>>of())
.build()
.nameservers)
.isNull();
assertThat(emptyBuilder()
.setNameservers(ImmutableSet.of(ReferenceUnion.<HostResource>create("foo")))
.build()
.nameservers)
.isNotNull();
// This behavior should also hold true for ImmutableObjects nested in collections.
assertThat(emptyBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, null)))
.build()
.getDsData().asList().get(0).getDigest())
.isNull();
assertThat(emptyBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[]{})))
.build()
.getDsData().asList().get(0).getDigest())
.isNull();
assertThat(emptyBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[]{1})))
.build()
.getDsData().asList().get(0).getDigest())
.isNotNull();
}
@Test
public void testEmptyTransferDataBecomesNull() throws Exception {
DomainApplication withNull = emptyBuilder().setTransferData(null).build();
DomainApplication withEmpty = withNull.asBuilder().setTransferData(TransferData.EMPTY).build();
assertThat(withNull).isEqualTo(withEmpty);
assertThat(withEmpty.hasTransferData()).isFalse();
}
}

View file

@ -0,0 +1,162 @@
// Copyright 2016 The Domain Registry 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 com.google.domain.registry.model.domain;
import com.google.domain.registry.model.ResourceCommandTestCase;
import org.junit.Test;
/** Test xml roundtripping of commands. */
public class DomainCommandTest extends ResourceCommandTestCase {
@Test
public void testCreate() throws Exception {
doXmlRoundtripTest("domain_create.xml");
}
@Test
public void testCreate_sunriseSignedMark() throws Exception {
doXmlRoundtripTest("domain_create_sunrise_signed_mark.xml");
}
@Test
public void testCreate_sunriseCode() throws Exception {
doXmlRoundtripTest("domain_create_sunrise_code.xml");
}
@Test
public void testCreate_sunriseMark() throws Exception {
doXmlRoundtripTest("domain_create_sunrise_mark.xml");
}
@Test
public void testCreate_sunriseCodeWithMark() throws Exception {
doXmlRoundtripTest("domain_create_sunrise_code_with_mark.xml");
}
@Test
public void testCreate_sunriseEncodedSignedMark() throws Exception {
doXmlRoundtripTest("domain_create_sunrise_encoded_signed_mark.xml");
}
@Test
public void testCreate_landrush() throws Exception {
doXmlRoundtripTest("domain_create_landrush.xml");
}
@Test
public void testCreate_fee() throws Exception {
doXmlRoundtripTest("domain_create_fee.xml");
}
@Test
public void testDelete() throws Exception {
doXmlRoundtripTest("domain_delete.xml");
}
@Test
public void testUpdate() throws Exception {
doXmlRoundtripTest("domain_update.xml");
}
@Test
public void testUpdate_fee() throws Exception {
doXmlRoundtripTest("domain_update_fee.xml");
}
@Test
public void testInfo() throws Exception {
doXmlRoundtripTest("domain_info.xml");
}
@Test
public void testInfo_sunrise() throws Exception {
doXmlRoundtripTest("domain_info_sunrise.xml");
}
@Test
public void testInfo_landrush() throws Exception {
doXmlRoundtripTest("domain_info_landrush.xml");
}
@Test
public void testInfo_sunriseNoApplicationId() throws Exception {
doXmlRoundtripTest("domain_info_sunrise_no_application_id.xml");
}
@Test
public void testInfo_feeExtension() throws Exception {
doXmlRoundtripTest("domain_info_fee.xml");
}
@Test
public void testCheck() throws Exception {
doXmlRoundtripTest("domain_check.xml");
}
@Test
public void testCheck_avail() throws Exception {
doXmlRoundtripTest("domain_check_avail.xml");
}
@Test
public void testCheck_claims() throws Exception {
doXmlRoundtripTest("domain_check_claims.xml");
}
@Test
public void testCheck_fee() throws Exception {
doXmlRoundtripTest("domain_check_fee.xml");
}
@Test
public void testTransferApprove() throws Exception {
doXmlRoundtripTest("domain_transfer_approve.xml");
}
@Test
public void testTransferReject() throws Exception {
doXmlRoundtripTest("domain_transfer_reject.xml");
}
@Test
public void testTransferCancel() throws Exception {
doXmlRoundtripTest("domain_transfer_cancel.xml");
}
@Test
public void testTransferQuery() throws Exception {
doXmlRoundtripTest("domain_transfer_query.xml");
}
@Test
public void testTransferRequest() throws Exception {
doXmlRoundtripTest("domain_transfer_request.xml");
}
@Test
public void testTransferRequest_fee() throws Exception {
doXmlRoundtripTest("domain_transfer_request_fee.xml");
}
@Test
public void testRenew() throws Exception {
doXmlRoundtripTest("domain_renew.xml");
}
@Test
public void testRenew_fee() throws Exception {
doXmlRoundtripTest("domain_renew_fee.xml");
}
}

View file

@ -0,0 +1,416 @@
// Copyright 2016 The Domain Registry 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 com.google.domain.registry.model.domain;
import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.truth.Truth.assertThat;
import static com.google.domain.registry.model.EppResourceUtils.loadByUniqueId;
import static com.google.domain.registry.testing.DatastoreHelper.cloneAndSetAutoTimestamps;
import static com.google.domain.registry.testing.DatastoreHelper.createTld;
import static com.google.domain.registry.testing.DatastoreHelper.newDomainResource;
import static com.google.domain.registry.testing.DatastoreHelper.persistResource;
import static com.google.domain.registry.testing.DomainResourceSubject.assertAboutDomains;
import static com.google.domain.registry.util.DateTimeUtils.START_OF_TIME;
import static org.joda.money.CurrencyUnit.USD;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Ordering;
import com.google.domain.registry.model.EntityTestCase;
import com.google.domain.registry.model.billing.BillingEvent;
import com.google.domain.registry.model.billing.BillingEvent.Reason;
import com.google.domain.registry.model.contact.ContactResource;
import com.google.domain.registry.model.domain.launch.LaunchNotice;
import com.google.domain.registry.model.domain.rgp.GracePeriodStatus;
import com.google.domain.registry.model.domain.secdns.DelegationSignerData;
import com.google.domain.registry.model.eppcommon.AuthInfo.PasswordAuth;
import com.google.domain.registry.model.eppcommon.StatusValue;
import com.google.domain.registry.model.eppcommon.Trid;
import com.google.domain.registry.model.host.HostResource;
import com.google.domain.registry.model.poll.PollMessage;
import com.google.domain.registry.model.registry.Registry;
import com.google.domain.registry.model.reporting.HistoryEntry;
import com.google.domain.registry.model.transfer.TransferData;
import com.google.domain.registry.model.transfer.TransferData.TransferServerApproveEntity;
import com.google.domain.registry.model.transfer.TransferStatus;
import com.google.domain.registry.testing.ExceptionRule;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.Ref;
import org.joda.money.Money;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.util.List;
/** Unit tests for {@link DomainResource}. */
public class DomainResourceTest extends EntityTestCase {
@Rule
public final ExceptionRule thrown = new ExceptionRule();
DomainResource domain;
@Before
public void setUp() throws Exception {
createTld("com");
HostResource hostResource = persistResource(
new HostResource.Builder()
.setFullyQualifiedHostName("ns1.example.com")
.setRepoId("1-COM")
.build());
ContactResource contactResource1 = persistResource(
new ContactResource.Builder()
.setContactId("contact_id1")
.setRepoId("2-COM")
.build());
ContactResource contactResource2 = persistResource(
new ContactResource.Builder()
.setContactId("contact_id2")
.setRepoId("3-COM")
.build());
// Set up a new persisted domain entity.
domain = cloneAndSetAutoTimestamps(
new DomainResource.Builder()
.setFullyQualifiedDomainName("example.com")
.setRepoId("4-COM")
.setCreationClientId("a registrar")
.setLastEppUpdateTime(clock.nowUtc())
.setLastEppUpdateClientId("another registrar")
.setLastTransferTime(clock.nowUtc())
.setStatusValues(ImmutableSet.of(
StatusValue.CLIENT_DELETE_PROHIBITED,
StatusValue.SERVER_DELETE_PROHIBITED,
StatusValue.SERVER_TRANSFER_PROHIBITED,
StatusValue.SERVER_UPDATE_PROHIBITED,
StatusValue.SERVER_RENEW_PROHIBITED,
StatusValue.SERVER_HOLD))
.setRegistrant(ReferenceUnion.create(contactResource1))
.setContacts(ImmutableSet.of(DesignatedContact.create(
DesignatedContact.Type.ADMIN,
ReferenceUnion.create(contactResource2))))
.setNameservers(ImmutableSet.of(ReferenceUnion.create(hostResource)))
.setSubordinateHosts(ImmutableSet.of("ns1.example.com"))
.setCurrentSponsorClientId("a third registrar")
.setRegistrationExpirationTime(clock.nowUtc().plusYears(1))
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password")))
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
.setLaunchNotice(
LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME))
.setTransferData(
new TransferData.Builder()
.setExtendedRegistrationYears(1)
.setGainingClientId("gaining")
.setLosingClientId("losing")
.setPendingTransferExpirationTime(clock.nowUtc())
.setServerApproveEntities(
ImmutableSet.<Key<? extends TransferServerApproveEntity>>of(
Key.create(BillingEvent.OneTime.class, 1),
Key.create(BillingEvent.Recurring.class, 2),
Key.create(PollMessage.Autorenew.class, 3)))
.setServerApproveBillingEvent(
Ref.create(Key.create(BillingEvent.OneTime.class, 1)))
.setServerApproveAutorenewEvent(
Ref.create(Key.create(BillingEvent.Recurring.class, 2)))
.setServerApproveAutorenewPollMessage(
Ref.create(Key.create(PollMessage.Autorenew.class, 3)))
.setTransferRequestTime(clock.nowUtc().plusDays(1))
.setTransferStatus(TransferStatus.SERVER_APPROVED)
.setTransferRequestTrid(Trid.create("client trid"))
.build())
.setDeletePollMessage(Key.create(PollMessage.OneTime.class, 1))
.setAutorenewBillingEvent(Ref.create(Key.create(BillingEvent.Recurring.class, 1)))
.setAutorenewPollMessage(Ref.create(Key.create(PollMessage.Autorenew.class, 2)))
.setSmdId("smdid")
.setApplicationTime(START_OF_TIME)
.setApplication(Ref.create(Key.create(DomainApplication.class, 1)))
.addGracePeriod(GracePeriod.create(
GracePeriodStatus.ADD, clock.nowUtc().plusDays(1), "registrar", null))
.build());
persistResource(domain);
}
@Test
public void testPersistence() throws Exception {
assertThat(loadByUniqueId(DomainResource.class, domain.getForeignKey(), clock.nowUtc()))
.isEqualTo(domain);
}
@Test
public void testIndexing() throws Exception {
verifyIndexing(
domain,
"allContacts.contactId.linked",
"fullyQualifiedDomainName",
"nameservers.linked",
"currentSponsorClientId",
"deletionTime",
"tld");
}
@Test
public void testEmptyStringsBecomeNull() {
assertThat(newDomainResource("example.com").asBuilder()
.setCurrentSponsorClientId(null)
.build()
.getCurrentSponsorClientId())
.isNull();
assertThat(newDomainResource("example.com").asBuilder()
.setCurrentSponsorClientId("")
.build()
.getCurrentSponsorClientId())
.isNull();
assertThat(newDomainResource("example.com").asBuilder()
.setCurrentSponsorClientId(" ")
.build()
.getCurrentSponsorClientId())
.isNotNull();
}
@Test
public void testEmptySetsAndArraysBecomeNull() {
assertThat(newDomainResource("example.com").asBuilder()
.setNameservers(null).build().nameservers).isNull();
assertThat(newDomainResource("example.com").asBuilder()
.setNameservers(ImmutableSet.<ReferenceUnion<HostResource>>of()).build().nameservers)
.isNull();
assertThat(newDomainResource("example.com").asBuilder()
.setNameservers(ImmutableSet.of(ReferenceUnion.<HostResource>create("foo")))
.build().nameservers)
.isNotNull();
// This behavior should also hold true for ImmutableObjects nested in collections.
assertThat(newDomainResource("example.com").asBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, null)))
.build().getDsData().asList().get(0).getDigest())
.isNull();
assertThat(newDomainResource("example.com").asBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[]{})))
.build().getDsData().asList().get(0).getDigest())
.isNull();
assertThat(newDomainResource("example.com").asBuilder()
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[]{1})))
.build().getDsData().asList().get(0).getDigest())
.isNotNull();
}
@Test
public void testEmptyTransferDataBecomesNull() throws Exception {
DomainResource withNull =
newDomainResource("example.com").asBuilder().setTransferData(null).build();
DomainResource withEmpty = withNull.asBuilder().setTransferData(TransferData.EMPTY).build();
assertThat(withNull).isEqualTo(withEmpty);
assertThat(withEmpty.hasTransferData()).isFalse();
}
@Test
public void testImplicitStatusValues() {
ImmutableSet<ReferenceUnion<HostResource>> nameservers =
ImmutableSet.of(ReferenceUnion.<HostResource>create("foo"));
StatusValue[] statuses = {StatusValue.OK};
// OK is implicit if there's no other statuses but there are nameservers.
assertAboutDomains()
.that(newDomainResource("example.com").asBuilder().setNameservers(nameservers).build())
.hasExactlyStatusValues(statuses);
StatusValue[] statuses1 = {StatusValue.CLIENT_HOLD};
// If there are other status values, OK should be suppressed. (Domains can't be LINKED.)
assertAboutDomains()
.that(newDomainResource("example.com").asBuilder()
.setNameservers(nameservers)
.setStatusValues(ImmutableSet.of(StatusValue.CLIENT_HOLD))
.build())
.hasExactlyStatusValues(statuses1);
StatusValue[] statuses2 = {StatusValue.CLIENT_HOLD};
// When OK is suppressed, it should be removed even if it was originally there.
assertAboutDomains()
.that(newDomainResource("example.com").asBuilder()
.setNameservers(nameservers)
.setStatusValues(ImmutableSet.of(StatusValue.OK, StatusValue.CLIENT_HOLD))
.build())
.hasExactlyStatusValues(statuses2);
StatusValue[] statuses3 = {StatusValue.INACTIVE};
// If there are no nameservers, INACTIVE should be added, which suppresses OK.
assertAboutDomains()
.that(newDomainResource("example.com").asBuilder().build())
.hasExactlyStatusValues(statuses3);
StatusValue[] statuses4 = {StatusValue.CLIENT_HOLD, StatusValue.INACTIVE};
// If there are no nameservers but there are status values, INACTIVE should still be added.
assertAboutDomains()
.that(newDomainResource("example.com").asBuilder()
.setStatusValues(ImmutableSet.of(StatusValue.CLIENT_HOLD))
.build())
.hasExactlyStatusValues(statuses4);
StatusValue[] statuses5 = {StatusValue.CLIENT_HOLD};
// If there are nameservers, INACTIVE should be removed even if it was originally there.
assertAboutDomains()
.that(newDomainResource("example.com").asBuilder()
.setNameservers(nameservers)
.setStatusValues(ImmutableSet.of(StatusValue.INACTIVE, StatusValue.CLIENT_HOLD))
.build())
.hasExactlyStatusValues(statuses5);
}
private void assertTransferred(
DomainResource domain,
DateTime newExpirationTime,
Key<BillingEvent.Recurring> newAutorenewEvent) {
assertThat(domain.getTransferData().getTransferStatus())
.isEqualTo(TransferStatus.SERVER_APPROVED);
assertThat(domain.getCurrentSponsorClientId()).isEqualTo("winner");
assertThat(domain.getLastTransferTime()).isEqualTo(clock.nowUtc().plusDays(1));
assertThat(domain.getRegistrationExpirationTime()).isEqualTo(newExpirationTime);
assertThat(domain.getAutorenewBillingEvent().getKey()).isEqualTo(newAutorenewEvent);
}
private void doExpiredTransferTest(DateTime oldExpirationTime) {
HistoryEntry historyEntry = new HistoryEntry.Builder().setParent(domain).build();
BillingEvent.OneTime transferBillingEvent = persistResource(
new BillingEvent.OneTime.Builder()
.setReason(Reason.TRANSFER)
.setClientId("winner")
.setTargetId("example.com")
.setEventTime(clock.nowUtc())
.setBillingTime(
clock.nowUtc().plusDays(1).plus(Registry.get("com").getTransferGracePeriodLength()))
.setCost(Money.of(USD, 11))
.setPeriodYears(1)
.setParent(historyEntry)
.build());
domain = domain.asBuilder()
.setRegistrationExpirationTime(oldExpirationTime)
.setTransferData(domain.getTransferData().asBuilder()
.setTransferStatus(TransferStatus.PENDING)
.setTransferRequestTime(clock.nowUtc().minusDays(4))
.setPendingTransferExpirationTime(clock.nowUtc().plusDays(1))
.setGainingClientId("winner")
.setServerApproveBillingEvent(Ref.create(Key.create(transferBillingEvent)))
.setServerApproveEntities(ImmutableSet.<Key<? extends TransferServerApproveEntity>>of(
Key.create(transferBillingEvent)))
.setExtendedRegistrationYears(1)
.build())
.addGracePeriod(
// Okay for billing event to be null since the point of this grace period is just
// to check that the transfer will clear all existing grace periods.
GracePeriod.create(GracePeriodStatus.ADD, clock.nowUtc().plusDays(100), "foo", null))
.build();
DomainResource afterTransfer = domain.cloneProjectedAtTime(clock.nowUtc().plusDays(1));
DateTime newExpirationTime = oldExpirationTime.plusYears(1);
Key<BillingEvent.Recurring> serverApproveAutorenewEvent =
domain.getTransferData().getServerApproveAutorenewEvent().getKey();
assertTransferred(afterTransfer, newExpirationTime, serverApproveAutorenewEvent);
assertThat(afterTransfer.getGracePeriods())
.containsExactly(GracePeriod.create(
GracePeriodStatus.TRANSFER,
clock.nowUtc().plusDays(1).plus(Registry.get("com").getTransferGracePeriodLength()),
"winner",
Ref.create(transferBillingEvent)));
// If we project after the grace period expires all should be the same except the grace period.
DomainResource afterGracePeriod = domain.cloneProjectedAtTime(
clock.nowUtc().plusDays(2).plus(Registry.get("com").getTransferGracePeriodLength()));
assertTransferred(afterGracePeriod, newExpirationTime, serverApproveAutorenewEvent);
assertThat(afterGracePeriod.getGracePeriods()).isEmpty();
}
@Test
public void testExpiredTransfer() {
doExpiredTransferTest(clock.nowUtc().plusMonths(1));
}
@Test
public void testExpiredTransfer_autoRenewBeforeTransfer() {
// Since transfer swallows a preceding autorenew, this should be identical to the regular
// transfer case (and specifically, the new expiration and grace periods will be the same as if
// there was no autorenew).
doExpiredTransferTest(clock.nowUtc().minusDays(1));
}
@Test
public void testStackedGracePeriods() {
List<GracePeriod> gracePeriods = ImmutableList.of(
GracePeriod.create(GracePeriodStatus.ADD, clock.nowUtc().plusDays(3), "foo", null),
GracePeriod.create(GracePeriodStatus.ADD, clock.nowUtc().plusDays(2), "bar", null),
GracePeriod.create(GracePeriodStatus.ADD, clock.nowUtc().plusDays(1), "baz", null));
domain = domain.asBuilder().setGracePeriods(ImmutableSet.copyOf(gracePeriods)).build();
for (int i = 1; i < 3; ++i) {
assertThat(domain.cloneProjectedAtTime(clock.nowUtc().plusDays(i)).getGracePeriods())
.containsExactlyElementsIn(Iterables.limit(gracePeriods, 3 - i));
}
}
@Test
public void testRenewalsHappenAtExpiration() {
DomainResource renewed =
domain.cloneProjectedAtTime(domain.getRegistrationExpirationTime());
assertThat(renewed.getRegistrationExpirationTime())
.isEqualTo(domain.getRegistrationExpirationTime().plusYears(1));
assertThat(renewed.getLastEppUpdateTime()).isEqualTo(clock.nowUtc());
assertThat(getOnlyElement(renewed.getGracePeriods()).getType())
.isEqualTo(GracePeriodStatus.AUTO_RENEW);
}
@Test
public void testTldGetsSet() {
createTld("tld");
domain = newDomainResource("foo.tld");
assertThat(domain.getTld()).isEqualTo("tld");
}
@Test
public void testRenewalsDontHappenOnFebruary29() {
domain = domain.asBuilder()
.setRegistrationExpirationTime(DateTime.parse("2004-02-29T22:00:00.0Z"))
.build();
DomainResource renewed =
domain.cloneProjectedAtTime(domain.getRegistrationExpirationTime().plusYears(4));
assertThat(renewed.getRegistrationExpirationTime().getDayOfMonth()).isEqualTo(28);
}
@Test
public void testMultipleAutoRenews() {
// Change the registry so that renewal costs change every year to make sure we are using the
// autorenew time as the lookup time for the cost.
DateTime oldExpirationTime = domain.getRegistrationExpirationTime();
persistResource(
Registry.get("com")
.asBuilder()
.setRenewBillingCostTransitions(
new ImmutableSortedMap.Builder<DateTime, Money>(Ordering.natural())
.put(START_OF_TIME, Money.of(USD, 1))
.put(oldExpirationTime.plusMillis(1), Money.of(USD, 2))
.put(oldExpirationTime.plusYears(1).plusMillis(1), Money.of(USD, 3))
// Surround the third autorenew with price changes right before and after just
// to be 100% sure that we lookup the cost at the expiration time.
.put(oldExpirationTime.plusYears(2).minusMillis(1), Money.of(USD, 4))
.put(oldExpirationTime.plusYears(2).plusMillis(1), Money.of(USD, 5))
.build())
.build());
DomainResource renewedThreeTimes =
domain.cloneProjectedAtTime(oldExpirationTime.plusYears(2));
assertThat(renewedThreeTimes.getRegistrationExpirationTime())
.isEqualTo(oldExpirationTime.plusYears(3));
assertThat(renewedThreeTimes.getLastEppUpdateTime()).isEqualTo(clock.nowUtc());
assertThat(renewedThreeTimes.getGracePeriods())
.containsExactly(GracePeriod.createForRecurring(
GracePeriodStatus.AUTO_RENEW,
oldExpirationTime.plusYears(2).plus(
Registry.get("com").getAutoRenewGracePeriodLength()),
renewedThreeTimes.getCurrentSponsorClientId(),
Ref.create(renewedThreeTimes.autorenewBillingEvent.key())));
}
}

View file

@ -0,0 +1,115 @@
// Copyright 2016 The Domain Registry 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 com.google.domain.registry.model.domain;
import static com.google.common.truth.Truth.assertThat;
import static org.joda.time.DateTimeZone.UTC;
import com.google.domain.registry.model.billing.BillingEvent;
import com.google.domain.registry.model.billing.BillingEvent.Reason;
import com.google.domain.registry.model.billing.BillingEvent.Recurring;
import com.google.domain.registry.model.domain.rgp.GracePeriodStatus;
import com.google.domain.registry.model.reporting.HistoryEntry;
import com.google.domain.registry.testing.AppEngineRule;
import com.google.domain.registry.testing.ExceptionRule;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.Ref;
import org.joda.money.CurrencyUnit;
import org.joda.money.Money;
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 GracePeriod}. */
@RunWith(JUnit4.class)
public class GracePeriodTest {
@Rule
public final AppEngineRule appEngine = AppEngineRule.builder()
.withDatastore() // Needed to be able to construct Keys.
.build();
@Rule
public final ExceptionRule thrown = new ExceptionRule();
private final DateTime now = DateTime.now(UTC);
private BillingEvent.OneTime onetime;
@Before
public void before() {
onetime = new BillingEvent.OneTime.Builder()
.setEventTime(now)
.setBillingTime(now.plusDays(1))
.setClientId("TheRegistrar")
.setCost(Money.of(CurrencyUnit.USD, 42))
.setParent(Key.create(HistoryEntry.class, 12345))
.setReason(Reason.CREATE)
.setPeriodYears(1)
.setTargetId("foo.google")
.build();
}
@Test
public void testSuccess_forBillingEvent() {
GracePeriod gracePeriod = GracePeriod.forBillingEvent(GracePeriodStatus.ADD, onetime);
assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.ADD);
assertThat(gracePeriod.getOneTimeBillingEvent()).isEqualTo(Ref.create(onetime));
assertThat(gracePeriod.getRecurringBillingEvent()).isNull();
assertThat(gracePeriod.getClientId()).isEqualTo("TheRegistrar");
assertThat(gracePeriod.getExpirationTime()).isEqualTo(now.plusDays(1));
assertThat(gracePeriod.isSunrushAddGracePeriod()).isFalse();
assertThat(gracePeriod.hasBillingEvent()).isTrue();
}
@Test
public void testSuccess_forBillingEvent_sunrushAdd() {
GracePeriod gracePeriod = GracePeriod.forBillingEvent(GracePeriodStatus.SUNRUSH_ADD, onetime);
assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.ADD);
assertThat(gracePeriod.isSunrushAddGracePeriod()).isTrue();
}
@Test
public void testSuccess_createWithoutBillingEvent() {
GracePeriod gracePeriod = GracePeriod.createWithoutBillingEvent(
GracePeriodStatus.REDEMPTION, now, "TheRegistrar");
assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.REDEMPTION);
assertThat(gracePeriod.getOneTimeBillingEvent()).isNull();
assertThat(gracePeriod.getRecurringBillingEvent()).isNull();
assertThat(gracePeriod.getClientId()).isEqualTo("TheRegistrar");
assertThat(gracePeriod.getExpirationTime()).isEqualTo(now);
assertThat(gracePeriod.hasBillingEvent()).isFalse();
}
@Test
public void testFailure_forBillingEvent_autoRenew() {
thrown.expect(IllegalArgumentException.class, "autorenew");
GracePeriod.forBillingEvent(GracePeriodStatus.AUTO_RENEW, onetime);
}
@Test
public void testFailure_createForRecurring_notAutoRenew() {
thrown.expect(IllegalArgumentException.class, "autorenew");
GracePeriod.createForRecurring(
GracePeriodStatus.RENEW,
now.plusDays(1),
"TheRegistrar",
Ref.create(Key.create(Recurring.class, 12345)));
}
}

View file

@ -0,0 +1,12 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<check>
<domain:check xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
<domain:name>example.net</domain:name>
<domain:name>example.org</domain:name>
</domain:check>
</check>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<check>
<domain:check
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example1.com</domain:name>
<domain:name>example2.com</domain:name>
<domain:name>example3.com</domain:name>
</domain:check>
</check>
<extension>
<launch:check
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0"
type="avail">
<launch:phase name="idn-release">custom</launch:phase>
</launch:check>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<check>
<domain:check
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example1.tld</domain:name>
<domain:name>example2.tld</domain:name>
</domain:check>
</check>
<extension>
<launch:check
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0"
type="claims">
<launch:phase>claims</launch:phase>
</launch:check>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,41 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<check>
<domain:check
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
<domain:name>example.net</domain:name>
<domain:name>example.org</domain:name>
</domain:check>
</check>
<extension>
<fee:check
xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
<fee:domain>
<fee:name>example.com</fee:name>
<fee:currency>USD</fee:currency>
<fee:command phase="sunrise">create</fee:command>
<fee:period unit="y">1</fee:period>
</fee:domain>
<fee:domain>
<fee:name>example.net</fee:name>
<fee:currency>EUR</fee:currency>
<fee:command phase="claims" subphase="landrush">
create</fee:command>
<fee:period unit="y">2</fee:period>
</fee:domain>
<fee:domain>
<fee:name>example.org</fee:name>
<fee:currency>EUR</fee:currency>
<fee:command>transfer</fee:command>
</fee:domain>
<fee:domain>
<fee:name>example.xyz</fee:name>
<fee:command>restore</fee:command>
<fee:period unit="y">1</fee:period>
</fee:domain>
</fee:check>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,22 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<create>
<domain:create
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
<domain:period unit="y">2</domain:period>
<domain:ns>
<domain:hostObj>ns1.example.net</domain:hostObj>
<domain:hostObj>ns2.example.net</domain:hostObj>
</domain:ns>
<domain:registrant>jd1234</domain:registrant>
<domain:contact type="admin">sh8013</domain:contact>
<domain:contact type="tech">sh8013</domain:contact>
<domain:authInfo>
<domain:pw>2fooBAR</domain:pw>
</domain:authInfo>
</domain:create>
</create>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<create>
<domain:create
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
<domain:period unit="y">2</domain:period>
<domain:ns>
<domain:hostObj>ns1.example.net</domain:hostObj>
<domain:hostObj>ns2.example.net</domain:hostObj>
</domain:ns>
<domain:registrant>jd1234</domain:registrant>
<domain:contact type="admin">sh8013</domain:contact>
<domain:contact type="tech">sh8013</domain:contact>
<domain:authInfo>
<domain:pw>2fooBAR</domain:pw>
</domain:authInfo>
</domain:create>
</create>
<extension>
<fee:create xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
<fee:currency>USD</fee:currency>
<fee:fee>5.00</fee:fee>
</fee:create>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<create>
<domain:create
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.tld</domain:name>
<domain:registrant>jd1234</domain:registrant>
<domain:contact type="admin">sh8013</domain:contact>
<domain:contact type="tech">sh8013</domain:contact>
<domain:authInfo>
<domain:pw>2fooBAR</domain:pw>
</domain:authInfo>
</domain:create>
</create>
<extension>
<launch:create
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0">
<launch:phase>landrush</launch:phase>
</launch:create>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<create>
<domain:create
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.tld</domain:name>
<domain:registrant>jd1234</domain:registrant>
<domain:contact type="admin">sh8013</domain:contact>
<domain:contact type="tech">sh8013</domain:contact>
<domain:authInfo>
<domain:pw>2fooBAR</domain:pw>
</domain:authInfo>
</domain:create>
</create>
<extension>
<launch:create
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0">
<launch:phase>sunrise</launch:phase>
<launch:codeMark>
<launch:code>49FD46E6C4B45C55D4AC</launch:code>
</launch:codeMark>
<launch:codeMark>
<launch:code>49FD46E6C4B45C55D4AD</launch:code>
</launch:codeMark>
<launch:codeMark>
<launch:code>49FD46E6C4B45C55D4AE</launch:code>
</launch:codeMark>
</launch:create>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<create>
<domain:create
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>exampleone.tld</domain:name>
<domain:registrant>jd1234</domain:registrant>
<domain:contact type="admin">sh8013</domain:contact>
<domain:contact type="tech">sh8013</domain:contact>
<domain:authInfo>
<domain:pw>2fooBAR</domain:pw>
</domain:authInfo>
</domain:create>
</create>
<extension>
<launch:create
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0">
<launch:phase>sunrise</launch:phase>
<launch:codeMark>
<launch:code>49FD46E6C4B45C55D4AC</launch:code>
<mark:mark
xmlns:mark="urn:ietf:params:xml:ns:mark-1.0">
<mark:trademark>
<mark:id>1234-2</mark:id>
<mark:markName>Example One</mark:markName>
<mark:holder entitlement="owner">
<mark:org>Example Inc.</mark:org>
<mark:addr>
<mark:street>123 Example Dr.</mark:street>
<mark:street>Suite 100</mark:street>
<mark:city>Reston</mark:city>
<mark:sp>VA</mark:sp>
<mark:pc>20190</mark:pc>
<mark:cc>US</mark:cc>
</mark:addr>
</mark:holder>
<mark:jurisdiction>US</mark:jurisdiction>
<mark:class>35</mark:class>
<mark:class>36</mark:class>
<mark:label>example-one</mark:label>
<mark:label>exampleone</mark:label>
<mark:goodsAndServices>Dirigendas et eiusmodi
featuring infringo in airfare et cartam servicia.
</mark:goodsAndServices>
<mark:regNum>234235</mark:regNum>
<mark:regDate>2009-08-16T09:00:00.0Z</mark:regDate>
<mark:exDate>2015-08-16T09:00:00.0Z</mark:exDate>
</mark:trademark>
</mark:mark>
</launch:codeMark>
</launch:create>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<create>
<domain:create
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>exampleone.tld</domain:name>
<domain:registrant>jd1234</domain:registrant>
<domain:contact type="admin">sh8013</domain:contact>
<domain:contact type="tech">sh8013</domain:contact>
<domain:authInfo>
<domain:pw>2fooBAR</domain:pw>
</domain:authInfo>
</domain:create>
</create>
<extension>
<launch:create
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0">
<launch:phase>sunrise</launch:phase>
<launch:codeMark>
<mark:mark
xmlns:mark="urn:ietf:params:xml:ns:mark-1.0">
<mark:trademark>
<mark:id>1234-2</mark:id>
<mark:markName>Example One</mark:markName>
<mark:holder entitlement="owner">
<mark:org>Example Inc.</mark:org>
<mark:addr>
<mark:street>123 Example Dr.</mark:street>
<mark:street>Suite 100</mark:street>
<mark:city>Reston</mark:city>
<mark:sp>VA</mark:sp>
<mark:pc>20190</mark:pc>
<mark:cc>US</mark:cc>
</mark:addr>
</mark:holder>
<mark:jurisdiction>US</mark:jurisdiction>
<mark:class>35</mark:class>
<mark:class>36</mark:class>
<mark:label>example-one</mark:label>
<mark:label>exampleone</mark:label>
<mark:goodsAndServices>Dirigendas et eiusmodi
featuring infringo in airfare et cartam servicia.
</mark:goodsAndServices>
<mark:regNum>234235</mark:regNum>
<mark:regDate>2009-08-16T09:00:00.0Z</mark:regDate>
<mark:exDate>2015-08-16T09:00:00.0Z</mark:exDate>
</mark:trademark>
</mark:mark>
</launch:codeMark>
</launch:create>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<create>
<domain:create
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>exampleone.tld</domain:name>
<domain:ns>
<domain:hostObj>ns1.example.net</domain:hostObj>
<domain:hostObj>ns2.example.net</domain:hostObj>
</domain:ns>
<domain:registrant>jd1234</domain:registrant>
<domain:contact type="admin">sh8013</domain:contact>
<domain:contact type="tech">sh8013</domain:contact>
<domain:authInfo>
<domain:pw>2fooBAR</domain:pw>
</domain:authInfo>
</domain:create>
</create>
<extension>
<launch:create
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0"
type="application">
<launch:phase>sunrise</launch:phase>
<smd:signedMark xmlns:smd="urn:ietf:params:xml:ns:signedMark-1.0" id="signedMark">
<smd:id>1-2</smd:id>
<smd:issuerInfo issuerID="2">
<smd:org>Example Inc.</smd:org>
<smd:email>support@example.tld</smd:email>
<smd:url>http://www.example.tld</smd:url>
<smd:voice x="1234">+1.7035555555</smd:voice>
</smd:issuerInfo>
<smd:notBefore>2009-08-16T09:00:00.0Z</smd:notBefore>
<smd:notAfter>2010-08-16T09:00:00.0Z</smd:notAfter>
<mark:mark xmlns:mark="urn:ietf:params:xml:ns:mark-1.0">
<mark:trademark>
<mark:id>1234-2</mark:id>
<mark:markName>Example One</mark:markName>
<mark:holder entitlement="owner">
<mark:org>Example Inc.</mark:org>
<mark:addr>
<mark:street>123 Example Dr.</mark:street>
<mark:street>Suite 100</mark:street>
<mark:city>Reston</mark:city>
<mark:sp>VA</mark:sp>
<mark:pc>20190</mark:pc>
<mark:cc>US</mark:cc>
</mark:addr>
</mark:holder>
<mark:jurisdiction>US</mark:jurisdiction>
<mark:class>35</mark:class>
<mark:class>36</mark:class>
<mark:label>example-one</mark:label>
<mark:label>exampleone</mark:label>
<mark:goodsAndServices>Dirigendas et eiusmodi featuring infringo in airfare et cartam servicia.</mark:goodsAndServices>
<mark:regNum>234235</mark:regNum>
<mark:regDate>2009-08-16T09:00:00.0Z</mark:regDate>
<mark:exDate>2015-08-16T09:00:00.0Z</mark:exDate>
</mark:trademark>
</mark:mark>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod
Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<Reference URI="#signedMark">
<Transforms>
<Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
</Transforms>
<DigestMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<DigestValue>
miF4M2aTd1Y3tKOzJtiyl2VpzAnVPnV1Hq7Zax+yzrA=
</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>
MELpHTWEVfG1JcsG1/a//o54OnlJ5A864+X5JwfqgGBBeZSzGHNzwzTKFzIyyyfn
lGxVwNMoBV5aSvkF7oEKMNVzfcl/P0czNQZ/LJ83p3Ol27/iUNsqgCaGf9Zupw+M
XT4Q2lOrIw+qSx5g7q9T83siMLvkD5uEYlU5dPqgsObLTW8/doTQrA14RcxgY4kG
a4+t5B1cT+5VaghTOPb8uUSEDKjnOsGdy8p24wgyK9n8h0CTSS2ZQ6Zq/RmQeT7D
sbceUHheQ+mkQWIljpMQqsiBjw5XXh4jkEgfAzrb6gkYEF+X8ReuPZuOYC4QjIET
yx8ifN4KE3GIbMXeF4LDsA==
</SignatureValue>
<KeyInfo>
<KeyValue>
<RSAKeyValue>
<Modulus>
o/cwvXhbVYl0RDWWvoyeZpETVZVVcMCovUVNg/swWinuMgEWgVQFrz0xA04pEhXC
FVv4evbUpekJ5buqU1gmQyOsCKQlhOHTdPjvkC5upDqa51Flk0TMaMkIQjs7aUKC
mA4RG4tTTGK/EjR1ix8/D0gHYVRldy1YPrMP+ou75bOVnIos+HifrAtrIv4qEqwL
L4FTZAUpaCa2BmgXfy2CSRQbxD5Or1gcSa3vurh5sPMCNxqaXmIXmQipS+DuEBqM
M8tldaN7RYojUEKrGVsNk5i9y2/7sjn1zyyUPf7vL4GgDYqhJYWV61DnXgx/Jd6C
WxvsnDF6scscQzUTEl+hyw==
</Modulus>
<Exponent>
AQAB
</Exponent>
</RSAKeyValue>
</KeyValue>
<X509Data>
<X509Certificate>
MIIESTCCAzGgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJVUzEL
MAkGA1UECBMCQ0ExFDASBgNVBAcTC0xvcyBBbmdlbGVzMRMwEQYDVQQKEwpJQ0FO
TiBUTUNIMRswGQYDVQQDExJJQ0FOTiBUTUNIIFRFU1QgQ0EwHhcNMTMwMjA4MDAw
MDAwWhcNMTgwMjA3MjM1OTU5WjBsMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0Ex
FDASBgNVBAcTC0xvcyBBbmdlbGVzMRcwFQYDVQQKEw5WYWxpZGF0b3IgVE1DSDEh
MB8GA1UEAxMYVmFsaWRhdG9yIFRNQ0ggVEVTVCBDRVJUMIIBIjANBgkqhkiG9w0B
AQEFAAOCAQ8AMIIBCgKCAQEAo/cwvXhbVYl0RDWWvoyeZpETVZVVcMCovUVNg/sw
WinuMgEWgVQFrz0xA04pEhXCFVv4evbUpekJ5buqU1gmQyOsCKQlhOHTdPjvkC5u
pDqa51Flk0TMaMkIQjs7aUKCmA4RG4tTTGK/EjR1ix8/D0gHYVRldy1YPrMP+ou7
5bOVnIos+HifrAtrIv4qEqwLL4FTZAUpaCa2BmgXfy2CSRQbxD5Or1gcSa3vurh5
sPMCNxqaXmIXmQipS+DuEBqMM8tldaN7RYojUEKrGVsNk5i9y2/7sjn1zyyUPf7v
L4GgDYqhJYWV61DnXgx/Jd6CWxvsnDF6scscQzUTEl+hywIDAQABo4H/MIH8MAwG
A1UdEwEB/wQCMAAwHQYDVR0OBBYEFPZEcIQcD/Bj2IFz/LERuo2ADJviMIGMBgNV
HSMEgYQwgYGAFO0/7kEh3FuEKS+Q/kYHaD/W6wihoWakZDBiMQswCQYDVQQGEwJV
UzELMAkGA1UECBMCQ0ExFDASBgNVBAcTC0xvcyBBbmdlbGVzMRMwEQYDVQQKEwpJ
Q0FOTiBUTUNIMRswGQYDVQQDExJJQ0FOTiBUTUNIIFRFU1QgQ0GCAQEwDgYDVR0P
AQH/BAQDAgeAMC4GA1UdHwQnMCUwI6AhoB+GHWh0dHA6Ly9jcmwuaWNhbm4ub3Jn
L3RtY2guY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQB2qSy7ui+43cebKUKwWPrzz9y/
IkrMeJGKjo40n+9uekaw3DJ5EqiOf/qZ4pjBD++oR6BJCb6NQuQKwnoAz5lE4Ssu
y5+i93oT3HfyVc4gNMIoHm1PS19l7DBKrbwbzAea/0jKWVzrvmV7TBfjxD3AQo1R
bU5dBr6IjbdLFlnO5x0G0mrG7x5OUPuurihyiURpFDpwH8KAH1wMcCpXGXFRtGKk
wydgyVYAty7otkl/z3bZkCVT34gPvF70sR6+QxUy8u0LzF5A/beYaZpxSYG31amL
AdXitTWFipaIGea9lEGFM0L9+Bg7XzNn4nVLXokyEB3bgS4scG6QznX23FGk
</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
</smd:signedMark>
</launch:create>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,11 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<delete>
<domain:delete
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
</domain:delete>
</delete>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,11 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<info>
<domain:info
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name hosts="all">example.com</domain:name>
</domain:info>
</info>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,17 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<info>
<domain:info xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name hosts="all">example.com</domain:name>
</domain:info>
</info>
<extension>
<fee:info xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
<fee:currency>USD</fee:currency>
<fee:command>create</fee:command>
<fee:period unit="y">1</fee:period>
</fee:info>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<info>
<domain:info
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.tld</domain:name>
</domain:info>
</info>
<extension>
<launch:info
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0">
<launch:phase>landrush</launch:phase>
<launch:applicationID>123</launch:applicationID>
</launch:info>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<info>
<domain:info
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.tld</domain:name>
</domain:info>
</info>
<extension>
<launch:info
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0">
<launch:phase name="landrush">sunrise</launch:phase>
<launch:applicationID>123</launch:applicationID>
</launch:info>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<info>
<domain:info
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.tld</domain:name>
</domain:info>
</info>
<extension>
<launch:info
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0"
includeMark="true">
<launch:phase name="landrush">sunrise</launch:phase>
</launch:info>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,13 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<renew>
<domain:renew
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.tld</domain:name>
<domain:curExpDate>2000-04-03</domain:curExpDate>
<domain:period unit="y">5</domain:period>
</domain:renew>
</renew>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<renew>
<domain:renew
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
<domain:curExpDate>2000-04-03</domain:curExpDate>
<domain:period unit="y">5</domain:period>
</domain:renew>
</renew>
<extension>
<fee:renew xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
<fee:currency>USD</fee:currency>
<fee:fee>5.00</fee:fee>
</fee:renew>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,11 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<transfer op="approve">
<domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
</domain:transfer>
</transfer>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,11 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<transfer op="cancel">
<domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
</domain:transfer>
</transfer>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,11 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<transfer op="query">
<domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
</domain:transfer>
</transfer>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,11 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<transfer op="reject">
<domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
</domain:transfer>
</transfer>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,15 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<transfer op="request">
<domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
<domain:period unit="y">1</domain:period>
<domain:authInfo>
<domain:pw roid="JD1234-REP">2fooBAR</domain:pw>
</domain:authInfo>
</domain:transfer>
</transfer>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,22 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<transfer op="request">
<domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
<domain:period unit="y">1</domain:period>
<domain:authInfo>
<domain:pw roid="JD1234-REP">2fooBAR</domain:pw>
</domain:authInfo>
</domain:transfer>
</transfer>
<extension>
<fee:transfer xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
<fee:currency>USD</fee:currency>
<fee:fee>5.00</fee:fee>
<fee:fee>8.00</fee:fee>
</fee:transfer>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,31 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<update>
<domain:update
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
<domain:add>
<domain:ns>
<domain:hostObj>ns2.example.com</domain:hostObj>
</domain:ns>
<domain:contact type="tech">mak21</domain:contact>
<domain:status s="clientHold"/>
</domain:add>
<domain:rem>
<domain:ns>
<domain:hostObj>ns1.example.com</domain:hostObj>
</domain:ns>
<domain:contact type="tech">sh8013</domain:contact>
<domain:status s="clientUpdateProhibited"/>
</domain:rem>
<domain:chg>
<domain:registrant>sh8013</domain:registrant>
<domain:authInfo>
<domain:pw>2BARfoo</domain:pw>
</domain:authInfo>
</domain:chg>
</domain:update>
</update>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -0,0 +1,37 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<update>
<domain:update
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
<domain:add>
<domain:ns>
<domain:hostObj>ns2.example.com</domain:hostObj>
</domain:ns>
<domain:contact type="tech">mak21</domain:contact>
<domain:status s="clientHold"/>
</domain:add>
<domain:rem>
<domain:ns>
<domain:hostObj>ns1.example.com</domain:hostObj>
</domain:ns>
<domain:contact type="tech">sh8013</domain:contact>
<domain:status s="clientUpdateProhibited"/>
</domain:rem>
<domain:chg>
<domain:registrant>sh8013</domain:registrant>
<domain:authInfo>
<domain:pw>2BARfoo</domain:pw>
</domain:authInfo>
</domain:chg>
</domain:update>
</update>
<extension>
<fee:create xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
<fee:currency>USD</fee:currency>
<fee:fee>5.00</fee:fee>
</fee:create>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>