示例#1
0
int CreateRequestTest(EppParser& parser, DOMNode* n)
{
	EppDomain domain("CREATE-FEE.BIZ");
	EppAuthInfo authInfo(EppAuthInfo::TYPE_PW, "3fooBar");
	domain.setAuthInfo(authInfo);
	EppCommandCreate eppCommand(&domain, "ABC-DEF-XXXX-ID");

	EppCommandCreateFee* feeExt = new EppCommandCreateFee();

	feeExt->setCurrency("INR");
	EppFeeFee *fee1 = new EppFeeFee();
	fee1->setApplied("immediate");
	fee1->setDescription("Application Fee");
	fee1->setRefundable("1");
	fee1->setFee(5.00);
	fee1->setGracePeriod("P30D");
	feeExt->addFee(fee1);

	eppCommand.addExtension(feeExt);


	DOMString orig = eppCommand.toString();

	parser.parse(orig);
	n = parser.getRootNode();
	EppCommandCreate * eppCommandNew = (EppCommandCreate *) EppCommand::fromXML(*n);
	DOMString again = eppCommandNew->toString();

	delete eppCommandNew;

	doValidate(orig, again, __FUNCTION__);
	return 0;

}
示例#2
0
int TransferRequestTest(EppParser& parser, DOMNode* n)
{
	EppCommandUpdateDomain eppCommand("TRANSFER-FEE.BIZ", "ABC-DEF-XXXX-ID");

	EppCommandTransferFee* feeExt = new EppCommandTransferFee();

	feeExt->setCurrency("INR");
			EppFeeFee *fee1 = new EppFeeFee();
			fee1->setApplied("immediate");
			fee1->setDescription("Application Fee");
			fee1->setRefundable("1");
			fee1->setFee(5.00);
			fee1->setGracePeriod("P22D");
	feeExt->addFee(fee1);

	eppCommand.addExtension(feeExt);


	DOMString orig = eppCommand.toString();

	parser.parse(orig);
	n = parser.getRootNode();
	EppCommandCreate * eppCommandNew = (EppCommandCreate *) EppCommand::fromXML(*n);
	DOMString again = eppCommandNew->toString();

	delete eppCommandNew;

	doValidate(orig, again, __FUNCTION__);
	return 0;

}
示例#3
0
int InfoRequestTest(EppParser & parser, DOMNode* n)
{
	EppCommandInfoDomain eppCommand("INFO.DOMAIN", "ABC-DEF-XXXX-ID");

	EppCommandInfoFee* feeExt = new EppCommandInfoFee();

	feeExt->setCurrency("CAD");

	EppFeeCommand* command = new EppFeeCommand();
	command->setCommand("NEWEPPCOMMAND");
	command->setPhase("sunrise");
	feeExt->setCommand(command);

	EppPeriod* period = new EppPeriod();
	period->setUnit('y');
	period->setValue(1);
	feeExt->setPeriod(period);

	eppCommand.addExtension(feeExt);


	DOMString orig = eppCommand.toString();

	parser.parse(orig);
	n = parser.getRootNode();
	EppCommandInfo * eppCommandNew = (EppCommandInfo *) EppCommand::fromXML(*n);
	DOMString again = eppCommandNew->toString();

	delete eppCommandNew;
	doValidate(orig, again, __FUNCTION__);
	return 0;
}
示例#4
0
int UpdateResponseTest(EppParser& parser, DOMNode* n)
{
	EppDomain domain("UPDATE-RESPONSE-TEST.BIZ");
	EppAuthInfo authInfo(EppAuthInfo::TYPE_PW, "3fooBar");
	domain.setAuthInfo(authInfo);

	EppResult result(EppError::CODE_NO_ERROR);
	EppValueReason reason0("Value0", "Reason0", "en");
	EppValueReason reason4("Value4");
	result.addValue(reason0);
	result.addValue("Value1");
	result.addValue("Value2");
	result.addValue("Value3");
	result.addValue(reason4);
	EppTransactionId trid("CLIENT-XID", "SERVER-ID");

	EppResponse rsp;
	rsp.addResult(result);
	rsp.setTransactionId(trid);

	//EppResponseDataUpdateDomain eppCommand("RENEW-RESPONSE-TEST.BIZ", time(0));
	//rsp.setResponseData(&eppCommand);


	EppResponseDataRenewDomain eppCommand("UPDATE-RESPONSE-TEST.BIZ", time(0));
	rsp.setResponseData(&eppCommand);

	
	EppResponseUpdateFee* feeExt = new EppResponseUpdateFee();
	feeExt->setCurrency("RND");

	EppFeeFee *fee2 = new EppFeeFee();
	fee2->setDescription("SOME Fee");
	fee2->setRefundable("1");
	fee2->setFee(5.00);
	feeExt->addFee(fee2);

	feeExt->setBalance("1000");
	feeExt->setCreditLimit("5000");
	rsp.addExtension(feeExt);

	DOMString orig = rsp.toString();

	parser.parse(orig);
	n = parser.getRootNode();

	EppResponse * newRsp = EppResponse::fromXML(*n);
	DOMString again = newRsp->toString();

	delete newRsp;
	
	doValidate(orig, again, __FUNCTION__);
	return 0;

}
示例#5
0
static Score::FileError doValidateAndImport(Score* score, const QString& name, QIODevice* dev)
      {
      // verify tuplet TDuration::DurationType dependencies
      tupletAssert();

      // validate the file
      Score::FileError res;
      res = doValidate(name, dev);
      if (res != Score::FileError::FILE_NO_ERROR)
            return res;

      // actually do the import
      importMusicXMLfromBuffer(score, name, dev);
      qDebug("importMusicXml() return %d", int(res));
      return res;
      }
示例#6
0
bool AbstractPlugin::isValid(Poco::JSON::Object::Ptr const& obj) const
{
    return doValidate(obj);
}
示例#7
0
	void TextBox::BaseLostFocus( void )
	{
		doValidate();
		BaseObject::BaseLostFocus();
	}
示例#8
0
int CheckResponseTest(EppParser& parser, DOMNode* n)
{
	EppResponse rsp;
	

	EppResult result(EppError::CODE_NO_ERROR);
	//EppValueReason reason0("Value0", "Reason0", "en_US");
	EppValueReason reason0("Value0", "Reason0", "en");
	EppValueReason reason4("Value4");
	result.addValue(reason0);
	result.addValue("Value1");
	result.addValue("Value2");
	result.addValue("Value3");
	result.addValue(reason4);
	EppTransactionId trid("CLIENT-XID", "SERVER-ID");

	rsp.addResult(result);
	rsp.setTransactionId(trid);

	EppResponseDataCheckDomain eppCommand;
	eppCommand.add("DOMAIN1.CLUB", DOMString(EppResponseDataCheck::FOUND));
	eppCommand.add("DOMAIN2.CLUB", DOMString(EppResponseDataCheck::NOT_FOUND));
	eppCommand.add("DOMAIN3.CLUB", DOMString(EppResponseDataCheck::FOUND));
	rsp.setResponseData(&eppCommand);


	EppResponseCheckFee* feeExt = new EppResponseCheckFee();
	{
		{
			EppResponseCheckFeeType* element = new  EppResponseCheckFeeType();
			element->setName("CHECK-RESPOSNSE-FEE-DOMAIN1.CLUB");
			element->setCurrency("USD");

			EppFeeCommand* command = new EppFeeCommand();
			command->setCommand("create");
			command->setPhase("sunrise");
			element->setCommand(command);
			
			EppPeriod* period = new EppPeriod();
			period->setUnit('y');
			period->setValue(1);
			element->setPeriod(period);
		
			EppFeeFee *fee1 = new EppFeeFee();
			fee1->setApplied("delayed");
			fee1->setDescription("Application Fee");
			fee1->setRefundable("0");
			fee1->setFee(5.002);
			fee1->setGracePeriod("P15D");
			element->addFee(fee1);
			
			EppFeeFee *fee2 = new EppFeeFee();
			fee2->setDescription("Registration Fee");
			fee2->setRefundable("1");
			fee2->setFee(5.003);
			element->addFee(fee2);
			feeExt->add(element);
		}
		{
			EppResponseCheckFeeType* element = new  EppResponseCheckFeeType();
			element->setName("CHECK-RESPOSNSE-FEE-DOMAIN2.CLUB");
			element->setCurrency("EUR");

			EppFeeCommand* command = new EppFeeCommand();
			command->setCommand("create");
			command->setPhase("claims");
			command->setSubPhase("landrush");
			element->setCommand(command);
			
			EppPeriod* period = new EppPeriod();
			period->setUnit('y');
			period->setValue(2);
			element->setPeriod(period);
		
			EppFeeFee *fee1 = new EppFeeFee();
			fee1->setFee(5.004);
			element->addFee(fee1);
			feeExt->add(element);
		}
		{
			EppResponseCheckFeeType* element = new  EppResponseCheckFeeType();
			element->setName("CHECK-RESPOSNSE-FEE-DOMAIN3.CLUB");
			element->setCurrency("EUR");

			EppFeeCommand* command = new EppFeeCommand();
			command->setCommand("transfer");
			element->setCommand(command);
			
			EppPeriod* period = new EppPeriod();
			period->setUnit('y');
			period->setValue(2);
			element->setPeriod(period);
		
			EppFeeFee *fee1 = new EppFeeFee();
			fee1->setApplied("immediate");
			fee1->setDescription("Transfer Fee");
			fee1->setFee(2.505);
			element->addFee(fee1);
			
			EppFeeFee *fee2 = new EppFeeFee();
			fee2->setDescription("Renewal Fee");
			fee2->setFee(10.00);
			element->addFee(fee2);
			feeExt->add(element);
		}
		
		{
			EppResponseCheckFeeType* element = new  EppResponseCheckFeeType();
			element->setName("CHECK-RESPOSNSE-FEE-DOMAIN4.CLUB");
			element->setCurrency("GBP");

			EppFeeCommand* command = new EppFeeCommand();
			command->setCommand("restore");
			element->setCommand(command);
			
			EppPeriod* period = new EppPeriod();
			period->setUnit('y');
			period->setValue(1);
			element->setPeriod(period);
		
			EppFeeFee *fee1 = new EppFeeFee();
			fee1->setDescription("Restore Fee");
			fee1->setFee(25);
			element->addFee(fee1);
			
			EppFeeFee *fee2 = new EppFeeFee();
			fee2->setDescription("Renewal Fee");
			fee2->setFee(5.00);
			element->addFee(fee2);
			
			element->setFeeClass("premium-tier1");
			feeExt->add(element);
		}
	}

	rsp.addExtension(feeExt);

	DOMString orig = rsp.toString();

	parser.parse(orig);


	n = parser.getRootNode();
	EppResponse * newRsp = (EppResponse *) EppResponse::fromXML(*n);
	DOMString again = newRsp->toString();

	delete newRsp;
	

	doValidate(orig, again, __FUNCTION__);
	return 0;
}
示例#9
0
int CheckRequestTest(EppParser& parser, DOMNode* n)
{
	EppCommandCheckDomain eppCommand;
	eppCommand.setClientTransactionId("CLINET-XID");
	eppCommand.add("CHECK-DOMAIN1.CLUB");
	eppCommand.add("CHECK-DOMAIN2.CLUB");
	eppCommand.add("CHECK-DOMAIN3.CLUB");

	EppCommandCheckFee* feeExt = new EppCommandCheckFee();
	{
		EppCommandCheckFeeType* element = new  EppCommandCheckFeeType();

		element->setName("CHECK-FEE-DOMAIN1.CLUB");
		element->setCurrency("USD");

		EppFeeCommand* command = new EppFeeCommand();
		command->setCommand("create");
		command->setPhase("sunrise");
		element->setCommand(command);

		EppPeriod* period = new EppPeriod();
		period->setUnit('y');
		period->setValue(1);
		element->setPeriod(period);
		
		feeExt->add(element);
	}
	{
		EppCommandCheckFeeType* element = new  EppCommandCheckFeeType();

		element->setName("CHECK-FEE-DOMAIN2.CLUB");
		element->setCurrency("EUR");

		EppFeeCommand* command = new EppFeeCommand();
		command->setCommand("create");
		command->setPhase("claims");
		command->setSubPhase("landrush");
		element->setCommand(command);

		EppPeriod* period = new EppPeriod();
		period->setUnit('y');
		period->setValue(2);
		element->setPeriod(period);
		
		feeExt->add(element);
	}
	{
		EppCommandCheckFeeType* element = new  EppCommandCheckFeeType();

		element->setName("CHECK-FEE-DOMAIN3.CLUB");
		element->setCurrency("EUR");

		EppFeeCommand* command = new EppFeeCommand();
		command->setCommand("transfer");
		element->setCommand(command);

		feeExt->add(element);
	}
	{
		EppCommandCheckFeeType* element = new  EppCommandCheckFeeType();

		element->setName("CHECK-FEE-DOMAIN4.CLUB");

		EppFeeCommand* command = new EppFeeCommand();
		command->setCommand("restore");
		element->setCommand(command);

		EppPeriod* period = new EppPeriod();
		period->setUnit('m');
		period->setValue(23);
		element->setPeriod(period);
		
		feeExt->add(element);
	}	

	eppCommand.addExtension(feeExt);

	DOMString orig = eppCommand.toString();
	
	parser.parse(orig);
	n = parser.getRootNode();
	EppCommandCheckDomain * eppCommandNew = (EppCommandCheckDomain *) EppCommand::fromXML(*n);
	DOMString again = eppCommandNew->toString();

	delete eppCommandNew;
	
	doValidate(orig, again, __FUNCTION__);
	return 0;
}
示例#10
0
int InfoResponseTest(EppParser& parser, DOMNode* n)
{
	EppDomain domain("INFO-RESPONSE-TEST.BIZ");
	domain.setRoid("ROID-ROID");

	EppStatus st(EppDomain::STATUS_CLIENT_UPDATE_PROHIBITED);
	domain.addStatus(st);

	domain.setClientId("123");

	EppResult result(EppError::CODE_NO_ERROR);
	//EppValueReason reason0("Value0", "Reason0", "en_US");
	EppValueReason reason0("Value0", "Reason0", "en");
	EppValueReason reason4("Value4");
	result.addValue(reason0);
	result.addValue("Value1");
	result.addValue("Value2");
	result.addValue("Value3");
	result.addValue(reason4);
	EppTransactionId trid("CLIENT-XID", "SERVER-ID");

	EppResponse rsp;
	rsp.addResult(result);
	rsp.setTransactionId(trid);
	EppResponseDataInfo infData(&domain);
	rsp.setResponseData(&infData);

	EppResponseInfoFee* feeExt = new EppResponseInfoFee();
	feeExt->setCurrency("RND");

	EppFeeCommand* command = new EppFeeCommand();
	command->setCommand("NEWEPPCOMMAND");
	command->setPhase("new-sunrise");
	feeExt->setCommand(command);

	EppPeriod* period = new EppPeriod();
	period->setUnit('m');
	period->setValue(11);
	feeExt->setPeriod(period);

	EppFeeFee *fee2 = new EppFeeFee();
	fee2->setDescription("SOME Fee");
	fee2->setRefundable("1");
	fee2->setFee(5.01);
	feeExt->addFee(fee2);

	rsp.addExtension(feeExt);

	DOMString orig = rsp.toString();

	parser.parse(orig);
	n = parser.getRootNode();

	EppResponse * newRsp = EppResponse::fromXML(*n);
	DOMString again = newRsp->toString();

	delete newRsp;
	
	doValidate(orig, again, __FUNCTION__);
	return 0;
}