		@Test
	public void testCreatedMessage() throws Exception{

		  SOAPMessage soapMessage = null;
	        MimeMessage mimeMsg = null;
	        MimeHeaders mimeHeaders = new MimeHeaders();
	        
	        InputStream contentStream = FIXTURE_LOADER.getResourceAsStream("mime_message_content.dat");		
	        mimeHeaders.setHeader("Content-Type", "text/xml; charset=utf-8");
	        
	        /* 
	         * Create an SOAP Message by using the resource loaded by FixtureLoader 
	         * And check the soapMessage are successfully created. 
	         */ 
	        try {
				soapMessage = 
					MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL).createMessage(mimeHeaders,contentStream);
			} catch (IOException e) {
				e.printStackTrace();
				Assert.fail("Failed on loading the content inputstream\n"+e.getMessage());
			} catch (SOAPException e) {
				e.printStackTrace();
				Assert.fail("Create SOAP Message Failed\n"+e.getMessage());			
			}
			if(soapMessage == null)
				Assert.fail("Create SOAP Message Failed\n Message Should not be Null.");
			System.out.println("SoapMessage Created.");
			

	        /* 
	         * Create an Mime Message by using SOAP message created above.
	         * And check the soapMessage are successfully created. 
	         */ 
			try {
				mimeMsg = 
						mailSender.createMessage(MAIL_FROM, MAIL_TO, "",
										"SOAPMailSenderTest.testCreatedMessageLineMaxLimit", 
										soapMessage);
			} catch (ConnectionException e) {
				e.printStackTrace();
				Assert.fail("Create MimeMessage Failed\n"+e.getMessage());
			}
			if(mimeMsg == null)
				Assert.fail("Create MimeMessage Failed\n Message Should not be Null.");		
			System.out.println("MimeMessage Created.");
			
			
			/*
			 * Pepare Sample Data 
			 */
			InputStream data = FIXTURE_LOADER.getResourceAsStream("mime_message_content.dat");
			mimeHeaders.setHeader("Content-Type", "text/xml; charset=utf-8");
			soapMessage = 
				MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL).createMessage(mimeHeaders,data);
			ByteArrayOutputStream sampleContentStream = new ByteArrayOutputStream();
			
			OutputStream os = MimeUtility.encode(sampleContentStream, "base64");
			soapMessage.writeTo(os);
			
			ByteArrayOutputStream actualContentStream = new ByteArrayOutputStream();
			mimeMsg.writeTo(actualContentStream);
			
			BufferedReader sampleDataReader = new BufferedReader(new StringReader(sampleContentStream.toString()));
			BufferedReader actualDataReader = new BufferedReader(new StringReader(actualContentStream.toString()));
			
			// Loop the reader to content head,
			// in order to skip those message header
			for(int i =0; i < 8; i++){
				actualDataReader.readLine();
			}
			
			boolean endOfString = false;
			do{
				String sample = sampleDataReader.readLine();
				String actual = actualDataReader.readLine();
				if(sample == null){
					endOfString = true;
					continue;
				}
				Assert.assertTrue(sample+"\n"+actual, sample.equals(actual));
			}while (!endOfString);
		}