From 293e5569b511bc22e0278b8a5f0578b5ea0b3e38 Mon Sep 17 00:00:00 2001 From: "edburns%acm.org" Date: Thu, 26 Feb 2004 04:21:24 +0000 Subject: [PATCH] This checkin makes all the existing webclient unit tests run successfully. We are now ready to continue with webclient 2.0 development. M build-tests.xml - formatting M build.xml - added target that skips the "main" dependency. M src_moz/ProfileManagerImpl.cpp - correct error messages M test/automated/src/classes/org/mozilla/webclient/ProfileManagerTest.java - reset the system to the original profile before deleting the new one. git-svn-id: svn://10.0.0.236/trunk@153268 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/java/webclient/build-tests.xml | 2 +- mozilla/java/webclient/build.xml | 10 +++++++++- mozilla/java/webclient/src_moz/ProfileManagerImpl.cpp | 6 +++--- .../org/mozilla/webclient/ProfileManagerTest.java | 6 +++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/mozilla/java/webclient/build-tests.xml b/mozilla/java/webclient/build-tests.xml index c3b6f4ea208..73819e38b55 100644 --- a/mozilla/java/webclient/build-tests.xml +++ b/mozilla/java/webclient/build-tests.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/mozilla/java/webclient/build.xml b/mozilla/java/webclient/build.xml index 62d53cbfdff..bc447336896 100644 --- a/mozilla/java/webclient/build.xml +++ b/mozilla/java/webclient/build.xml @@ -293,10 +293,18 @@ ${myenv.MOZ_JDKHOME}/bin/java ${debug.options} org.mozilla.webclient.test.Embedd - + + + + + + + + diff --git a/mozilla/java/webclient/src_moz/ProfileManagerImpl.cpp b/mozilla/java/webclient/src_moz/ProfileManagerImpl.cpp index 43105cd2d5d..1cebd33385f 100644 --- a/mozilla/java/webclient/src_moz/ProfileManagerImpl.cpp +++ b/mozilla/java/webclient/src_moz/ProfileManagerImpl.cpp @@ -370,10 +370,10 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_ProfileMa (PRUnichar *) ::util_GetStringChars(env, oldNameJstr), *newName = (nsnull == newNameJstr) ? nsnull : (PRUnichar *) ::util_GetStringChars(env, newNameJstr); - + rv = profile->RenameProfile(oldName, newName); if (NS_FAILED(rv)) { - ::util_ThrowExceptionToJava(env, "Can't create new profile."); + ::util_ThrowExceptionToJava(env, "Can't rename new profile."); } ::util_ReleaseStringChars(env, oldNameJstr, oldName); @@ -402,7 +402,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_ProfileMa rv = profile->DeleteProfile(profileName, canDeleteFiles); if (NS_FAILED(rv)) { - ::util_ThrowExceptionToJava(env, "Can't create new profile."); + ::util_ThrowExceptionToJava(env, "Can't delete profile."); } ::util_ReleaseStringChars(env, profileNameJstr, profileName); diff --git a/mozilla/java/webclient/test/automated/src/classes/org/mozilla/webclient/ProfileManagerTest.java b/mozilla/java/webclient/test/automated/src/classes/org/mozilla/webclient/ProfileManagerTest.java index 98a92cb22be..3f03c843d48 100644 --- a/mozilla/java/webclient/test/automated/src/classes/org/mozilla/webclient/ProfileManagerTest.java +++ b/mozilla/java/webclient/test/automated/src/classes/org/mozilla/webclient/ProfileManagerTest.java @@ -1,5 +1,5 @@ /* - * $Id: ProfileManagerTest.java,v 1.1 2003-09-28 06:29:18 edburns%acm.org Exp $ + * $Id: ProfileManagerTest.java,v 1.2 2004-02-26 04:21:24 edburns%acm.org Exp $ */ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- @@ -117,6 +117,10 @@ public class ProfileManagerTest extends WebclientTestCase { } assertTrue(!hasExpectedProfile); + // switch back to the base profile + profiles = profileManager.getProfileList(); + profileManager.setCurrentProfile(profiles[0]); + // test that we can delete the new profile profileManager.deleteProfile(newName, true);