You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/05 16:19:39 UTC
[3/5] incubator-ignite git commit: #nodejs: add test classes.
#nodejs: add test classes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4e858907
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4e858907
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4e858907
Branch: refs/heads/nodejs
Commit: 4e8589079663dd1a490a5f32f75bd78ef99166b5
Parents: 6546a87
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Jun 5 16:35:15 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Jun 5 16:35:15 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/NodeJsAbstractTest.java | 71 ++++++++++++++++++++
.../apache/ignite/internal/NodeJsSelfTest.java | 69 +++++--------------
.../testsuites/IgniteNodeJsTestSuite.java | 38 +++++++++++
3 files changed, 124 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4e858907/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsAbstractTest.java b/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsAbstractTest.java
new file mode 100644
index 0000000..ea08bd4
--- /dev/null
+++ b/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsAbstractTest.java
@@ -0,0 +1,71 @@
+/*
+ * 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.ignite.internal;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+/**
+ * Abstract class for Node JS testing.
+ */
+public class NodeJsAbstractTest extends GridCommonAbstractTest {
+ /** Cache name. */
+ public static final String CACHE_NAME = "mycache";
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+ cfg.setCacheConfiguration(cacheConfiguration());
+
+ ConnectorConfiguration conCfg = new ConnectorConfiguration();
+
+ conCfg.setJettyPath(getNodeJsTestDir() + "rest-jetty.xml");
+
+ cfg.setConnectorConfiguration(conCfg);
+
+ return cfg;
+ }
+
+ /**
+ * @return Cache configuration.
+ */
+ protected CacheConfiguration cacheConfiguration() {
+ CacheConfiguration ccfg = new CacheConfiguration();
+
+ ccfg.setName(CACHE_NAME);
+ ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
+
+ return ccfg;
+ }
+
+ /**
+ * @return Node js test dir.
+ */
+ protected String getNodeJsTestDir() {
+ String sep = System.getProperty("file.separator");
+
+ return U.getIgniteHome() +
+ sep + "modules" +
+ sep + "nodejs" +
+ sep + "src" +
+ sep + "test" +
+ sep + "nodejs" + sep;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4e858907/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsSelfTest.java b/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsSelfTest.java
index d79dc76..e526bbc 100644
--- a/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsSelfTest.java
+++ b/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsSelfTest.java
@@ -1,20 +1,24 @@
/*
- * Copyright (C) GridGain Systems. All Rights Reserved.
- * _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ * 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.ignite.internal;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.testframework.junits.common.*;
import java.util.*;
import java.util.concurrent.*;
@@ -24,36 +28,7 @@ import static java.util.concurrent.TimeUnit.*;
/**
* Test node js client.
*/
-public class NodeJsSelfTest extends GridCommonAbstractTest {
- /** Cache name. */
- private static final String CACHE_NAME = "mycache";
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
- cfg.setCacheConfiguration(cacheConfiguration());
-
- ConnectorConfiguration conCfg = new ConnectorConfiguration();
-
- conCfg.setJettyPath(getNodeJsTestDir() + "rest-jetty.xml");
-
- cfg.setConnectorConfiguration(conCfg);
-
- return cfg;
- }
-
- /**
- * @return Cache configuration.
- */
- private CacheConfiguration cacheConfiguration() {
- CacheConfiguration ccfg = new CacheConfiguration();
-
- ccfg.setName(CACHE_NAME);
- ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
-
- return ccfg;
- }
-
+public class NodeJsSelfTest extends NodeJsAbstractTest {
/**
* @throws Exception If failed.
*/
@@ -101,18 +76,4 @@ public class NodeJsSelfTest extends GridCommonAbstractTest {
proc.killProcess();
}
}
-
- /**
- * @return Node js test dir.
- */
- private String getNodeJsTestDir() {
- String sep = System.getProperty("file.separator");
-
- return U.getIgniteHome() +
- sep + "modules" +
- sep + "nodejs" +
- sep + "src" +
- sep + "test" +
- sep + "nodejs" + sep;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4e858907/modules/nodejs/src/test/java/org/apache/ignite/testsuites/IgniteNodeJsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/java/org/apache/ignite/testsuites/IgniteNodeJsTestSuite.java b/modules/nodejs/src/test/java/org/apache/ignite/testsuites/IgniteNodeJsTestSuite.java
new file mode 100644
index 0000000..bba1ece
--- /dev/null
+++ b/modules/nodejs/src/test/java/org/apache/ignite/testsuites/IgniteNodeJsTestSuite.java
@@ -0,0 +1,38 @@
+/*
+ * 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.ignite.testsuites;
+
+import junit.framework.*;
+import org.apache.ignite.internal.*;
+
+/**
+ * Node JS test suite.
+ */
+public class IgniteNodeJsTestSuite extends TestSuite {
+ /**
+ * @return Suite.
+ * @throws Exception If failed.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("Ignite Node JS Test Suite");
+
+ suite.addTest(new TestSuite(NodeJsSelfTest.class));
+
+ return suite;
+ }
+}