Skip to content

Commit a0dbcc2

Browse files
authored
fix some messages (#1056)
1 parent 47e1ffc commit a0dbcc2

File tree

6 files changed

+58
-16
lines changed

6 files changed

+58
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2016 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.tools.eclipse.appengine.newproject.maven;
18+
19+
import org.junit.Assert;
20+
import org.junit.Test;
21+
22+
public class MessagesTest {
23+
24+
@Test
25+
public void testWizardTitle() {
26+
Assert.assertEquals(
27+
"Maven-based App Engine Standard Project", Messages.getString("WIZARD_TITLE"));
28+
}
29+
30+
}

plugins/com.google.cloud.tools.eclipse.appengine.newproject.maven/src/com/google/cloud/tools/eclipse/appengine/newproject/maven/CreateMavenBasedAppEngineStandardProject.java

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,32 @@ protected void execute(IProgressMonitor monitor)
5757
SubMonitor progress = SubMonitor.convert(monitor, "Creating Maven AppEngine archetype", 110);
5858

5959
String appengineArtifactVersion = MavenUtils.resolveLatestReleasedArtifactVersion(
60-
progress.newChild(20), "com.google.appengine", "appengine-api-1.0-sdk", "jar",
60+
progress.newChild(20),
61+
"com.google.appengine", //$NON-NLS-1$
62+
"appengine-api-1.0-sdk", //$NON-NLS-1$
63+
"jar", //$NON-NLS-1$
6164
AppEngineStandardFacet.DEFAULT_APPENGINE_SDK_VERSION);
6265
String gcloudArtifactVersion = MavenUtils.resolveLatestReleasedArtifactVersion(
63-
progress.newChild(20), "com.google.appengine", "gcloud-maven-plugin", "maven-plugin",
66+
progress.newChild(20),
67+
"com.google.appengine", //$NON-NLS-1$
68+
"gcloud-maven-plugin", //$NON-NLS-1$
69+
"maven-plugin", //$NON-NLS-1$
6470
AppEngineStandardFacet.DEFAULT_GCLOUD_PLUGIN_VERSION);
6571

6672
Properties properties = new Properties();
67-
properties.put("appengine-version", appengineArtifactVersion);
68-
properties.put("gcloud-version", gcloudArtifactVersion);
69-
properties.put("useJstl", "true");
73+
properties.put("appengine-version", appengineArtifactVersion); //$NON-NLS-1$
74+
properties.put("gcloud-version", gcloudArtifactVersion); //$NON-NLS-1$
75+
properties.put("useJstl", "true"); //$NON-NLS-1$ //$NON-NLS-2$
7076
// The project ID is currently necessary due to tool bugs.
71-
properties.put("application-id", artifactId);
72-
properties.put("useObjectify", Boolean.toString(appEngineLibraryIds.contains("objectify")));
73-
properties.put("useEndpoints1", Boolean.toString(appEngineLibraryIds.contains("appengine-endpoints")));
74-
properties.put("useEndpoints2", "false");
75-
properties.put("useAppEngineApi", Boolean.toString(appEngineLibraryIds.contains("appengine-api")));
77+
properties.put("application-id", artifactId); //$NON-NLS-1$
78+
properties.put("useObjectify", //$NON-NLS-1$
79+
Boolean.toString(appEngineLibraryIds.contains("objectify"))); //$NON-NLS-1$
80+
properties.put("useEndpoints1", //$NON-NLS-1$
81+
Boolean.toString(appEngineLibraryIds.contains("appengine-endpoints"))); //$NON-NLS-1$
82+
properties.put("useEndpoints2", //$NON-NLS-1$
83+
"false"); //$NON-NLS-1$
84+
properties.put("useAppEngineApi", //$NON-NLS-1$
85+
Boolean.toString(appEngineLibraryIds.contains("appengine-api"))); //$NON-NLS-1$
7686

7787
ProjectImportConfiguration importConfiguration = new ProjectImportConfiguration();
7888
String packageName = this.packageName == null || this.packageName.isEmpty()
@@ -85,8 +95,10 @@ protected void execute(IProgressMonitor monitor)
8595
for (IProject project : archetypeProjects) {
8696
IFacetedProject facetedProject = ProjectFacetsManager.create(
8797
project, true, loopMonitor.newChild(1));
88-
AppEngineStandardFacet.installAppEngineFacet(facetedProject, true /* installDependentFacets */, loopMonitor.newChild(1));
89-
AppEngineStandardFacet.installAllAppEngineRuntimes(facetedProject, true /* force */, loopMonitor.newChild(1));
98+
AppEngineStandardFacet.installAppEngineFacet(facetedProject,
99+
true /* installDependentFacets */, loopMonitor.newChild(1));
100+
AppEngineStandardFacet.installAllAppEngineRuntimes(facetedProject, true /* force */,
101+
loopMonitor.newChild(1));
90102
}
91103

92104
/*

plugins/com.google.cloud.tools.eclipse.appengine.newproject.maven/src/com/google/cloud/tools/eclipse/appengine/newproject/maven/MavenArchetypeProjectWizard.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.google.cloud.tools.eclipse.appengine.newproject.StandardProjectWizard;
2020
import com.google.cloud.tools.eclipse.appengine.ui.AppEngineJavaComponentMissingPage;
2121
import com.google.cloud.tools.eclipse.appengine.ui.CloudSdkMissingPage;
22-
import com.google.cloud.tools.eclipse.appengine.ui.Messages;
2322
import com.google.cloud.tools.eclipse.sdk.ui.preferences.CloudSdkPrompter;
2423
import com.google.cloud.tools.eclipse.usagetracker.AnalyticsEvents;
2524
import com.google.cloud.tools.eclipse.usagetracker.AnalyticsPingManager;

plugins/com.google.cloud.tools.eclipse.appengine.newproject.maven/src/com/google/cloud/tools/eclipse/appengine/newproject/maven/MavenCoordinatesValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private static boolean validateMavenId(String id) {
5656
return false;
5757
}
5858
// verify matches pattern
59-
return id.matches("[A-Za-z0-9_\\-.]+");
59+
return id.matches("[A-Za-z0-9_\\-.]+"); //$NON-NLS-1$
6060
}
6161

6262
private static IWorkspace getWorkspace() {

plugins/com.google.cloud.tools.eclipse.appengine.newproject.maven/src/com/google/cloud/tools/eclipse/appengine/newproject/maven/Messages.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
import java.util.ResourceBundle;
2121

2222
public class Messages {
23-
private static final String BUNDLE_NAME = "com.google.cloud.tools.eclipse.appengine.newproject.maven.messages"; //$NON-NLS-1$
23+
private static final String BUNDLE_NAME =
24+
"com.google.cloud.tools.eclipse.appengine.newproject.maven.messages"; //$NON-NLS-1$
2425

2526
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
2627

plugins/com.google.cloud.tools.eclipse.appengine.newproject.maven/src/com/google/cloud/tools/eclipse/appengine/newproject/maven/messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
WIZARD_TITLE=Maven-based App Engine Standard Project
2-
WIZARD_DESCRIPTION=Create new Maven-based App Engine Standard Project
2+
WIZARD_DESCRIPTION=Create new Maven-based App Engine Standard Environment Project
33
SELECT_AN_ARCHETYPE=Select an Archetype
44
APPENGINE_GUESTBOOK_ARCHETYPE_DESCRIPTION=Generates the guestbook demo sample, complete and ready to run and test.
55
APPENGINE_GUESTBOOK_ARCHETYPE_DISPLAY_NAME=Guestbook example

0 commit comments

Comments
 (0)