diff --git a/.project b/.project new file mode 100644 index 00000000..071b8b81 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + addressbook + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000..f897a7f1 --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..dff5f3a5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1 @@ +language: java diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..119a023e --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,58 @@ +node { + def mvnHome + def version + stage('Preparation') { +<<<<<<< HEAD + git 'https://github.com/SeshagiriSriram/addressbook.git' + mvnHome = tool 'LOCAL_MAVEN' + version = '2.3.5' + } + stage('Build') { + withMaven( + maven: 'LOCAL_MAVEN', // Maven installation declared in the Jenkins "Global Tool Configuration" + mavenSettingsConfig: 'settings.xml', // Maven settings.xml file defined with the Jenkins Config File Provider Plugin + mavenLocalRepo: 'd:/repos') { + + if (isUnix()) { + sh "'${mvnHome}/bin/mvn' -Dmaven.test.failure.ignore test -Pfunctional-test -DSkipUTs=true -DskipTests=true" + } else { + bat(/"${mvnHome}\bin\mvn" -Dmaven.test.failure.ignore test -Pfunctional-test -DSkipUTs=true -DskipTests=true/) +======= + git 'https://github.com/sachingupta771/addressbook.git' + mvnHome = tool 'LOCAL_MAVEN' + version = '3.3.9' + } + stage('Perform-UnitTest') { + withMaven( + maven: 'LOCAL_MAVEN', // Maven installation declared in the Jenkins "Global Tool Configuration" + mavenSettingsConfig: 'settings.xml', // Maven settings.xml file defined with the Jenkins Config File Provider Plugin + mavenLocalRepo: '/opt/maven') { + + if (isUnix()) { + sh "'${mvnHome}/bin/mvn' clean test" + } else { + bat(/"${mvnHome}\bin\mvn" -Dmaven.test.failure.ignore clean test/) +>>>>>>> c618cbe7fefbbff7a5530f00ef38639b7f80756d + } + } // withMaven will discover the generated Maven artifacts, JUnit reports and FindBugs reports + + + } +<<<<<<< HEAD + stage('Results') { + junit '**/target/surefire-reports/TEST-*.xml' + archive 'target/*.jar' + } + stage('DeployToServer') { + } +} +======= + stage('PublishResults') { + junit '**/target/surefire-reports/TEST-*.xml' + archive 'target/*.jar' + } + + stage('notify') { + } +} +>>>>>>> c618cbe7fefbbff7a5530f00ef38639b7f80756d diff --git a/README.md b/README.md index fefd2a53..3b1a0acb 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,31 @@ To use the built in server adapters of Eclipse, instead of doing "Run As -> Mave - Select the server you want to run on, e.g. Apache Tomcat 8 and click ok - *Do not use the suggested J2EE Preview server* as it is outdated, deprecated and does not support Servlet 3, which is required for this application +## Required Software +* Maven +* ANT +* Java (preferrably JDK 7+) +* PMD (Optional - if not installing it, remove references to PMD in Ant build files) +* Cobertura (Optional, bu recommended) + +### Installing PMD +* Download PMD from https://github.com/pmd/pmd/releases/download/pmd_releases%2F5.4.0/pmd-bin-5.4.0.zip +* Unzip file to c:\apps\pmd +* Set System Variable PMD_HOME to c:\apps\pmd + +### Installing Maven +* Download MAven and unzip to a folder +* set MAVEN_HOME to name of folders where it was unzipped. + +### Installing ANT +* Download MAven and unzip to a folder +* set ANT_HOME to name of folders where it was unzipped. + +### Additional config +* download and copy following files to %ANT_HOME%\lib folder + * sonarqube-ant-task-2.4.jar + * ant-contrib.jar (Download from from http://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ (Do not use 1.0b3)) + * maven-ant-tasks-2.1.3.jar +* Adjust paths in build.xml/build.properties as per your local configuration + *** End of documentation \ No newline at end of file diff --git a/addressbook_main/.classpath b/addressbook_main/.classpath new file mode 100644 index 00000000..3c88c332 --- /dev/null +++ b/addressbook_main/.classpath @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addressbook_main/.gitignore b/addressbook_main/.gitignore new file mode 100644 index 00000000..b83d2226 --- /dev/null +++ b/addressbook_main/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/addressbook_main/.project b/addressbook_main/.project new file mode 100644 index 00000000..0ced24b2 --- /dev/null +++ b/addressbook_main/.project @@ -0,0 +1,37 @@ + + + addressbook_main + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/addressbook_main/.settings/.jsdtscope b/addressbook_main/.settings/.jsdtscope new file mode 100644 index 00000000..24181231 --- /dev/null +++ b/addressbook_main/.settings/.jsdtscope @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/addressbook_main/.settings/org.eclipse.core.resources.prefs b/addressbook_main/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..cdfe4f1b --- /dev/null +++ b/addressbook_main/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/addressbook_main/.settings/org.eclipse.jdt.core.prefs b/addressbook_main/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..6e80039d --- /dev/null +++ b/addressbook_main/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/addressbook_main/.settings/org.eclipse.m2e.core.prefs b/addressbook_main/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000..f897a7f1 --- /dev/null +++ b/addressbook_main/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/addressbook_main/.settings/org.eclipse.wst.common.component b/addressbook_main/.settings/org.eclipse.wst.common.component new file mode 100644 index 00000000..0bf189c2 --- /dev/null +++ b/addressbook_main/.settings/org.eclipse.wst.common.component @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/addressbook_main/.settings/org.eclipse.wst.common.project.facet.core.xml b/addressbook_main/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000..427e35e9 --- /dev/null +++ b/addressbook_main/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/addressbook_main/.settings/org.eclipse.wst.jsdt.ui.superType.container b/addressbook_main/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 00000000..3bd5d0a4 --- /dev/null +++ b/addressbook_main/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/addressbook_main/.settings/org.eclipse.wst.jsdt.ui.superType.name b/addressbook_main/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 00000000..05bd71b6 --- /dev/null +++ b/addressbook_main/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/addressbook_main/.settings/org.eclipse.wst.validation.prefs b/addressbook_main/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 00000000..04cad8cb --- /dev/null +++ b/addressbook_main/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,2 @@ +disabled=06target +eclipse.preferences.version=1 diff --git a/build.properties b/addressbook_main/build.properties similarity index 100% rename from build.properties rename to addressbook_main/build.properties diff --git a/build.xml b/addressbook_main/build.xml similarity index 100% rename from build.xml rename to addressbook_main/build.xml diff --git a/addressbook_main/pom.xml b/addressbook_main/pom.xml new file mode 100644 index 00000000..d593f179 --- /dev/null +++ b/addressbook_main/pom.xml @@ -0,0 +1,692 @@ + + + 4.0.0 + com.edurekademo.tutorial + addressbook_main + war + 1.1.1-SNAPSHOT + Vaadin Addressbook example + + UTF-8 + false + 8.0.0.alpha2 + ${vaadin.version} + ssriram + 198ffad5-5b21-421b-9f62-847273245db2 + false + ${skipTests} + ${skipTests} + SeshagiriSriram + + + + + + ${env.ART_ID} + ${env.ART_NAME} + ${env.ART_URL} + + + ${env.REL_ART_ID} + ${env.REL_ART_NAME} + ${env.REL_ART_URL} + + + + + scm:git:git@github.com:${github.account}/addressbook.git + scm:git:git@github.com:${github.account}/addressbook.git + scm:git:git@github.com:${github.account}/game-of-life.git + + HEAD + + + + + vaadin-prereleases + Vaadin Pre-releases + https://maven.vaadin.com/vaadin-prereleases + + + + vaadin-addons + http://maven.vaadin.com/vaadin-addons + + + + vaadin-snapshots + http://oss.sonatype.org/content/repositories/vaadin-snapshots/ + + false + + + true + + + + + + + vaadin-snapshots + http://oss.sonatype.org/content/repositories/vaadin-snapshots/ + + false + + + true + + + + apache.snapshots + Apache Snapshots + http://repository.apache.org/content/groups/snapshots-group/ + + false + + + true + + + + apache.public + Apache public + http://repository.apache.org/content/groups/public + + true + + + false + + + + + + + + com.vaadin + vaadin-compatibility-server + ${vaadin.version} + + + com.vaadin + vaadin-compatibility-shared + ${vaadin.version} + + + com.vaadin + vaadin-compatibility-client-compiled + ${vaadin.version} + + + com.vaadin + vaadin-themes + ${vaadin.version} + + + javax.servlet + javax.servlet-api + 3.0.1 + compile + + + + commons-beanutils + commons-beanutils + 1.9.3 + jar + + + + commons-codec + commons-codec + 1.5 + + + + + log4j + log4j + 1.2.7 + + + org.slf4j + slf4j-api + 1.7.7 + + + org.slf4j + slf4j-simple + 1.7.7 + + + org.slf4j + slf4j-log4j12 + 1.7.7 + + + + + junit + junit + 4.7 + test + + + + + + commons-httpclient + commons-httpclient + 3.1 + + + + org.apache.commons + commons-lang3 + 3.1 + + + + + org.json + json + 20140107 + + + org.codehaus.jackson + jackson-jaxrs + 1.9.4 + + + + + com.sun.xml.security + xml-security-impl + 1.0 + + + + org.seleniumhq.selenium + selenium-java + 2.46.0 + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.2 + + 1.8 + 1.8 + + + + org.eclipse.jetty + jetty-maven-plugin + 9.2.3.v20140905 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19.1 + + methods + 10 + ${skipUTs} + + **/Test*.java + **/Test.java + **/TestCase.java + + + + **/*Abstract*Test.java + **/*selenium_test*.java + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + -Xdoclint:none + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.19.1 + + + run-integration-tests + integration-test + + integration-test + verify + + + + + ${skipTests} + ${skipITs} + methods + 10 + + + + + **/*Abstract*Test.java + **/Test*.java + **/Test.java + **/TestCase.java + ${mytest} + + + + + + + addressbook + + + + + + + org.apache.maven.plugins + maven-surefire-report-plugin + 2.19.1 + + + org.apache.maven.plugins + maven-failsafe-report-plugin + 2.19.1 + + + + + + + + development + + true + + + + + + web-test + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.19.1 + + + run-integration-tests + integration-test + + integration-test + verify + + + + + ${skipTests} + ${skipITs} + methods + 10 + + **/*selenium_test*.java + + + **/*Abstract*Test.java + **/Test*.java + **/Test.java + **/TestCase.java + ${mytest} + + + + + + + + + + + + functional-test + + + + org.easyb + maven-easyb-plugin + 1.4 + + + + test + + + + + html + target/easyb/easyb.html + src/test/stories + -Xmx512m -Dwebdriver.driver=${webdriver.driver} + + + + + + + + metrics + + + + + + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.2 + + 1.8 + true + html + + 20 + + true + 2 + + + + + + findbugs-maven-plugin + 2.4.0 + + Max + true + + + + + + + maven3 + + true + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 1.0 + + + enforce-versions + + enforce + + + + + [3.0,) + + + + + + + + org.apache.maven.plugins + maven-site-plugin + 3.3 + + + + maven-project-info-reports-plugin + 2.7 + + + org.jacoco + jacoco-maven-plugin + 0.7.2.201409121644 + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.0.1 + + + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.2 + + 1.8 + true + html + + /pmd-rules.xml + + + 20 + true + + + + org.codehaus.mojo + findbugs-maven-plugin + 2.4.0 + + Max + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + -Xdoclint:none + + + + + org.apache.maven.plugins + maven-jxr-plugin + 2.4 + + + + + + com.edurekademo.tutorial + addressbook + ${project.version} + + + + + + + + maven2 + + + + org.apache.maven.plugins + maven-enforcer-plugin + 1.0 + + + enforce-versions + + enforce + + + + + [2.0.9, 2.2.1] + + + + + + + + org.apache.maven.plugins + maven-site-plugin + 2.1.1 + + + com.edurekademo.tutorial + addressbook + ${project.version} + + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + ${cobertura.version} + + + html + xml + + + + + org.apache.maven.plugins + maven-pmd-plugin + 2.5 + + 1.8 + true + html + + /pmd-rules.xml + + + 20 + true + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.9.1 + + addressbook-build/checkstyle.xml + + + + org.codehaus.mojo + findbugs-maven-plugin + 2.4.0 + + Max + true + + + + maven-javadoc-plugin + 2.7 + + 1.8 + + gr.spinellis.umlgraph.doclet.UmlGraphDoc + + + gr.spinellis + UmlGraph + 4.6 + + + -inferrel -inferdep -hide java.* -collpackages + java.util.* -attributes -operations + -enumerations -enumconstants + + + + + org.apache.maven.plugins + maven-jxr-plugin + 2.1 + + + + + + + + diff --git a/src/main/java/com/edurekademo/helper/GenericResourceBundle.java b/addressbook_main/src/main/java/com/edurekademo/helper/GenericResourceBundle.java similarity index 100% rename from src/main/java/com/edurekademo/helper/GenericResourceBundle.java rename to addressbook_main/src/main/java/com/edurekademo/helper/GenericResourceBundle.java diff --git a/src/main/java/com/edurekademo/tutorial/addressbook/AddressbookUI.java b/addressbook_main/src/main/java/com/edurekademo/tutorial/addressbook/AddressbookUI.java similarity index 100% rename from src/main/java/com/edurekademo/tutorial/addressbook/AddressbookUI.java rename to addressbook_main/src/main/java/com/edurekademo/tutorial/addressbook/AddressbookUI.java diff --git a/src/main/java/com/edurekademo/tutorial/addressbook/ContactForm.java b/addressbook_main/src/main/java/com/edurekademo/tutorial/addressbook/ContactForm.java similarity index 97% rename from src/main/java/com/edurekademo/tutorial/addressbook/ContactForm.java rename to addressbook_main/src/main/java/com/edurekademo/tutorial/addressbook/ContactForm.java index 6a4d0ac2..e185be18 100644 --- a/src/main/java/com/edurekademo/tutorial/addressbook/ContactForm.java +++ b/addressbook_main/src/main/java/com/edurekademo/tutorial/addressbook/ContactForm.java @@ -12,7 +12,7 @@ import com.vaadin.v7.data.fieldgroup.FieldGroup; import com.vaadin.v7.ui.DateField; import com.vaadin.v7.ui.TextField; - +import com.edurekademo.utilities.LoggerStackTraceUtil; /* Create custom UI Components. * * Create your own Vaadin components by inheritance and composition. @@ -88,6 +88,7 @@ public void save(Button.ClickEvent event) { getUI().refreshContacts(); } catch (FieldGroup.CommitException e) { // Validation exceptions could be shown here + LoggerStackTraceUtil.printErrorMessage(e); } } diff --git a/src/main/java/com/edurekademo/tutorial/addressbook/backend/Contact.java b/addressbook_main/src/main/java/com/edurekademo/tutorial/addressbook/backend/Contact.java similarity index 100% rename from src/main/java/com/edurekademo/tutorial/addressbook/backend/Contact.java rename to addressbook_main/src/main/java/com/edurekademo/tutorial/addressbook/backend/Contact.java diff --git a/src/main/java/com/edurekademo/tutorial/addressbook/backend/ContactService.java b/addressbook_main/src/main/java/com/edurekademo/tutorial/addressbook/backend/ContactService.java similarity index 97% rename from src/main/java/com/edurekademo/tutorial/addressbook/backend/ContactService.java rename to addressbook_main/src/main/java/com/edurekademo/tutorial/addressbook/backend/ContactService.java index 34da9ecb..1c31db33 100644 --- a/src/main/java/com/edurekademo/tutorial/addressbook/backend/ContactService.java +++ b/addressbook_main/src/main/java/com/edurekademo/tutorial/addressbook/backend/ContactService.java @@ -59,7 +59,7 @@ public synchronized List findAll(String stringFilter) { ArrayList arrayList = new ArrayList(); for (Contact contact : contacts.values()) { try { - boolean passesFilter = (stringFilter == null || stringFilter.isEmpty()) + boolean passesFilter = stringFilter == null || stringFilter.isEmpty() || contact.toString().toLowerCase() .contains(stringFilter.toLowerCase()); if (passesFilter) { diff --git a/src/main/java/com/edurekademo/utilities/CaseInsensitiveComparator.java b/addressbook_main/src/main/java/com/edurekademo/utilities/CaseInsensitiveComparator.java similarity index 100% rename from src/main/java/com/edurekademo/utilities/CaseInsensitiveComparator.java rename to addressbook_main/src/main/java/com/edurekademo/utilities/CaseInsensitiveComparator.java diff --git a/src/main/java/com/edurekademo/utilities/GenericComparator.java b/addressbook_main/src/main/java/com/edurekademo/utilities/GenericComparator.java similarity index 100% rename from src/main/java/com/edurekademo/utilities/GenericComparator.java rename to addressbook_main/src/main/java/com/edurekademo/utilities/GenericComparator.java diff --git a/src/main/java/com/edurekademo/utilities/HexAsciiConvertor.java b/addressbook_main/src/main/java/com/edurekademo/utilities/HexAsciiConvertor.java similarity index 100% rename from src/main/java/com/edurekademo/utilities/HexAsciiConvertor.java rename to addressbook_main/src/main/java/com/edurekademo/utilities/HexAsciiConvertor.java diff --git a/src/main/java/com/edurekademo/utilities/LoggerStackTraceUtil.java b/addressbook_main/src/main/java/com/edurekademo/utilities/LoggerStackTraceUtil.java similarity index 100% rename from src/main/java/com/edurekademo/utilities/LoggerStackTraceUtil.java rename to addressbook_main/src/main/java/com/edurekademo/utilities/LoggerStackTraceUtil.java diff --git a/src/main/java/com/edurekademo/utilities/PrepareTargetMethod.java b/addressbook_main/src/main/java/com/edurekademo/utilities/PrepareTargetMethod.java similarity index 100% rename from src/main/java/com/edurekademo/utilities/PrepareTargetMethod.java rename to addressbook_main/src/main/java/com/edurekademo/utilities/PrepareTargetMethod.java diff --git a/src/main/java/com/edurekademo/utilities/PropertyHelper.java b/addressbook_main/src/main/java/com/edurekademo/utilities/PropertyHelper.java similarity index 98% rename from src/main/java/com/edurekademo/utilities/PropertyHelper.java rename to addressbook_main/src/main/java/com/edurekademo/utilities/PropertyHelper.java index a1bf5ab5..0a62097d 100644 --- a/src/main/java/com/edurekademo/utilities/PropertyHelper.java +++ b/addressbook_main/src/main/java/com/edurekademo/utilities/PropertyHelper.java @@ -54,8 +54,6 @@ public static String getProperty(String propertyName){ LoggerStackTraceUtil.printErrorMessage(e); propertyValue = ""; } - finally { - } return propertyValue; } @@ -79,8 +77,6 @@ public static String getProperty(String propertyName,String strDefault){ LoggerStackTraceUtil.printErrorMessage(e); propertyValue = ""; } - finally { - } return propertyValue; } diff --git a/src/main/java/com/edurekademo/utilities/PropertyLoader.java b/addressbook_main/src/main/java/com/edurekademo/utilities/PropertyLoader.java similarity index 96% rename from src/main/java/com/edurekademo/utilities/PropertyLoader.java rename to addressbook_main/src/main/java/com/edurekademo/utilities/PropertyLoader.java index 628918ae..e0ca1a53 100644 --- a/src/main/java/com/edurekademo/utilities/PropertyLoader.java +++ b/addressbook_main/src/main/java/com/edurekademo/utilities/PropertyLoader.java @@ -93,9 +93,9 @@ public static Properties loadProperties (String names, ClassLoader loader) { in.close (); } - catch (Throwable ignore) {} + catch (Throwable ignore) {LOG.debug("Ignored exception",ignore.getMessage());} } - if (THROW_ON_LOAD_FAILURE && (result == null)) + if (THROW_ON_LOAD_FAILURE && result == null) { // LOG exception... Do not re-throw this.. as I do not expect users to catch this exception :-) //throw new IllegalArgumentException ("could not load [" + name + "]"+ " as " + (LOAD_AS_RESOURCE_BUNDLE ? "a resource bundle" : "a classloader resource")); diff --git a/src/main/java/com/edurekademo/utilities/StringUtilities.java b/addressbook_main/src/main/java/com/edurekademo/utilities/StringUtilities.java similarity index 93% rename from src/main/java/com/edurekademo/utilities/StringUtilities.java rename to addressbook_main/src/main/java/com/edurekademo/utilities/StringUtilities.java index 2f83a35b..2fedfe70 100644 --- a/src/main/java/com/edurekademo/utilities/StringUtilities.java +++ b/addressbook_main/src/main/java/com/edurekademo/utilities/StringUtilities.java @@ -133,7 +133,7 @@ private static Object convert(String value, String types) { Class> finalClass = null ; //If value or type passed is null or empty or string return back value as such - if ((value == null) || value.isEmpty() || types == null || types.isEmpty() || types.equalsIgnoreCase(STRING_TYPE)) return value; + if (value == null || value.isEmpty() || types == null || types.isEmpty() || types.equalsIgnoreCase(STRING_TYPE)) return value; String type = types.toLowerCase(); @@ -180,12 +180,13 @@ private static Object convertStringToDate(String dateString) { Object finalDate = null; String dateStringVal=null; //If the incoming date string contains the format as well parse using the given format, else parse using default - dateFormat = (dateString.contains(DATEFORMAT_SEPARATOR)) ? dateString.split(DATEFORMAT_SEPARATOR)[1] : DATE_FORMAT ; - dateStringVal = (dateString.contains(DATEFORMAT_SEPARATOR)) ? dateString.split(DATEFORMAT_SEPARATOR)[0] : dateString ; + dateFormat = dateString.contains(DATEFORMAT_SEPARATOR) ? dateString.split(DATEFORMAT_SEPARATOR)[1] : DATE_FORMAT ; + dateStringVal = dateString.contains(DATEFORMAT_SEPARATOR) ? dateString.split(DATEFORMAT_SEPARATOR)[0] : dateString ; SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat); try{ finalDate = dateFormatter.parse(dateStringVal); + LOG.debug("convertStringToDate:{}/{}",dateStringVal,finalDate); }catch(ParseException e){ LoggerStackTraceUtil.printErrorMessage(e); } diff --git a/src/main/pmd/pmd.xsl b/addressbook_main/src/main/pmd/pmd.xsl similarity index 98% rename from src/main/pmd/pmd.xsl rename to addressbook_main/src/main/pmd/pmd.xsl index 5035d4db..33eee081 100644 --- a/src/main/pmd/pmd.xsl +++ b/addressbook_main/src/main/pmd/pmd.xsl @@ -85,7 +85,7 @@ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /> - PMD Report: Demo Utilities. Generated on + PMD Report: Addressbook Web Application. Generated on diff --git a/src/main/pmd/ruleset_basics.xml b/addressbook_main/src/main/pmd/ruleset_basics.xml similarity index 100% rename from src/main/pmd/ruleset_basics.xml rename to addressbook_main/src/main/pmd/ruleset_basics.xml diff --git a/src/main/pmd/ruleset_j2ee.xml b/addressbook_main/src/main/pmd/ruleset_j2ee.xml similarity index 100% rename from src/main/pmd/ruleset_j2ee.xml rename to addressbook_main/src/main/pmd/ruleset_j2ee.xml diff --git a/src/main/pmd/ruleset_security.xml b/addressbook_main/src/main/pmd/ruleset_security.xml similarity index 100% rename from src/main/pmd/ruleset_security.xml rename to addressbook_main/src/main/pmd/ruleset_security.xml diff --git a/src/test/java/com/edurekademo/utilities/ExceptionThrower.java b/addressbook_main/src/test/java/com/edurekademo/utilities/ExceptionThrower.java similarity index 100% rename from src/test/java/com/edurekademo/utilities/ExceptionThrower.java rename to addressbook_main/src/test/java/com/edurekademo/utilities/ExceptionThrower.java diff --git a/src/test/java/com/edurekademo/utilities/TestGenericComparator.java b/addressbook_main/src/test/java/com/edurekademo/utilities/TestGenericComparator.java similarity index 100% rename from src/test/java/com/edurekademo/utilities/TestGenericComparator.java rename to addressbook_main/src/test/java/com/edurekademo/utilities/TestGenericComparator.java diff --git a/src/test/java/com/edurekademo/utilities/TestHexAsciiConversion.java b/addressbook_main/src/test/java/com/edurekademo/utilities/TestHexAsciiConversion.java similarity index 100% rename from src/test/java/com/edurekademo/utilities/TestHexAsciiConversion.java rename to addressbook_main/src/test/java/com/edurekademo/utilities/TestHexAsciiConversion.java diff --git a/src/test/java/com/edurekademo/utilities/TestLogger.java b/addressbook_main/src/test/java/com/edurekademo/utilities/TestLogger.java similarity index 100% rename from src/test/java/com/edurekademo/utilities/TestLogger.java rename to addressbook_main/src/test/java/com/edurekademo/utilities/TestLogger.java diff --git a/src/test/java/com/edurekademo/utilities/UnitDTO.java b/addressbook_main/src/test/java/com/edurekademo/utilities/UnitDTO.java similarity index 100% rename from src/test/java/com/edurekademo/utilities/UnitDTO.java rename to addressbook_main/src/test/java/com/edurekademo/utilities/UnitDTO.java diff --git a/addressbook_main/src/test/java/com/edurekademo/webtest/selenium_tests.java b/addressbook_main/src/test/java/com/edurekademo/webtest/selenium_tests.java new file mode 100644 index 00000000..b611790c --- /dev/null +++ b/addressbook_main/src/test/java/com/edurekademo/webtest/selenium_tests.java @@ -0,0 +1,36 @@ +package com.edurekademo.webtest; +import static org.junit.Assert.*; + +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.remote.DesiredCapabilities; +import org.openqa.selenium.remote.RemoteWebDriver; + +import java.net.MalformedURLException; +import java.net.URL; + +import org.junit.Test; + +public class selenium_tests { + + @Test + public void test() throws MalformedURLException { + //String URL = "https://ssriram:198ffad5-5b21-421b-9f62-847273245db2@ondemand.saucelabs.com:443/wd/hub"; + + //DesiredCapabilities caps = DesiredCapabilities.chrome(); + //caps.setCapability("platform", "Windows XP"); + //caps.setCapability("version", "43.0"); + + //WebDriver driver = new RemoteWebDriver(new URL(URL), caps); + + /** + * Goes to Sauce Lab's guinea-pig page and prints title + */ + + //driver.get("https://saucelabs.com/test/guinea-pig"); + //System.out.println("title of page is: " + driver.getTitle()); + System.out.println("title of page is: Some Demo Page"); + //driver.quit(); + + } + +} diff --git a/src/test/resources/Dateformat.properties b/addressbook_main/src/test/resources/Dateformat.properties similarity index 100% rename from src/test/resources/Dateformat.properties rename to addressbook_main/src/test/resources/Dateformat.properties diff --git a/addressbook_main/src/test/stories/CountingThings.story b/addressbook_main/src/test/stories/CountingThings.story new file mode 100644 index 00000000..db3fee29 --- /dev/null +++ b/addressbook_main/src/test/stories/CountingThings.story @@ -0,0 +1,12 @@ +scenario 'Adding two integers', { + given 'two integer values of 1 and 2', { + a = 1 + b = 2 + } + when 'we calculate the sum of the two values', { + sum = a + b + } + then 'the sum should be 3', { + sum.shouldBe 3 + } +} \ No newline at end of file diff --git a/addressbook_main/src/test/stories/MultiplyingThings.story b/addressbook_main/src/test/stories/MultiplyingThings.story new file mode 100644 index 00000000..efe52c5c --- /dev/null +++ b/addressbook_main/src/test/stories/MultiplyingThings.story @@ -0,0 +1,12 @@ +scenario 'Multiplying two integers', { + given 'two integer values of 2 and 3', { + a = 2 + b = 3 + } + when 'we calculate the product of the two values', { + mult = a * b + } + then 'the product should be 6', { + mult.shouldBe 6 + } +} \ No newline at end of file diff --git a/deploy.bat b/deploy.bat new file mode 100644 index 00000000..57091edd --- /dev/null +++ b/deploy.bat @@ -0,0 +1,11 @@ +@echo off +echo %ART_ID% : %ART_URL% +echo %REL_ART_ID% : %REL_ART_URL% + +set REL_ART_ID=release-qa +SET REL_ART_URL=http://localhost:8081/repository/release-qa/ + +set REL_ART_ID=maven-releases +SET REL_ART_URL=http://localhost:8081/repository/maven-releases/ + +mvn deploy \ No newline at end of file diff --git a/pom.xml b/pom.xml index f2b7c142..a1a5b8fb 100644 --- a/pom.xml +++ b/pom.xml @@ -1,44 +1,38 @@ - + 4.0.0 com.edurekademo.tutorial addressbook - war - 2.0 - Vaadin Addressbook example - + 1.1.1-SNAPSHOT + pom + Address Book Edureka Demo + https://github.com/SeshagiriSriram/addressbook + SNAPSHOT UTF-8 - false - 8.0.0.alpha2 - ${vaadin.version} + 1.4 + 2.6 + + 1.8 + 1.8 + SeshagiriSriram + 0.9.268 + addressbook - - - - vaadin-prereleases - Vaadin Pre-releases - https://maven.vaadin.com/vaadin-prereleases - - - - vaadin-addons - http://maven.vaadin.com/vaadin-addons - - - - vaadin-snapshots - http://oss.sonatype.org/content/repositories/vaadin-snapshots/ - - false - - - true - - - + + + ${env.ART_ID} + ${env.ART_NAME} + ${env.ART_URL} + + + ${env.REL_ART_ID} + ${env.REL_ART_NAME} + ${env.REL_ART_URL} + + + + @@ -51,445 +45,34 @@ true + + apache.snapshots + Apache Snapshots + http://repository.apache.org/content/groups/snapshots-group/ + + false + + + true + + + + apache.public + Apache public + http://repository.apache.org/content/groups/public + + true + + + false + + - - - com.vaadin - vaadin-compatibility-server - ${vaadin.version} - - - com.vaadin - vaadin-compatibility-shared - ${vaadin.version} - - - com.vaadin - vaadin-compatibility-client-compiled - ${vaadin.version} - - - com.vaadin - vaadin-themes - ${vaadin.version} - - - javax.servlet - javax.servlet-api - 3.0.1 - compile - - - - commons-beanutils - commons-beanutils - 1.9.2 - jar - - - - - log4j - log4j - 1.2.9 - - - org.slf4j - slf4j-api - 1.7.7 - - - org.slf4j - slf4j-simple - 1.7.7 - - - org.slf4j - slf4j-log4j12 - 1.7.7 - - - - - junit - junit - 4.7 - test - - - - - - commons-httpclient - commons-httpclient - 3.1 - - - - org.apache.commons - commons-lang3 - 3.1 - - - - - org.json - json - 20140107 - - - org.codehaus.jackson - jackson-jaxrs - 1.9.4 - - - - - com.sun.xml.security - xml-security-impl - 1.0 - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.2 - - 1.8 - 1.8 - - - - org.eclipse.jetty - jetty-maven-plugin - 9.2.3.v20140905 - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.19.1 - - methods - 10 - - **/Test*.java - **/Test.java - **/TestCase.java - - - **/*Abstract*Test.java - - - - - - addressbook - - - - - - - org.apache.maven.plugins - maven-surefire-report-plugin - 2.19.1 - - - - - - - development - - true - - - - - metrics - - - - - - - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-pmd-plugin - 3.2 - - 1.8 - true - xml - - 20 - - true - 2 - - - - - - findbugs-maven-plugin - 2.4.0 - - Max - true - - - - - - - maven3 - - true - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.0 - - - enforce-versions - - enforce - - - - - [3.0,) - - - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.3 - - - - maven-project-info-reports-plugin - 2.7 - - - org.jacoco - jacoco-maven-plugin - 0.7.2.201409121644 - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.0.1 - - - - - - org.apache.maven.plugins - maven-pmd-plugin - 3.2 - - 1.8 - true - xml - - /pmd-rules.xml - - - 20 - true - - - - org.codehaus.mojo - findbugs-maven-plugin - 2.4.0 - - Max - true - - - - maven-javadoc-plugin - 2.9.1 - - 1.8 - - gr.spinellis.umlgraph.doclet.UmlGraphDoc - - - gr.spinellis - UmlGraph - 4.6 - - - -inferrel -inferdep -hide java.* -collpackages - java.util.* -attributes -operations - -enumerations -enumconstants - - - - - org.apache.maven.plugins - maven-jxr-plugin - 2.4 - - - - - - com.edurekademo.tutorial - addressbook - ${project.version} - - - - - - - - maven2 - - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.0 - - - enforce-versions - - enforce - - - - - [2.0.9, 2.2.1] - - - - - - - - org.apache.maven.plugins - maven-site-plugin - 2.1.1 - - - com.edurekademo.tutorial - addressbook - ${project.version} - - - - - - - - - org.codehaus.mojo - cobertura-maven-plugin - ${cobertura.version} - - - html - xml - - - - - org.apache.maven.plugins - maven-pmd-plugin - 2.5 - - 1.8 - true - xml - - /pmd-rules.xml - - - 20 - true + + addressbook_main + - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.9.1 - - addressbook-build/checkstyle.xml - - - - org.codehaus.mojo - findbugs-maven-plugin - 2.4.0 - - Max - true - - - - maven-javadoc-plugin - 2.7 - - 1.8 - - gr.spinellis.umlgraph.doclet.UmlGraphDoc - - - gr.spinellis - UmlGraph - 4.6 - - - -inferrel -inferdep -hide java.* -collpackages - java.util.* -attributes -operations - -enumerations -enumconstants - - - - - org.apache.maven.plugins - maven-jxr-plugin - 2.1 - - - - - diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..2e8e7856 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,14 @@ +# must be unique in a given SonarQube instance +sonar.projectKey=sapient:demo +# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1. +sonar.projectName=Address Book New +sonar.projectVersion=1.0.5 + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +# Since SonarQube 4.2, this property is optional if sonar.modules is set. +# If not set, SonarQube starts looking for source code from the directory containing +# the sonar-project.properties file. +sonar.sources=. + +# Encoding of the source code. Default is default system encoding +#sonar.sourceEncoding=UTF-8 \ No newline at end of file