Framework may refer to: [http://en.wikipedia.org/wiki/Framework]
public void testSendPDWithJavamail() {
String host = "mailhost.xxxxx.com";
String from = "
This email address is being protected from spambots. You need JavaScript enabled to view it.
";
String to = "
This email address is being protected from spambots. You need JavaScript enabled to view it.
";
// Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", host);
// Get session
Session session = Session.getInstance(props, null);
try {
// Define message
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject("Hello JavaMail Attachment subject");
Multipart multipart = new MimeMultipart();
// Part one is a text
MimeBodyPart textMessageBodyPart = new MimeBodyPart();
textMessageBodyPart.setText("Hi hello this is the msg in mail");
multipart.addBodyPart(textMessageBodyPart);
// Part two is attachment
MimeBodyPart attachmentMessageBodyPart = new MimeBodyPart();
byte[] pdf = new Resource("A1U0E0.pdf").getRawContent();
attachmentMessageBodyPart.setDataHandler(new DataHandler(new ByteArrayDataSource(pdf, "application/pdf")));
multipart.addBodyPart(attachmentMessageBodyPart);
// Put parts in message
message.setContent(multipart);
// Send the message
Transport.send(message);
} catch (MessagingException e) {
Assert.fail(e.getMessage());
} catch (IOException e) {
Assert.fail(e.getMessage());
}
System.out.println("sent msg");
}
I put some effort the last few days in this new framework.
Done:
Selenium test suite do not accept a baseurl (or only a part of it) so I have a full path like /Joomla1.5.7/installation/index.php in a selenium test case instead of /installation/index.php in test case and baseurl= http://localhost/Joomla1.5.7)
All cluster operations are in cluster.xml these basic functions are
All Joomla specific operations are in joomla.library.xml
All PHPUnit operation are in phpunit.xml
Settings are in setEnv.xml, in future I will lazy load a file if it exist as environment variable
If you know ANT, the code is quite readable...
Packt publishing has offered me to make a review of two of their new books (Thanks to them). I should receive free samples for review beginning of next week. Since it is two of my favorite subjects (Maven and Joomla!® ), I think it may also interest you. A review will follow in some days.
- Make your extensions extensible, add extensions points to allow third parties to customize your extension
- Create international extensions by enabling multilingual capabilities
- Build more than just HTML pages - create PDF documents, Atom Feeds, and more!
- Improve the user experience by adding Ajax
- Create Atom and RSS feeds to keep users up-to-date
- Utilize the power of Subversion to maintain your source code
- Execute database queries and handle returned data in order to access and modify your data
- Dynamically extend your database tables using JParameter to make your extensions more flexible
- Keep your gremlins at bay by handling errors the Joomla! way
- Work with the file system, interrogate existing files and folders and store data in the file system
- Take control of your workflows by using www.JoomlaCode.org to manage your Joomla! projects
Here is 3 different way to control the lifetime a local Tomcat 7 container using Apache Maven. A typical scenario would be to start a servlet container prior to running integration tests (Selenium, SAHI or using any other framework you can think of )
With the following examples, you will be able to start an instance of Tomcat 7 running your web application in the pre-integration-test phase and stop the instance in the post-integration-test phase. You can also decide to use an embedded container like Jetty instead.
Read more: Tomcat 7 and Apache Maven
The Apache software fundation has put a new project in it's incubator line: Harmony
A free open source Java virtual machine and classes librairies!!!
Right now it is only a thread, and a FAQ...an interesting discussion has start on Slashdot.org
Purpose of this project is to create and use an open source, compatible implementation of J2SE
5, the latest version of the Java 2 Standard Edition specification.
"The Apache Software Foundation provides support for the Apache community of open-source software projects. The Apache projects are characterized by a collaborative, consensus based development process, an open and pragmatic software license, and a desire to create high quality software that leads the way in its field. We consider ourselves not simply a group of projects sharing a server, but rather a community of developers and users."
Update: Sun executives have endorsed the project, and the company might even participate. found at www.informationweek.com
The Zend Optimizer FAQ answers the question "Why use the Zend Optimizer?" with this statement: "The standard Zend run-time compiler used by PHP is indeed extremely fast, generating code that is usually 2 to 10 times faster. But an application that uses the Zend Optimizer typically executes another 40% to 100% faster."
Read the results of the load test HERE.
![]()
I will show you in an Apache Maven configuration file how to copy files to server each time the package phase is executed.
This snippet of code is a ready to use code that make use of Apache Ant task scp, Just put this snippet of code in your Maven module where the assembly is executed or anywhere else to push all tar.gz files to a server just run a maven mvn package, you can add as many ant task and push to many server the same file during the reactor build.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>server-copy</id>
<goals>
<goal>run</goal>
</goals>
<phase>package</phase>
<configuration>
<target>
<echo message="Push to server/home/"/>
<scp trust="yes"
todir="user:password@server:/home/">
<fileset dir="${basedir}/target">
<include name="**/*.tar.gz"/>
</fileset>
</scp>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.8.2</version>
</dependency>
</dependencies>
</plugin>
The maven-deploy-plugin allows you to configure the deploy phase to deploy to a server using scp. There is a page in the documentation that describes how it can be done.
Another alternative would be to use Maven Wagon SCP like described in this post for example
Privacy Statement | Copyright Notice | Licenses
© 1999-2012 Waltercedric.com. Designed by Cédric Walter. Sitemap
Reproduction without explicit permission is prohibited. All Rights Reserved. All photos remain copyright © their rightful owners. No copyright infringement is intended.
Disclaimer: The editor(s) reserve the right to edit any comments that are found to be abusive, offensive, contain profanity, serves as spam, is largely self-promotional, or displaying attempts to harbour irrelevant text links for any purpose.