<commit_before>/**
 * <copyright> Copyright (c) 2008-2009 <NAME>, <NAME>. All rights reserved. This program and the
 * accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this
 * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html </copyright>
 */
package org.eclipse.emf.emfstore.client.test.server;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import org.eclipse.emf.emfstore.client.model.connectionmanager.xmlrpc.XmlRpcClientManager;
import org.eclipse.emf.emfstore.client.model.connectionmanager.xmlrpc.XmlRpcConnectionManager;
import org.eclipse.emf.emfstore.client.test.SetupHelper;
import org.eclipse.emf.emfstore.common.CommonUtil;
import org.eclipse.emf.emfstore.common.model.Project;
import org.eclipse.emf.emfstore.server.ServerConfiguration;
import org.eclipse.emf.emfstore.server.exceptions.EmfStoreException;
import org.eclipse.emf.emfstore.server.exceptions.InvalidInputException;
import org.eclipse.emf.emfstore.server.exceptions.UnknownSessionException;
import org.eclipse.emf.emfstore.server.model.ProjectId;
import org.eclipse.emf.emfstore.server.model.SessionId;
import org.eclipse.emf.emfstore.server.model.versioning.ChangePackage;
import org.eclipse.emf.emfstore.server.model.versioning.HistoryQuery;
import org.eclipse.emf.emfstore.server.model.versioning.LogMessage;
import org.eclipse.emf.emfstore.server.model.versioning.PrimaryVersionSpec;
import org.eclipse.emf.emfstore.server.model.versioning.TagVersionSpec;
import org.eclipse.emf.emfstore.server.model.versioning.VersionSpec;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * This test calls the servermethods with null arguments.
 * 
 * @author wesendon
 */
public class InvalidArgumentsTest extends ServerTests {

	/**
	 * {@inheritDoc}
	 * 
	 * @throws EmfStoreException in case of failure
	 * @throws IOException
	 */
	@BeforeClass
	public static void setUpBeforeClass() throws EmfStoreException, IOException {
		ServerConfiguration.setTesting(true);
		CommonUtil.setTesting(true);

		// delete all data before test start
		SetupHelper.removeServerTestProfile();

		SetupHelper.addUserFileToServer(false);

		// setConnectionManager(WorkspaceManager.getInstance().getConnectionManager());
		setServerInfo(SetupHelper.getServerInfo());
		// login();
		initArguments();

		setConnectionManager(new XmlRpcConnectionManager() {
			@Override
			protected XmlRpcClientManager getConnectionProxy(SessionId sessionId) throws UnknownSessionException {
				if (sessionId == null && getConnectionProxyMap().size() > 0) {
					return getConnectionProxyMap().values().iterator().next();
				}
				return super.getConnectionProxy(sessionId);

			}
		});

		SetupHelper.startSever();
		ServerTests.login();
	}

	/**
	 * {@inheritDoc}
	 */<commit_msg>removed SetupHelper#removeTestProfile from beforeClass method<commit_after>/**
 * <copyright> Copyright (c) 2008-2009 <NAME>, <NAME>. All rights reserved. This program and the
 * accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this
 * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html </copyright>
 */
package org.eclipse.emf.emfstore.client.test.server;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import org.eclipse.emf.emfstore.client.model.connectionmanager.xmlrpc.XmlRpcClientManager;
import org.eclipse.emf.emfstore.client.model.connectionmanager.xmlrpc.XmlRpcConnectionManager;
import org.eclipse.emf.emfstore.client.test.SetupHelper;
import org.eclipse.emf.emfstore.common.CommonUtil;
import org.eclipse.emf.emfstore.common.model.Project;
import org.eclipse.emf.emfstore.server.ServerConfiguration;
import org.eclipse.emf.emfstore.server.exceptions.EmfStoreException;
import org.eclipse.emf.emfstore.server.exceptions.InvalidInputException;
import org.eclipse.emf.emfstore.server.exceptions.UnknownSessionException;
import org.eclipse.emf.emfstore.server.model.ProjectId;
import org.eclipse.emf.emfstore.server.model.SessionId;
import org.eclipse.emf.emfstore.server.model.versioning.ChangePackage;
import org.eclipse.emf.emfstore.server.model.versioning.HistoryQuery;
import org.eclipse.emf.emfstore.server.model.versioning.LogMessage;
import org.eclipse.emf.emfstore.server.model.versioning.PrimaryVersionSpec;
import org.eclipse.emf.emfstore.server.model.versioning.TagVersionSpec;
import org.eclipse.emf.emfstore.server.model.versioning.VersionSpec;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * This test calls the servermethods with null arguments.
 * 
 * @author wesendon
 */
public class InvalidArgumentsTest extends ServerTests {

	/**
	 * {@inheritDoc}
	 * 
	 * @throws EmfStoreException in case of failure
	 * @throws IOException
	 */
	@BeforeClass
	public static void setUpBeforeClass() throws EmfStoreException, IOException {
		ServerConfiguration.setTesting(true);
		CommonUtil.setTesting(true);

		SetupHelper.addUserFileToServer(false);

		// setConnectionManager(WorkspaceManager.getInstance().getConnectionManager());
		setServerInfo(SetupHelper.getServerInfo());
		// login();
		initArguments();

		setConnectionManager(new XmlRpcConnectionManager() {
			@Override
			protected XmlRpcClientManager getConnectionProxy(SessionId sessionId) throws UnknownSessionException {
				if (sessionId == null && getConnectionProxyMap().size() > 0) {
					return getConnectionProxyMap().values().iterator().next();
				}
				return super.getConnectionProxy(sessionId);

			}
		});

		SetupHelper.startSever();
		ServerTests.login();
	}

	/**
	 * {@inheritDoc}
	 */
{'fraction_non_alphanumeric': 0.11107272413197443, 'fraction_numerical': 0.00449127655899119, 'mean_word_length': 5.527621195039459, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1897068', 'n_tokens_mistral': 1815, 'n_tokens_neox': 1694, 'n_words': 303}