Browse code

BM-14204 Fix: remove plugins/net.bluemind.lib.elasticsearch.tests

kladier authored on 08/02/2019 07:44:28
Showing 7 changed files
1 1
deleted file mode 100644
... ...
@@ -1,7 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<classpath>
3
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5
-	<classpathentry kind="src" path="src/"/>
6
-	<classpathentry kind="output" path="target/classes"/>
7
-</classpath>
... ...
@@ -1,7 +1,7 @@
1
-<?xml version="1.0"?>
1
+<?xml version="1.0" encoding="UTF-8"?>
2 2
 <projectDescription>
3 3
 	<name>net.bluemind.lib.elasticsearch.tests</name>
4
-	<comment/>
4
+	<comment></comment>
5 5
 	<projects>
6 6
 	</projects>
7 7
 	<buildSpec>
... ...
@@ -20,10 +20,8 @@
20 20
 			<arguments>
21 21
 			</arguments>
22 22
 		</buildCommand>
23
-		
24 23
 	</buildSpec>
25 24
 	<natures>
26
-		
27 25
 		<nature>org.eclipse.pde.PluginNature</nature>
28 26
 		<nature>org.eclipse.jdt.core.javanature</nature>
29 27
 	</natures>
30 28
deleted file mode 100644
... ...
@@ -1,15 +0,0 @@
1
-Manifest-Version: 1.0
2
-Bundle-ManifestVersion: 2
3
-Bundle-Name: net.bluemind.lib.elasticsearch.tests
4
-Bundle-SymbolicName: net.bluemind.lib.elasticsearch.tests
5
-Bundle-Version: 4.1.0.qualifier
6
-Bundle-Activator: net.bluemind.lib.elasticsearch.tests.Activator
7
-Bundle-Vendor: blue-mind.net
8
-Require-Bundle: org.eclipse.core.runtime,
9
- org.junit;bundle-version="3.8.2",
10
- net.bluemind.lib.elasticsearch;bundle-version="1.0.0",
11
- com.google.guava;bundle-version="19.0.0",
12
- org.eclipse.equinox.p2.directorywatcher;bundle-version="1.1.100"
13
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
14
-Bundle-ActivationPolicy: lazy
15
-Import-Package: com.google.common.collect
16 0
deleted file mode 100644
... ...
@@ -1,3 +0,0 @@
1
-source.. = src/
2
-bin.includes = META-INF/,\
3
-               .
4 0
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
-	<modelVersion>4.0.0</modelVersion>
5
-
6
-	<parent>
7
-		<groupId>net.bluemind</groupId>
8
-		<artifactId>plugins</artifactId>
9
-		<version>4.1.0-SNAPSHOT</version>
10
-	</parent>
11
-
12
-	<artifactId>net.bluemind.lib.elasticsearch.tests</artifactId>
13
-
14
-	<packaging>eclipse-test-plugin</packaging>
15
-	
16
-
17
-</project>
18 0
\ No newline at end of file
19 1
deleted file mode 100644
... ...
@@ -1,52 +0,0 @@
1
-/* BEGIN LICENSE
2
- * Copyright © Blue Mind SAS, 2012-2016
3
- *
4
- * This file is part of BlueMind. BlueMind is a messaging and collaborative
5
- * solution.
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of either the GNU Affero General Public License as
9
- * published by the Free Software Foundation (version 3 of the License).
10
- *
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
- *
16
- * See LICENSE.txt
17
- * END LICENSE
18
- */
19
-package net.bluemind.lib.elasticsearch.tests;
20
-
21
-import org.osgi.framework.BundleActivator;
22
-import org.osgi.framework.BundleContext;
23
-
24
-public class Activator implements BundleActivator {
25
-
26
-	private static BundleContext context;
27
-
28
-	static BundleContext getContext() {
29
-		return context;
30
-	}
31
-
32
-	/*
33
-	 * (non-Javadoc)
34
-	 * 
35
-	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.
36
-	 * BundleContext)
37
-	 */
38
-	public void start(BundleContext bundleContext) throws Exception {
39
-		Activator.context = bundleContext;
40
-	}
41
-
42
-	/*
43
-	 * (non-Javadoc)
44
-	 * 
45
-	 * @see
46
-	 * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
47
-	 */
48
-	public void stop(BundleContext bundleContext) throws Exception {
49
-		Activator.context = null;
50
-	}
51
-
52
-}
53 0
deleted file mode 100644
... ...
@@ -1,96 +0,0 @@
1
-/* BEGIN LICENSE
2
- * Copyright © Blue Mind SAS, 2012-2016
3
- *
4
- * This file is part of BlueMind. BlueMind is a messaging and collaborative
5
- * solution.
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of either the GNU Affero General Public License as
9
- * published by the Free Software Foundation (version 3 of the License).
10
- *
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
- *
16
- * See LICENSE.txt
17
- * END LICENSE
18
- */
19
-package net.bluemind.lib.elasticsearch.tests;
20
-
21
-import java.net.InetAddress;
22
-import java.net.UnknownHostException;
23
-import java.util.HashMap;
24
-import java.util.List;
25
-import java.util.Map;
26
-import java.util.UUID;
27
-
28
-import org.elasticsearch.action.ActionFuture;
29
-import org.elasticsearch.action.index.IndexResponse;
30
-import org.elasticsearch.client.transport.TransportClient;
31
-import org.elasticsearch.common.settings.Settings;
32
-import org.elasticsearch.common.transport.TransportAddress;
33
-import org.elasticsearch.search.SearchHits;
34
-import org.elasticsearch.transport.client.PreBuiltTransportClient;
35
-
36
-import com.google.common.collect.Lists;
37
-
38
-import junit.framework.TestCase;
39
-import net.bluemind.lib.elasticsearch.ESearchActivator;
40
-
41
-public class ESSimpleTests extends TestCase {
42
-
43
-	public void testAddDocument() throws UnknownHostException {
44
-		org.elasticsearch.common.settings.Settings.Builder settingsBuilder = Settings.builder();
45
-
46
-		settingsBuilder.put("node.name", "client-" + UUID.randomUUID());
47
-		settingsBuilder.put("cluster.name", "bluemind");
48
-		Settings settings = settingsBuilder.build();
49
-		TransportClient cli = new PreBuiltTransportClient(settings);
50
-		cli.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9300));
51
-		assertNotNull(cli);
52
-
53
-		Map<String, Object> data = new HashMap<>();
54
-		data.put("uid", 7);
55
-		data.put("ownerId", 34);
56
-		data.put("in", "INBOX");
57
-		List<String> fnames = Lists.newArrayList("toto.txt", "blabla.doc");
58
-		data.put("filename", fnames);
59
-		String body = "the content";
60
-		data.put("body", body);
61
-		String subject = "suject of the mail";
62
-		data.put("subject", subject);
63
-		List<String> content = Lists.newArrayList(fnames);
64
-		content.add(body);
65
-		content.add(subject);
66
-		data.put("content", content);
67
-
68
-		ActionFuture<IndexResponse> future = cli.prepareIndex("mailspool", "message", "34:INBOX:7").setSource(data)
69
-				.execute();
70
-		IndexResponse ir = future.actionGet();
71
-		System.out.println("ir.version: " + ir.getVersion());
72
-
73
-		long time = System.currentTimeMillis();
74
-		for (int i = 8; i < 10008; i++) {
75
-			future = cli.prepareIndex("mailspool", "message", "34:INBOX:" + i).setSource(data).execute();
76
-			ir = future.actionGet();
77
-		}
78
-		time = System.currentTimeMillis() - time;
79
-		System.out.println("Added 10k in " + time + "ms.");
80
-
81
-		cli.close();
82
-	}
83
-
84
-	public void testPurgeIndex() {
85
-		ESearchActivator.deleteByQuery("mailspool", "_type:msg");
86
-	}
87
-
88
-	public void testSearch() {
89
-		ESearchActivator.search("mailspool", "_type:msg");
90
-	}
91
-
92
-	public void testPagination() {
93
-		SearchHits res = ESearchActivator.search("mailspool", "_type:msg", 0, 1, "*");
94
-		assertEquals(1, res.getHits().length);
95
-	}
96
-}