1 package org.simantics.db.testing.impl;
3 import org.eclipse.core.runtime.Platform;
5 /*******************************************************************************
6 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
8 * All rights reserved. This program and the accompanying materials
9 * are made available under the terms of the Eclipse Public License v1.0
10 * which accompanies this distribution, and is available at
11 * http://www.eclipse.org/legal/epl-v10.html
14 * VTT Technical Research Centre of Finland - initial API and implementation
15 *******************************************************************************/
17 public class Configuration {
18 public final boolean purge = false; // Used to test purge.
19 public final boolean debug = false; // Used to initialize DEBUG flag on various places.
20 public final boolean remoteCore = false; // If true connects to remote core.
21 public final boolean useJournal = false;
22 public final boolean useFailedTests;
23 public final boolean virtual;
24 public final boolean transactionKeep;
25 // public final String driverName;
26 public final String workspace = "../../";
27 public final String coreDir = Platform.getLocation().append("db").toFile().getAbsolutePath();
28 public final String host = "127.0.0.1";
29 // public final String host = "Linux-64-Ubuntu-1";
30 // public final String host = "Espvm3k973";
31 public final int port = (remoteCore) ? 6666 : 0;
32 public final boolean skipServerCreation = (remoteCore) ? true : false;
33 public final String username = "Default User";
34 public final String password = "";
35 public final int connectionReconnectCount;
36 public final int connectionThreadCount;
37 public final int connectionSaveCount;
38 public final int connectionInstanceCount;
39 public final int modellingLoopCount;
40 public final int modellingOpCount;
41 public final String textIndexingFile;
42 public final int rwQueryThreds;
43 public final int rwQueryCount;
44 public final int importOuterCount;
45 public final int importInnerCount;
46 public final int cachedClusterCount; // limited by the number of bits reserved for clusters (32768 for now and system needs a few)
47 public final int cachedClusterRounds;
48 public final int generateCount;
49 public final String generateModel;
50 public final int publishLoopCount;
51 public final int collectedLoopCount;
52 public final int refreshLoopCount;
53 public final int refreshAddCount;
54 public final int callLoopCount;
55 public final int callCallCount;
56 public final int callThreadCount;
57 public final int i3199ResourceCount;
58 public final int i3176BlockCount;
59 public final int i3176BigBlockCount;
60 public final int i1659LoopCount;
61 public final String databaseInitFile = "graph.txt";
62 private static Configuration current = new Configuration();
64 protected Configuration() {
65 String configuration = System.getProperty("test.configuration", "regression");
66 virtual = System.getProperty("test.graph.impl", "").equals("virtual");
67 // driverName = virtual ? ProCoreDriver.ProCoreDriverNameVirtual : ProCoreDriver.ProCoreDriverName;
68 transactionKeep = System.getProperty("test.transaction.policy", "keep").equals("keep");
69 useFailedTests = System.getProperty("test.use.failed", "false").equals("true");
70 @SuppressWarnings("unused")
71 String timeout = System.getProperty("test.exit.timeout", "30000");
72 if (configuration.equals("stress")) {
73 connectionReconnectCount = 100;
74 connectionThreadCount = 10;
75 connectionSaveCount = 10;
76 connectionInstanceCount = 10;
77 modellingLoopCount = 1000;
78 modellingOpCount = 1000;
79 textIndexingFile = "./data/cprrn10.txt";
81 rwQueryCount = 1000000;
82 importOuterCount = 10;
83 importInnerCount = 100000;
84 cachedClusterCount = 4096;
85 cachedClusterRounds = 10;
87 generateModel = "devs";
88 publishLoopCount = 200;
89 collectedLoopCount = 1000;
91 refreshAddCount = 1000000;
93 callCallCount = 100000;
94 callThreadCount = 100;
95 i3199ResourceCount = 100 * 1000 * 1000;
96 i3176BlockCount = 1000;
97 i3176BigBlockCount = 5000;
99 } else { // regression
100 connectionReconnectCount = 2;
101 connectionThreadCount = 1;
102 connectionSaveCount = 1;
103 connectionInstanceCount = 1;
104 modellingLoopCount = 2;
105 modellingOpCount = 100;
106 textIndexingFile = "./data/cprrn00.txt";
109 importOuterCount = 10;
110 importInnerCount = 100;
111 cachedClusterCount = 10;
112 cachedClusterRounds = 2;
114 generateModel = "test";
115 publishLoopCount = 2;
116 collectedLoopCount = 1;
117 refreshLoopCount = 2;
118 refreshAddCount = 100;
121 callThreadCount = 10;
122 i3199ResourceCount = 200 * 1000;
124 i3176BigBlockCount = 10;
128 public static Configuration get() {