You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cz...@apache.org on 2012/12/21 07:39:05 UTC
svn commit: r1424813 - in /incubator/flex/falcon/trunk/compiler.tests:
feature-tests/mxml/tags/ functional-tests/f/ src/org/ src/org/apache/
src/org/apache/flex/ src/org/apache/flex/utils/ src/utils/
unit-tests/org/apache/flex/compiler/internal/tree/mxml/
Author: czadra
Date: Fri Dec 21 06:39:05 2012
New Revision: 1424813
URL: http://svn.apache.org/viewvc?rev=1424813&view=rev
Log:
moved EnvProperties to org.apache.flex.utils and added apache license header
Added:
incubator/flex/falcon/trunk/compiler.tests/src/org/
incubator/flex/falcon/trunk/compiler.tests/src/org/apache/
incubator/flex/falcon/trunk/compiler.tests/src/org/apache/flex/
incubator/flex/falcon/trunk/compiler.tests/src/org/apache/flex/utils/
incubator/flex/falcon/trunk/compiler.tests/src/org/apache/flex/utils/EnvProperties.java (with props)
Removed:
incubator/flex/falcon/trunk/compiler.tests/src/utils/
Modified:
incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java
incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLNodeBaseTests.java
Modified: incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java?rev=1424813&r1=1424812&r2=1424813&view=diff
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java (original)
+++ incubator/flex/falcon/trunk/compiler.tests/feature-tests/mxml/tags/MXMLFeatureTestsBase.java Fri Dec 21 06:39:05 2012
@@ -31,10 +31,10 @@ import java.util.List;
import org.apache.flex.compiler.clients.MXMLC;
import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.utils.EnvProperties;
import org.apache.flex.utils.FilenameNormalization;
import org.apache.flex.utils.StringUtils;
-import utils.EnvProperties;
/**
* Base class for MXML feature tests which compile MXML code with MXMLC and run it in the standalone Flash Player.
Modified: incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java?rev=1424813&r1=1424812&r2=1424813&view=diff
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java (original)
+++ incubator/flex/falcon/trunk/compiler.tests/functional-tests/f/SDKSWCTests.java Fri Dec 21 06:39:05 2012
@@ -30,10 +30,10 @@ import java.util.List;
import org.apache.flex.compiler.clients.COMPC;
import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.utils.EnvProperties;
import org.junit.Ignore;
import org.junit.Test;
-import utils.EnvProperties;
/**
* JUnit tests to compile the SWCs of the Flex SDK.
Added: incubator/flex/falcon/trunk/compiler.tests/src/org/apache/flex/utils/EnvProperties.java
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/src/org/apache/flex/utils/EnvProperties.java?rev=1424813&view=auto
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/src/org/apache/flex/utils/EnvProperties.java (added)
+++ incubator/flex/falcon/trunk/compiler.tests/src/org/apache/flex/utils/EnvProperties.java Fri Dec 21 06:39:05 2012
@@ -0,0 +1,100 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.flex.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.flex.utils.FilenameNormalization;
+
+
+/**
+ * EnvProperties checks in following order for a value.
+ *
+ * 1) unittest.properties
+ * 2) environment variables
+ * 3) for key FLEX_HOME & PLAYERGLOBAL_HOME sets a default value.
+ */
+public class EnvProperties {
+
+ /**
+ * FLEX_HOME
+ */
+ public String SDK;
+
+ /**
+ * PLAYERGLOBAL_HOME
+ */
+ public String FPSDK;
+
+ /**
+ * AIR_HOME
+ */
+ public String AIRSDK;
+
+ /**
+ * FLASHPLAYER_DEBUGGER
+ */
+ public String FDBG;
+
+
+ private static EnvProperties env;
+
+ public static EnvProperties initiate() {
+ if(env == null) {
+ env = new EnvProperties();
+ env.setup();
+ }
+ return env;
+ }
+
+ private void setup()
+ {
+ Properties p = new Properties();
+ try {
+ File f = new File("unittest.properties");
+ p.load(new FileInputStream( f ));
+ } catch (FileNotFoundException e) {
+ System.out.println("unittest.properties not found");
+ } catch (IOException e) {
+ }
+
+ SDK = p.getProperty("FLEX_HOME", System.getenv("FLEX_HOME"));
+ if(SDK == null)
+ SDK = FilenameNormalization.normalize("../compiler/generated/dist/sdk");
+ System.out.println("environment property - FLEX_HOME = " + SDK);
+
+ FPSDK = p.getProperty("PLAYERGLOBAL_HOME", System.getenv("PLAYERGLOBAL_HOME"));
+ if(FPSDK == null)
+ FPSDK = FilenameNormalization.normalize("../compiler/generated/dist/sdk/frameworks/libs/player");
+ System.out.println("environment property - PLAYERGLOBAL_HOME = " + FPSDK);
+
+
+ AIRSDK = p.getProperty("AIR_HOME", System.getenv("AIR_HOME"));
+ System.out.println("environment property - AIR_HOME = " + AIRSDK);
+
+ FDBG = p.getProperty("FLASHPLAYER_DEBUGGER", System.getenv("FLASHPLAYER_DEBUGGER"));
+ System.out.println("environment property - FLASHPLAYER_DEBUGGER = " + FDBG);
+ }
+
+}
Propchange: incubator/flex/falcon/trunk/compiler.tests/src/org/apache/flex/utils/EnvProperties.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLNodeBaseTests.java
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLNodeBaseTests.java?rev=1424813&r1=1424812&r2=1424813&view=diff
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLNodeBaseTests.java (original)
+++ incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLNodeBaseTests.java Fri Dec 21 06:39:05 2012
@@ -38,10 +38,10 @@ import org.apache.flex.compiler.mxml.MXM
import org.apache.flex.compiler.tree.as.IASNode;
import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.utils.EnvProperties;
import org.apache.flex.utils.FilenameNormalization;
import org.junit.Test;
-import utils.EnvProperties;
/**
* JUnit tests for {@link MXMLNodeBase}.