repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
liuyanggithub/Hi | src/com/ly/hi/im/view/MyLetterView.java | // Path: src/com/ly/hi/im/util/PixelUtil.java
// public class PixelUtil {
//
// /**
// * The context.
// */
// private static Context mContext = CustomApplication.getInstance();
//
// /**
// * dpת px.
// *
// * @param value the value
// * @return the int
// */
// pu... | import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widg... | package com.ly.hi.im.view;
/** ͨѶ¼ÓÒ²à¿ìËÙ¹ö¶¯À¸
* @ClassName: MyLetterView
* @Description: TODO
* @author smile
* @date 2014-6-7 ÏÂÎç1:20:33
*/
public class MyLetterView extends View {
// ´¥Ãþʼþ
private OnTouchingLetterChangedListener onTouchingLetterChangedListener;
// 26¸ö×Öĸ
public static St... | // Path: src/com/ly/hi/im/util/PixelUtil.java
// public class PixelUtil {
//
// /**
// * The context.
// */
// private static Context mContext = CustomApplication.getInstance();
//
// /**
// * dpת px.
// *
// * @param value the value
// * @return the int
// */
// pu... | paint.setTextSize(PixelUtil.sp2px(12)); |
liuyanggithub/Hi | src/com/ly/hi/im/ui/LocationActivity.java | // Path: src/com/ly/hi/im/view/HeaderLayout.java
// public interface onRightImageButtonClickListener {
// void onClick();
// }
| import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import cn.bmob.im.util.BmobLog;
import com.baidu.location.BDLocation;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationCl... | GeoCoder mSearch = null; // ËÑË÷Ä£¿é£¬ÒòΪ°Ù¶È¶¨Î»sdkÄܹ»µÃµ½¾Î³¶È£¬µ«ÊÇÈ´ÎÞ·¨µÃµ½¾ßÌåµÄÏêϸµØÖ·£¬Òò´ËÐèÒª²ÉÈ¡·´±àÂ뷽ʽȥËÑË÷´Ë¾Î³¶È´ú±íµÄµØÖ·
static BDLocation lastLocation = null;
BitmapDescriptor bdgeo = BitmapDescriptorFactory.fromResource(R.drawable.icon_geo);
@Override
public void onCreate(Bundle sav... | // Path: src/com/ly/hi/im/view/HeaderLayout.java
// public interface onRightImageButtonClickListener {
// void onClick();
// }
// Path: src/com/ly/hi/im/ui/LocationActivity.java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilte... | new onRightImageButtonClickListener() { |
liuyanggithub/Hi | src/com/ly/hi/im/adapter/base/BaseArrayListAdapter.java | // Path: src/com/ly/hi/im/im/bean/FaceText.java
// public class FaceText {
// public String text;
//
// public FaceText(String text) {
// super();
// this.text = text;
// }
//
// }
| import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.ly.hi.im.im.bean.FaceText; | package com.ly.hi.im.adapter.base;
public class BaseArrayListAdapter extends BaseAdapter {
protected Context mContext;
protected LayoutInflater mInflater; | // Path: src/com/ly/hi/im/im/bean/FaceText.java
// public class FaceText {
// public String text;
//
// public FaceText(String text) {
// super();
// this.text = text;
// }
//
// }
// Path: src/com/ly/hi/im/adapter/base/BaseArrayListAdapter.java
import java.util.ArrayList;
import java.util.Arrays;
import jav... | protected List<FaceText> mDatas = new ArrayList<FaceText>(); |
liuyanggithub/Hi | src/com/ly/hi/lbs/http/params/BaseRequestParams.java | // Path: src/com/ly/hi/lbs/common/BizInterface.java
// public interface BizInterface {
// String BAIDU_LBS_GEOTABLE_ID = "98950";
// String BAIDU_LBS_GEOTABLE_TYPE = "1";
// String BAIDU_LBS_AK = "ouKiQX83oFa3GevQH58hBRWY";
//
//
// String CREATE_GEOTABLE = "http://api.map.baidu.com/geodata/v3/geotable/... | import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import com.ly.hi.lbs.common.BizInterface; | package com.ly.hi.lbs.http.params;
/**
* ÇëÇóµÄ»ù´¡²ÎÊý
*/
public class BaseRequestParams {
//½Ó¿Ú°æ±¾ºÅ
protected String ak; //ÃÜÔ¿
public BaseRequestParams() { | // Path: src/com/ly/hi/lbs/common/BizInterface.java
// public interface BizInterface {
// String BAIDU_LBS_GEOTABLE_ID = "98950";
// String BAIDU_LBS_GEOTABLE_TYPE = "1";
// String BAIDU_LBS_AK = "ouKiQX83oFa3GevQH58hBRWY";
//
//
// String CREATE_GEOTABLE = "http://api.map.baidu.com/geodata/v3/geotable/... | this.ak = BizInterface.BAIDU_LBS_AK; |
liuyanggithub/Hi | src/com/ly/hi/im/ui/UpdateInfoActivity.java | // Path: src/com/ly/hi/im/im/bean/User.java
// public class User extends BmobChatUser {
//
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// /**
// * ·¢²¼µÄ²©¿ÍÁбí
// */
// private BmobRelation blogs;
//
// /**
// * //ÏÔʾÊý¾ÝÆ´ÒôµÄÊ××Öĸ
// */
// private String sortLe... | import android.os.Bundle;
import android.widget.EditText;
import cn.bmob.v3.listener.UpdateListener;
import com.ly.hi.R;
import com.ly.hi.im.im.bean.User;
import com.ly.hi.im.view.HeaderLayout.onRightImageButtonClickListener; | package com.ly.hi.im.ui;
/**
* ÉèÖÃêdzƺÍÐÔ±ð
*
* @ClassName: SetNickAndSexActivity
* @Description: TODO
* @author liuy
*/
public class UpdateInfoActivity extends ActivityBase {
EditText edit_nick;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super... | // Path: src/com/ly/hi/im/im/bean/User.java
// public class User extends BmobChatUser {
//
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// /**
// * ·¢²¼µÄ²©¿ÍÁбí
// */
// private BmobRelation blogs;
//
// /**
// * //ÏÔʾÊý¾ÝÆ´ÒôµÄÊ××Öĸ
// */
// private String sortLe... | new onRightImageButtonClickListener() { |
liuyanggithub/Hi | src/com/ly/hi/im/ui/UpdateInfoActivity.java | // Path: src/com/ly/hi/im/im/bean/User.java
// public class User extends BmobChatUser {
//
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// /**
// * ·¢²¼µÄ²©¿ÍÁбí
// */
// private BmobRelation blogs;
//
// /**
// * //ÏÔʾÊý¾ÝÆ´ÒôµÄÊ××Öĸ
// */
// private String sortLe... | import android.os.Bundle;
import android.widget.EditText;
import cn.bmob.v3.listener.UpdateListener;
import com.ly.hi.R;
import com.ly.hi.im.im.bean.User;
import com.ly.hi.im.view.HeaderLayout.onRightImageButtonClickListener; | package com.ly.hi.im.ui;
/**
* ÉèÖÃêdzƺÍÐÔ±ð
*
* @ClassName: SetNickAndSexActivity
* @Description: TODO
* @author liuy
*/
public class UpdateInfoActivity extends ActivityBase {
EditText edit_nick;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super... | // Path: src/com/ly/hi/im/im/bean/User.java
// public class User extends BmobChatUser {
//
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// /**
// * ·¢²¼µÄ²©¿ÍÁбí
// */
// private BmobRelation blogs;
//
// /**
// * //ÏÔʾÊý¾ÝÆ´ÒôµÄÊ××Öĸ
// */
// private String sortLe... | final User user = userManager.getCurrentUser(User.class); |
liuyanggithub/Hi | src/com/android/volley/toolbox/NetworkImageView.java | // Path: src/com/android/volley/toolbox/ImageLoader.java
// public class ImageContainer {
// /**
// * The most relevant bitmap for the container. If the image was in cache, the
// * Holder to use for the final bitmap (the one that pairs to the requested URL).
// */
// private Bitmap mBitmap;
//
... | import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.ImageLoader.ImageContainer;
import com.android.volley.toolbox.ImageLoader... | /**
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed 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 ap... | // Path: src/com/android/volley/toolbox/ImageLoader.java
// public class ImageContainer {
// /**
// * The most relevant bitmap for the container. If the image was in cache, the
// * Holder to use for the final bitmap (the one that pairs to the requested URL).
// */
// private Bitmap mBitmap;
//
... | private ImageContainer mImageContainer; |
liuyanggithub/Hi | src/com/android/volley/toolbox/NetworkImageView.java | // Path: src/com/android/volley/toolbox/ImageLoader.java
// public class ImageContainer {
// /**
// * The most relevant bitmap for the container. If the image was in cache, the
// * Holder to use for the final bitmap (the one that pairs to the requested URL).
// */
// private Bitmap mBitmap;
//
... | import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.ImageLoader.ImageContainer;
import com.android.volley.toolbox.ImageLoader... | // if the URL to be loaded in this view is empty, cancel any old requests and clear the
// currently loaded image.
if (TextUtils.isEmpty(mUrl)) {
if (mImageContainer != null) {
mImageContainer.cancelRequest();
mImageContainer = null;
}
... | // Path: src/com/android/volley/toolbox/ImageLoader.java
// public class ImageContainer {
// /**
// * The most relevant bitmap for the container. If the image was in cache, the
// * Holder to use for the final bitmap (the one that pairs to the requested URL).
// */
// private Bitmap mBitmap;
//
... | new ImageListener() { |
liuyanggithub/Hi | src/com/ly/hi/im/view/HeaderLayout.java | // Path: src/com/ly/hi/im/util/PixelUtil.java
// public class PixelUtil {
//
// /**
// * The context.
// */
// private static Context mContext = CustomApplication.getInstance();
//
// /**
// * dpת px.
// *
// * @param value the value
// * @return the int
// */
// pu... | import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.ly.hi.R;
import com.ly.hi.im.util.PixelUtil; | return null;
}
/**
* »ñÈ¡ÓÒ±ßÎÄ×Ö
*
* @Title: getRightImageButton
* @Description: TODO
* @param @return
* @return TextView
* @throws
*/
public TextView getRightTextView() {
if (mRightTextView != null) {
return mRightTextView;
}
return null;
}
public void setDefaultTitle(CharSequence ti... | // Path: src/com/ly/hi/im/util/PixelUtil.java
// public class PixelUtil {
//
// /**
// * The context.
// */
// private static Context mContext = CustomApplication.getInstance();
//
// /**
// * dpת px.
// *
// * @param value the value
// * @return the int
// */
// pu... | mRightImageButton.setWidth(PixelUtil.dp2px(45)); |
Sinrel/SinrelLauncherEngine-Dev | src/org/sinrel/engine/library/PatchManager.java | // Path: src/org/sinrel/engine/util/VirtualZipModifer.java
// public class VirtualZipModifer {
// private File file;
// private ZipFile zipFile;
// private Map<String, byte[]> virtualEntries;
//
// public VirtualZipModifer(File file) throws ZipException, IOException {
// this.file = file;
// virtualEntries = n... | import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtField;
import javassist.CtMethod;
import javassist.NotFoundException;
import javassist.expr.ExprEditor;
import javassist.expr.FieldAccess;
import javassist.expr.NewExpr;
import org.sinrel.engine.util.Virtua... | package org.sinrel.engine.library;
public final class PatchManager {
protected static String class_joinserver = "ayh", class_checkserver = "iu";
protected static String methodname_joinserver, methodsign_joinserver;
protected static String methodname_checkserver, methodsign_checkserver;
| // Path: src/org/sinrel/engine/util/VirtualZipModifer.java
// public class VirtualZipModifer {
// private File file;
// private ZipFile zipFile;
// private Map<String, byte[]> virtualEntries;
//
// public VirtualZipModifer(File file) throws ZipException, IOException {
// this.file = file;
// virtualEntries = n... | public static void patchWorkDir(final VirtualZipModifer virtualJar, final ClassPool pool, final String workDir) throws Exception { |
Sinrel/SinrelLauncherEngine-Dev | src/org/sinrel/engine/library/NetManager.java | // Path: src/org/sinrel/engine/Engine.java
// public class Engine {
//
// private EngineSettings settings;
//
// private Intent intent;
// private Config config;
//
// private Downloader downloader;
// private Checker checker;
// private AuthBehavior auth;
// private MinecraftStarter starter;
//
// priv... | import java.awt.Desktop;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.n... | conn.setRequestProperty("Content-Length", Integer.toString(bytes.length));
conn.setUseCaches(false);
conn.setDoInput(true);
conn.setDoOutput(true);
conn.connect();
OutputStream wr = conn.getOutputStream();
wr.write(bytes);
wr.flush();
wr.close();
StringBuffer s = new StringBuffer();
BufferedRe... | // Path: src/org/sinrel/engine/Engine.java
// public class Engine {
//
// private EngineSettings settings;
//
// private Intent intent;
// private Config config;
//
// private Downloader downloader;
// private Checker checker;
// private AuthBehavior auth;
// private MinecraftStarter starter;
//
// priv... | public static final String getEngineLink( Engine engine ) throws MalformedURLException { |
Sinrel/SinrelLauncherEngine-Dev | src/net/minecraft/Launcher.java | // Path: src/org/sinrel/engine/actions/AuthData.java
// public class AuthData {
// private String session;
// private String login;
// private String token;
// private AuthResult result;
//
// public String getToken() {
// return token;
// }
//
// public String getSession() {
// return session;
// }
// ... | import java.applet.Applet;
import java.applet.AppletStub;
import java.awt.BorderLayout;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Map;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import org.... | package net.minecraft;
public class Launcher extends Applet implements AppletStub {
private static final long serialVersionUID = 1L;
private Applet applet = null;
public Map<String, String> customParameters = new HashMap<String, String>();
private int context = 0;
private boolean active = false;
private U... | // Path: src/org/sinrel/engine/actions/AuthData.java
// public class AuthData {
// private String session;
// private String login;
// private String token;
// private AuthResult result;
//
// public String getToken() {
// return token;
// }
//
// public String getSession() {
// return session;
// }
// ... | private AuthData authData; |
Sinrel/SinrelLauncherEngine-Dev | src/org/sinrel/engine/library/OSManager.java | // Path: src/org/sinrel/engine/Engine.java
// public class Engine {
//
// private EngineSettings settings;
//
// private Intent intent;
// private Config config;
//
// private Downloader downloader;
// private Checker checker;
// private AuthBehavior auth;
// private MinecraftStarter starter;
//
// priv... | import java.io.File;
import org.sinrel.engine.Engine;
| package org.sinrel.engine.library;
public final class OSManager {
/**
* @param name Имя рабочей папки
* @param clientName Имя сервера, к которому принадлежит клиент
* @return Возвращает директорию в которой содержатся файлы клиента
* Пример:
* name = sinrel
* clientName = simple
* Б... | // Path: src/org/sinrel/engine/Engine.java
// public class Engine {
//
// private EngineSettings settings;
//
// private Intent intent;
// private Config config;
//
// private Downloader downloader;
// private Checker checker;
// private AuthBehavior auth;
// private MinecraftStarter starter;
//
// priv... | public static final File getClientFolder( Engine engine, String clientName ) {
|
Sinrel/SinrelLauncherEngine-Dev | src/org/sinrel/engine/actions/Downloader.java | // Path: src/org/sinrel/engine/Engine.java
// public class Engine {
//
// private EngineSettings settings;
//
// private Intent intent;
// private Config config;
//
// private Downloader downloader;
// private Checker checker;
// private AuthBehavior auth;
// private MinecraftStarter starter;
//
// priv... | import java.util.ArrayList;
import org.sinrel.engine.Engine;
import org.sinrel.engine.listeners.DownloadListener; | additionalFiles.add( filename );
}
public void removeAdditionalFile( String filename ) {
additionalFiles.remove( filename );
}
public void addAdditionalArchive( String filename ) {
additionalArchives.add( filename );
}
public void removeAdditionalArchive( String filename ) {
additionalArchives.remov... | // Path: src/org/sinrel/engine/Engine.java
// public class Engine {
//
// private EngineSettings settings;
//
// private Intent intent;
// private Config config;
//
// private Downloader downloader;
// private Checker checker;
// private AuthBehavior auth;
// private MinecraftStarter starter;
//
// priv... | public abstract DownloadResult downloadClient( Engine e , String clientName ); |
JimSeker/service | eclipse/ServiceDemoIPC/src/edu/cs4730/servicedemoipc/MainFragment.java | // Path: ServiceDemoIPC/app/src/main/java/edu/cs4730/servicedemoipc/RandNumService.java
// public class LocalBinder extends Binder {
// RandNumService getService() {
// // Return this instance of LocalService so clients can call public methods
// return RandNumService.this;
// }
// }
| import edu.cs4730.servicedemoipc.RandNumService.LocalBinder;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.app.Fragment;
import android.view.Lay... | public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View myView = inflater.inflate(R.layout.fragment_main, container, false);
//setup the button, so it will call into the service and get a random number.
myView.findView... | // Path: ServiceDemoIPC/app/src/main/java/edu/cs4730/servicedemoipc/RandNumService.java
// public class LocalBinder extends Binder {
// RandNumService getService() {
// // Return this instance of LocalService so clients can call public methods
// return RandNumService.this;
// }
// }
// Path: ... | LocalBinder binder = (LocalBinder) service; |
JimSeker/service | ServiceDemoIPC/app/src/main/java/edu/cs4730/servicedemoipc/MainFragment.java | // Path: ServiceDemoIPC/app/src/main/java/edu/cs4730/servicedemoipc/RandNumService.java
// public class LocalBinder extends Binder {
// RandNumService getService() {
// // Return this instance of LocalService so clients can call public methods
// return RandNumService.this;
// }
// }
| import edu.cs4730.servicedemoipc.RandNumService.LocalBinder;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import androidx.fragment.app.Fragment;
import android.view.Layo... | // Inflate the layout for this fragment
View myView = inflater.inflate(R.layout.fragment_main, container, false);
//setup the button, so it will call into the service and get a random number.
myView.findViewById(R.id.btn_gn).setOnClickListener(new OnClickListener() {
@Overri... | // Path: ServiceDemoIPC/app/src/main/java/edu/cs4730/servicedemoipc/RandNumService.java
// public class LocalBinder extends Binder {
// RandNumService getService() {
// // Return this instance of LocalService so clients can call public methods
// return RandNumService.this;
// }
// }
// Path: ... | LocalBinder binder = (LocalBinder) service; |
jkirsch/jedi | core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/features/detector/FindShortestPathFeatureExtractor.java | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
//
// T entity1;
// T entity2;
//
// String pattern;
// String relation;
//
// public FoundFeature(T entity1, T entity2, String pattern) {
// this.entity1 = entity1... | import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.*;
import com.google.common.primitives.Ints;
import de.tudarmstadt.ukp.dkpro.core.api.coref.type.CoreferenceChain;
import de.tud... | package edu.tuberlin.dima.textmining.jedi.core.features.detector;
/**
* A Function that takes a JCas as input and extracts
* its annotations in terms of the shortest path between
* all recognized entities.
*/
public class FindShortestPathFeatureExtractor extends AbstractShortestPathFeatureExtractor {
public ... | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
//
// T entity1;
// T entity2;
//
// String pattern;
// String relation;
//
// public FoundFeature(T entity1, T entity2, String pattern) {
// this.entity1 = entity1... | public List<FoundFeature<Annotation>> getShortestPaths(final UndirectedGraph<Token, DependencyEdge> graph) { |
jkirsch/jedi | core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/features/detector/FindShortestPathFeatureExtractor.java | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
//
// T entity1;
// T entity2;
//
// String pattern;
// String relation;
//
// public FoundFeature(T entity1, T entity2, String pattern) {
// this.entity1 = entity1... | import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.*;
import com.google.common.primitives.Ints;
import de.tudarmstadt.ukp.dkpro.core.api.coref.type.CoreferenceChain;
import de.tud... |
// sort the named entities based on their appearance on the text
Collections.sort(namedEntities, Ordering.from(new Comparator<Annotation>() {
@Override
public int compare(Annotation o1, Annotation o2) {
return Integer.compare(o1.getBegin(), o2.getBegin());
}
}));
// get all pairs of entities omit... | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
//
// T entity1;
// T entity2;
//
// String pattern;
// String relation;
//
// public FoundFeature(T entity1, T entity2, String pattern) {
// this.entity1 = entity1... | if (StringComparision.determineSimilar(left.getCoveredText(), right.getCoveredText())) { |
jkirsch/jedi | core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/freebase/FreebaseHelper.java | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FreebaseRelation.java
// public class FreebaseRelation {
//
// String domain;
// String range;
//
// List<String> domainTypes;
// List<String> rangeTypes;
//
// public FreebaseRelation(String domain, Stri... | import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Charsets;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import co... |
JsonNode jsonNode = getURL(metaURL);
if (jsonNode.has("property")) {
final JsonNode property = jsonNode.get("property");
if (property.has("/type/property/reverse_property")) {
return property.get("/type/property/reverse_property").get("values").get(0).get("id").asText();
}
}
return null;
}
p... | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FreebaseRelation.java
// public class FreebaseRelation {
//
// String domain;
// String range;
//
// List<String> domainTypes;
// List<String> rangeTypes;
//
// public FreebaseRelation(String domain, Stri... | public FreebaseRelation getTypesForRelationFromFreebase(String r) throws IOException { |
jkirsch/jedi | core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/features/detector/AbstractShortestPathFeatureExtractor.java | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
//
// T entity1;
// T entity2;
//
// String pattern;
// String relation;
//
// public FoundFeature(T entity1, T entity2, String pattern) {
// this.entity1 = entity1... | import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import de.tudarmstadt.ukp.dk... | package edu.tuberlin.dima.textmining.jedi.core.features.detector;
/**
*/
public abstract class AbstractShortestPathFeatureExtractor {
@Parameter(names = {"-lemmatize"}, description = "Lemmatize the pattern to remove times", required = false)
private boolean lemmatize = false;
@Parameter(names = {"-pic... | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
//
// T entity1;
// T entity2;
//
// String pattern;
// String relation;
//
// public FoundFeature(T entity1, T entity2, String pattern) {
// this.entity1 = entity1... | @Parameter(names = {"-selectionType"}, description = "Class of selection Type (e.g. Named Entity)", required = true, converter = JCommanderClassConverter.class) |
jkirsch/jedi | core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/features/detector/AbstractShortestPathFeatureExtractor.java | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
//
// T entity1;
// T entity2;
//
// String pattern;
// String relation;
//
// public FoundFeature(T entity1, T entity2, String pattern) {
// this.entity1 = entity1... | import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import de.tudarmstadt.ukp.dk... | package edu.tuberlin.dima.textmining.jedi.core.features.detector;
/**
*/
public abstract class AbstractShortestPathFeatureExtractor {
@Parameter(names = {"-lemmatize"}, description = "Lemmatize the pattern to remove times", required = false)
private boolean lemmatize = false;
@Parameter(names = {"-pic... | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
//
// T entity1;
// T entity2;
//
// String pattern;
// String relation;
//
// public FoundFeature(T entity1, T entity2, String pattern) {
// this.entity1 = entity1... | public final List<FoundFeature<Annotation>> exec(JCas xmlDocument) throws IOException { |
jkirsch/jedi | core/src/test/java/edu/tuberlin/dima/textmining/jedi/core/freebase/FreebaseHelperTest.java | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FreebaseRelation.java
// public class FreebaseRelation {
//
// String domain;
// String range;
//
// List<String> domainTypes;
// List<String> rangeTypes;
//
// public FreebaseRelation(String domain, Stri... | import edu.tuberlin.dima.textmining.jedi.core.model.FreebaseRelation;
import org.junit.Assert;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is; | package edu.tuberlin.dima.textmining.jedi.core.freebase;
public class FreebaseHelperTest {
@Test
public void testGetTopicForID() throws Exception {
FreebaseHelper freebaseHelper = new FreebaseHelper();
/*
{"pred":"/people/person/education./education/education/degree",
"sub":"/m/0g6g2m",
"obj":"/m/02h4rq6",
"ev... | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FreebaseRelation.java
// public class FreebaseRelation {
//
// String domain;
// String range;
//
// List<String> domainTypes;
// List<String> rangeTypes;
//
// public FreebaseRelation(String domain, Stri... | FreebaseRelation typesForRelationFromFreebase = freebaseHelper.getTypesForRelationFromFreebase("ns:people.person.education..education.education.degree"); |
jkirsch/jedi | core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/features/detector/AllPairsShortestPathFeatureExtractor.java | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
//
// T entity1;
// T entity2;
//
// String pattern;
// String relation;
//
// public FoundFeature(T entity1, T entity2, String pattern) {
// this.entity1 = entity1... | import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.*;
import com.google.common.primitives.Ints;
import de.tudarmstadt.ukp.dkpro.core.api.coref.type.CoreferenceChain;
import de.tud... | package edu.tuberlin.dima.textmining.jedi.core.features.detector;
/**
*/
public class AllPairsShortestPathFeatureExtractor extends AbstractShortestPathFeatureExtractor {
public AllPairsShortestPathFeatureExtractor(String options) throws UIMAException {
super(options);
}
public AllPairsShortestPat... | // Path: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/model/FoundFeature.java
// public class FoundFeature<T> {
//
// T entity1;
// T entity2;
//
// String pattern;
// String relation;
//
// public FoundFeature(T entity1, T entity2, String pattern) {
// this.entity1 = entity1... | public List<FoundFeature<Annotation>> getShortestPaths(UndirectedGraph<Token, DependencyEdge> graph) { |
junit-team/junit4 | src/test/java/org/junit/rules/TempFolderRuleTest.java | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
... | package org.junit.rules;
public class TempFolderRuleTest {
private static File[] createdFiles = new File[20];
public static class HasTempFolder {
@Rule
public TemporaryFolder folder = new TemporaryFolder();
@Test
public void testUsingTempFolder() throws IOException {
... | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | assertTrue(createdFiles[0].exists()); |
junit-team/junit4 | src/test/java/org/junit/rules/TempFolderRuleTest.java | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
... | package org.junit.rules;
public class TempFolderRuleTest {
private static File[] createdFiles = new File[20];
public static class HasTempFolder {
@Rule
public TemporaryFolder folder = new TemporaryFolder();
@Test
public void testUsingTempFolder() throws IOException {
... | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | assertFalse(createdFiles[0].exists()); |
junit-team/junit4 | src/test/java/org/junit/rules/TempFolderRuleTest.java | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
... | folder.delete();
assertFalse(file.exists());
assertFalse(folder.getRoot().exists());
}
@Test
public void recursiveDeleteFolderWithOneRandomElement() throws IOException {
TemporaryFolder folder = new TemporaryFolder();
folder.create();
File file = folder.newFi... | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | assertEquals(expectedPermissions, actualPermissions); |
junit-team/junit4 | src/main/java/org/junit/internal/runners/statements/FailOnTimeout.java | // Path: src/main/java/org/junit/runners/model/MultipleFailureException.java
// public class MultipleFailureException extends Exception {
// private static final long serialVersionUID = 1L;
//
// /*
// * We have to use the f prefix until the next major release to ensure
// * serialization compatibili... | import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.Timeou... | private Throwable getResult(FutureTask<Throwable> task, Thread thread) {
try {
if (timeout > 0) {
return task.get(timeout, timeUnit);
} else {
return task.get();
}
} catch (InterruptedException e) {
return e; // caller w... | // Path: src/main/java/org/junit/runners/model/MultipleFailureException.java
// public class MultipleFailureException extends Exception {
// private static final long serialVersionUID = 1L;
//
// /*
// * We have to use the f prefix until the next major release to ensure
// * serialization compatibili... | return new MultipleFailureException( |
junit-team/junit4 | src/main/java/org/junit/rules/ErrorCollector.java | // Path: src/main/java/org/junit/Assert.java
// public static <T extends Throwable> T assertThrows(Class<T> expectedThrowable,
// ThrowingRunnable runnable) {
// return assertThrows(null, expectedThrowable, runnable);
// }
//
// Path: src/main/java/org/junit/runners/model/MultipleFailureException.java
// p... | import static org.junit.Assert.assertThrows;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import org.junit.function.ThrowingRunnable;
import org.junit.internal.AssumptionViolatedException;
import org.hamcrest.Matcher;
import org.hamcrest.MatcherAssert;
import org.junit.runner... | package org.junit.rules;
/**
* The ErrorCollector rule allows execution of a test to continue after the
* first problem is found (for example, to collect _all_ the incorrect rows in a
* table, and report them all at once):
*
* <pre>
* public static class UsesErrorCollectorTwice {
* @Rule
* public Err... | // Path: src/main/java/org/junit/Assert.java
// public static <T extends Throwable> T assertThrows(Class<T> expectedThrowable,
// ThrowingRunnable runnable) {
// return assertThrows(null, expectedThrowable, runnable);
// }
//
// Path: src/main/java/org/junit/runners/model/MultipleFailureException.java
// p... | MultipleFailureException.assertEmpty(errors); |
junit-team/junit4 | src/main/java/org/junit/rules/ErrorCollector.java | // Path: src/main/java/org/junit/Assert.java
// public static <T extends Throwable> T assertThrows(Class<T> expectedThrowable,
// ThrowingRunnable runnable) {
// return assertThrows(null, expectedThrowable, runnable);
// }
//
// Path: src/main/java/org/junit/runners/model/MultipleFailureException.java
// p... | import static org.junit.Assert.assertThrows;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import org.junit.function.ThrowingRunnable;
import org.junit.internal.AssumptionViolatedException;
import org.hamcrest.Matcher;
import org.hamcrest.MatcherAssert;
import org.junit.runner... | * Adds to the table the exception, if any, thrown from {@code callable}.
* Execution continues, but the test will fail at the end if
* {@code callable} threw an exception.
*/
public <T> T checkSucceeds(Callable<T> callable) {
try {
return callable.call();
} catch (Ass... | // Path: src/main/java/org/junit/Assert.java
// public static <T extends Throwable> T assertThrows(Class<T> expectedThrowable,
// ThrowingRunnable runnable) {
// return assertThrows(null, expectedThrowable, runnable);
// }
//
// Path: src/main/java/org/junit/runners/model/MultipleFailureException.java
// p... | assertThrows(expectedThrowable, runnable); |
junit-team/junit4 | src/test/java/org/junit/tests/running/methods/AnnotationTest.java | // Path: src/main/java/org/junit/runner/JUnitCore.java
// public class JUnitCore {
// private final RunNotifier notifier = new RunNotifier();
//
// /**
// * Run the tests contained in the classes named in the <code>args</code>.
// * If all tests run successfully, exit with a status of 0. Otherwise ex... | import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.experimental.results.PrintableResult.testResult;
import static org.junit.experimental.results.ResultMatchers.isSuccessful;
import java.util.... | package org.junit.tests.running.methods;
public class AnnotationTest extends TestCase {
static boolean run;
@Override
public void setUp() {
run = false;
}
public static class SimpleTest {
@Test
public void success() {
run = true;
}
}
public ... | // Path: src/main/java/org/junit/runner/JUnitCore.java
// public class JUnitCore {
// private final RunNotifier notifier = new RunNotifier();
//
// /**
// * Run the tests contained in the classes named in the <code>args</code>.
// * If all tests run successfully, exit with a status of 0. Otherwise ex... | JUnitCore runner = new JUnitCore(); |
junit-team/junit4 | src/test/java/org/junit/tests/listening/ListenerTest.java | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.Description;
import org.junit.runner.JUnitCore;
import org.junit.runner.notification.RunListener; | package org.junit.tests.listening;
public class ListenerTest {
private static String log;
public static class OneTest {
@Test
public void nothing() {
}
}
@Test
public void notifyListenersInTheOrderInWhichTheyAreAdded() { | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | JUnitCore core = new JUnitCore(); |
junit-team/junit4 | src/test/java/org/junit/tests/listening/ListenerTest.java | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.Description;
import org.junit.runner.JUnitCore;
import org.junit.runner.notification.RunListener; | package org.junit.tests.listening;
public class ListenerTest {
private static String log;
public static class OneTest {
@Test
public void nothing() {
}
}
@Test
public void notifyListenersInTheOrderInWhichTheyAreAdded() {
JUnitCore core = new JUnitCore();
... | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | assertEquals("first second ", log); |
junit-team/junit4 | src/test/java/org/junit/experimental/categories/JavadocTest.java | // Path: src/main/java/org/junit/Assert.java
// @Deprecated
// public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
// assertThat("", actual, matcher);
// }
//
// Path: src/main/java/org/junit/Assert.java
// public static void assertTrue(String message, boolean condition) {
// if (!conditi... | import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Test;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.RunWith;
import org.junit.runners.Suite; | package org.junit.experimental.categories;
/**
* @author tibor17
* @version 4.12
* @since 4.12
*/
public class JavadocTest {
public static interface FastTests {}
public static interface SlowTests {}
public static interface SmokeTests {}
public static class A {
public void a() { | // Path: src/main/java/org/junit/Assert.java
// @Deprecated
// public static <T> void assertThat(T actual, Matcher<? super T> matcher) {
// assertThat("", actual, matcher);
// }
//
// Path: src/main/java/org/junit/Assert.java
// public static void assertTrue(String message, boolean condition) {
// if (!conditi... | fail(); |
junit-team/junit4 | src/main/java/org/junit/runner/FilterFactories.java | // Path: src/main/java/org/junit/internal/Classes.java
// public class Classes {
//
// /**
// * Do not instantiate.
// * @deprecated will be private soon.
// */
// @Deprecated
// public Classes() {
// }
//
// /**
// * Returns Class.forName for {@code className} using... | import org.junit.internal.Classes;
import org.junit.runner.FilterFactory.FilterNotCreatedException;
import org.junit.runner.manipulation.Filter;
| package org.junit.runner;
/**
* Utility class whose methods create a {@link FilterFactory}.
*/
class FilterFactories {
/**
* Creates a {@link Filter}.
*
* A filter specification is of the form "package.of.FilterFactory=args-to-filter-factory" or
* "package.of.FilterFactory".
... | // Path: src/main/java/org/junit/internal/Classes.java
// public class Classes {
//
// /**
// * Do not instantiate.
// * @deprecated will be private soon.
// */
// @Deprecated
// public Classes() {
// }
//
// /**
// * Returns Class.forName for {@code className} using... | filterFactoryClass = Classes.getClass(filterFactoryFqcn).asSubclass(FilterFactory.class);
|
junit-team/junit4 | src/test/java/org/junit/tests/experimental/theories/runner/WithAutoGeneratedDataPoints.java | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | import static org.junit.Assert.assertEquals;
import static org.junit.tests.experimental.theories.TheoryTestUtils.potentialAssignments;
import org.junit.Test;
import org.junit.experimental.theories.DataPoint;
import org.junit.experimental.theories.Theories;
import org.junit.runner.RunWith; | package org.junit.tests.experimental.theories.runner;
public class WithAutoGeneratedDataPoints {
private enum ENUM { VALUE, OTHER_VALUE, THIRD_VALUE }
@RunWith(Theories.class)
public static class TheoryTestClassWithAutogeneratedParameterValues {
public void theory(ENUM e) {
... | // Path: src/main/java/org/junit/Assert.java
// public static void assertEquals(String message, Object expected,
// Object actual) {
// if (equalsRegardingNull(expected, actual)) {
// return;
// }
// if (expected instanceof String && actual instanceof String) {
// String cleanMessage... | assertEquals(ENUM.values().length, potentialAssignments( |
junit-team/junit4 | src/main/java/org/junit/rules/ExpectedException.java | // Path: src/main/java/org/junit/Assert.java
// public static void fail(String message) {
// if (message == null) {
// throw new AssertionError();
// }
// throw new AssertionError(message);
// }
| import static java.lang.String.format;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.fail;
import static org.junit.internal.matchers.ThrowableCauseMatcher.hasCause;
import static org.junit.internal.matchers.ThrowableMessageMatc... | private class ExpectedExceptionStatement extends Statement {
private final Statement next;
public ExpectedExceptionStatement(Statement base) {
next = base;
}
@Override
public void evaluate() throws Throwable {
try {
next.evaluate();
... | // Path: src/main/java/org/junit/Assert.java
// public static void fail(String message) {
// if (message == null) {
// throw new AssertionError();
// }
// throw new AssertionError(message);
// }
// Path: src/main/java/org/junit/rules/ExpectedException.java
import static java.lang.String.format;
im... | fail(missingExceptionMessage()); |
Simsilica/SiO2 | demos/bullet/src/main/java/com/simsilica/demo/bullet/WanderDriver.java | // Path: src/main/java/com/simsilica/sim/SimTime.java
// public class SimTime {
// private long frame;
// private long lastRealTime;
// private boolean rebase;
//
// /**
// * gameTime is the 0-based 'game time' that is adjusted based on
// * the advancement of 'real time' provide... | import java.util.Random;
import com.jme3.bullet.collision.PhysicsCollisionEvent;
import com.jme3.math.*;
import com.simsilica.es.*;
import com.simsilica.sim.SimTime;
import com.simsilica.bullet.*;
| protected float calculateWanderSteer() {
// We do this by imagining a wheel in front of us that randomly
// turns left or right... we will steer towards wherever the 0 degree
// mark on the wheel happens to be in our field of view.
float volatility = 0.4f;
headingAngle +... | // Path: src/main/java/com/simsilica/sim/SimTime.java
// public class SimTime {
// private long frame;
// private long lastRealTime;
// private boolean rebase;
//
// /**
// * gameTime is the 0-based 'game time' that is adjusted based on
// * the advancement of 'real time' provide... | public void update( SimTime time, EntityRigidBody body ) {
|
Simsilica/SiO2 | src/main/java/com/simsilica/net/server/ChatHostedService.java | // Path: src/main/java/com/simsilica/net/ChatSession.java
// public interface ChatSession {
//
// /**
// * Sends a new message to the chat.
// */
// @Asynchronous
// public void sendMessage( String message );
//
// /**
// * Returns the list of players currently in the chat.
... | import java.util.*;
import java.util.concurrent.*;
import org.slf4j.*;
import com.jme3.network.HostedConnection;
import com.jme3.network.MessageConnection;
import com.jme3.network.Server;
import com.jme3.network.service.AbstractHostedConnectionService;
import com.jme3.network.service.HostedServiceManager;
impor... | /*
* $Id$
*
* Copyright (c) 2016, Simsilica, LLC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
... | // Path: src/main/java/com/simsilica/net/ChatSession.java
// public interface ChatSession {
//
// /**
// * Sends a new message to the chat.
// */
// @Asynchronous
// public void sendMessage( String message );
//
// /**
// * Returns the list of players currently in the chat.
... | rmi.share((byte)channel, session, ChatSession.class);
|
Simsilica/SiO2 | src/main/java/com/simsilica/net/server/ChatHostedService.java | // Path: src/main/java/com/simsilica/net/ChatSession.java
// public interface ChatSession {
//
// /**
// * Sends a new message to the chat.
// */
// @Asynchronous
// public void sendMessage( String message );
//
// /**
// * Returns the list of players currently in the chat.
... | import java.util.*;
import java.util.concurrent.*;
import org.slf4j.*;
import com.jme3.network.HostedConnection;
import com.jme3.network.MessageConnection;
import com.jme3.network.Server;
import com.jme3.network.service.AbstractHostedConnectionService;
import com.jme3.network.service.HostedServiceManager;
impor... | // may call it and it will also be called during connection shutdown.
conn.setAttribute(ATTRIBUTE_SESSION, null);
// Remove player session from the active sessions list
players.remove(player);
// Send the leave event to other players
... | // Path: src/main/java/com/simsilica/net/ChatSession.java
// public interface ChatSession {
//
// /**
// * Sends a new message to the chat.
// */
// @Asynchronous
// public void sendMessage( String message );
//
// /**
// * Returns the list of players currently in the chat.
... | private class ChatSessionImpl implements ChatSession, ChatSessionListener {
|
Simsilica/SiO2 | extensions/bullet/src/main/java/com/simsilica/bullet/DefaultContactPublisher.java | // Path: src/main/java/com/simsilica/es/common/Decay.java
// public class Decay implements EntityComponent, PersistentComponent {
// private long startTime;
// private long endTime;
//
// public Decay() {
// }
//
// /**
// * Creates a decay component with a start/end time that c... | import com.simsilica.es.*;
import com.simsilica.es.common.Decay;
import com.jme3.bullet.collision.*;
import com.jme3.math.*;
| // Calculate the energy of the collision
Vector3f v1 = (object1 instanceof EntityRigidBody) ? ((EntityRigidBody)object1).getLastVelocity() : Vector3f.ZERO;
Vector3f v2 = (object2 instanceof EntityRigidBody) ? ((EntityRigidBody)object2).getLastVelocity() : Vector3f.ZERO; ... | // Path: src/main/java/com/simsilica/es/common/Decay.java
// public class Decay implements EntityComponent, PersistentComponent {
// private long startTime;
// private long endTime;
//
// public Decay() {
// }
//
// /**
// * Creates a decay component with a start/end time that c... | ed.setComponents(contactEntity, c, new Decay());
|
Simsilica/SiO2 | src/main/java/com/simsilica/net/client/ChatClientService.java | // Path: src/main/java/com/simsilica/net/ChatSession.java
// public interface ChatSession {
//
// /**
// * Sends a new message to the chat.
// */
// @Asynchronous
// public void sendMessage( String message );
//
// /**
// * Returns the list of players currently in the chat.
... | import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.slf4j.*;
import com.jme3.network.MessageConnection;
import com.jme3.network.service.AbstractClientService;
import com.jme3.network.service.ClientServiceManager;
import com.jme3.network.service.rmi.RmiClientService;
import com.sim... | /*
* $Id$
*
* Copyright (c) 2016, Simsilica, LLC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
... | // Path: src/main/java/com/simsilica/net/ChatSession.java
// public interface ChatSession {
//
// /**
// * Sends a new message to the chat.
// */
// @Asynchronous
// public void sendMessage( String message );
//
// /**
// * Returns the list of players currently in the chat.
... | private List<ChatSessionListener> listeners = new CopyOnWriteArrayList<>();
|
Simsilica/SiO2 | src/main/java/com/simsilica/state/DebugHudState.java | // Path: src/main/java/com/simsilica/post/DefaultSceneProcessor.java
// public class DefaultSceneProcessor implements SceneProcessor {
//
// @Override
// public void initialize( RenderManager rm, ViewPort vp ) {
// }
//
// @Override
// public void reshape( ViewPort vp, int w, int h ) {
// ... | import java.util.HashMap;
import java.util.Map;
import org.slf4j.*;
import com.jme3.app.Application;
import com.jme3.app.SimpleApplication;
import com.jme3.app.state.BaseAppState;
import com.jme3.math.Vector3f;
import com.jme3.post.SceneProcessor;
import com.jme3.renderer.Camera;
import com.jme3.renderer.ViewP... | screen.removeFromParent();
getHudViewPort().removeProcessor(reshapeListener);
}
private class DebugView {
String name;
VersionedReference<String> ref;
Label nameLabel;
Label label;
Location location;
public DebugView( Strin... | // Path: src/main/java/com/simsilica/post/DefaultSceneProcessor.java
// public class DefaultSceneProcessor implements SceneProcessor {
//
// @Override
// public void initialize( RenderManager rm, ViewPort vp ) {
// }
//
// @Override
// public void reshape( ViewPort vp, int w, int h ) {
// ... | private class ReshapeListener extends DefaultSceneProcessor {
|
Simsilica/SiO2 | extensions/bullet/src/main/java/com/simsilica/bullet/debug/PhysicsDebugState.java | // Path: extensions/bullet/src/main/java/com/simsilica/bullet/CollisionShapes.java
// public interface CollisionShapes {
//
// /**
// * Registers the specific shape for the specified ShapeInfo such that
// * subsequent calls to loadShape(info) will resolve to that shape.
// * This can be... | import java.util.*;
import org.slf4j.*;
import com.jme3.app.Application;
import com.jme3.app.SimpleApplication;
import com.jme3.app.state.BaseAppState;
import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.util.DebugShapeFactory;
import com.jme3.material.Material;
import com.jme3.materi... | /*
* $Id$
*
* Copyright (c) 2018, Simsilica, LLC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
... | // Path: extensions/bullet/src/main/java/com/simsilica/bullet/CollisionShapes.java
// public interface CollisionShapes {
//
// /**
// * Registers the specific shape for the specified ShapeInfo such that
// * subsequent calls to loadShape(info) will resolve to that shape.
// * This can be... | private CollisionShapes shapes;
|
Simsilica/SiO2 | extensions/bullet/src/main/java/com/simsilica/bullet/debug/PhysicsDebugState.java | // Path: extensions/bullet/src/main/java/com/simsilica/bullet/CollisionShapes.java
// public interface CollisionShapes {
//
// /**
// * Registers the specific shape for the specified ShapeInfo such that
// * subsequent calls to loadShape(info) will resolve to that shape.
// * This can be... | import java.util.*;
import org.slf4j.*;
import com.jme3.app.Application;
import com.jme3.app.SimpleApplication;
import com.jme3.app.state.BaseAppState;
import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.util.DebugShapeFactory;
import com.jme3.material.Material;
import com.jme3.materi... | Spatial result = debugShapeCache.get(shape);
if( result == null && create ) {
result = DebugShapeFactory.getDebugShape(shape);
debugShapeCache.put(shape, result);
}
return result.clone();
} catch( Exception e ) {
... | // Path: extensions/bullet/src/main/java/com/simsilica/bullet/CollisionShapes.java
// public interface CollisionShapes {
//
// /**
// * Registers the specific shape for the specified ShapeInfo such that
// * subsequent calls to loadShape(info) will resolve to that shape.
// * This can be... | this.shape = shapes.getShape(entity.get(ShapeInfo.class));
|
Simsilica/SiO2 | demos/bullet-char/src/main/java/com/simsilica/demo/bullet/PlatformPathDriver.java | // Path: src/main/java/com/simsilica/sim/SimTime.java
// public class SimTime {
// private long frame;
// private long lastRealTime;
// private boolean rebase;
//
// /**
// * gameTime is the 0-based 'game time' that is adjusted based on
// * the advancement of 'real time' provide... | import java.util.Random;
import com.jme3.bullet.collision.PhysicsCollisionEvent;
import com.jme3.math.*;
import com.simsilica.es.*;
import com.simsilica.mathd.*;
import com.simsilica.sim.SimTime;
import com.simsilica.bullet.*;
|
public PlatformPathDriver( Entity entity ) {
this.entity = entity;
}
public void setPath( PlatformPath path ) {
this.path = path;
if( path == null ) {
return;
}
this.start = path.getStart().toVector3f();
this.end = path.getEnd().to... | // Path: src/main/java/com/simsilica/sim/SimTime.java
// public class SimTime {
// private long frame;
// private long lastRealTime;
// private boolean rebase;
//
// /**
// * gameTime is the 0-based 'game time' that is adjusted based on
// * the advancement of 'real time' provide... | public void update( SimTime time, EntityRigidBody body ) {
|
Simsilica/SiO2 | extensions/bullet/src/main/java/com/simsilica/bullet/ControlDriver.java | // Path: src/main/java/com/simsilica/sim/SimTime.java
// public class SimTime {
// private long frame;
// private long lastRealTime;
// private boolean rebase;
//
// /**
// * gameTime is the 0-based 'game time' that is adjusted based on
// * the advancement of 'real time' provide... | import com.simsilica.es.EntityId;
import com.simsilica.sim.SimTime;
import com.jme3.bullet.collision.PhysicsCollisionEvent;
| /*
* $Id$
*
* Copyright (c) 2018, Simsilica, LLC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
... | // Path: src/main/java/com/simsilica/sim/SimTime.java
// public class SimTime {
// private long frame;
// private long lastRealTime;
// private boolean rebase;
//
// /**
// * gameTime is the 0-based 'game time' that is adjusted based on
// * the advancement of 'real time' provide... | public void update( SimTime time, EntityRigidBody body );
|
Simsilica/SiO2 | demos/bullet-char/src/main/java/com/simsilica/demo/bullet/CharInputDriver.java | // Path: src/main/java/com/simsilica/sim/SimTime.java
// public class SimTime {
// private long frame;
// private long lastRealTime;
// private boolean rebase;
//
// /**
// * gameTime is the 0-based 'game time' that is adjusted based on
// * the advancement of 'real time' provide... | import java.util.Random;
import com.jme3.bullet.collision.PhysicsCollisionEvent;
import com.jme3.bullet.collision.PhysicsCollisionObject;
import com.jme3.bullet.objects.PhysicsRigidBody;
import com.jme3.math.*;
import com.simsilica.es.*;
import com.simsilica.mathd.*;
import com.simsilica.sim.SimTime;
import co... | //System.out.println("++++ contact:" + otherBody);
// Just until we can tweak our ghost size more appropriately
canJump = true;
PhysicsRigidBody rb = (PhysicsRigidBody)otherBody;
rb.getLinearVelocity(vTemp);
groundVelocity.addLocal(vTemp);
... | // Path: src/main/java/com/simsilica/sim/SimTime.java
// public class SimTime {
// private long frame;
// private long lastRealTime;
// private boolean rebase;
//
// /**
// * gameTime is the 0-based 'game time' that is adjusted based on
// * the advancement of 'real time' provide... | public void update( SimTime time, EntityRigidBody body ) {
|
Simsilica/SiO2 | extensions/bullet/src/main/java/com/simsilica/bullet/debug/ContactDebugState.java | // Path: extensions/bullet/src/main/java/com/simsilica/bullet/Contact.java
// public class Contact implements EntityComponent {
//
// private EntityId entity1;
// private int type1;
//
// private EntityId entity2;
// private int type2;
//
// private int typeMask;
//
// pri... | import java.util.*;
import org.slf4j.*;
import com.jme3.app.Application;
import com.jme3.app.SimpleApplication;
import com.jme3.app.state.BaseAppState;
import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.util.DebugShapeFactory;
import com.jme3.material.Material;
import com.jme3.materi... |
this.debugRoot = new Node("contactDebugRoot");
this.contacts = new ContactDebugContainer(ed);
}
@Override
protected void cleanup( Application app ) {
}
@Override
protected void onEnable() {
((SimpleApplication)getApplication()).getRootNode().attachC... | // Path: extensions/bullet/src/main/java/com/simsilica/bullet/Contact.java
// public class Contact implements EntityComponent {
//
// private EntityId entity1;
// private int type1;
//
// private EntityId entity2;
// private int type2;
//
// private int typeMask;
//
// pri... | for( Contact c : contacts.getArray() ) {
|
pviotti/hybris | src/main/java/fr/eurecom/hybris/mds/Rmds.java | // Path: src/main/java/fr/eurecom/hybris/Hybris.java
// public class HybrisWatcher implements CuratorWatcher {
//
// private boolean changed = false;
// public boolean isChanged() { return this.changed; }
//
// /**
// * Process a notification sent by ZooKeeper
// * @see org.apache.curator.framew... | import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.zookeeper.data.Stat;
import fr.eurecom.hybris.Hybris.HybrisWatcher;
import fr.eurecom.hybris.kvs.drivers.Kvs;
import fr.eurecom.hybris.mds.Metadata.Timestamp;
import fr.eurecom.hybris.HybrisException; | /**
* Copyright (C) 2013 EURECOM (www.eurecom.fr)
*
* Licensed 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 applic... | // Path: src/main/java/fr/eurecom/hybris/Hybris.java
// public class HybrisWatcher implements CuratorWatcher {
//
// private boolean changed = false;
// public boolean isChanged() { return this.changed; }
//
// /**
// * Process a notification sent by ZooKeeper
// * @see org.apache.curator.framew... | boolean tsWrite(String key, Metadata md, long version) throws HybrisException; |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/converters/path/IPathToProjectNameConverter.java | // Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectException.java
// public class UnparsableProjectException extends Exception {
//
// private static final long serialVersionUID = 643951700141491862L;
//
// public UnparsableProjectException(String reason) {
// super(reason);
// }
//
// }
| import com.asolutions.scmsshd.sshd.UnparsableProjectException; | package com.asolutions.scmsshd.converters.path;
public interface IPathToProjectNameConverter {
public abstract String convert(String toParse) | // Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectException.java
// public class UnparsableProjectException extends Exception {
//
// private static final long serialVersionUID = 643951700141491862L;
//
// public UnparsableProjectException(String reason) {
// super(reason);
// }
//
// }
// P... | throws UnparsableProjectException; |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitSCMCommandImpl.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolutions.scmssh... | package com.asolutions.scmsshd.commands.git;
public abstract class GitSCMCommandImpl implements ISCMCommandHandler {
protected final Logger log = LoggerFactory.getLogger(getClass());
public GitSCMCommandImpl() {
super();
}
| // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | public void execute(FilteredCommand filteredCommand, |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitSCMCommandImpl.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolutions.scmssh... | package com.asolutions.scmsshd.commands.git;
public abstract class GitSCMCommandImpl implements ISCMCommandHandler {
protected final Logger log = LoggerFactory.getLogger(getClass());
public GitSCMCommandImpl() {
super();
}
public void execute(FilteredCommand filteredCommand,
InputStream inputStream, Outp... | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | Properties config, AuthorizationLevel authorizationLevel) { |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.assertEquals;
import java.util.Properties;
import org.jmock.Expectations;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.fi... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBaseTest extends MockTestCase {
private static final String ARGUMENT = "argument";
private static final String COMMAND = "command";
@Test
public void testBadCommandReturnsNoOp() throws Exception {
| // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | final IBadCommandFilter mockBadCommandFilter = context.mock(IBadCommandFilter.class);
|
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.assertEquals;
import java.util.Properties;
import org.jmock.Expectations;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.fi... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBaseTest extends MockTestCase {
private static final String ARGUMENT = "argument";
private static final String COMMAND = "command";
@Test
public void testBadCommandReturnsNoOp() throws Exception {
final IBadComman... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | will(throwException(new BadCommandException()));
|
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.assertEquals;
import java.util.Properties;
import org.jmock.Expectations;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.fi... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBaseTest extends MockTestCase {
private static final String ARGUMENT = "argument";
private static final String COMMAND = "command";
@Test
public void testBadCommandReturnsNoOp() throws Exception {
final IBadComman... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | assertEquals(NoOpCommand.class, factory.createCommand(COMMAND).getClass());
|
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.assertEquals;
import java.util.Properties;
import org.jmock.Expectations;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.fi... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBaseTest extends MockTestCase {
private static final String ARGUMENT = "argument";
private static final String COMMAND = "command";
@Test
public void testBadCommandReturnsNoOp() throws Exception {
final IBadComman... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | final FilteredCommand filteredCommand = new FilteredCommand(COMMAND, ARGUMENT);
|
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.assertEquals;
import java.util.Properties;
import org.jmock.Expectations;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.fi... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBaseTest extends MockTestCase {
private static final String ARGUMENT = "argument";
private static final String COMMAND = "command";
@Test
public void testBadCommandReturnsNoOp() throws Exception {
final IBadComman... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | final IProjectAuthorizer mockProjAuth = context.mock(IProjectAuthorizer.class);
|
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.assertEquals;
import java.util.Properties;
import org.jmock.Expectations;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.fi... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBaseTest extends MockTestCase {
private static final String ARGUMENT = "argument";
private static final String COMMAND = "command";
@Test
public void testBadCommandReturnsNoOp() throws Exception {
final IBadComman... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | final IPathToProjectNameConverter mockPathConverter = context.mock(IPathToProjectNameConverter.class);
|
gaffo/scumd | src/main/java/com/asolutions/scmsshd/ldap/JavaxNamingProvider.java | // Path: src/main/java/com/asolutions/scmsshd/ssl/PromiscuousSSLSocketFactory.java
// public class PromiscuousSSLSocketFactory extends SocketFactory {
// protected final Logger log = LoggerFactory.getLogger(getClass());
// private static SocketFactory blindFactory = null;
//
// /**
// *
// * Builds an all trus... | import java.util.Properties;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.directory.InitialDirContext;
import com.asolutions.scmsshd.ssl.PromiscuousSSLSocketFactory; | package com.asolutions.scmsshd.ldap;
public class JavaxNamingProvider implements IJavaxNamingProvider {
private String url;
private boolean promiscuous;
public JavaxNamingProvider(String url, boolean promiscuous) {
this.url = url;
this.promiscuous = promiscuous;
}
public InitialDirContext getBinding(S... | // Path: src/main/java/com/asolutions/scmsshd/ssl/PromiscuousSSLSocketFactory.java
// public class PromiscuousSSLSocketFactory extends SocketFactory {
// protected final Logger log = LoggerFactory.getLogger(getClass());
// private static SocketFactory blindFactory = null;
//
// /**
// *
// * Builds an all trus... | properties.setProperty("java.naming.ldap.factory.socket", PromiscuousSSLSocketFactory.class.getName()); |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/authorizors/AlwaysPassProjectAuthorizer.java | // Path: src/main/java/com/asolutions/scmsshd/sshd/IProjectAuthorizer.java
// public interface IProjectAuthorizer {
//
// AuthorizationLevel userIsAuthorizedForProject(String username, String project) throws UnparsableProjectException;
//
// }
//
// Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectE... | import com.asolutions.scmsshd.sshd.IProjectAuthorizer;
import com.asolutions.scmsshd.sshd.UnparsableProjectException; | package com.asolutions.scmsshd.authorizors;
public class AlwaysPassProjectAuthorizer implements IProjectAuthorizer {
public AuthorizationLevel userIsAuthorizedForProject(String username, | // Path: src/main/java/com/asolutions/scmsshd/sshd/IProjectAuthorizer.java
// public interface IProjectAuthorizer {
//
// AuthorizationLevel userIsAuthorizedForProject(String username, String project) throws UnparsableProjectException;
//
// }
//
// Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectE... | String project) throws UnparsableProjectException { |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/converters/path/regexp/ConfigurablePathToProjectConverterTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.asynchrony.customizations.AsynchronyPathToProjectNameConverter;
import com.asolutions.scmsshd.sshd.UnparsableProjectException; | package com.asolutions.scmsshd.converters.path.regexp;
public class ConfigurablePathToProjectConverterTest extends MockTestCase{
@Test
public void testMatchReturnsTrue() throws Exception {
ConfigurablePathToProjectConverter converter = new ConfigurablePathToProjectConverter();
converter.setProjectPattern("(\... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | new AsynchronyPathToProjectNameConverter().convert(""); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/converters/path/regexp/ConfigurablePathToProjectConverterTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.asynchrony.customizations.AsynchronyPathToProjectNameConverter;
import com.asolutions.scmsshd.sshd.UnparsableProjectException; | package com.asolutions.scmsshd.converters.path.regexp;
public class ConfigurablePathToProjectConverterTest extends MockTestCase{
@Test
public void testMatchReturnsTrue() throws Exception {
ConfigurablePathToProjectConverter converter = new ConfigurablePathToProjectConverter();
converter.setProjectPattern("(\... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | catch (UnparsableProjectException e){ |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import static org.junit.Assert.*;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.tr... | package com.asolutions.scmsshd.commands.git;
public class GitReceivePackSCMCommandHandlerTest extends MockTestCase {
@Test
public void testReceivePackPassesCorrectStuffToJGIT() throws Exception {
final String pathtobasedir = "pathtobasedir"; | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | final FilteredCommand filteredCommand = new FilteredCommand( |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import static org.junit.Assert.*;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.tr... | final OutputStream mockOutputStream = context.mock(OutputStream.class,
"mockOutputStream");
final OutputStream mockErrorStream = context.mock(OutputStream.class,
"mockErrorStream");
final ExitCallback mockExitCallback = context.mock(ExitCallback.class);
final GitSCMRepositoryProvider mockRepoProvider =... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | GitSCMCommandFactory.REPOSITORY_BASE); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import static org.junit.Assert.*;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.tr... | final File base = new File(pathtobasedir);
final GitReceivePackProvider mockReceivePackProvider = context
.mock(GitReceivePackProvider.class);
final ReceivePack mockUploadPack = context.mock(ReceivePack.class);
final Properties mockConfig = context.mock(Properties.class);
checking(new Expectations() {
... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | AuthorizationLevel.AUTH_LEVEL_READ_WRITE); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import static org.junit.Assert.*;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.tr... | final OutputStream mockOutputStream = context.mock(OutputStream.class,
"mockOutputStream");
final OutputStream mockErrorStream = context.mock(OutputStream.class,
"mockErrorStream");
final ExitCallback mockExitCallback = context.mock(ExitCallback.class);
final GitSCMRepositoryProvider mockRepoProvider =... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | } catch (Failure e) { |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import static org.junit.Assert.*;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.tr... | "mockOutputStream");
final OutputStream mockErrorStream = context.mock(OutputStream.class,
"mockErrorStream");
final ExitCallback mockExitCallback = context.mock(ExitCallback.class);
final GitSCMRepositoryProvider mockRepoProvider = context
.mock(GitSCMRepositoryProvider.class);
final File base = n... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | assertEquals(MustHaveWritePrivilagesToPushFailure.class, e |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitUploadPackSCMCommandHandler.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.trans... | package com.asolutions.scmsshd.commands.git;
public class GitUploadPackSCMCommandHandler extends GitSCMCommandImpl {
protected final Logger log = LoggerFactory.getLogger(getClass());
private GitSCMRepositoryProvider repositoryProvider;
private GitUploadPackProvider uploadPackProvider;
public GitUploadPackSCMC... | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | protected void runCommand(FilteredCommand filteredCommand, |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitUploadPackSCMCommandHandler.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.trans... | package com.asolutions.scmsshd.commands.git;
public class GitUploadPackSCMCommandHandler extends GitSCMCommandImpl {
protected final Logger log = LoggerFactory.getLogger(getClass());
private GitSCMRepositoryProvider repositoryProvider;
private GitUploadPackProvider uploadPackProvider;
public GitUploadPackSCMC... | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | Properties config, AuthorizationLevel authorizationLevel) |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitUploadPackSCMCommandHandler.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.trans... | package com.asolutions.scmsshd.commands.git;
public class GitUploadPackSCMCommandHandler extends GitSCMCommandImpl {
protected final Logger log = LoggerFactory.getLogger(getClass());
private GitSCMRepositoryProvider repositoryProvider;
private GitUploadPackProvider uploadPackProvider;
public GitUploadPackSCMC... | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | String strRepoBase = config.getProperty(GitSCMCommandFactory.REPOSITORY_BASE); |
gaffo/scumd | src/exttest/java/com/asolutions/scmsshd/test/integration/PushTest.java | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.spearce.jgi... | }
@After
public void closeRepos()
{
fromRepository.close();
}
@Test
public void testPush() throws Exception {
addRemoteConfigForLocalGitDirectory(fromRepository, toRepoDir, ORIGIN);
push(ORIGIN, REFSPEC, fromRepository);
assertPushOfMaster(fromRefMaster);
}
@Test
public void testRoundTrip() t... | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | final SCuMD sshd = new SCuMD(); |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import java.util.Properties;
import org.apache.sshd.server.CommandFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
impor... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBase implements CommandFactory {
protected final Logger log = LoggerFactory.getLogger(getClass());
| // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | private IProjectAuthorizer projectAuthorizer;
|
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import java.util.Properties;
import org.apache.sshd.server.CommandFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
impor... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBase implements CommandFactory {
protected final Logger log = LoggerFactory.getLogger(getClass());
private IProjectAuthorizer projectAuthorizer;
| // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | private IBadCommandFilter badCommandFilter;
|
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import java.util.Properties;
import org.apache.sshd.server.CommandFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
impor... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBase implements CommandFactory {
protected final Logger log = LoggerFactory.getLogger(getClass());
private IProjectAuthorizer projectAuthorizer;
private IBadCommandFilter badCommandFilter;
private ISCMCommandFactory scmComman... | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | private IPathToProjectNameConverter pathToProjectNameConverter;
|
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import java.util.Properties;
import org.apache.sshd.server.CommandFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
impor... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBase implements CommandFactory {
protected final Logger log = LoggerFactory.getLogger(getClass());
private IProjectAuthorizer projectAuthorizer;
private IBadCommandFilter badCommandFilter;
private ISCMCommandFactory scmComman... | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | FilteredCommand fc = badCommandFilter.filterOrThrow(command);
|
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import java.util.Properties;
import org.apache.sshd.server.CommandFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
impor... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBase implements CommandFactory {
protected final Logger log = LoggerFactory.getLogger(getClass());
private IProjectAuthorizer projectAuthorizer;
private IBadCommandFilter badCommandFilter;
private ISCMCommandFactory scmComman... | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | } catch (BadCommandException e) {
|
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import java.util.Properties;
import org.apache.sshd.server.CommandFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.NoOpCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
impor... | package com.asolutions.scmsshd.commands.factories;
public class CommandFactoryBase implements CommandFactory {
protected final Logger log = LoggerFactory.getLogger(getClass());
private IProjectAuthorizer projectAuthorizer;
private IBadCommandFilter badCommandFilter;
private ISCMCommandFactory scmComman... | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | return new NoOpCommand();
|
gaffo/scumd | src/exttest/java/com/asolutions/scmsshd/test/integration/util/ConstantProjectNameConverter.java | // Path: src/main/java/com/asolutions/scmsshd/converters/path/IPathToProjectNameConverter.java
// public interface IPathToProjectNameConverter {
//
// public abstract String convert(String toParse)
// throws UnparsableProjectException;
//
// }
//
// Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProje... | import com.asolutions.scmsshd.converters.path.IPathToProjectNameConverter;
import com.asolutions.scmsshd.sshd.UnparsableProjectException; | package com.asolutions.scmsshd.test.integration.util;
public class ConstantProjectNameConverter implements
IPathToProjectNameConverter {
public ConstantProjectNameConverter() {
}
| // Path: src/main/java/com/asolutions/scmsshd/converters/path/IPathToProjectNameConverter.java
// public interface IPathToProjectNameConverter {
//
// public abstract String convert(String toParse)
// throws UnparsableProjectException;
//
// }
//
// Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProje... | public String convert(String toParse) throws UnparsableProjectException { |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/authorizors/PassIfAnyInCollectionPassAuthorizorTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.*;
import java.util.ArrayList;
import org.jmock.Expectations;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.scmsshd.sshd.IProjectAuthorizer; | package com.asolutions.scmsshd.authorizors;
public class PassIfAnyInCollectionPassAuthorizorTest extends MockTestCase {
private static final String PROJECT = "project";
private static final String USERNAME = "username";
@Test
public void testAuthingWithEmptyChainFails() throws Exception {
assertNull(new P... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | final IProjectAuthorizer failsAuth = context.mock(IProjectAuthorizer.class, "failsAuth"); |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitSCMCommandHandler.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.handlers.ISCMComma... | package com.asolutions.scmsshd.commands.git;
public class GitSCMCommandHandler implements ISCMCommandHandler {
private ISCMCommandHandler uploadPackHandler;
private ISCMCommandHandler receivePackHandler;
public GitSCMCommandHandler() {
this(new GitUploadPackSCMCommandHandler(), new GitReceivePackSCMCommandH... | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | public void execute(FilteredCommand filteredCommand, |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitSCMCommandHandler.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.handlers.ISCMComma... | package com.asolutions.scmsshd.commands.git;
public class GitSCMCommandHandler implements ISCMCommandHandler {
private ISCMCommandHandler uploadPackHandler;
private ISCMCommandHandler receivePackHandler;
public GitSCMCommandHandler() {
this(new GitUploadPackSCMCommandHandler(), new GitReceivePackSCMCommandH... | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | AuthorizationLevel authorizationLevel) { |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/authorizors/PassIfAnyInCollectionPassAuthorizor.java | // Path: src/main/java/com/asolutions/scmsshd/sshd/IProjectAuthorizer.java
// public interface IProjectAuthorizer {
//
// AuthorizationLevel userIsAuthorizedForProject(String username, String project) throws UnparsableProjectException;
//
// }
//
// Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectE... | import java.util.ArrayList;
import com.asolutions.scmsshd.sshd.IProjectAuthorizer;
import com.asolutions.scmsshd.sshd.UnparsableProjectException; | package com.asolutions.scmsshd.authorizors;
public class PassIfAnyInCollectionPassAuthorizor implements IProjectAuthorizer {
private ArrayList<IProjectAuthorizer> authList = new ArrayList<IProjectAuthorizer>();
public AuthorizationLevel userIsAuthorizedForProject(String username, String project) | // Path: src/main/java/com/asolutions/scmsshd/sshd/IProjectAuthorizer.java
// public interface IProjectAuthorizer {
//
// AuthorizationLevel userIsAuthorizedForProject(String username, String project) throws UnparsableProjectException;
//
// }
//
// Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectE... | throws UnparsableProjectException { |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/ldap/LDAPBindingProvider.java | // Path: src/main/java/com/asolutions/scmsshd/ssl/PromiscuousSSLSocketFactory.java
// public class PromiscuousSSLSocketFactory extends SocketFactory {
// protected final Logger log = LoggerFactory.getLogger(getClass());
// private static SocketFactory blindFactory = null;
//
// /**
// *
// * Builds an all trus... | import java.util.Properties;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.directory.InitialDirContext;
import com.asolutions.scmsshd.ssl.PromiscuousSSLSocketFactory; | /**
*
*/
package com.asolutions.scmsshd.ldap;
public class LDAPBindingProvider {
private String lookupUserDN;
private String lookupUserPassword;
private String url;
private boolean promiscuous;
public LDAPBindingProvider(String lookupUserDN, String lookupUserPassword,
String url, boolean promiscuous) {... | // Path: src/main/java/com/asolutions/scmsshd/ssl/PromiscuousSSLSocketFactory.java
// public class PromiscuousSSLSocketFactory extends SocketFactory {
// protected final Logger log = LoggerFactory.getLogger(getClass());
// private static SocketFactory blindFactory = null;
//
// /**
// *
// * Builds an all trus... | properties.setProperty("java.naming.ldap.factory.socket", PromiscuousSSLSocketFactory.class.getName()); |
gaffo/scumd | src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
import org.junit.Test;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.transport.FetchResult;
import com.asolutions.scms... | package com.asolutions.scmsshd.test.integration;
public class FetchTest extends IntegrationTestCase {
@Test
public void testFetchLocal() throws Exception {
File gitDir = new File(".git");
String remoteName = "origin";
Repository db = createCloneToRepo();
addRemoteConfigForLocalGitDirectory(db, gitD... | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | final SCuMD sshd = new SCuMD(); |
gaffo/scumd | src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
import org.junit.Test;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.transport.FetchResult;
import com.asolutions.scms... | package com.asolutions.scmsshd.test.integration;
public class FetchTest extends IntegrationTestCase {
@Test
public void testFetchLocal() throws Exception {
File gitDir = new File(".git");
String remoteName = "origin";
Repository db = createCloneToRepo();
addRemoteConfigForLocalGitDirectory(db, gitD... | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | sshd.setPublickeyAuthenticator(new AlwaysPassPublicKeyAuthenticator()); |
gaffo/scumd | src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
import org.junit.Test;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.transport.FetchResult;
import com.asolutions.scms... | package com.asolutions.scmsshd.test.integration;
public class FetchTest extends IntegrationTestCase {
@Test
public void testFetchLocal() throws Exception {
File gitDir = new File(".git");
String remoteName = "origin";
Repository db = createCloneToRepo();
addRemoteConfigForLocalGitDirectory(db, gitD... | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | GitCommandFactory factory = new GitCommandFactory(); |
gaffo/scumd | src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
import org.junit.Test;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.transport.FetchResult;
import com.asolutions.scms... | package com.asolutions.scmsshd.test.integration;
public class FetchTest extends IntegrationTestCase {
@Test
public void testFetchLocal() throws Exception {
File gitDir = new File(".git");
String remoteName = "origin";
Repository db = createCloneToRepo();
addRemoteConfigForLocalGitDirectory(db, gitD... | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | factory.setPathToProjectNameConverter(new ConstantProjectNameConverter()); |
gaffo/scumd | src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
import org.junit.Test;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.transport.FetchResult;
import com.asolutions.scms... | package com.asolutions.scmsshd.test.integration;
public class FetchTest extends IntegrationTestCase {
@Test
public void testFetchLocal() throws Exception {
File gitDir = new File(".git");
String remoteName = "origin";
Repository db = createCloneToRepo();
addRemoteConfigForLocalGitDirectory(db, gitD... | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | factory.setProjectAuthorizor(new AlwaysPassProjectAuthorizer()); |
gaffo/scumd | src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
import org.junit.Test;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.transport.FetchResult;
import com.asolutions.scms... | package com.asolutions.scmsshd.test.integration;
public class FetchTest extends IntegrationTestCase {
@Test
public void testFetchLocal() throws Exception {
File gitDir = new File(".git");
String remoteName = "origin";
Repository db = createCloneToRepo();
addRemoteConfigForLocalGitDirectory(db, gitD... | // Path: src/main/java/com/asolutions/scmsshd/SCuMD.java
// public class SCuMD extends SshServer {
//
// /**
// * @param args
// */
// public static void main(String[] args) {
// if (args.length != 1) {
// System.err.println("Usage: SCuMD pathToConfigFile");
// return;
// }
// new FileSystemXmlApplic... | config.setProperty(GitSCMCommandFactory.REPOSITORY_BASE, System.getProperty("user.dir")); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/AllowedCommandCheckerTest.java | // Path: src/main/java/com/asolutions/scmsshd/commands/filters/BadCommandException.java
// public class BadCommandException extends Exception {
//
// private static final long serialVersionUID = 4904880805323643780L;
//
// public BadCommandException(String reason) {
// super(reason);
// }
//
// public BadComma... | import static org.junit.Assert.fail;
import org.junit.Test;
import com.asolutions.scmsshd.commands.filters.BadCommandException; | package com.asolutions.scmsshd.commands;
public class AllowedCommandCheckerTest {
@Test
public void testParsesGitCommands() throws Exception {
new AllowedCommandChecker("git-upload-pack");
new AllowedCommandChecker("git upload-pack");
new AllowedCommandChecker("git-receive-pack");
new AllowedCommandCheck... | // Path: src/main/java/com/asolutions/scmsshd/commands/filters/BadCommandException.java
// public class BadCommandException extends Exception {
//
// private static final long serialVersionUID = 4904880805323643780L;
//
// public BadCommandException(String reason) {
// super(reason);
// }
//
// public BadComma... | catch (BadCommandException e){ |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandler.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.trans... | package com.asolutions.scmsshd.commands.git;
public class GitReceivePackSCMCommandHandler extends GitSCMCommandImpl {
protected final Logger log = LoggerFactory.getLogger(getClass());
private GitSCMRepositoryProvider repositoryProvider;
private GitReceivePackProvider receivePackProvider;
public GitReceivePack... | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | protected void runCommand(FilteredCommand filteredCommand, |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandler.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.trans... | package com.asolutions.scmsshd.commands.git;
public class GitReceivePackSCMCommandHandler extends GitSCMCommandImpl {
protected final Logger log = LoggerFactory.getLogger(getClass());
private GitSCMRepositoryProvider repositoryProvider;
private GitReceivePackProvider receivePackProvider;
public GitReceivePack... | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | Properties config, AuthorizationLevel authorizationLevel) throws IOException { |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandler.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.trans... | package com.asolutions.scmsshd.commands.git;
public class GitReceivePackSCMCommandHandler extends GitSCMCommandImpl {
protected final Logger log = LoggerFactory.getLogger(getClass());
private GitSCMRepositoryProvider repositoryProvider;
private GitReceivePackProvider receivePackProvider;
public GitReceivePack... | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | throw new MustHaveWritePrivilagesToPushFailure("Tried to push to " + filteredCommand.getArgument()); |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandler.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.trans... | package com.asolutions.scmsshd.commands.git;
public class GitReceivePackSCMCommandHandler extends GitSCMCommandImpl {
protected final Logger log = LoggerFactory.getLogger(getClass());
private GitSCMRepositoryProvider repositoryProvider;
private GitReceivePackProvider receivePackProvider;
public GitReceivePack... | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | .getProperty(GitSCMCommandFactory.REPOSITORY_BASE); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitBadCommandFilterTest.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
import com.asolutions.scmsshd.commands.filters.git.GitBadCommandFilter; | package com.asolutions.scmsshd.commands.git;
public class GitBadCommandFilterTest {
@Test
public void testCorrect() throws Exception { | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | GitBadCommandFilter filter = new GitBadCommandFilter(); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitBadCommandFilterTest.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
import com.asolutions.scmsshd.commands.filters.git.GitBadCommandFilter; | package com.asolutions.scmsshd.commands.git;
public class GitBadCommandFilterTest {
@Test
public void testCorrect() throws Exception {
GitBadCommandFilter filter = new GitBadCommandFilter(); | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | FilteredCommand fc = filter.filterOrThrow("git-upload-pack 'bob'"); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitBadCommandFilterTest.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
import com.asolutions.scmsshd.commands.filters.git.GitBadCommandFilter; | public void testNoArgs() throws Exception {
assertThrows("git-upload-pack");
}
@Test
public void test2Args() throws Exception {
assertThrows("git-upload-pack bob tom");
}
@Test
public void testUnquoted() throws Exception {
assertThrows("git-upload-pack bob");
}
@Test
public void testWithUnsafeBang... | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | catch (BadCommandException e){ |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/ldap/LDAPProjectAuthorizer.java | // Path: src/main/java/com/asolutions/scmsshd/authenticators/LDAPUsernameResolver.java
// public class LDAPUsernameResolver {
// LDAPBindingProvider provider;
// private String userBase;
// private String matchingElement;
// public LDAPUsernameResolver(LDAPBindingProvider provider, String userBase) {
// this(prov... | import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.authenticators.LDAPUsernameResolver;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolu... | package com.asolutions.scmsshd.ldap;
public class LDAPProjectAuthorizer implements IProjectAuthorizer {
protected final Logger log = LoggerFactory.getLogger(getClass());
private String groupBaseDN;
private String groupSuffix; | // Path: src/main/java/com/asolutions/scmsshd/authenticators/LDAPUsernameResolver.java
// public class LDAPUsernameResolver {
// LDAPBindingProvider provider;
// private String userBase;
// private String matchingElement;
// public LDAPUsernameResolver(LDAPBindingProvider provider, String userBase) {
// this(prov... | private AuthorizationLevel authorizationLevel; |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/ldap/LDAPProjectAuthorizer.java | // Path: src/main/java/com/asolutions/scmsshd/authenticators/LDAPUsernameResolver.java
// public class LDAPUsernameResolver {
// LDAPBindingProvider provider;
// private String userBase;
// private String matchingElement;
// public LDAPUsernameResolver(LDAPBindingProvider provider, String userBase) {
// this(prov... | import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.authenticators.LDAPUsernameResolver;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolu... | package com.asolutions.scmsshd.ldap;
public class LDAPProjectAuthorizer implements IProjectAuthorizer {
protected final Logger log = LoggerFactory.getLogger(getClass());
private String groupBaseDN;
private String groupSuffix;
private AuthorizationLevel authorizationLevel;
private LDAPBindingProvider binding; | // Path: src/main/java/com/asolutions/scmsshd/authenticators/LDAPUsernameResolver.java
// public class LDAPUsernameResolver {
// LDAPBindingProvider provider;
// private String userBase;
// private String matchingElement;
// public LDAPUsernameResolver(LDAPBindingProvider provider, String userBase) {
// this(prov... | private LDAPUsernameResolver resolver; |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/ldap/LDAPProjectAuthorizer.java | // Path: src/main/java/com/asolutions/scmsshd/authenticators/LDAPUsernameResolver.java
// public class LDAPUsernameResolver {
// LDAPBindingProvider provider;
// private String userBase;
// private String matchingElement;
// public LDAPUsernameResolver(LDAPBindingProvider provider, String userBase) {
// this(prov... | import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.authenticators.LDAPUsernameResolver;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolu... | package com.asolutions.scmsshd.ldap;
public class LDAPProjectAuthorizer implements IProjectAuthorizer {
protected final Logger log = LoggerFactory.getLogger(getClass());
private String groupBaseDN;
private String groupSuffix;
private AuthorizationLevel authorizationLevel;
private LDAPBindingProvider binding;
... | // Path: src/main/java/com/asolutions/scmsshd/authenticators/LDAPUsernameResolver.java
// public class LDAPUsernameResolver {
// LDAPBindingProvider provider;
// private String userBase;
// private String matchingElement;
// public LDAPUsernameResolver(LDAPBindingProvider provider, String userBase) {
// this(prov... | throws UnparsableProjectException { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.